Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt 1.6.1 (was 1.5.8) #471

Merged
merged 4 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ jobs:
- name: "Run tests with Scala 2.12 and AdoptOpenJDK 11"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.12.15
- SCALA_VERSION=2.12.15
- ADOPTOPENJDK=11

- name: "Run tests with Scala 2.13 and AdoptOpenJDK 11"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.13.7
- SCALA_VERSION=2.13.7
- ADOPTOPENJDK=11

- name: "Run tests with Scala 2.12 and AdoptOpenJDK 8"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.12.15
- SCALA_VERSION=2.12.15
- ADOPTOPENJDK=8

- name: "Run tests with Scala 2.13 and AdoptOpenJDK 8"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.13.7
- SCALA_VERSION=2.13.7
- ADOPTOPENJDK=8

- stage: docs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To add the sbt plugin to your project add the sbt plugin dependency in
`project/plugins.sbt`:

```scala
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "LATEST_VERSION")
addSbtPlugin("com.typesafe.play" % "sbt-twirl" % "LATEST_VERSION")
```

Replacing the `LATEST_VERSION` with the latest version published, which should be [![Latest version](https://index.scala-lang.org/playframework/twirl/twirl-api/latest.svg?color=orange)](https://index.scala-lang.org/playframework/twirl/twirl-api). And enable the plugin on projects using:
Expand Down
41 changes: 23 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ val previousVersion: Option[String] = Some("1.5.0")

val ScalaTestVersion = "3.2.10"

// Do NOT upgrade these dependencies to 2.x or newer! twirl is a sbt-plugin
// and gets published with Scala 2.12, therefore we need to stay at the same major version
// like the 2.12.x Scala compiler, otherwise we run into conflicts when using sbt 1.5+
// See https://github.com/scala/scala/pull/9743
val ScalaParserCombinatorsVersion = "1.1.2" // Do not upgrade beyond 1.x
val ScalaXmlVersion = "1.3.0" // Do not upgrade beyond 1.x
def parserCombinators(scalaVersion: String) = "org.scala-lang.modules" %% "scala-parser-combinators" % {
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, _)) => "1.1.2"
case _ => "2.1.0"
}
}

val mimaSettings = Seq(
mimaPreviousArtifacts := previousVersion.map(organization.value %% name.value % _).toSet
)

ThisBuild / sonatypeProfileName := "com.typesafe"
ThisBuild / sonatypeProfileName := "com.typesafe.play"

// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed
ThisBuild / dynverTagPrefix := ""
Expand Down Expand Up @@ -67,8 +67,13 @@ lazy val api = crossProject(JVMPlatform, JSPlatform)
"org.scalatest.tools.ScalaTestFramework"
)
),
libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % ScalaXmlVersion,
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => "1.3.0"
case _ => "2.0.1"
}
},
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
)

lazy val apiJvm = api.jvm
Expand All @@ -79,10 +84,10 @@ lazy val parser = project
.enablePlugins(Common, Omnidoc)
.settings(
mimaSettings,
name := "twirl-parser",
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % ScalaParserCombinatorsVersion % Optional,
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.2" % Test,
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
name := "twirl-parser",
libraryDependencies += parserCombinators(scalaVersion.value) % Optional,
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.2" % Test,
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
)

lazy val compiler = project
Expand All @@ -91,10 +96,10 @@ lazy val compiler = project
.dependsOn(apiJvm, parser % "compile;test->test")
.settings(
mimaSettings,
name := "twirl-compiler",
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % ScalaParserCombinatorsVersion % "optional",
run / fork := true,
name := "twirl-compiler",
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
libraryDependencies += parserCombinators(scalaVersion.value) % "optional",
run / fork := true,
)

lazy val plugin = project
Expand All @@ -103,7 +108,7 @@ lazy val plugin = project
.dependsOn(compiler)
.settings(
name := "sbt-twirl",
organization := "com.typesafe.sbt",
organization := "com.typesafe.play",
scalaVersion := Scala212,
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
Compile / resourceGenerators += generateVersionFile.taskValue,
Expand Down
2 changes: 1 addition & 1 deletion docs/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.8
sbt.version=1.6.1
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.8
sbt.version=1.6.1
2 changes: 1 addition & 1 deletion sbt-twirl/src/sbt-test/twirl/compile/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % sys.props("project.version"))
addSbtPlugin("com.typesafe.play" % "sbt-twirl" % sys.props("project.version"))
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % sys.props("project.version"))
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0")
addSbtPlugin("com.typesafe.play" % "sbt-twirl" % sys.props("project.version"))
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0")
2 changes: 1 addition & 1 deletion scripts/test-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Copyright (C) Lightbend Inc. <https://www.lightbend.com>

sbt "++ $TRAVIS_SCALA_VERSION test" || exit 1
sbt "++ $SCALA_VERSION test" || exit 1
sbt +publishLocal plugin/test plugin/scripted || exit 1