summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt88
1 files changed, 22 insertions, 66 deletions
diff --git a/build.sbt b/build.sbt
index 984ac0e91c..bd76167278 100644
--- a/build.sbt
+++ b/build.sbt
@@ -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"))
@@ -115,7 +111,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[_]](
@@ -134,7 +130,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
@@ -332,6 +328,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"
@@ -347,9 +344,6 @@ 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>,
@@ -357,12 +351,9 @@ lazy val library = configureAsSubproject(project)
"/project/packaging" -> <packaging>jar</packaging>
)
)
- // Remove the dependency on "forkjoin" from the POM because it is included in the JAR:
- .settings(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: _*)
@@ -533,26 +524,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: _*)
@@ -599,7 +570,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: _*)
@@ -646,7 +617,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>,
@@ -690,7 +661,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>,
@@ -709,10 +680,20 @@ lazy val root = (project in file("."))
publish := {},
publishLocal := {},
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
+ },
Quiet.silenceIvyUpdateInfoLogging
-)
- .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
@@ -721,12 +702,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
@@ -738,7 +719,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)
@@ -774,29 +755,6 @@ 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(disablePublishing: _*)
- .settings(
- 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/quick")
@@ -902,10 +860,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,