summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt100
1 files changed, 28 insertions, 72 deletions
diff --git a/build.sbt b/build.sbt
index 5b9036deb4..4962e4e41c 100644
--- a/build.sbt
+++ b/build.sbt
@@ -4,8 +4,8 @@
* What you see below is very much work-in-progress. The following features are implemented:
* - Compiling all classses for the compiler and library ("compile" in the respective subprojects)
* - Running JUnit tests ("test") and partest ("test/it:test")
- * - Creating build-sbt/quick with all compiled classes and launcher scripts ("dist/mkQuick")
- * - Creating build-sbt/pack with all JARs and launcher scripts ("dist/mkPack")
+ * - Creating build/quick with all compiled classes and launcher scripts ("dist/mkQuick")
+ * - Creating build/pack with all JARs and launcher scripts ("dist/mkPack")
* - Building all scaladoc sets ("doc")
* - Publishing ("publishDists" and standard sbt tasks like "publish" and "publishLocal")
*
@@ -60,10 +60,6 @@ val bootstrapScalaVersion = versionProps("starr.version")
def withoutScalaLang(moduleId: ModuleID): ModuleID = moduleId exclude("org.scala-lang", "*")
// exclusion of the scala-library transitive dependency avoids eviction warnings during `update`.
-val actorsMigrationDep = withoutScalaLang("org.scala-lang" %% "scala-actors-migration" % versionNumber("actors-migration"))
-val akkaActorDep = withoutScalaLang("com.typesafe.akka" %% "akka-actor" % versionNumber("akka-actor"))
-val scalaContinuationsLibraryDep = withoutScalaLang("org.scala-lang.plugins" %% "scala-continuations-library" % versionNumber("scala-continuations-library"))
-val scalaContinuationsPluginDep = withoutScalaLang("org.scala-lang.plugins" % ("scala-continuations-plugin_" + versionProps("scala.full.version")) % versionNumber("scala-continuations-plugin"))
val scalaParserCombinatorsDep = withoutScalaLang("org.scala-lang.modules" %% "scala-parser-combinators" % versionNumber("scala-parser-combinators"))
val scalaSwingDep = withoutScalaLang("org.scala-lang.modules" %% "scala-swing" % versionNumber("scala-swing"))
val scalaXmlDep = withoutScalaLang("org.scala-lang.modules" %% "scala-xml" % versionNumber("scala-xml"))
@@ -113,7 +109,7 @@ lazy val publishSettings : Seq[Setting[_]] = Seq(
// VersionUtil.versionPropertiesImpl for details. The standard sbt `version` setting should not be set directly. It
// is the same as the Maven version and derived automatically from `baseVersion` and `baseVersionSuffix`.
globalVersionSettings
-baseVersion in Global := "2.11.9"
+baseVersion in Global := "2.12.0"
baseVersionSuffix in Global := "SNAPSHOT"
lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings ++ Seq[Setting[_]](
@@ -132,7 +128,7 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings +
// we always assume that Java classes are standalone and do not have any dependency
// on Scala classes
compileOrder := CompileOrder.JavaThenScala,
- javacOptions in Compile ++= Seq("-g", "-source", "1.5", "-target", "1.6"),
+ javacOptions in Compile ++= Seq("-g", "-source", "1.8", "-target", "1.8"),
// we don't want any unmanaged jars; as a reminder: unmanaged jar is a jar stored
// directly on the file system and it's not resolved through Ivy
// Ant's build stored unmanaged jars in `lib/` directory
@@ -302,6 +298,7 @@ lazy val library = configureAsSubproject(project)
.settings(
name := "scala-library",
description := "Scala Standard Library",
+ compileOrder := CompileOrder.Mixed, // needed for JFunction classes in scala.runtime.java8
scalacOptions in Compile ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString),
scalacOptions in Compile in doc ++= {
val libraryAuxDir = (baseDirectory in ThisBuild).value / "src/library-aux"
@@ -317,22 +314,16 @@ lazy val library = configureAsSubproject(project)
val base = (unmanagedResourceDirectories in Compile).value
base ** "*.txt" pair relativeTo(base)
},
- // Include forkjoin classes in scala-library.jar
- products in Compile in packageBin ++=
- (products in Compile in packageBin in forkjoin).value,
Osgi.headers += "Import-Package" -> "sun.misc;resolution:=optional, *",
fixPom(
"/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:
- removePomDependencies(("org.scala-lang", "forkjoin"))
+ )
)
.settings(filterDocSources("*.scala" -- (regexFileFilter(".*/runtime/.*\\$\\.scala") ||
regexFileFilter(".*/runtime/ScalaRunTime\\.scala") ||
regexFileFilter(".*/runtime/StringAdd\\.scala"))): _*)
- .dependsOn(forkjoin)
lazy val reflect = configureAsSubproject(project)
.settings(generatePropertiesFileSettings: _*)
@@ -502,26 +493,6 @@ lazy val scalap = configureAsSubproject(project)
)
.dependsOn(compiler)
-// deprecated Scala Actors project
-lazy val actors = configureAsSubproject(project)
- .settings(generatePropertiesFileSettings: _*)
- .settings(Osgi.settings: _*)
- .settings(
- name := "scala-actors",
- description := "Scala Actors Library",
- Osgi.bundleName := "Scala Actors",
- startYear := Some(2006),
- fixPom(
- "/project/name" -> <name>Scala Actors library</name>,
- "/project/description" -> <description>Deprecated Actors Library for Scala</description>,
- "/project/packaging" -> <packaging>jar</packaging>
- )
- )
- .settings(filterDocSources("*.scala"): _*)
- .dependsOn(library)
-
-lazy val forkjoin = configureAsForkOfJavaProject(project)
-
lazy val partestExtras = configureAsSubproject(Project("partest-extras", file(".") / "src" / "partest-extras"))
.dependsOn(replJlineEmbedded)
.settings(clearSourceAndResourceDirectories: _*)
@@ -568,7 +539,7 @@ lazy val partestJavaAgent = Project("partest-javaagent", file(".") / "src" / "pa
)
lazy val test = project
- .dependsOn(compiler, interactive, actors, replJlineEmbedded, scalap, partestExtras, partestJavaAgent, scaladoc)
+ .dependsOn(compiler, interactive, replJlineEmbedded, scalap, partestExtras, partestJavaAgent, scaladoc)
.configs(IntegrationTest)
.settings(commonSettings: _*)
.settings(disableDocs: _*)
@@ -615,7 +586,7 @@ lazy val libraryAll = Project("library-all", file(".") / "target" / "library-all
name := "scala-library-all",
publishArtifact in (Compile, packageBin) := false,
publishArtifact in (Compile, packageSrc) := false,
- libraryDependencies ++= Seq(scalaXmlDep, scalaParserCombinatorsDep, scalaContinuationsLibraryDep, scalaSwingDep, akkaActorDep, actorsMigrationDep),
+ libraryDependencies ++= Seq(scalaXmlDep, scalaParserCombinatorsDep, scalaSwingDep),
apiURL := None,
fixPom(
"/project/name" -> <name>Scala Library Powerpack</name>,
@@ -659,7 +630,7 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di
(htmlOut ** "*.html").get ++ (fixedManOut ** "*.1").get
}.taskValue,
managedResourceDirectories in Compile := Seq((resourceManaged in Compile).value),
- libraryDependencies ++= Seq(scalaContinuationsPluginDep, jlineDep),
+ libraryDependencies += jlineDep,
apiURL := None,
fixPom(
"/project/name" -> <name>Scala Distribution Artifacts</name>,
@@ -677,10 +648,20 @@ lazy val root = (project in file("."))
publishArtifact := false,
publish := {},
publishLocal := {},
- commands ++= ScriptCommands.all
+ commands ++= ScriptCommands.all,
+ // Generate (Product|TupleN|Function|AbstractFunction)*.scala files and scaladoc stubs for all AnyVal sources.
+ // They should really go into a managedSources dir instead of overwriting sources checked into git but scaladoc
+ // source links (could be fixed by shipping these sources with the scaladoc bundles) and scala-js source maps
+ // rely on them being on github.
+ commands += Command.command("generateSources") { state =>
+ val dir = (((baseDirectory in ThisBuild).value) / "src" / "library" / "scala")
+ genprod.main(Array(dir.getPath))
+ GenerateAnyVals.run(dir.getAbsoluteFile)
+ state
+ }
)
- .aggregate(library, forkjoin, reflect, compiler, interactive, repl, replJline, replJlineEmbedded,
- scaladoc, scalap, actors, partestExtras, junit, libraryAll, scalaDist).settings(
+ .aggregate(library, reflect, compiler, interactive, repl, replJline, replJlineEmbedded,
+ scaladoc, scalap, partestExtras, junit, libraryAll, scalaDist).settings(
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
@@ -689,12 +670,12 @@ lazy val root = (project in file("."))
)
// The following subprojects' binaries are required for building "pack":
-lazy val distDependencies = Seq(replJline, replJlineEmbedded, compiler, library, partestExtras, partestJavaAgent, reflect, scalap, actors, scaladoc)
+lazy val distDependencies = Seq(replJline, replJlineEmbedded, compiler, library, partestExtras, partestJavaAgent, reflect, scalap, scaladoc)
lazy val dist = (project in file("dist"))
.settings(commonSettings)
.settings(
- libraryDependencies ++= Seq(scalaContinuationsLibraryDep, scalaContinuationsPluginDep, scalaSwingDep, jlineDep),
+ libraryDependencies ++= Seq(scalaSwingDep, jlineDep),
mkBin := mkBinImpl.value,
mkQuick <<= Def.task {
val cp = (fullClasspath in IntegrationTest in LocalProject("test")).value
@@ -706,7 +687,7 @@ lazy val dist = (project in file("dist"))
mkPack <<= Def.task {} dependsOn (packagedArtifact in (Compile, packageBin), mkBin),
target := (baseDirectory in ThisBuild).value / "target" / thisProject.value.id,
packageBin in Compile := {
- val extraDeps = Set(scalaContinuationsLibraryDep, scalaContinuationsPluginDep, scalaSwingDep, scalaParserCombinatorsDep, scalaXmlDep)
+ val extraDeps = Set(scalaSwingDep, scalaParserCombinatorsDep, scalaXmlDep)
val targetDir = (buildDirectory in ThisBuild).value / "pack" / "lib"
def uniqueModule(m: ModuleID) = (m.organization, m.name.replaceFirst("_.*", ""))
val extraModules = extraDeps.map(uniqueModule)
@@ -742,33 +723,10 @@ def configureAsSubproject(project: Project): Project = {
.settings(generatePropertiesFileSettings: _*)
}
-/**
- * Configuration for subprojects that are forks of some Java projects
- * we depend on. At the moment there's just forkjoin.
- *
- * We do not publish artifacts for those projects but we package their
- * binaries in a jar of other project (compiler or library).
- *
- * For that reason we disable docs generation, packaging and publishing.
- */
-def configureAsForkOfJavaProject(project: Project): Project = {
- val base = file(".") / "src" / project.id
- (project in base)
- .settings(commonSettings: _*)
- .settings(disableDocs: _*)
- .settings(
- publishArtifact := false,
- sourceDirectory in Compile := baseDirectory.value,
- javaSource in Compile := (sourceDirectory in Compile).value,
- sources in Compile in doc := Seq.empty,
- classDirectory in Compile := buildDirectory.value / "libs/classes" / thisProject.value.id
- )
-}
-
lazy val buildDirectory = settingKey[File]("The directory where all build products go. By default ./build")
lazy val mkBin = taskKey[Seq[File]]("Generate shell script (bash or Windows batch).")
-lazy val mkQuick = taskKey[Unit]("Generate a full build, including scripts, in build-sbt/quick")
-lazy val mkPack = taskKey[Unit]("Generate a full build, including scripts, in build-sbt/pack")
+lazy val mkQuick = taskKey[Unit]("Generate a full build, including scripts, in build/quick")
+lazy val mkPack = taskKey[Unit]("Generate a full build, including scripts, in build/pack")
// Defining these settings is somewhat redundant as we also redefine settings that depend on them.
// However, IntelliJ's project import works better when these are set correctly.
@@ -827,7 +785,7 @@ def generateServiceProviderResources(services: (String, String)*): Setting[_] =
}
}.taskValue
-buildDirectory in ThisBuild := (baseDirectory in ThisBuild).value / "build-sbt"
+buildDirectory in ThisBuild := (baseDirectory in ThisBuild).value / "build"
// Add tab completion to partest
commands += Command("partest")(_ => PartestUtil.partestParser((baseDirectory in ThisBuild).value, (baseDirectory in ThisBuild).value / "test")) { (state, parsed) =>
@@ -870,10 +828,8 @@ intellij := {
val buildModule = ("scala-build", scalabuild.BuildInfo.buildClasspath.split(":").toSeq.map(new File(_)))
// `sbt projects` lists all modules in the build
buildModule :: List(
- moduleDeps(actors).value,
moduleDeps(compilerP).value,
// moduleDeps(dist).value, // No sources, therefore no module in IntelliJ
- moduleDeps(forkjoin).value,
moduleDeps(interactive).value,
moduleDeps(junit).value,
moduleDeps(library).value,