Skip to content

Commit fa8012d

Browse files
committed
Remove our fork of forkjoin. Java 8 bundles it.
Provide deprecated compatibility stubs for the types and static members, which forward as follows: ``` scala.concurrent.forkjoin.ForkJoinPool => java.util.concurrent.ForkJoinPool scala.concurrent.forkjoin.ForkJoinTask => java.util.concurrent.ForkJoinTask scala.concurrent.forkjoin.ForkJoinWorkerThread => java.util.concurrent.ForkJoinWorkerThread scala.concurrent.forkjoin.LinkedTransferQueue => java.util.concurrent.LinkedTransferQueue scala.concurrent.forkjoin.RecursiveAction => java.util.concurrent.RecursiveAction scala.concurrent.forkjoin.RecursiveTask => java.util.concurrent.RecursiveTask scala.concurrent.forkjoin.ThreadLocalRandom => java.util.concurrent.ThreadLocalRandom ``` To prepare for Java 9, the Scala library does not itself use `sun.misc.Unsafe`. However, for now, it provide a convenience accessor for it via `scala.concurrent.util.Unsafe`. This (deprecated) class will be removed as soon as the eco-system drops its use (akka-actor, I'm looking at you).
1 parent eda41a2 commit fa8012d

21 files changed

+125
-7408
lines changed

build.sbt

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ lazy val library = configureAsSubproject(project)
156156
Seq("-doc-no-compile", libraryAuxDir.toString)
157157
},
158158
includeFilter in unmanagedResources in Compile := libIncludes)
159-
.dependsOn (forkjoin)
160159

161160
lazy val reflect = configureAsSubproject(project)
162161
.settings(generatePropertiesFileSettings: _*)
@@ -213,8 +212,6 @@ lazy val scaladoc = configureAsSubproject(project)
213212
lazy val scalap = configureAsSubproject(project).
214213
dependsOn(compiler)
215214

216-
lazy val forkjoin = configureAsForkOfJavaProject(project)
217-
218215
lazy val partestExtras = configureAsSubproject(Project("partest-extras", file(".") / "src" / "partest-extras"))
219216
.dependsOn(repl)
220217
.settings(clearSourceAndResourceDirectories: _*)
@@ -283,7 +280,7 @@ lazy val test = project.
283280
)
284281

