summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.sbt22
-rw-r--r--src/library/scala/sys/process/ProcessBuilder.scala8
-rw-r--r--src/library/scala/sys/process/package.scala10
3 files changed, 23 insertions, 17 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)
diff --git a/src/library/scala/sys/process/ProcessBuilder.scala b/src/library/scala/sys/process/ProcessBuilder.scala
index 9713b712fc..fe4c30ee50 100644
--- a/src/library/scala/sys/process/ProcessBuilder.scala
+++ b/src/library/scala/sys/process/ProcessBuilder.scala
@@ -90,19 +90,19 @@ import ProcessBuilder._
*
* If not specified, the input of the external commands executed with `run` or
* `!` will not be tied to anything, and the output will be redirected to the
- * stdout and stderr of the Scala process. For the methods `!!` and `lines`, no
+ * stdout and stderr of the Scala process. For the methods `!!` and `lineStream`, no
* input will be provided, and the output will be directed according to the
* semantics of these methods.
*
* Some methods will cause stdin to be used as input. Output can be controlled
- * with a [[scala.sys.process.ProcessLogger]] -- `!!` and `lines` will only
+ * with a [[scala.sys.process.ProcessLogger]] -- `!!` and `lineStream` will only
* redirect error output when passed a `ProcessLogger`. If one desires full
* control over input and output, then a [[scala.sys.process.ProcessIO]] can be
* used with `run`.
*
- * For example, we could silence the error output from `lines_!` like this:
+ * For example, we could silence the error output from `lineStream_!` like this:
* {{{
- * val etcFiles = "find /etc" lines_! ProcessLogger(line => ())
+ * val etcFiles = "find /etc" lineStream_! ProcessLogger(line => ())
* }}}
*
* ==Extended Example==
diff --git a/src/library/scala/sys/process/package.scala b/src/library/scala/sys/process/package.scala
index ff0fd920c9..bf4287dfc3 100644
--- a/src/library/scala/sys/process/package.scala
+++ b/src/library/scala/sys/process/package.scala
@@ -25,7 +25,7 @@ package scala.sys {
*
* {{{
* import scala.sys.process._
- * "ls" #| "grep .scala" #&& Seq("sh", "-c", "scalac *.scala") #|| "echo nothing found" lines
+ * "ls" #| "grep .scala" #&& Seq("sh", "-c", "scalac *.scala") #|| "echo nothing found" lineStream
* }}}
*
* We describe below the general concepts and architecture of the package,
@@ -92,7 +92,7 @@ package scala.sys {
*
* - Return status of the process (`!` methods)
* - Output of the process as a `String` (`!!` methods)
- * - Continuous output of the process as a `Stream[String]` (`lines` methods)
+ * - Continuous output of the process as a `Stream[String]` (`lineStream` methods)
* - The `Process` representing it (`run` methods)
*
* Some simple examples of these methods:
@@ -109,7 +109,7 @@ package scala.sys {
* // a Stream[String]
* def sourceFilesAt(baseDir: String): Stream[String] = {
* val cmd = Seq("find", baseDir, "-name", "*.scala", "-type", "f")
- * cmd.lines
+ * cmd.lineStream
* }
* }}}
*
@@ -167,8 +167,8 @@ package scala.sys {
* def sourceFilesAt(baseDir: String): (Stream[String], StringBuffer) = {
* val buffer = new StringBuffer()
* val cmd = Seq("find", baseDir, "-name", "*.scala", "-type", "f")
- * val lines = cmd lines_! ProcessLogger(buffer append _)
- * (lines, buffer)
+ * val lineStream = cmd lineStream_! ProcessLogger(buffer append _)
+ * (lineStream, buffer)
* }
* }}}
*