summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2016-10-18 10:51:08 -0700
committerAdriaan Moors <adriaan@lightbend.com>2016-10-18 10:52:22 -0700
commit360e0b0ede0b58cbf24f711c971819f849f12771 (patch)
tree49f26d45b81a4a89cf031b0a8b3e4428b398998d /build.sbt
parent28426aba1b9576e352b867f19258faa3376ba023 (diff)
parent823b2d9b130296576d91a86a45e7f6c7d7d94b48 (diff)
downloadscala-360e0b0ede0b58cbf24f711c971819f849f12771.tar.gz
scala-360e0b0ede0b58cbf24f711c971819f849f12771.tar.bz2
scala-360e0b0ede0b58cbf24f711c971819f849f12771.zip
Merge 2.11.x into 2.12.x
Including PRs #5199, #5405
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt22
1 files changed, 14 insertions, 8 deletions
diff --git a/build.sbt b/build.sbt
index 6e8b02441a..17ff3bfb6d 100644
--- a/build.sbt
+++ b/build.sbt
@@ -195,7 +195,7 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings +
// directly to stdout
outputStrategy in run := Some(StdoutOutput),
Quiet.silenceScalaBinaryVersionWarning
-)
+) ++ removePomDependencies
/** Extra post-processing for the published POM files. These are needed to create POMs that
* are equivalent to the ones from the Ant build. In the long term this should be removed and
@@ -224,10 +224,16 @@ def fixPom(extra: (String, scala.xml.Node)*): Setting[_] = {
) ++ extra) }
}
+val pomDependencyExclusions =
+ settingKey[Seq[(String, String)]]("List of (groupId, artifactId) pairs to exclude from the POM and ivy.xml")
+
+pomDependencyExclusions in Global := Nil
+
/** Remove unwanted dependencies from the POM and ivy.xml. */
-def removePomDependencies(deps: (String, String)*): Seq[Setting[_]] = Seq(
+lazy val removePomDependencies: Seq[Setting[_]] = Seq(
pomPostProcess := { n =>
val n2 = pomPostProcess.value.apply(n)
+ val deps = pomDependencyExclusions.value
import scala.xml._
import scala.xml.transform._
new RuleTransformer(new RewriteRule {
@@ -245,6 +251,7 @@ def removePomDependencies(deps: (String, String)*): Seq[Setting[_]] = Seq(
import scala.xml._
import scala.xml.transform._
val f = deliverLocal.value
+ val deps = pomDependencyExclusions.value
val e = new RuleTransformer(new RewriteRule {
override def transform(node: Node) = node match {
case e: Elem if e.label == "dependency" && {
@@ -337,7 +344,9 @@ lazy val library = configureAsSubproject(project)
"/project/name" -> <name>Scala Library</name>,
"/project/description" -> <description>Standard library for the Scala Programming Language</description>,
"/project/packaging" -> <packaging>jar</packaging>
- )
+ ),
+ // Remove the dependency on "forkjoin" from the POM because it is included in the JAR:
+ pomDependencyExclusions += ((organization.value, "forkjoin"))
)
.settings(filterDocSources("*.scala" -- (regexFileFilter(".*/runtime/.*\\$\\.scala") ||
regexFileFilter(".*/runtime/ScalaRunTime\\.scala") ||
@@ -418,12 +427,9 @@ lazy val compiler = configureAsSubproject(project)
"/project/description" -> <description>Compiler for the Scala Programming Language</description>,
"/project/packaging" -> <packaging>jar</packaging>
),
- apiURL := None
+ apiURL := None,
+ pomDependencyExclusions ++= List(("org.apache.ant", "ant"), ("org.scala-lang.modules", "scala-asm"))
)
- .settings(removePomDependencies(
- ("org.apache.ant", "ant"),
- ("org.scala-lang.modules", "scala-asm")
- ): _*)
.dependsOn(library, reflect)
lazy val interactive = configureAsSubproject(project)