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

use slash syntax instead of deprecated in #172

Merged
merged 1 commit into from
Jul 15, 2021
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 build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _root_.interplay.ScalaVersions._
import buildinfo.BuildInfo._

// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed
dynverVTagPrefix in ThisBuild := false
ThisBuild / dynverVTagPrefix := false

// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Expand All @@ -27,7 +27,7 @@ lazy val interplay = (project in file("."))
checkSnapshotDependencies,
runClean,
releaseStepCommandAndRemaining("+test"),
releaseStepTask(playBuildExtraTests in thisProjectRef.value),
releaseStepTask(thisProjectRef.value / playBuildExtraTests),
releaseStepCommandAndRemaining("+publishSigned"),
// Using `playBuildPromoteSonatype` is obsolete now.
// ifDefinedAndTrue(playBuildPromoteSonatype, releaseStepCommand("sonatypeBundleRelease")),
Expand Down Expand Up @@ -70,11 +70,11 @@ playBuildExtraTests := {
// that they can be run with either sbt 0.13 or
// sbt 1.
scriptedLaunchOpts += {
val sbtV = (sbtVersion in pluginCrossBuild).value
val sbtV = (pluginCrossBuild / sbtVersion).value
s"-Dsbt.version=$sbtV"
}

playBuildRepoName in ThisBuild := "interplay"
ThisBuild / playBuildRepoName := "interplay"

enablePlugins(SbtPlugin)

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/interplay/AutomaticModuleName.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ object AutomaticModuleName {
private val AutomaticModuleName = "Automatic-Module-Name"

def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] = Seq(
packageOptions in (Compile, packageBin) += Package.ManifestAttributes(AutomaticModuleName -> name)
Compile / packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name)
)
}
4 changes: 2 additions & 2 deletions src/main/scala/interplay/Omnidoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object Omnidoc extends AutoPlugin {
val tree: String = if (isSnapshot.value) development else tagged
val prefix: String = "/" + (omnidocPathPrefix ?? "").value
val path: String = {
val buildDir: File = (baseDirectory in ThisBuild).value
val buildDir: File = (ThisBuild / baseDirectory).value
val projDir: File = baseDirectory.value
val rel: Option[String] = IO.relativize(buildDir, projDir)
rel match {
Expand All @@ -46,7 +46,7 @@ object Omnidoc extends AutoPlugin {
}
s"https://github.com/${repo}/tree/${tree}${path}"
},
packageOptions in (Compile, packageSrc) ++= omnidocSourceUrl.value.toSeq map { url =>
Compile / packageSrc / packageOptions ++= omnidocSourceUrl.value.toSeq map { url =>
ManifestAttributes(SourceUrlKey -> url)
}
)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/interplay/PlayBuildBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ object PlayBuildBase extends AutoPlugin {
override def projectSettings = Seq(
// General settings
organization := "com.typesafe.play",
homepage := Some(url(s"https://github.com/playframework/${(playBuildRepoName in ThisBuild).value}")),
homepage := Some(url(s"https://github.com/playframework/${(ThisBuild / playBuildRepoName).value}")),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),

scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-encoding", "utf8"),
Expand Down Expand Up @@ -98,7 +98,7 @@ object PlayBuildBase extends AutoPlugin {
},

pomExtra := {
val repoName = (playBuildRepoName in ThisBuild).value
val repoName = (ThisBuild / playBuildRepoName).value
<scm>
<url>https://github.com/playframework/{repoName}</url>
<connection>scm:git:git@github.com:playframework/{repoName}.git</connection>
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/interplay/PlayLibraryBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import interplay.Omnidoc.autoImport.omnidocTagPrefix
import PlayBuildBase.autoImport._

override def projectSettings = Seq(
omnidocGithubRepo := s"playframework/${(playBuildRepoName in ThisBuild).value}",
omnidocGithubRepo := s"playframework/${(ThisBuild / playBuildRepoName).value}",
omnidocTagPrefix := "",
javacOptions in compile ++= Seq("-source", "1.8", "-target", "1.8"),
javacOptions in doc := Seq("-source", "1.8"),
compile / javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
doc / javacOptions := Seq("-source", "1.8"),
crossScalaVersions := Seq(scalaVersion.value, ScalaVersions.scala212),
scalaVersion := sys.props.get("scala.version").getOrElse(ScalaVersions.scala213),
playCrossBuildRootProject in ThisBuild := true
ThisBuild / playCrossBuildRootProject := true
)
}
6 changes: 3 additions & 3 deletions src/main/scala/interplay/PlayReleaseBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object PlayReleaseBase extends AutoPlugin {

// Release settings
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseTagName := (version in ThisBuild).value,
releaseTagName := (ThisBuild / version).value,
releaseProcess := {
import ReleaseTransformations._

Expand All @@ -33,14 +33,14 @@ object PlayReleaseBase extends AutoPlugin {
runClean,
releaseStepCommandAndRemaining("+test"),

releaseStepTask(playBuildExtraTests in thisProjectRef.value),
releaseStepTask(thisProjectRef.value / playBuildExtraTests),
setReleaseVersion,
commitReleaseVersion,
tagRelease,

releaseStepCommandAndRemaining("+publishSigned"),

releaseStepTask(playBuildExtraPublish in thisProjectRef.value),
releaseStepTask(thisProjectRef.value / playBuildExtraPublish),
// Using `playBuildPromoteSonatype` is obsolete now.
// ifDefinedAndTrue(playBuildPromoteSonatype, releaseStepCommand("sonatypeBundleRelease")),
releaseStepCommand("sonatypeBundleRelease"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/interplay/PlayRootProjectBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object PlayRootProjectBase extends AutoPlugin {
override def requires = PlayBuildBase && PlaySonatypeBase && PlayReleaseBase
override def projectSettings = PlayNoPublishBase.projectSettings ++ Seq(
crossScalaVersions := {
if ((playCrossBuildRootProject in ThisBuild).?.value.exists(identity)) {
if ((ThisBuild / playCrossBuildRootProject).?.value.exists(identity)) {
Seq(ScalaVersions.scala212, ScalaVersions.scala213)
} else {
Seq(ScalaVersions.scala212)
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/interplay/PlaySbtBuildBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ private[interplay] object PlaySbtBuildBase extends AutoPlugin {
override def projectSettings = Seq(
scalaVersion := ScalaVersions.scala212,
crossScalaVersions := Seq(ScalaVersions.scala212),
sbtVersion in pluginCrossBuild := SbtVersions.sbt10,
javacOptions in compile ++= Seq("-source", "1.8", "-target", "1.8"),
javacOptions in doc := Seq("-source", "1.8")
pluginCrossBuild / sbtVersion := SbtVersions.sbt10,
compile / javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
doc / javacOptions := Seq("-source", "1.8")
)
}
6 changes: 3 additions & 3 deletions src/main/scala/interplay/PlayWhitesourcePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object PlayWhitesourcePlugin extends AutoPlugin {

override lazy val projectSettings = Seq(
whitesourceProduct := "Lightbend Reactive Platform",
whitesourceAggregateProjectName := (moduleName in LocalRootProject).value + "-" + {
whitesourceAggregateProjectName := (LocalRootProject / moduleName).value + "-" + {
if (isSnapshot.value) {
// There are two scenarios then:
// 1. It is the master branch
Expand All @@ -28,14 +28,14 @@ object PlayWhitesourcePlugin extends AutoPlugin {
} else {
// If it is not "master", then it is a release branch
// that should also be handled as an snapshot report.
CrossVersion.partialVersion((version in LocalRootProject).value) match {
CrossVersion.partialVersion((LocalRootProject / version).value) match {
case Some((major, minor)) => s"$major.$minor-snapshot"
case None => "snapshot"
}
}
} else {
// Here we have only the case where we are releasing a version.
CrossVersion.partialVersion((version in LocalRootProject).value) match {
CrossVersion.partialVersion((LocalRootProject / version).value) match {
case Some((major, minor)) => s"$major.$minor-stable"
case None => "snapshot"
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/interplay/Playdoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ object Playdoc extends AutoPlugin {
override def trigger = noTrigger

override def projectSettings =
Defaults.packageTaskSettings(playdocPackage, mappings in playdocPackage) ++
Defaults.packageTaskSettings(playdocPackage, playdocPackage / mappings) ++
Seq(
playdocDirectory := (baseDirectory in ThisBuild).value / "docs" / "manual",
mappings in playdocPackage := {
playdocDirectory := (ThisBuild / baseDirectory).value / "docs" / "manual",
playdocPackage / mappings := {
val base: File = playdocDirectory.value
base.allPaths.pair(IO.relativize(base.getParentFile(), _))
},
artifactClassifier in playdocPackage := Some("playdoc"),
artifact in playdocPackage ~= { _.withConfigurations(Vector(Docs)) }
playdocPackage / artifactClassifier := Some("playdoc"),
playdocPackage / artifact ~= { _.withConfigurations(Vector(Docs)) }
) ++
addArtifact(artifact in playdocPackage, playdocPackage)
addArtifact(playdocPackage / artifact, playdocPackage)

}
16 changes: 8 additions & 8 deletions src/sbt-test/interplay/library-with-plugin/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lazy val common: Seq[Setting[_]] = Seq(
lazy val `mock-root` = (project in file("."))
.settings(
common,
playCrossBuildRootProject in ThisBuild := true // activates cross build for Scala 2.12 and 2.13
ThisBuild / playCrossBuildRootProject := true // activates cross build for Scala 2.12 and 2.13
)
.enablePlugins(PlayRootProject)
.aggregate(`mock-library`, `mock-sbt-plugin`) // has a sbt plugin that will be built together with root project
Expand All @@ -33,16 +33,16 @@ lazy val `mock-library` = (project in file("mock-library"))
.settings(common)

playBuildExtraTests := {
(scripted in `mock-sbt-plugin`).toTask("").value
val _ = (test in (`mock-sbt-library`, Test)).value
(`mock-sbt-plugin` / scripted).toTask("").value
val _ = (`mock-sbt-library` / Test / test).value
}

playBuildExtraPublish := {
val p = (PgpKeys.publishSigned in `mock-sbt-plugin`).value
val l = (PgpKeys.publishSigned in `mock-sbt-library`).value
val p = (`mock-sbt-plugin` / PgpKeys.publishSigned).value
val l = (`mock-sbt-library` / PgpKeys.publishSigned).value
}

playBuildRepoName in ThisBuild := "mock"
ThisBuild / playBuildRepoName := "mock"

// Below this line is for facilitating tests

Expand All @@ -58,12 +58,12 @@ InputKey[Unit]("contains") := {
}
}

commands in ThisBuild := {
ThisBuild / commands := {
Seq("sonatypeRelease", "sonatypeBundleRelease").map { name =>
Command.command(name) { state =>
val extracted = Project.extract(state)
IO.write(extracted.get(target) / "sonatype-release-version", extracted.get(version))
state
}
} ++ (commands in ThisBuild).value
} ++ (ThisBuild / commands).value
}
2 changes: 1 addition & 1 deletion src/sbt-test/interplay/library-with-plugin/version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.2.3-SNAPSHOT"
ThisBuild / version := "1.2.3-SNAPSHOT"
6 changes: 3 additions & 3 deletions src/sbt-test/interplay/library-with-root/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lazy val `mock-library` = (project in file("mock-library"))
.enablePlugins(PlayLibrary)
.settings(common)

playBuildRepoName in ThisBuild := "mock"
ThisBuild / playBuildRepoName := "mock"

// Below this line is for facilitating tests
InputKey[Unit]("contains") := {
Expand All @@ -28,12 +28,12 @@ def common: Seq[Setting[_]] = Seq(
credentials := Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", "sbt", "notcorrectpassword"))
)

commands in ThisBuild := {
ThisBuild / commands := {
Seq("sonatypeRelease", "sonatypeBundleRelease").map { name =>
Command.command(name) { state =>
val extracted = Project.extract(state)
IO.write(extracted.get(target) / "sonatype-release-version", extracted.get(version))
state
}
} ++ (commands in ThisBuild).value
} ++ (ThisBuild / commands).value
}
2 changes: 1 addition & 1 deletion src/sbt-test/interplay/library-with-root/version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.2.3-SNAPSHOT"
ThisBuild / version := "1.2.3-SNAPSHOT"
8 changes: 4 additions & 4 deletions src/sbt-test/interplay/library/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val `mock-library` = (project in file("."))
.enablePlugins(PlayLibrary && PlayReleaseBase)
.settings(common: _*)

playBuildRepoName in ThisBuild := "mock"
ThisBuild / playBuildRepoName := "mock"

// Below this line is for facilitating tests
InputKey[Unit]("contains") := {
Expand All @@ -25,7 +25,7 @@ TaskKey[Unit]("verifyOmnidocSourceUrl") := {
case other => throw sys.error(s"Expected $expected source url, got $other")
}

val srcZip = (packageSrc in Compile).value
val srcZip = (Compile / packageSrc).value
val jarFile = new JarFile(srcZip)
val manifest = jarFile.getManifest.getMainAttributes

Expand All @@ -44,12 +44,12 @@ def common: Seq[Setting[_]] = Seq(
credentials := Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", "sbt", "notcorrectpassword"))
)

commands in ThisBuild := {
ThisBuild / commands := {
Seq("sonatypeRelease", "sonatypeBundleRelease").map { name =>
Command.command(name) { state =>
val extracted = Project.extract(state)
IO.write(extracted.get(target) / "sonatype-release-version", extracted.get(version))
state
}
} ++ (commands in ThisBuild).value
} ++ (ThisBuild / commands).value
}
2 changes: 1 addition & 1 deletion src/sbt-test/interplay/library/version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.2.3-SNAPSHOT"
ThisBuild / version := "1.2.3-SNAPSHOT"
8 changes: 4 additions & 4 deletions src/sbt-test/interplay/plugin-with-root/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ lazy val `mock-sbt-plugin` = (project in file("mock-sbt-plugin"))
)

playBuildExtraTests := {
(scripted in `mock-sbt-plugin`).toTask("").value
(`mock-sbt-plugin` / scripted).toTask("").value
}

playBuildRepoName in ThisBuild := "mock"
ThisBuild / playBuildRepoName := "mock"

// Below this line is for facilitating tests
InputKey[Unit]("contains") := {
Expand All @@ -38,12 +38,12 @@ def common: Seq[Setting[_]] = Seq(
publish := { throw sys.error("Publish should not have been invoked") },
)

commands in ThisBuild := {
ThisBuild / commands := {
Seq("sonatypeRelease", "sonatypeBundleRelease").map { name =>
Command.command(name) { state =>
val extracted = Project.extract(state)
IO.write(extracted.get(target) / "sonatype-release-version", extracted.get(version))
state
}
} ++ (commands in ThisBuild).value
} ++ (ThisBuild / commands).value
}
2 changes: 1 addition & 1 deletion src/sbt-test/interplay/plugin-with-root/version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.2.3-SNAPSHOT"
ThisBuild / version := "1.2.3-SNAPSHOT"
8 changes: 4 additions & 4 deletions src/sbt-test/interplay/plugin-without-cross-release/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ lazy val `mock-sbt-plugin` = (project in file("."))
)

playBuildExtraTests := {
(scripted in `mock-sbt-plugin`).toTask("").value
(`mock-sbt-plugin` / scripted).toTask("").value
}

playBuildRepoName in ThisBuild := "mock-without-cross-release"
ThisBuild / playBuildRepoName := "mock-without-cross-release"

// Below this line is for facilitating tests

Expand All @@ -35,12 +35,12 @@ def common: Seq[Setting[_]] = Seq(
publish := { throw sys.error("Publish should not have been invoked") },
)

commands in ThisBuild := {
ThisBuild / commands := {
Seq("sonatypeRelease", "sonatypeBundleRelease").map { name =>
Command.command(name) { state =>
val extracted = Project.extract(state)
IO.write(extracted.get(target) / "sonatype-release-version", extracted.get(version))
state
}
} ++ (commands in ThisBuild).value
} ++ (ThisBuild / commands).value
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.2.3-SNAPSHOT"
ThisBuild / version := "1.2.3-SNAPSHOT"
Loading