From d18a66f534e5cc619e78b72e84e3b6f1ee8b0e07 Mon Sep 17 00:00:00 2001 From: Jeff May Date: Wed, 26 Sep 2018 17:21:39 -0700 Subject: [PATCH] Upgrade to sbt 1.0 and fix issues with MiMa versioning - Upgrade to sbt 1.0 to solve a weird bug with MiMa (https://github.com/lightbend/migration-manager/issues/206) - Add missing resolver - Remove name supression config - Fix resolver issue --- build.sbt | 39 +++++++++++++------------------------- project/Dependencies.scala | 8 ++++++-- project/build.properties | 2 +- project/plugins.sbt | 2 +- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/build.sbt b/build.sbt index cfdc6a4..d6f0f60 100644 --- a/build.sbt +++ b/build.sbt @@ -1,42 +1,30 @@ import Dependencies._ name := "play-module-json-error-handler-root" -organizationName in ThisBuild := "Rally Health" -organization in ThisBuild := "com.rallyhealth" -scalaVersion in ThisBuild := Scala_2_11 +ThisBuild / organizationName := "Rally Health" +ThisBuild / organization := "com.rallyhealth" -licenses in ThisBuild := Seq("MIT" -> url("http://opensource.org/licenses/MIT")) +ThisBuild / scalaVersion := Scala_2_11 -bintrayOrganization in ThisBuild := Some("rallyhealth") -bintrayRepository in ThisBuild := "maven" +ThisBuild / licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")) -resolvers in ThisBuild += Resolver.bintrayRepo("jeffmay", "maven") +ThisBuild / bintrayOrganization := Some("rallyhealth") +ThisBuild / bintrayRepository := "maven" + +ThisBuild / resolvers += Resolver.bintrayRepo("rallyhealth", "maven") +ThisBuild / resolvers += Resolver.bintrayRepo("jeffmay", "maven") // Disable publishing of root project publish := {} publishLocal := {} -/** - * Suppress naming check until next minor version. - * - * @note just delete this code if you get the following exception - */ -val suppressNameCheckUntilNextMajorVersion = semVerCheck := { - version.value.split('.') match { - case Array("0", minor, _*) if minor.toInt < 2 => - case Array("0", "2", "0", _*) => - case _ => // anything > 0.2.0 - throw new IllegalStateException("Version bump! It's time to re-enable semantic version validation.") - } -} - def commonProject(id: String, path: String): Project = { Project(id, file(path)) .settings( // disable scaladoc generation - sources in(Compile, doc) := Seq.empty, - publishArtifact in packageDoc := false, + Compile / doc / sources := Seq.empty, + packageDoc / publishArtifact := false, scalacOptions := scalacOptions.value .filterNot(_ == "-deprecation") ++ Seq( @@ -62,12 +50,11 @@ def playModuleJsonErrorHandler(includePlayVersion: String): Project = { val projectPath = "code" commonProject(s"play$playSuffix-module-json-error-handler", s"play$playSuffix") .settings( - suppressNameCheckUntilNextMajorVersion, scalaVersion := scalaVersions.head, crossScalaVersions := scalaVersions, sourceDirectory := file(s"$projectPath/src").getAbsoluteFile, - (sourceDirectory in Compile) := file(s"$projectPath/src/main").getAbsoluteFile, - (sourceDirectory in Test) := file(s"$projectPath/src/test").getAbsoluteFile, + Compile / sourceDirectory := file(s"$projectPath/src/main").getAbsoluteFile, + Test / sourceDirectory := file(s"$projectPath/src/test").getAbsoluteFile, libraryDependencies ++= Seq( Dependencies.guice, Dependencies.play(includePlayVersion), diff --git a/project/Dependencies.scala b/project/Dependencies.scala index ef9fe28..de37bdd 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,7 +6,7 @@ object Dependencies { final val Scala_2_12 = "2.12.6" final val Play_2_5 = "2.5.18" - final val Play_2_6 = "2.6.16" + final val Play_2_6 = "2.6.19" private final val guiceVersion = "4.0" private final val play25JsonVersion = Play_2_5 @@ -37,7 +37,11 @@ object Dependencies { } def playTestOps(playVersion: String): ModuleID = { - "me.jeffmay" %% "play25-test-ops-core" % playTestOpsVersion + val playSuffix = playVersion match { + case Play_2_5 => "25" + case Play_2_6 => "26" + } + "me.jeffmay" %% s"play$playSuffix-test-ops-core" % playTestOpsVersion } val scalatest: ModuleID = { diff --git a/project/build.properties b/project/build.properties index 133a8f1..0cd8b07 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.17 +sbt.version=1.2.3 diff --git a/project/plugins.sbt b/project/plugins.sbt index b4fd52d..8c20972 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ resolvers += Resolver.url( url("https://dl.bintray.com/rallyhealth/sbt-plugins") )(Resolver.ivyStylePatterns) -addSbtPlugin("com.rallyhealth.sbt" % "sbt-git-versioning" % "1.1.0") +addSbtPlugin("com.rallyhealth.sbt" %% "sbt-git-versioning" % "1.2.0") addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.6")