Skip to content

Commit

Permalink
support Scala 2.13.x. drop Scala 2.10.x and 2.11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Aug 12, 2019
1 parent add4c58 commit 3b2bf6c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 65 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ matrix:
- env: SBT_VERSION=1.2.8
jdk: openjdk8
scripted: sbt "-no-colors" "^^ $SBT_VERSION" ";scalafmtCheckAll;plugin/scripted;scaffold/scripted;lib/test;app/compile"
- env: SBT_VERSION=0.13.18
jdk: openjdk8
scripted: sbt "-no-colors" "^^ $SBT_VERSION" ";plugin/scripted;scaffold/scripted;lib/test;app/compile"
- name: "Scala 2.13"
script:
- sbt "++ 2.13.0" app/test lib/test
- env: SBT_VERSION=1.1.6
jdk: openjdk11
scripted: sbt "-no-colors" "^^ $SBT_VERSION" ";plugin/scripted;scaffold/scripted;lib/test;app/compile"
Expand Down
25 changes: 8 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lazy val app = (project in file("app"))
.settings(
description := "Command line tool to apply templates defined on GitHub",
name := "giter8",
crossScalaVersions := List(scala210, scala211, scala212),
crossScalaVersions := List(scala212, scala213),
sourceDirectory in csRun := {
(baseDirectory).value.getParentFile / "src" / "main" / "conscript"
},
Expand All @@ -61,14 +61,13 @@ lazy val app = (project in file("app"))
)

lazy val crossSbt = Seq(
crossSbtVersions := List(sbt013, sbt1),
crossSbtVersions := List(sbt1),
scalaVersion := {
val crossSbtVersion = (sbtVersion in pluginCrossBuild).value
partialVersion(crossSbtVersion) match {
case Some((0, 13)) => scala210
case Some((1, _)) => scala212
case _ =>
throw new Exception(s"unexpected sbt version: $crossSbtVersion (supported: 0.13.x or 1.X)")
throw new Exception(s"unexpected sbt version: $crossSbtVersion (supported: 1.X)")
}
}
)
Expand All @@ -81,7 +80,7 @@ lazy val scaffold = (project in file("scaffold"))
name := "sbt-giter8-scaffold",
description := "sbt plugin for scaffolding giter8 templates",
sbtPlugin := true,
crossScalaVersions := List(scala210, scala212),
crossScalaVersions := List(scala212),
scriptedLaunchOpts ++= javaVmArgs.filter(
a => Seq("-Xmx", "-Xms", "-XX").exists(a.startsWith)
),
Expand All @@ -103,7 +102,7 @@ lazy val plugin = (project in file("plugin"))
name := "sbt-giter8",
description := "sbt plugin for testing giter8 templates",
sbtPlugin := true,
crossScalaVersions := List(scala210, scala212),
crossScalaVersions := List(scala212),
resolvers += Resolver.typesafeIvyRepo("releases"),
scriptedLaunchOpts ++= javaVmArgs.filter(
a => Seq("-Xmx", "-Xms", "-XX").exists(a.startsWith)
Expand All @@ -118,12 +117,10 @@ lazy val plugin = (project in file("plugin"))

val artifact =
partialVersion(crossSbtVersion) match {
case Some((0, 13)) =>
"org.scala-sbt" % "scripted-plugin"
case Some((1, _)) =>
"org.scala-sbt" %% "scripted-plugin"
case _ =>
throw new Exception(s"unexpected sbt version: $crossSbtVersion (supported: 0.13.x or 1.X)")
throw new Exception(s"unexpected sbt version: $crossSbtVersion (supported: 1.X)")
}

artifact % crossSbtVersion
Expand All @@ -140,7 +137,7 @@ lazy val lib = (project in file("library"))
.settings(
name := "giter8-lib",
description := "shared library for app and plugin",
crossScalaVersions := List(scala210, scala211, scala212),
crossScalaVersions := List(scala212, scala213),
libraryDependencies ++= Seq(
stringTemplate,
jgit,
Expand All @@ -162,13 +159,7 @@ lazy val lib = (project in file("library"))
def customCommands: Seq[Setting[_]] = Seq(
commands += Command.command("release") { state =>
"clean" ::
s"++${scala210}" ::
s"^^${sbt013}" ::
"lib/publishSigned" ::
"app/publishSigned" ::
"plugin/publishSigned" ::
"scaffold/publishSigned" ::
s"++${scala211}" ::
s"++${scala213}" ::
"app/publishSigned" ::
"lib/publishSigned" ::
s"++${scala212}" ::
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/scala/g8.scala
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ object G8 {

print(s"$k [$message]: ")
Console.flush() // Gotta flush for Windows console!
val in = Console.readLine().trim
val in = scala.io.StdIn.readLine().trim
(k, if (in.isEmpty) default else in)
}
)
Expand Down
36 changes: 0 additions & 36 deletions plugin/src/main/scala-sbt-0.13/sbt/sbtgiter8/SBTCompat.scala

This file was deleted.

14 changes: 6 additions & 8 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ object Dependencies {
ExclusionRule("com.sun.jmx", "jmxri")
)
val scopt = "com.github.scopt" %% "scopt" % "3.7.1"
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.13.5"
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
val scalatest = "org.scalatest" %% "scalatest" % "3.0.8"
val scalamock = "org.scalamock" %% "scalamock-scalatest-support" % "3.6.0"
val sbtIo = "org.scala-sbt" %% "io" % "1.2.2"
val scala210 = "2.10.7"
val scala211 = "2.11.12"
val scalamock = "org.scalamock" %% "scalamock" % "4.3.0"
val sbtIo = "org.scala-sbt" %% "io" % "1.3.0-M13"
val scala212 = "2.12.8"
val scala213 = "2.13.0"
val sbt1 = "1.2.8"
val sbt013 = "0.13.17"
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.1.0"
val parserCombinator = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0"
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.2.0"
val parserCombinator = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
val logback = "ch.qos.logback" % "logback-classic" % "1.2.3"
}

0 comments on commit 3b2bf6c

Please sign in to comment.