From f2e5d48b6b6d9aba7dc24f14b0bc5c9a84c2997f Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 3 Feb 2015 19:36:45 -0500 Subject: [PATCH] remove precompiled compiler bridges - Scala 2.8.x or 2.9.x are no longer used that often. - Precompiled is a cross build liability as sbt (2.10.4) depends on 2.8.x/2.9.x code. - Scripted test was modified to check 2.8 and 2.9 compilation --- build.sbt | 74 ++++--------------- project/Dependencies.scala | 3 - .../compiler-project/run2.8-2.9/build.sbt | 13 ++++ .../src/main/scala/Foo.scala | 0 .../src/test/scala/ATest.scala | 0 .../sbt-test/compiler-project/run2.8-2.9/test | 6 ++ .../compiler-project/run2.8/build.sbt | 5 -- sbt/src/sbt-test/compiler-project/run2.8/test | 1 - 8 files changed, 32 insertions(+), 70 deletions(-) create mode 100644 sbt/src/sbt-test/compiler-project/run2.8-2.9/build.sbt rename sbt/src/sbt-test/compiler-project/{run2.8 => run2.8-2.9}/src/main/scala/Foo.scala (100%) rename sbt/src/sbt-test/compiler-project/{run2.8 => run2.8-2.9}/src/test/scala/ATest.scala (100%) create mode 100644 sbt/src/sbt-test/compiler-project/run2.8-2.9/test delete mode 100644 sbt/src/sbt-test/compiler-project/run2.8/build.sbt delete mode 100644 sbt/src/sbt-test/compiler-project/run2.8/test diff --git a/build.sbt b/build.sbt index 9a8c1ca75..47417d5f6 100644 --- a/build.sbt +++ b/build.sbt @@ -302,9 +302,18 @@ lazy val compileInterfaceProj = (project in compilePath / "interface"). artifact in (Compile, packageSrc) := Artifact(srcID).copy(configurations = Compile :: Nil).extra("e:component" -> srcID) ) -lazy val precompiled282 = precompiled(scala282) -lazy val precompiled292 = precompiled(scala292) -lazy val precompiled293 = precompiled(scala293) +def precompiledSettings = Seq( + artifact in packageBin <<= (appConfiguration, scalaVersion) { (app, sv) => + val launcher = app.provider.scalaProvider.launcher + val bincID = binID + "_" + ScalaInstance(sv, launcher).actualVersion + Artifact(binID) extra ("e:component" -> bincID) + }, + target <<= (target, scalaVersion) { (base, sv) => base / ("precompiled_" + sv) }, + scalacOptions := Nil, + ivyScala ~= { _.map(_.copy(checkExplicit = false, overrideScalaVersion = false)) }, + exportedProducts in Compile := Nil, + libraryDependencies += scalaCompiler.value % "provided" +) // Implements the core functionality of detecting and propagating changes incrementally. // Defines the data structures for representing file fingerprints and relationships and the overall source analysis @@ -412,7 +421,7 @@ lazy val mainProj = (project in mainPath). // technically, we need a dependency on all of mainProj's dependencies, but we don't do that since this is strictly an integration project // with the sole purpose of providing certain identifiers without qualification (with a package object) lazy val sbtProj = (project in sbtPath). - dependsOn(mainProj, compileInterfaceProj, precompiled282, precompiled292, precompiled293, scriptedSbtProj % "test->test"). + dependsOn(mainProj, compileInterfaceProj, scriptedSbtProj % "test->test"). settings(baseSettings: _*). settings( name := "sbt", @@ -520,35 +529,6 @@ def utilPath = file("util") def compilePath = file("compile") def mainPath = file("main") -def precompiledSettings = Seq( - artifact in packageBin <<= (appConfiguration, scalaVersion) { (app, sv) => - val launcher = app.provider.scalaProvider.launcher - val bincID = binID + "_" + ScalaInstance(sv, launcher).actualVersion - Artifact(binID) extra ("e:component" -> bincID) - }, - target <<= (target, scalaVersion) { (base, sv) => base / ("precompiled_" + sv) }, - scalacOptions := Nil, - ivyScala ~= { _.map(_.copy(checkExplicit = false, overrideScalaVersion = false)) }, - exportedProducts in Compile := Nil, - libraryDependencies += scalaCompiler.value % "provided" -) - -def precompiled(scalav: String): Project = Project(id = normalize("Precompiled " + scalav.replace('.', '_')), base = compilePath / "interface"). - dependsOn(interfaceProj). - settings(baseSettings ++ precompiledSettings: _*). - settings( - name := "Precompiled " + scalav.replace('.', '_'), - scalaHome := None, - scalaVersion <<= (scalaVersion in ThisBuild) { sbtScalaV => - assert(sbtScalaV != scalav, "Precompiled compiler interface cannot have the same Scala version (" + scalav + ") as sbt.") - scalav - }, - crossScalaVersions := Seq(scalav), - // we disable compiling and running tests in precompiled Projprojects of compiler interface - // so we do not need to worry about cross-versioning testing dependencies - sources in Test := Nil - ) - lazy val safeUnitTests = taskKey[Unit]("Known working tests (for both 2.10 and 2.11)") lazy val safeProjects: ScopeFilter = ScopeFilter( inProjects(launchProj, mainSettingsProj, mainProj, ivyProj, completeProj, @@ -576,46 +556,18 @@ def customCommands: Seq[Setting[_]] = Seq( }, commands += Command.command("release-sbt-local") { state => "clean" :: - "precompiled-2_8_2/compile" :: - "precompiled-2_9_2/compile" :: - "precompiled-2_9_3/compile" :: "so compile" :: - "precompiled-2_8_2/publishLocal" :: - "precompiled-2_9_2/publishLocal" :: - "precompiled-2_9_3/publishLocal" :: "so publishLocal" :: "reload" :: state }, - /** There are several complications with sbt's build. - * First is the fact that interface project is a Java-only project - * that uses source generator from datatype subproject in Scala 2.10.4, - * which is depended on by Scala 2.8.2, Scala 2.9.2, and Scala 2.9.3 precompiled project. - * - * Second is the fact that sbt project (currently using Scala 2.10.4) depends on - * the precompiled projects (that uses Scala 2.8.2 etc.) - * - * Finally, there's the fact that all subprojects are released with crossPaths - * turned off for the sbt's Scala version 2.10.4, but some of them are also - * cross published against 2.11.1 with crossPaths turned on. - * - * Because of the way ++ (and its improved version wow) is implemented - * precompiled compiler briges are handled outside of doge aggregation on root. - * `so compile` handles 2.10.x/2.11.x cross building. - */ commands += Command.command("release-sbt") { state => // TODO - Any sort of validation "clean" :: "checkCredentials" :: "conscript-configs" :: - "precompiled-2_8_2/compile" :: - "precompiled-2_9_2/compile" :: - "precompiled-2_9_3/compile" :: "so compile" :: "so publishSigned" :: - "precompiled-2_8_2/publishSigned" :: - "precompiled-2_9_2/publishSigned" :: - "precompiled-2_9_3/publishSigned" :: "publishLauncher" :: state } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 5be547f47..cefb127ad 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,9 +2,6 @@ import sbt._ import Keys._ object Dependencies { - lazy val scala282 = "2.8.2" - lazy val scala292 = "2.9.2" - lazy val scala293 = "2.9.3" lazy val scala210 = "2.10.4" lazy val scala211 = "2.11.1" diff --git a/sbt/src/sbt-test/compiler-project/run2.8-2.9/build.sbt b/sbt/src/sbt-test/compiler-project/run2.8-2.9/build.sbt new file mode 100644 index 000000000..c4ad9ed83 --- /dev/null +++ b/sbt/src/sbt-test/compiler-project/run2.8-2.9/build.sbt @@ -0,0 +1,13 @@ +lazy val specs = Def.setting { + "org.scala-tools.testing" %% "specs" % (scalaVersion.value match { + case "2.8.1" | "2.8.2" | "2.9.0" => "1.6.8" + case "2.9.3" => "1.6.9" + }) +} + +lazy val root = (project in file(".")). + settings( + scalaVersion := "2.8.1", + libraryDependencies += specs.value % Test, + libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _) + ) diff --git a/sbt/src/sbt-test/compiler-project/run2.8/src/main/scala/Foo.scala b/sbt/src/sbt-test/compiler-project/run2.8-2.9/src/main/scala/Foo.scala similarity index 100% rename from sbt/src/sbt-test/compiler-project/run2.8/src/main/scala/Foo.scala rename to sbt/src/sbt-test/compiler-project/run2.8-2.9/src/main/scala/Foo.scala diff --git a/sbt/src/sbt-test/compiler-project/run2.8/src/test/scala/ATest.scala b/sbt/src/sbt-test/compiler-project/run2.8-2.9/src/test/scala/ATest.scala similarity index 100% rename from sbt/src/sbt-test/compiler-project/run2.8/src/test/scala/ATest.scala rename to sbt/src/sbt-test/compiler-project/run2.8-2.9/src/test/scala/ATest.scala diff --git a/sbt/src/sbt-test/compiler-project/run2.8-2.9/test b/sbt/src/sbt-test/compiler-project/run2.8-2.9/test new file mode 100644 index 000000000..fbea7588f --- /dev/null +++ b/sbt/src/sbt-test/compiler-project/run2.8-2.9/test @@ -0,0 +1,6 @@ +> ++2.8.1 +> test:test +> ++2.9.0 +> test:test +> ++2.9.3 +> test:test diff --git a/sbt/src/sbt-test/compiler-project/run2.8/build.sbt b/sbt/src/sbt-test/compiler-project/run2.8/build.sbt deleted file mode 100644 index 159ac76e6..000000000 --- a/sbt/src/sbt-test/compiler-project/run2.8/build.sbt +++ /dev/null @@ -1,5 +0,0 @@ -scalaVersion := "2.8.1" - -libraryDependencies += "org.scala-tools.testing" %% "specs" % "1.6.7.2" % "test" - -libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _) \ No newline at end of file diff --git a/sbt/src/sbt-test/compiler-project/run2.8/test b/sbt/src/sbt-test/compiler-project/run2.8/test deleted file mode 100644 index 7c6f9c539..000000000 --- a/sbt/src/sbt-test/compiler-project/run2.8/test +++ /dev/null @@ -1 +0,0 @@ -> test:test \ No newline at end of file