From fab236cd4a1e063406234c4bfc67232dc321ff06 Mon Sep 17 00:00:00 2001 From: Marco Lopes Date: Fri, 19 Jul 2019 13:58:07 +0100 Subject: [PATCH 1/6] Upgrade to Scala 2.13.0 --- build.sbt | 66 ++++++++------------------------------ project/Dependencies.scala | 8 ++--- project/build.properties | 1 + project/plugins.sbt | 1 + 4 files changed, 20 insertions(+), 56 deletions(-) diff --git a/build.sbt b/build.sbt index 5aec235..4dfa6f4 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,9 @@ import Dependencies._ -ThisBuild / scalaVersion := "2.12.8" +lazy val scala213 = "2.13.0" +lazy val scala212 = "2.12.8" + +ThisBuild / scalaVersion := scala213 ThisBuild / organization := "dev.mlopes" ThisBuild / organizationName := "mlopes" @@ -9,6 +12,7 @@ lazy val wen = project .aggregate(core, cats, circe) .settings(name := "Wen Root") .settings( + crossScalaVersions := Nil, publish := {}, publishArtifact := false ) @@ -19,7 +23,8 @@ lazy val core = project .settings( libraryDependencies ++= refinedDependencies, libraryDependencies ++= testDependencies ++ catsDependencies.map(_ % Test), - defaultConfig + defaultConfig, + versionConfig ) lazy val cats = project @@ -29,7 +34,8 @@ lazy val cats = project .settings( libraryDependencies ++= catsDependencies, libraryDependencies ++= testDependencies, - defaultConfig + defaultConfig, + versionConfig ) lazy val circe = project @@ -39,63 +45,19 @@ lazy val circe = project .settings( libraryDependencies ++= circeDependencies, libraryDependencies ++= testDependencies ++ circeExtraDependencies.map(_ % Test), - defaultConfig + defaultConfig, + versionConfig ) lazy val defaultConfig = Seq( - scalacOptions := appScalacOptions, compile in Compile := (compile in Compile).dependsOn(dependencyUpdates).value, coverageMinimum := 100, coverageFailOnMinimum := true, publishTo := sonatypePublishTo.value ) -lazy val appScalacOptions = Seq( - "-deprecation", // Emit warning and location for usages of deprecated APIs. - "-encoding", "utf-8", // Specify character encoding used by source files. - "-explaintypes", // Explain type errors in more detail. - "-feature", // Emit warning and location for usages of features that should be imported explicitly. - "-language:existentials", // Existential types (besides wildcard types) can be written and inferred - "-language:experimental.macros", // Allow macro definition (besides implementation and application) - "-language:higherKinds", // Allow higher-kinded types - "-language:implicitConversions", // Allow definition of implicit functions called views - "-unchecked", // Enable additional warnings where generated code depends on assumptions. - "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. - "-Xfatal-warnings", // Fail the compilation if there are any warnings. - "-Xfuture", // Turn on future language features. - "-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver. - "-Xlint:by-name-right-associative", // By-name parameter of right associative operator. - "-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error. - "-Xlint:delayedinit-select", // Selecting member of DelayedInit. - "-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element. - "-Xlint:inaccessible", // Warn about inaccessible types in method signatures. - "-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`. - "-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id. - "-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'. - "-Xlint:nullary-unit", // Warn when nullary methods return Unit. - "-Xlint:option-implicit", // Option.apply used implicit view. - "-Xlint:package-object-classes", // Class or object defined in package object. - "-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds. - "-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field. - "-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component. - "-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope. - "-Xlint:unsound-match", // Pattern match may not be typesafe. - "-Yno-adapted-args", // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver. - "-Ypartial-unification", // Enable partial unification in type constructor inference - "-Ywarn-dead-code", // Warn when dead code is identified. - "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined. - "-Ywarn-inaccessible", // Warn about inaccessible types in method signatures. - "-Ywarn-infer-any", // Warn when a type argument is inferred to be `Any`. - "-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'. - "-Ywarn-nullary-unit", // Warn when nullary methods return Unit. - "-Ywarn-numeric-widen", // Warn when numerics are widened. - "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused. - "-Ywarn-unused:imports", // Warn if an import selector is not referenced. - "-Ywarn-unused:locals", // Warn if a local definition is unused. - "-Ywarn-unused:params", // Warn if a value parameter is unused. - "-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused. - "-Ywarn-unused:privates", // Warn if a private member is unused. - "-Ywarn-value-discard", // Warn when non-Unit expression results are unused. - "-Ywarn-macros:after" // Check for warning after marco expansion +lazy val versionConfig = Seq( + scalaVersion := scala213, + crossScalaVersions := List(scala213, scala212) ) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 729585a..f19c49a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,11 +2,11 @@ import sbt._ object Dependencies { - val scalaTestVersion = "3.0.7" + val scalaTestVersion = "3.0.8" val scalaCheckVersion = "1.14.0" - val refinedVersion = "0.9.5" - val catsVersion = "1.6.0" - val circeVersion = "0.11.1" + val refinedVersion = "0.9.8" + val catsVersion = "2.0.0-M4" + val circeVersion = "0.12.0-M4" lazy val testDependencies = Seq( diff --git a/project/build.properties b/project/build.properties index c0bab04..fcd715e 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1,2 @@ sbt.version=1.2.8 +scala.version=1.13.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index bcb717d..4d78fdc 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,3 +5,4 @@ addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.7") From 5ac2e5651aa7f1bfac331e72c6ebcd6ae58f368c Mon Sep 17 00:00:00 2001 From: Marco Lopes Date: Fri, 19 Jul 2019 14:20:29 +0100 Subject: [PATCH 2/6] Bump scoverage in the hopes it supports scala 1.13.0 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 4d78fdc..ca52513 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,6 +3,6 @@ addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11") addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.7") From a55971e849c79bdc7d97534fa763d0f3210d408f Mon Sep 17 00:00:00 2001 From: Marco Lopes Date: Fri, 19 Jul 2019 14:32:49 +0100 Subject: [PATCH 3/6] Upgrade plugins --- project/plugins.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index ca52513..7a81b18 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ -addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "0.2.10") -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0") +addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "1.1.0") +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.2") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11") addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") From 525f2145b8a9890d04f57247c0068ea45213b8a4 Mon Sep 17 00:00:00 2001 From: Marco Lopes Date: Fri, 19 Jul 2019 14:36:42 +0100 Subject: [PATCH 4/6] Add build for Scala 2.13.x --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 555dba3..5f559d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: scala scala: + - 2.13.0 - 2.12.8 script: "sbt clean coverage test coverageReport && sbt coverageAggregate && sbt coveralls" From b0be78b98ad865cb2af8b9446329a880df890254 Mon Sep 17 00:00:00 2001 From: Marco Lopes Date: Fri, 19 Jul 2019 14:46:12 +0100 Subject: [PATCH 5/6] It doesn't look like there's a use for building on 2.12.8 image as the version is locked by sbt --- .travis.yml | 1 - README.md | 8 ++++---- notes/1.0.0.markdown | 5 +++++ version.sbt | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 notes/1.0.0.markdown diff --git a/.travis.yml b/.travis.yml index 5f559d8..b9ef35a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: scala scala: - 2.13.0 - - 2.12.8 script: "sbt clean coverage test coverageReport && sbt coverageAggregate && sbt coveralls" diff --git a/README.md b/README.md index de26a2d..541753b 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,13 @@ Date and time types and instances ## Getting Started -Wen is available for Scala 2.12. You can add wen to your sbt project by adding the following to +Wen is available for Scala 2.13 and 2.12. You can add wen to your sbt project by adding the following to your `build.sbt`: ```scala -libraryDependencies += "dev.mlopes" %% "wen" % "1.0.0-M1" -libraryDependencies += "dev.mlopes" %% "wen-cats" % "1.0.0-M1" // For cats instances -libraryDependencies += "dev.mlopes" %% "wen-circe" % "1.0.0-M1" // For circe encoders and decoders +libraryDependencies += "dev.mlopes" %% "wen" % "1.0.0" +libraryDependencies += "dev.mlopes" %% "wen-cats" % "1.0.0" // For cats instances +libraryDependencies += "dev.mlopes" %% "wen-circe" % "1.0.0" // For circe encoders and decoders ``` ## What is Wen? diff --git a/notes/1.0.0.markdown b/notes/1.0.0.markdown new file mode 100644 index 0000000..3cf1427 --- /dev/null +++ b/notes/1.0.0.markdown @@ -0,0 +1,5 @@ +1.0.0-M1 +======== + +- Add build for Scala 2.13 + diff --git a/version.sbt b/version.sbt index 6dc0588..3265844 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "1.0.0-SNAPSHOT" +version in ThisBuild := "1.0.0" From 3df59f75ea23c41ae27a2d7490c4423dd2ea346c Mon Sep 17 00:00:00 2001 From: Marco Lopes Date: Sun, 4 Aug 2019 14:47:23 +0100 Subject: [PATCH 6/6] Setting version to 1.0.1-SNAPSHOT --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index 3265844..dc11afe 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "1.0.0" +version in ThisBuild := "1.0.1-SNAPSHOT"