Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #176 from mkurz/drop_scala212
Browse files Browse the repository at this point in the history
Drop Scala 2.12 + add Scala 3 (but not use it)
  • Loading branch information
mergify[bot] authored Aug 25, 2021
2 parents b9080f3 + 97c4f6a commit ec299ad
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 26 deletions.
1 change: 0 additions & 1 deletion src/main/scala/interplay/PlayBuildBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ object PlayBuildBase extends AutoPlugin {
val playBuildExtraTests = taskKey[Unit]("Run extra tests during the release")
val playBuildExtraPublish = taskKey[Unit]("Publish extract non aggregated projects during the release")
val playBuildRepoName = settingKey[String]("The name of the repository in the playframework GitHub organization")
val playCrossBuildRootProject = settingKey[Boolean]("Whether the root project should be cross built or not")

// This is not using sbt-git because we need a more stable way to set
// the current branch in a more stable way, for example, we may want to
Expand Down
3 changes: 1 addition & 2 deletions src/main/scala/interplay/PlayLibraryBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import interplay.Omnidoc.autoImport.omnidocTagPrefix
omnidocTagPrefix := "",
compile / javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
doc / javacOptions := Seq("-source", "1.8"),
crossScalaVersions := Seq(scalaVersion.value, ScalaVersions.scala212),
crossScalaVersions := Seq(scalaVersion.value), // TODO: Add ScalaVersions.scala3
scalaVersion := sys.props.get("scala.version").getOrElse(ScalaVersions.scala213),
ThisBuild / playCrossBuildRootProject := true
)
}
13 changes: 1 addition & 12 deletions src/main/scala/interplay/PlayRootProjectBase.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package interplay

import sbt._
import sbt.Keys._

import interplay.PlayBuildBase.autoImport._

