-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #773 from playframework/drop-interplay
Drop interplay
- Loading branch information
Showing
5 changed files
with
110 additions
and
16 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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import scala.sys.process._ | ||
|
||
import com.typesafe.tools.mima.plugin.MimaPlugin._ | ||
import com.typesafe.tools.mima.core._ | ||
import interplay.ScalaVersions._ | ||
|
||
ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("releases") | ||
|
||
|
@@ -17,29 +15,42 @@ Global / onLoad := (Global / onLoad).value.andThen { s => | |
} | ||
|
||
lazy val commonSettings = Seq( | ||
// Work around https://issues.scala-lang.org/browse/SI-9311 | ||
scalacOptions ~= (_.filterNot(_ == "-Xfatal-warnings")), | ||
organization := "com.typesafe.play", | ||
organizationName := "The Play Framework Project", | ||
organizationHomepage := Some(url("https://playframework.com/")), | ||
homepage := Some(url(s"https://github.com/playframework/${Common.repoName}")), | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:-options"), | ||
compile / javacOptions ++= Seq("--release", "11"), | ||
doc / javacOptions := Seq("-source", "11"), | ||
scalaVersion := "2.13.12", // scala213, | ||
crossScalaVersions := Seq("2.13.12", "3.3.1"), // scala213, | ||
pomExtra := scala.xml.NodeSeq.Empty, // Can be removed when dropping interplay | ||
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-encoding", "utf8") ++ | ||
(CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 13)) => Seq("-Xsource:3", "-Xmigration") | ||
case _ => Seq.empty | ||
}), | ||
developers += Developer( | ||
"playframework", | ||
"The Play Framework Contributors", | ||
"[email protected]", | ||
url("https://github.com/playframework") | ||
), | ||
pomIncludeRepository := { _ => false } | ||
) | ||
|
||
lazy val `play-slick-root` = (project in file(".")) | ||
.enablePlugins(PlayRootProject) | ||
.aggregate( | ||
`play-slick`, | ||
`play-slick-evolutions` | ||
) | ||
.settings(commonSettings) | ||
.settings( | ||
publish / skip := true | ||
) | ||
|
||
lazy val `play-slick` = (project in file("src/core")) | ||
.enablePlugins(PlayLibrary, Playdoc, MimaPlugin) | ||
.enablePlugins(Omnidoc, Playdoc, MimaPlugin) | ||
.configs(Docs) | ||
.settings(libraryDependencies ++= Dependencies.core) | ||
.settings(mimaSettings) | ||
|
@@ -50,7 +61,7 @@ lazy val `play-slick` = (project in file("src/core")) | |
.settings(commonSettings) | ||
|
||
lazy val `play-slick-evolutions` = (project in file("src/evolutions")) | ||
.enablePlugins(PlayLibrary, Playdoc, MimaPlugin) | ||
.enablePlugins(Omnidoc, Playdoc, MimaPlugin) | ||
.configs(Docs) | ||
.settings(libraryDependencies ++= Dependencies.evolutions) | ||
.settings(mimaSettings) | ||
|
@@ -65,8 +76,6 @@ lazy val docs = project | |
.dependsOn(`play-slick-evolutions`) | ||
.settings(commonSettings) | ||
|
||
ThisBuild / playBuildRepoName := "play-slick" | ||
|
||
// Binary compatibility is tested against this version | ||
val previousVersion: Option[String] = Some("5.2.0-RC1") | ||
|
||
|
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
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,53 @@ | ||
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 omnidocGithubRepo: Option[String] = Some(s"playframework/${Common.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