From e55bd5220eb07017ed5fb14fc4f33f0a8f83fd2d Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 15 Mar 2015 10:25:33 -0700 Subject: [PATCH 1/3] Remove stdout/stderr output from Junit tests --- test/junit/scala/collection/mutable/VectorTest.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/test/junit/scala/collection/mutable/VectorTest.scala b/test/junit/scala/collection/mutable/VectorTest.scala index e9c4d44a72e5..b3219d1b0229 100644 --- a/test/junit/scala/collection/mutable/VectorTest.scala +++ b/test/junit/scala/collection/mutable/VectorTest.scala @@ -38,7 +38,6 @@ class VectorTest { def iteratorCat() { def its = vecs.map(_.toList.toIterator) val cats = vecs.map(a => its.map(a ++ _)) - println(cats) assert( cats == ans ) } From fa04f87c7cb061bdef2a18b3e4fb346efbfa2cfc Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 20 Apr 2015 14:37:54 +1000 Subject: [PATCH 2/3] Avoid wildcard ignorance of files named 'target'. In favour of explicitly ignoring the ones we know contain SBT build output. Rationale: we used to have a package named target. Admittedly we thought better of that (55109d0d253) so it is now called `meta`, but let's not get lazy and encode a poor practice into our gitignore. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e3bc794f089a..d6571a377f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -50,5 +50,7 @@ /qbin # Sbt's target directories -**/target/ +/target/ +/project/target/ +/project/project/target /build-sbt/ From 245d6e968060f6f5a465eb2aafe36dd2f5a8d0ca Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 20 Apr 2015 16:18:02 +1000 Subject: [PATCH 3/3] Avoid unwanted boostrap JARs in the subproject classpaths I added build configuration to ask SBT to forcible override the Scala version in the subproject to the declared bootstrap version. I did this in response to a warning by SBT the declared `scalaVersion` has been evicted. However, we actually *want* the newer version. To get rid of the warning, we need to exclude all `"org.scala-lang" % "*"` when depending on Scala modules. This cleanly breaks the cycle. Here's a diff of `*/dependencyClasspath` as a result of this patch: https://gist.github.com/retronym/217c76001b1b81798042 --- build.sbt | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/build.sbt b/build.sbt index d89bdd8067bb..0df2e6a800b7 100644 --- a/build.sbt +++ b/build.sbt @@ -52,16 +52,18 @@ val bootstrapScalaVersion = "2.11.5" +def withoutScalaLang(moduleId: ModuleID): ModuleID = moduleId exclude("org.scala-lang", "*") + // exclusion of the scala-library transitive dependency avoids eviction warnings during `update`. -val scalaParserCombinatorsDep = "org.scala-lang.modules" %% "scala-parser-combinators" % versionNumber("scala-parser-combinators") exclude("org.scala-lang", "scala-library") -val scalaXmlDep = "org.scala-lang.modules" %% "scala-xml" % versionNumber("scala-xml") exclude("org.scala-lang", "scala-library") -val partestDep = "org.scala-lang.modules" %% "scala-partest" % versionNumber("partest") exclude("org.scala-lang", "scala-library") -val partestInterfaceDep = "org.scala-lang.modules" %% "scala-partest-interface" % "0.5.0" exclude("org.scala-lang", "scala-library") +val scalaParserCombinatorsDep = withoutScalaLang("org.scala-lang.modules" %% "scala-parser-combinators" % versionNumber("scala-parser-combinators")) +val scalaXmlDep = withoutScalaLang("org.scala-lang.modules" %% "scala-xml" % versionNumber("scala-xml")) +val partestDep = withoutScalaLang("org.scala-lang.modules" %% "scala-partest" % versionNumber("partest")) +val partestInterfaceDep = withoutScalaLang("org.scala-lang.modules" %% "scala-partest-interface" % "0.5.0") val junitDep = "junit" % "junit" % "4.11" val junitIntefaceDep = "com.novocode" % "junit-interface" % "0.11" % "test" val jlineDep = "jline" % "jline" % versionProps("jline.version") val antDep = "org.apache.ant" % "ant" % "1.9.4" -val scalacheckDep = "org.scalacheck" %% "scalacheck" % "1.11.4" exclude("org.scala-lang", "scala-library") +val scalacheckDep = withoutScalaLang("org.scalacheck" %% "scalacheck" % "1.11.4") lazy val commonSettings = clearSourceAndResourceDirectories ++ Seq[Setting[_]]( organization := "org.scala-lang", @@ -181,10 +183,6 @@ lazy val compiler = configureAsSubproject(project) lazy val interactive = configureAsSubproject(project) .settings(disableDocsAndPublishingTasks: _*) - .settings( - scalaVersion := bootstrapScalaVersion, - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) } - ) .dependsOn(compiler) lazy val repl = configureAsSubproject(project) @@ -217,8 +215,6 @@ lazy val partestExtras = configureAsSubproject(Project("partest-extras", file(". .dependsOn(repl) .settings(clearSourceAndResourceDirectories: _*) .settings( - scalaVersion := bootstrapScalaVersion, - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, libraryDependencies += partestDep, unmanagedSourceDirectories in Compile := List(baseDirectory.value) ) @@ -228,8 +224,6 @@ lazy val junit = project.in(file("test") / "junit") .settings(clearSourceAndResourceDirectories: _*) .settings(commonSettings: _*) .settings( - scalaVersion := bootstrapScalaVersion, - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, fork in Test := true, libraryDependencies ++= Seq(junitDep, junitIntefaceDep), testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"), @@ -243,8 +237,6 @@ lazy val partestJavaAgent = (project in file(".") / "src" / "partest-javaagent") doc := file("!!! NO DOCS !!!"), publishLocal := {}, publish := {}, - scalaVersion := bootstrapScalaVersion, - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, // Setting name to "scala-partest-javaagent" so that the jar file gets that name, which the Runner relies on name := "scala-partest-javaagent", // writing jar file to $buildDirectory/pack/lib because that's where it's expected to be found @@ -263,8 +255,6 @@ lazy val test = project. settings(commonSettings: _*). settings(Defaults.itSettings: _*). settings( - scalaVersion := bootstrapScalaVersion, - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, libraryDependencies ++= Seq(partestDep, scalaXmlDep, partestInterfaceDep, scalacheckDep), unmanagedBase in Test := baseDirectory.value / "files" / "lib", unmanagedJars in Test <+= (unmanagedBase) (j => Attributed.blank(j)) map(identity), @@ -291,8 +281,6 @@ lazy val test = project. lazy val root = (project in file(".")). aggregate(library, forkjoin, reflect, compiler, asm, interactive, repl, scaladoc, scalap, actors, partestExtras, junit).settings( - scalaVersion := bootstrapScalaVersion, - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, sources in Compile := Seq.empty, onLoadMessage := """|*** Welcome to the sbt build definition for Scala! *** |This build definition has an EXPERIMENTAL status. If you are not