From 50cc1af95930d773fb850664f4246f74892ad81d Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 19 Feb 2019 20:23:54 -0800 Subject: [PATCH] upgrade to sbt 1 --- build.sbt | 12 ++++++------ project/build.properties | 2 +- project/plugins.sbt | 11 ++--------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/build.sbt b/build.sbt index 451d4375..add97b8f 100644 --- a/build.sbt +++ b/build.sbt @@ -1,10 +1,9 @@ import ScalaModulePlugin._ import sbtcrossproject.{crossProject, CrossType} import _root_.scalafix.sbt.BuildInfo.{scalafixVersion, scala212 => scalafixScala212} +import sys.process._ lazy val commonSettings = Seq( - // this line could be removed after https://github.com/scala/sbt-scala-module/issues/48 is fixed - licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))), headerLicense := Some(HeaderLicense.Custom( s"""|Scala (https://www.scala-lang.org) | @@ -83,7 +82,7 @@ lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform)( val x = (baseDirectory in LocalRootProject).value.toURI.toString val y = "https://raw.githubusercontent.com/scala/scala-collection-compat/" + sys.process .Process("git rev-parse HEAD") - .lines_! + .lineStream_! .head s"-P:scalajs:mapSourceURI:$x->$y/" }, @@ -315,7 +314,7 @@ inThisBuild( state }, commands += Command.command("ci") { state => - val toRun = + val toRun: Seq[String] = if (isScalafmt) { Seq("scalafmt-test") } else { @@ -359,7 +358,7 @@ inThisBuild( if (releaseVersion.nonEmpty && !isBinaryCompat) { List( preRelease, - s"$projectPrefix/publish-signed" + s"$projectPrefix/publishSigned" ) } else { Nil @@ -379,6 +378,7 @@ inThisBuild( toRun.foreach(println) println("---------") - toRun ::: state + val newCommands = toRun.toList.map(Exec(_, None)) + state.copy(remainingCommands = newCommands ::: state.remainingCommands) } )) diff --git a/project/build.properties b/project/build.properties index 8e682c52..c0bab049 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.18 +sbt.version=1.2.8 diff --git a/project/plugins.sbt b/project/plugins.sbt index fed3154a..705b37c6 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,16 +1,9 @@ -if (System.getProperty("java.version").startsWith("1.")) - Seq() -else - // override to version that works on Java 11, - // see https://github.com/scala/sbt-scala-module/issues/35 - Seq(addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.3")) - val scalaJSVersion = Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("0.6.26") addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14") +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.0.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.4") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") -addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2-1") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.0.0")