-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: don't depend on Interplay (#468)
- Loading branch information
Showing
7 changed files
with
174 additions
and
49 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
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,35 @@ | ||
import sbt.Keys._ | ||
import sbt._ | ||
import sbt.plugins.JvmPlugin | ||
|
||
object Common extends AutoPlugin { | ||
override def trigger = allRequirements | ||
|
||
override def requires = JvmPlugin | ||
|
||
val repoName = "play-json" | ||
|
||
override def globalSettings = | ||
Seq( | ||
organization := "com.typesafe.play", | ||
organizationName := "Lightbend Inc.", | ||
organizationHomepage := Some(url("https://www.lightbend.com/")), | ||
homepage := Some(url(s"https://github.com/playframework/${repoName}")), | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-encoding", "utf8"), | ||
javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:-options"), | ||
scmInfo := Some( | ||
ScmInfo( | ||
url(s"https://github.com/playframework/${repoName}"), | ||
s"scm:git:git@github.com:playframework/${repoName}.git" | ||
) | ||
), | ||
developers += Developer( | ||
"contributors", | ||
"Contributors", | ||
"https://gitter.im/playframework/contributors", | ||
url("https://github.com/playframework") | ||
), | ||
description := "Play JSON" | ||
) | ||
} |
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,5 @@ | ||
object Dependencies { | ||
// scalaVersion needs to be kept in sync with travis-ci | ||
val Scala212 = "2.12.10" | ||
val Scala213 = "2.13.1" | ||
} |
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,57 @@ | ||
import sbt.Keys._ | ||
import sbt.Package.ManifestAttributes | ||
import sbt._ | ||
|
||
/** | ||
* Copied in from | ||
* https://github.com/playframework/interplay/blob/master/src/main/scala/interplay/Omnidoc.scala | ||
* | ||
* 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 omnidocGithubRepo = settingKey[String]("Github repository for source URL") | ||
lazy val omnidocSnapshotBranch = settingKey[String]("Git branch for development versions") | ||
// lazy val omnidocTagPrefix = settingKey[String]("Prefix before git tagged versions") | ||
lazy val omnidocPathPrefix = settingKey[String]("Prefix before source directory paths") | ||
lazy val omnidocSourceUrl = settingKey[Option[String]]("Source URL for scaladoc linking") | ||
} | ||
|
||
val omnidocGithubRepo = Some(s"playframework/${Common.repoName}") | ||
val omnidocTagPrefix = 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 ?? "master").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 = (baseDirectory in ThisBuild).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}" | ||
}, | ||
packageOptions in (Compile, packageSrc) ++= 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.Keys._ | ||
import sbt._ | ||
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, mappings in playdocPackage) ++ | ||
Seq( | ||
playdocDirectory := (baseDirectory in ThisBuild).value / "docs" / "manual", | ||
mappings in playdocPackage := { | ||
val base: File = playdocDirectory.value | ||
base.allPaths.pair(IO.relativize(base.getParentFile(), _)) | ||
}, | ||
artifactClassifier in playdocPackage := Some("playdoc"), | ||
artifact in playdocPackage ~= { _.withConfigurations(Vector(Docs)) } | ||
) ++ | ||
addArtifact(artifact in playdocPackage, 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object Publish extends AutoPlugin { | ||
|
||
import bintray.BintrayPlugin | ||
import bintray.BintrayPlugin.autoImport._ | ||
|
||
override def trigger = noTrigger | ||
|
||
override def requires = BintrayPlugin | ||
|
||
override def projectSettings = | ||
Seq( | ||
bintrayOrganization := Some("playframework"), | ||
bintrayRepository := (if (isSnapshot.value) "snapshots" else "maven"), | ||
bintrayPackage := "play-json", | ||
bintrayReleaseOnPublish := false, | ||
publishMavenStyle := true, | ||
bintrayPackageLabels := Seq("playframework", "JSON", "Scala.js") | ||
) | ||
} |
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