285282
lazy val root = (project in file(".")).
286-
aggregate(library, forkjoin, reflect, compiler, interactive, repl,
283+
aggregate(library, reflect, compiler, interactive, repl,
287284
scaladoc, scalap, partestExtras, junit).settings(
288285
sources in Compile := Seq.empty,
289286
onLoadMessage := """|*** Welcome to the sbt build definition for Scala! ***
@@ -312,27 +309,6 @@ def configureAsSubproject(project: Project): Project = {
312309
(project in base).settings(scalaSubprojectSettings: _*)
313310
}
314311

315-
/**
316-
* Configuration for subprojects that are forks of some Java projects
317-
* we depend on. At the moment there's just forkjoin.
318-
*
319-
* We do not publish artifacts for those projects but we package their
320-
* binaries in a jar of other project (compiler or library).
321-
*
322-
* For that reason we disable docs generation, packaging and publishing.
323-
*/
324-
def configureAsForkOfJavaProject(project: Project): Project = {
325-
val base = file(".") / "src" / project.id
326-
(project in base).
327-
settings(commonSettings: _*).
328-
settings(disableDocsAndPublishingTasks: _*).
329-
settings(
330-
sourceDirectory in Compile := baseDirectory.value,
331-
javaSource in Compile := (sourceDirectory in Compile).value,
332-
sources in Compile in doc := Seq.empty,
333-
classDirectory in Compile := buildDirectory.value / "libs/classes" / thisProject.value.id
334-
)
335-
}
336312

337313
lazy val buildDirectory = settingKey[File]("The directory where all build products go. By default ./build")
338314
lazy val copyrightString = settingKey[String]("Copyright string.")

build.xml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ TODO:
165165
<property name="build.dir" value="${basedir}/build"/>
166166
<property name="build-deps.dir" value="${build.dir}/deps"/>
167167
<property name="build-libs.dir" value="${build.dir}/libs"/>
168-
<property name="build-forkjoin.dir" value="${build-libs.dir}"/>
169168
<property name="build-locker.dir" value="${build.dir}/locker"/>
170169
<property name="build-quick.dir" value="${build.dir}/quick"/>
171170
<property name="build-pack.dir" value="${build.dir}/pack"/>
@@ -570,9 +569,6 @@ TODO:
570569
</propertyfile>
571570
</then></if>
572571

573-
<path id="forkjoin.classpath" path="${build-forkjoin.dir}/classes/forkjoin"/>
574-
<property name="forkjoin-classes" refid="forkjoin.classpath"/>
575-
576572
<!-- the following properties fully define staged-docs, staged-pack, make-bundle, copy-bundle and mvn-package for each of the projects -->
577573
<property name="library.description" value="Scala Standard Library"/>
578574
<property name="library.docroot" value="rootdoc.txt"/>
@@ -627,7 +623,7 @@ TODO:
627623
<property name="partest-extras.description" value="Scala Compiler Testing Tool (compiler-specific extras)"/>
628624
<property name="partest-javaagent.description" value="Scala Compiler Testing Tool (compiler-specific java agent)"/>
629625

630-
<!-- projects without project-specific options: forkjoin, manual, bin, repl -->
626+
<!-- projects without project-specific options: manual, bin, repl -->
631627
<for list="compiler,interactive,scaladoc,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml,repl-jline" param="project">
632628
<sequential>
633629
<!-- description is mandatory -->
@@ -685,7 +681,6 @@ TODO:
685681
<!-- LOCKER -->
686682
<path id="locker.library.build.path">
687683
<pathelement location="${build-locker.dir}/classes/library"/>
688-
<path refid="forkjoin.classpath"/>
689684
<path refid="aux.libs"/>
690685
</path>
691686

@@ -706,7 +701,6 @@ TODO:
706701
<!-- QUICK -->
707702
<path id="quick.library.build.path">
708703
<pathelement location="${build-quick.dir}/classes/library"/>
709-
<path refid="forkjoin.classpath"/>
710704
<path refid="aux.libs"/>
711705
</path>
712706

@@ -781,7 +775,6 @@ TODO:
781775
<pathelement location="${reflect.jar}"/>
782776
<pathelement location="${compiler.jar}"/>
783777
<pathelement location="${ant.jar}"/>
784-
<path refid="forkjoin.classpath"/>
785778
<path refid="aux.libs"/>
786779
</path>
787780

@@ -799,7 +792,6 @@ TODO:
799792

800793
<path id="pack.library.files">
801794
<fileset dir="${build-quick.dir}/classes/library"/>
802-
<fileset dir="${forkjoin-classes}"/>
803795
</path>
804796

805797
<path id="pack.repl-jline.files"> <fileset dir="${build-quick.dir}/classes/repl-jline"/> </path>
@@ -829,7 +821,6 @@ TODO:
829821
<!-- STRAP -->
830822
<path id="strap.library.build.path">
831823
<pathelement location="${build-strap.dir}/classes/library"/>
832-
<path refid="forkjoin.classpath"/>
833824
<path refid="aux.libs"/>
834825
</path>
835826

@@ -958,7 +949,6 @@ TODO:
958949
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-reflect.jar"/>
959950
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-compiler.jar"/>
960951
<path refid="pax.exam.classpath"/>
961-
<path refid="forkjoin.classpath"/>
962952
</path>
963953

964954
<path id="test.osgi.compiler.build.path.felix">
@@ -1029,8 +1019,6 @@ TODO:
10291019
LOCAL DEPENDENCIES
10301020
============================================================================ -->
10311021

1032-
<target name="forkjoin.done" depends="init"> <simple-javac project="forkjoin" args="-XDignore.symbol.file" jar="no"/></target>
1033-
10341022
<!-- For local development only. We only allow released versions of Scala for STARR.
10351023
This builds quick (core only) and publishes it with a generated version number,
10361024
saving it as starr.version in build.properties, so this compiler will be used as STARR in your next build
@@ -1051,7 +1039,7 @@ TODO:
10511039
<!-- ===========================================================================
10521040
LOCAL REFERENCE BUILD (LOCKER)
10531041
============================================================================ -->
1054-
<target name="locker.start" depends="forkjoin.done">
1042+
<target name="locker.start" depends="init">
10551043
<condition property="locker.locked"><available file="${build-locker.dir}/locker.locked"/></condition></target>
10561044

10571045
<target name="locker.lib" depends="locker.start" unless="locker.locked">
@@ -1137,7 +1125,7 @@ TODO:
11371125
<!-- ===========================================================================
11381126
PACKED QUICK BUILD (PACK)
11391127
============================================================================ -->
1140-
<target name="pack.lib" depends="quick.lib, forkjoin.done"> <staged-pack project="library"/></target>
1128+
<target name="pack.lib" depends="quick.lib"> <staged-pack project="library"/></target>
11411129

11421130
<target name="pack.reflect" depends="quick.reflect"> <staged-pack project="reflect"/> </target>
11431131

0 commit comments

Comments
 (0)