-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
118 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ import com.typesafe.tools.mima.core._ | |
import sbt.util.{ Level => _, _ } | ||
|
||
import sbt.io.Path._ | ||
import interplay.ScalaVersions._ | ||
|
||
val SeleniumVersion = "4.12.1" | ||
val SeleniumHtmlunitVersion = "4.12.0" | ||
|
@@ -27,7 +26,6 @@ val ScalatestVersion = "3.2.17" | |
val ScalatestSeleniumVersion = ScalatestVersion + ".0" | ||
val ScalatestMockitoVersion = ScalatestVersion + ".0" | ||
|
||
ThisBuild / playBuildRepoName := "scalatestplus-play" | ||
ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("releases") | ||
|
||
// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed | ||
|
@@ -49,8 +47,8 @@ lazy val mimaSettings = Seq( | |
) | ||
|
||
lazy val commonSettings = Seq( | ||
scalaVersion := scala213, | ||
crossScalaVersions := Seq(scala213, scala3), | ||
scalaVersion := "2.13.12", | ||
crossScalaVersions := Seq("2.13.12", "3.3.1"), | ||
Test / parallelExecution := false, | ||
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oTK"), | ||
headerLicense := Some( | ||
|
@@ -75,22 +73,26 @@ lazy val commonSettings = Seq( | |
|
||
lazy val `scalatestplus-play-root` = project | ||
.in(file(".")) | ||
.enablePlugins(PlayRootProject) | ||
.aggregate(`scalatestplus-play`) | ||
.settings(commonSettings) | ||
.settings( | ||
sonatypeProfileName := "org.scalatestplus.play", | ||
mimaPreviousArtifacts := Set.empty | ||
mimaPreviousArtifacts := Set.empty, | ||
publish / skip := true | ||
) | ||
|
||
lazy val `scalatestplus-play` = project | ||
.in(file("module")) | ||
.enablePlugins(Playdoc, PlayLibrary) | ||
.enablePlugins(Omnidoc, Playdoc) | ||
.configs(Docs) | ||
.settings( | ||
commonSettings, | ||
mimaSettings, | ||
organization := "org.scalatestplus.play", | ||
organizationName := "The Play Framework Project", | ||
organizationHomepage := Some(url("https://playframework.com")), | ||
homepage := Some(url(s"https://github.com/playframework/${Omnidoc.repoName}")), | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
libraryDependencies ++= Seq( | ||
ws, | ||
nettyServer % Test, // Using netty for now, we can switch back to akkaHttpServer when it has Scala 3 artifacts | ||
|
@@ -103,18 +105,35 @@ lazy val `scalatestplus-play` = project | |
"net.sourceforge.htmlunit" % "htmlunit-cssparser" % CssParserVersion | ||
), | ||
Compile / doc / scalacOptions := Seq("-doc-title", "ScalaTest + Play, " + version.value), | ||
doc / javacOptions := Seq("-source", "11"), | ||
Test / fork := true, | ||
Test / javaOptions ++= List( | ||
"-Dwebdriver.firefox.logfile=/dev/null", // disable GeckoDriver logs polluting the CI logs | ||
), | ||
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-encoding", "utf8") ++ | ||
(CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 13)) => Seq("-Xsource:3", "-Xmigration") | ||
case _ => Seq.empty | ||
}), | ||
javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:-options", "--release", "11"), | ||
developers += Developer( | ||
"playframework", | ||
"The Play Framework Contributors", | ||
"[email protected]", | ||
url("https://github.com/playframework") | ||
), | ||
pomIncludeRepository := { _ => | ||
false | ||
} | ||
) | ||
|
||
lazy val docs = project | ||
.in(file("docs")) | ||
.enablePlugins(PlayDocsPlugin, PlayNoPublish) | ||
.enablePlugins(PlayDocsPlugin) | ||
.configs(Docs) | ||
.settings( | ||
commonSettings, | ||
publish / skip := true, | ||
libraryDependencies ++= Seq( | ||
"org.mockito" % "mockito-core" % MockitoVersion % Test, | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import sbt._ | ||
import sbt.Keys._ | ||
import sbt.Package.ManifestAttributes | ||
|
||
/** | ||
* This AutoPlugin adds the `Omnidoc-Source-URL` key on the MANIFEST.MF of artifact-sources.jar so later Omnidoc can use | ||
* that value to link scaladocs to GitHub sources. | ||
*/ | ||
object Omnidoc extends AutoPlugin { | ||
|
||
object autoImport { | ||
lazy val omnidocSnapshotBranch = settingKey[String]("Git branch for development versions") | ||
lazy val omnidocPathPrefix = settingKey[String]("Prefix before source directory paths") | ||
lazy val omnidocSourceUrl = settingKey[Option[String]]("Source URL for scaladoc linking") | ||
} | ||
|
||
val repoName = "scalatestplus-play" | ||
|
||
val omnidocGithubRepo: Option[String] = Some(s"playframework/${repoName}") | ||
|
||
val omnidocTagPrefix: Option[String] = Some("") | ||
|
||
val SourceUrlKey = "Omnidoc-Source-URL" | ||
|
||
override def requires = sbt.plugins.JvmPlugin | ||
|
||
override def trigger = noTrigger | ||
|
||
import autoImport.* | ||
|
||
override def projectSettings = Seq( | ||
omnidocSourceUrl := omnidocGithubRepo.map { repo => | ||
val development: String = (omnidocSnapshotBranch ?? "main").value | ||
val tagged: String = omnidocTagPrefix.getOrElse("v") + version.value | ||
val tree: String = if (isSnapshot.value) development else tagged | ||
val prefix: String = "/" + (omnidocPathPrefix ?? "").value | ||
val path: String = { | ||
val buildDir: File = (ThisBuild / baseDirectory).value | ||
val projDir: File = baseDirectory.value | ||
val rel: Option[String] = IO.relativize(buildDir, projDir) | ||
rel match { | ||
case None if buildDir == projDir => "" // Same dir (sbt 0.13) | ||
case Some("") => "" // Same dir (sbt 1.0) | ||
case Some(childDir) => prefix + childDir // Child dir | ||
case None => "" // Disjoint dirs (Rich: I'm not sure if this can happen) | ||
} | ||
} | ||
s"https://github.com/${repo}/tree/${tree}${path}" | ||
}, | ||
Compile / packageSrc / packageOptions ++= omnidocSourceUrl.value.toSeq.map { url => | ||
ManifestAttributes(SourceUrlKey -> url) | ||
} | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import sbt._ | ||
import sbt.Keys._ | ||
import sbt.io.IO | ||
|
||
object Playdoc extends AutoPlugin { | ||
|
||
object autoImport { | ||
final val Docs = config("docs") | ||
val playdocDirectory = settingKey[File]("Base directory of play documentation") | ||
val playdocPackage = taskKey[File]("Package play documentation") | ||
} | ||
|
||
import autoImport._ | ||
|
||
override def requires = sbt.plugins.JvmPlugin | ||
|
||
override def trigger = noTrigger | ||
|
||
override def projectSettings = | ||
Defaults.packageTaskSettings(playdocPackage, playdocPackage / mappings) ++ | ||
Seq( | ||
playdocDirectory := (ThisBuild / baseDirectory).value / "docs" / "manual", | ||
playdocPackage / mappings := { | ||
val base: File = playdocDirectory.value | ||
base.allPaths.pair(IO.relativize(base.getParentFile(), _)) | ||
}, | ||
playdocPackage / artifactClassifier := Some("playdoc"), | ||
playdocPackage / artifact ~= { _.withConfigurations(Vector(Docs)) } | ||
) ++ | ||
addArtifact(playdocPackage / artifact, playdocPackage) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
resolvers ++= DefaultOptions.resolvers(snapshot = true) | ||
resolvers ++= Seq( | ||
Resolver.typesafeRepo("releases"), | ||
Resolver.sonatypeRepo("releases"), | ||
Resolver.sonatypeRepo("snapshots"), // used by deploy nightlies, which publish here & use -Dplay.version | ||
) | ||
resolvers ++= Resolver | ||
.sonatypeOssRepos("snapshots") // used by deploy nightlies, which publish here & use -Dplay.version | ||
|
||
addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.getOrElse("interplay.version", "3.1.7")) | ||
addSbtPlugin("com.typesafe.play" % "play-docs-sbt-plugin" % sys.props.getOrElse("play.version", "2.9.0-RC2")) | ||
|
||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") | ||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") | ||
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") | ||
|
||
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") |