/**
* Base Plugin for a root project that doesn't get published.
Expand All @@ -13,13 +10,5 @@ import interplay.PlayBuildBase.autoImport._
object PlayRootProjectBase extends AutoPlugin {
override def trigger = noTrigger
override def requires = PlayBuildBase && PlaySonatypeBase && PlayReleaseBase
override def projectSettings = PlayNoPublishBase.projectSettings ++ Seq(
crossScalaVersions := {
if ((ThisBuild / playCrossBuildRootProject).?.value.exists(identity)) {
Seq(ScalaVersions.scala212, ScalaVersions.scala213)
} else {
Seq(ScalaVersions.scala212)
}
}
)
override def projectSettings = PlayNoPublishBase.projectSettings
}
1 change: 1 addition & 0 deletions src/main/scala/interplay/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package interplay
object ScalaVersions {
val scala212 = "2.12.14"
val scala213 = "2.13.6"
val scala3 = "3.0.1"
}

object SbtVersions {
Expand Down
4 changes: 3 additions & 1 deletion src/sbt-test/interplay/library-with-plugin/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import interplay.ScalaVersions._

lazy val common: Seq[Setting[_]] = Seq(
PgpKeys.publishSigned := {
IO.write(crossTarget.value / "publish-version", s"${publishTo.value.get.name}:${version.value}")
Expand All @@ -10,7 +12,7 @@ lazy val common: Seq[Setting[_]] = Seq(
lazy val `mock-root` = (project in file("."))
.settings(
common,
ThisBuild / playCrossBuildRootProject := true // activates cross build for Scala 2.12 and 2.13
crossScalaVersions := Seq(scala212, scala213)
)
.enablePlugins(PlayRootProject)
.aggregate(`mock-library`, `mock-sbt-plugin`) // has a sbt plugin that will be built together with root project
Expand Down
6 changes: 4 additions & 2 deletions src/sbt-test/interplay/library-with-plugin/test
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ $ exec git branch -u origin/main
$ exists mock-sbt-plugin/target/scripted-ran

# Make sure publishSigned ran on every project with the right publish settings
> contains target/scala-2.12/publish-version no-publish:1.2.3
#TODO:
#> contains target/scala-3/publish-version no-publish:1.2.3
> contains target/scala-2.13/publish-version no-publish:1.2.3
> contains mock-sbt-plugin/target/scala-2.12/sbt-1.0/publish-version sonatype-local-bundle:1.2.3
> contains mock-library/target/scala-2.12/publish-version sonatype-local-bundle:1.2.3
#TODO:
#> contains mock-library/target/scala-3/publish-version sonatype-local-bundle:1.2.3
> contains mock-library/target/scala-2.13/publish-version sonatype-local-bundle:1.2.3
> contains mock-sbt-library/target/scala-2.12/publish-version sonatype-local-bundle:1.2.3

Expand Down
7 changes: 6 additions & 1 deletion src/sbt-test/interplay/library-with-root/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import interplay.ScalaVersions._

// What an actual project would look like
lazy val `mock-root` = (project in file("."))
.enablePlugins(PlayRootProject)
.aggregate(`mock-library`)
.settings(common)
.settings(
common,
crossScalaVersions := Seq(scala212, scala213)
)

lazy val `mock-library` = (project in file("mock-library"))
.enablePlugins(PlayLibrary)
Expand Down
6 changes: 4 additions & 2 deletions src/sbt-test/interplay/library-with-root/test
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ $ exec git branch -u origin/main
> release with-defaults

# Make sure publishSigned ran on every project with the right publish settings
> contains target/scala-2.12/publish-version no-publish:1.2.3
#TODO:
#> contains target/scala-3/publish-version no-publish:1.2.3
> contains target/scala-2.13/publish-version no-publish:1.2.3
> contains mock-library/target/scala-2.12/publish-version sonatype-local-bundle:1.2.3
#TODO:
#> contains mock-library/target/scala-3/publish-version sonatype-local-bundle:1.2.3
> contains mock-library/target/scala-2.13/publish-version sonatype-local-bundle:1.2.3

# Make sure sonatypeRelease ran only in the root project
Expand Down
3 changes: 2 additions & 1 deletion src/sbt-test/interplay/library/test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ $ exec git diff
> release with-defaults

# Make sure publishSigned ran
> contains target/scala-2.12/publish-version sonatype-local-bundle:1.2.3
#TODO:
#> contains target/scala-3/publish-version sonatype-local-bundle:1.2.3
> contains target/scala-2.13/publish-version sonatype-local-bundle:1.2.3

# Make sure sonatypeRelease ran
Expand Down
7 changes: 6 additions & 1 deletion src/sbt-test/interplay/plugin-with-root/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import interplay.ScalaVersions._

// What an actual project would look like
lazy val `mock-root` = (project in file("."))
.enablePlugins(PlayRootProject)
.aggregate(`mock-sbt-plugin`)
.settings(common)
.settings(
common,
crossScalaVersions := Seq(scala212, scala213)
)

lazy val `mock-sbt-plugin` = (project in file("mock-sbt-plugin"))
.enablePlugins(PlaySbtPlugin)
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/interplay/plugin-with-root/test
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ $ exec git branch -u origin/main
# However, that initial state does not contain the above created .git folder (created via git init) yet.
> reload

> release cross with-defaults
> release with-defaults

# Make sure scripted tests ran
$ exists mock-sbt-plugin/target/scripted-ran

# Make sure publishSigned ran on every project with the right publish settings
$ exists target/scala-2.12/publish-version
> contains target/scala-2.12/publish-version no-publish:1.2.3
$ exists target/scala-2.13/publish-version
> contains target/scala-2.13/publish-version no-publish:1.2.3
> contains mock-sbt-plugin/target/scala-2.12/sbt-1.0/publish-version sonatype-local-bundle:1.2.3

# Make sure bintrayRelease ran only in the root project
Expand Down

0 comments on commit ec299ad

Please sign in to comment.