Skip to content

Commit 743b729

Browse files
committed
Merge pull request scala#4597 from adriaanm/rebase-4594
Rebase 4594
2 parents 43e115e + bf951ec commit 743b729

File tree

193 files changed

+3480
-401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+3480
-401
lines changed

build-ant-macros.xml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@
202202
<!-- overrides the output directory; used when building multiple projects into the same directory-->
203203
<attribute name="srcdir" default="@{project}"/>
204204
<attribute name="java-excludes" default=""/>
205+
<attribute name="mixed" default="NOPE"/>
205206
<sequential>
207+
<local name="mixed.true"/><condition property="mixed.true"><equals arg1="@{mixed}" arg2="true"/></condition>
206208
<!-- TODO: detect zinc anywhere on PATH
207209
use zinc for the quick stage if it's available;
208210
would use it for locker but something is iffy in sbt: get a class cast error on global phase -->
@@ -220,12 +222,14 @@
220222
<then>
221223
<scalacfork taskname="@{stage}.@{project}" jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" params="${scalac.args.@{stage}} @{args}">
222224
<include name="**/*.scala"/>
225+
<include name="**/*.java" if="mixed.true"/>
223226
<compilationpath refid="@{stage}.@{project}.build.path"/>
224227
</scalacfork>
225228
</then>
226229
<else>
227230
<scalacfork taskname="@{stage}.@{project}" jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" srcpath="@{srcpath}" params="${scalac.args.@{stage}} @{args}">
228231
<include name="**/*.scala"/>
232+
<include name="**/*.java" if="mixed.true"/>
229233
<compilationpath refid="@{stage}.@{project}.build.path"/>
230234
</scalacfork>
231235
</else>
@@ -270,6 +274,7 @@
270274
<attribute name="includes" default="comp.includes"/>
271275
<attribute name="java-excludes" default=""/>
272276
<attribute name="version" default=""/>
277+
<attribute name="mixed" default="NOPE"/>
273278
<!-- non-empty for scaladoc: use @{version}.version.number in property file-->
274279
<sequential>
275280
<staged-uptodate stage="@{stage}" project="@{project}">
@@ -279,9 +284,18 @@
279284
<do>
280285
<stopwatch name="@{stage}.@{project}.timer"/>
281286
<mkdir dir="${build-@{stage}.dir}/classes/@{project}"/>
282-
<staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
283-
<!-- always compile with javac for simplicity and regularity; it's cheap -->
284-
<staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/>
287+
<if>
288+
<equals arg1="@{mixed}" arg2="true"/>
289+
<then>
290+
<staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}" mixed="@{mixed}"/>
291+
<staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
292+
</then>
293+
<else>
294+
<staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
295+
<!-- always compile with javac for simplicity and regularity; it's cheap -->
296+
<staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/>
297+
</else>
298+
</if>
285299
<if>
286300
<equals arg1="@{version}" arg2=""/>
287301
<then>
@@ -474,7 +488,8 @@
474488
<filter token="SCALA_COMPILER_INTERACTIVE_VERSION" value="${scala-compiler-interactive.version.number}"/>
475489
<filter token="XML_VERSION" value="${scala-xml.version.number}" />
476490
<filter token="PARSER_COMBINATORS_VERSION" value="${scala-parser-combinators.version.number}" />
477-
<filter token="SCALA_SWING_VERSION" value="${scala-swing.version.number}" />
491+
<filter token="SCALA_SWING_VERSION" value="${scala-swing.version.osgi}" />
492+
<filter token="SOURCE_JARNAME" value="${@{project}.targetjar}"/>
478493
</filterset>
479494
</copy>
480495
<bnd classpath="${@{project}.jar}" eclipse="false" failok="false" exceptions="true" files="${build-osgi.dir}/${@{project}.name}.bnd" output="${build-osgi.dir}"/>

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ lazy val library = configureAsSubproject(project)
142142
.settings(generatePropertiesFileSettings: _*)
143143
.settings(
144144
name := "scala-library",
145+
compileOrder := CompileOrder.Mixed, // needed for JFunction classes in scala.runtime.java8
145146
scalacOptions in Compile ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString),
146147
// Workaround for a bug in `scaladoc` that it seems to not respect the `-sourcepath` option
147148
// as a result of this bug, the compiler cannot even initialize Definitions without

build.xml

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -265,42 +265,36 @@ TODO:
265265
-->
266266
<if><not><isset property="maven-deps-done"></isset></not><then>
267267
<mkdir dir="${user.home}/.m2/repository"/>
268-
269-
<artifact:remoteRepository id="sonatype-release" url="https://oss.sonatype.org/content/repositories/releases"/>
270-
<artifact:remoteRepository id="sonatype-snapshots" url="https://oss.sonatype.org/content/repositories/snapshots"/>
271-
<artifact:remoteRepository id="extra-repo" url="${extra.repo.url}"/>
272-
273268
<!-- This task has an issue where if the user directory does not exist, so we create it above. UGH. -->
274269
<artifact:dependencies pathId="extra.tasks.classpath" filesetId="extra.tasks.fileset">
275-
<dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/>
270+
<dependency groupId="biz.aQute.bnd" artifactId="biz.aQute.bnd" version="2.4.1"/>
276271
</artifact:dependencies>
277272

278273
<artifact:dependencies pathId="jarjar.classpath">
279274
<dependency groupId="com.googlecode.jarjar" artifactId="jarjar" version="1.3"/>
280275
</artifact:dependencies>
281276

282277
<!-- JUnit -->
283-
<property name="junit.version" value="4.11"/>
278+
<property name="junit.version" value="4.12"/>
284279
<artifact:dependencies pathId="junit.classpath" filesetId="junit.fileset">
285280
<dependency groupId="junit" artifactId="junit" version="${junit.version}"/>
286281
</artifact:dependencies>
287282
<copy-deps project="junit"/>
288283

289284
<!-- Pax runner -->
290-
<property name="pax.exam.version" value="3.5.0"/><!-- Last version which supports Java 6 -->
291-
<property name="osgi.felix.version" value="4.4.0"/>
292-
<property name="osgi.equinox.version" value="3.7.1"/>
285+
<property name="pax.exam.version" value="4.5.0"/>
286+
<property name="osgi.felix.version" value="5.0.1"/>
287+
<property name="osgi.equinox.version" value="3.10.100.v20150521-1310"/>
293288
<artifact:dependencies pathId="pax.exam.classpath" filesetId="pax.exam.fileset">
294-
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}">
295-
<exclusion groupId="org.osgi" artifactId="org.osgi.core"/><!-- Avoid dragging in a dependency which requires Java >6 -->
296-
</dependency>
289+
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}"/>
297290
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-junit4" version="${pax.exam.version}"/>
298291
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-link-assembly" version="${pax.exam.version}"/>
299-
<dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="2.2.0"/>
300-
<dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-tracker" version="1.8.0"/>
301-
<dependency groupId="ch.qos.logback" artifactId="logback-core" version="1.1.2"/>
302-
<dependency groupId="ch.qos.logback" artifactId="logback-classic" version="1.1.2"/>
292+
<dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="2.4.1"/>
293+
<dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-tracker" version="1.8.1"/>
294+
<dependency groupId="ch.qos.logback" artifactId="logback-core" version="1.1.3"/>
295+
<dependency groupId="ch.qos.logback" artifactId="logback-classic" version="1.1.3"/>
303296
<dependency groupId="junit" artifactId="junit" version="${junit.version}"/>
297+
<dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.7.12"/>
304298
</artifact:dependencies>
305299
<copy-deps project="pax.exam"/>
306300

@@ -309,42 +303,12 @@ TODO:
309303
</artifact:dependencies>
310304

311305
<artifact:dependencies pathId="osgi.framework.equinox">
312-
<dependency groupId="org.eclipse.osgi" artifactId="org.eclipse.osgi" version="${osgi.equinox.version}"/>
306+
<dependency groupId="org.eclipse.tycho" artifactId="org.eclipse.osgi" version="${osgi.equinox.version}"/>
313307
</artifact:dependencies>
314308

315309
<artifact:remoteRepository id="sonatype-release" url="https://oss.sonatype.org/content/repositories/releases"/>
316310
<artifact:remoteRepository id="extra-repo" url="${extra.repo.url}"/>
317311

318-
<!-- scala-java8-compat, used by the experimental -target jvm-1.8 support. -->
319-
<if><isset property="scala-java8-compat.package"/><then>
320-
<property name="scala-java8-compat.version" value="0.5.0"/>
321-
<property name="scala-java8-compat.binary.version" value="2.11"/>
322-
<artifact:dependencies pathId="scala-java8-compat.classpath" filesetId="scala-java8-compat.fileset">
323-
<dependency groupId="org.scala-lang.modules" artifactId="scala-java8-compat_${scala-java8-compat.binary.version}" version="${scala-java8-compat.version}">
324-
<exclusion groupId="org.scala-lang" artifactId="scala-library"/>
325-
</dependency>
326-
</artifact:dependencies>
327-
<property name="scala-java8-compat-classes" value="${build-quick.dir}/scala-java8-compat"/>
328-
<delete dir="${scala-java8-compat-classes}"/>
329-
<unzip dest="${scala-java8-compat-classes}">
330-
<fileset refid="scala-java8-compat.fileset"/>
331-
<patternset>
332-
<include name="**/*.class"/>
333-
</patternset>
334-
</unzip>
335-
<path id="scala-java8-compat.libs">
336-
<pathelement location="${scala-java8-compat-classes}"/>
337-
</path>
338-
<fileset id="scala-java8-compat.fileset" dir="${scala-java8-compat-classes}">
339-
<include name="**/*"/>
340-
</fileset>
341-
</then>
342-
<else>
343-
<path id="scala-java8-compat.libs"/>
344-
<fileset id="scala-java8-compat.fileset" dir="." excludes="**"/>
345-
</else>
346-
</if>
347-
348312
<!-- prepare, for each of the names below, the property "@{name}.cross", set to the
349313
necessary cross suffix (usually something like "_2.11.0-M6". -->
350314
<prepareCross name="scala-xml" />
@@ -637,18 +601,21 @@ TODO:
637601

638602
<property name="swing.description" value="Scala Swing Library"/>
639603
<property name="swing.package" value="modules."/>
604+
<property name="swing.targetjar" value="scala-swing${scala-swing.cross}-${scala-swing.version.number}.jar"/>
640605
<property name="swing.jar" value="${scala-swing}"/>
641606
<property name="swing.src" value="false"/>
642607
<property name="swing.srcjar" value="${scala-swing-sources}"/>
643608

644609
<property name="parser-combinators.description" value="Scala Parser Combinators Library"/>
645610
<property name="parser-combinators.package" value="modules."/>
611+
<property name="parser-combinators.targetjar" value="scala-parser-combinators${scala-parser-combinators.cross}-${scala-parser-combinators.version.number}.jar"/>
646612
<property name="parser-combinators.jar" value="${scala-parser-combinators}"/>
647613
<property name="parser-combinators.src" value="false"/>
648614
<property name="parser-combinators.srcjar" value="${scala-parser-combinators-sources}"/>
649615

650616
<property name="xml.description" value="Scala XML Library"/>
651617
<property name="xml.package" value="modules."/>
618+
<property name="xml.targetjar" value="scala-xml${scala-xml.cross}-${scala-xml.version.number}.jar"/>
652619
<property name="xml.jar" value="${scala-xml}"/>
653620
<property name="xml.src" value="false"/>
654621
<property name="xml.srcjar" value="${scala-xml-sources}"/>
@@ -720,7 +687,6 @@ TODO:
720687
<pathelement location="${build-locker.dir}/classes/library"/>
721688
<path refid="forkjoin.classpath"/>
722689
<path refid="aux.libs"/>
723-
<path refid="scala-java8-compat.libs"/>
724690
</path>
725691

726692
<path id="locker.reflect.build.path">
@@ -742,7 +708,6 @@ TODO:
742708
<pathelement location="${build-quick.dir}/classes/library"/>
743709
<path refid="forkjoin.classpath"/>
744710
<path refid="aux.libs"/>
745-
<path refid="scala-java8-compat.libs"/>
746711
</path>
747712

748713
<path id="quick.reflect.build.path">
@@ -835,7 +800,6 @@ TODO:
835800
<path id="pack.library.files">
836801
<fileset dir="${build-quick.dir}/classes/library"/>
837802
<fileset dir="${forkjoin-classes}"/>
838-
<fileset refid="scala-java8-compat.fileset"/>
839803
</path>
840804

841805
<path id="pack.repl-jline.files"> <fileset dir="${build-quick.dir}/classes/repl-jline"/> </path>
@@ -1091,7 +1055,8 @@ TODO:
10911055
<condition property="locker.locked"><available file="${build-locker.dir}/locker.locked"/></condition></target>
10921056

10931057
<target name="locker.lib" depends="locker.start" unless="locker.locked">
1094-
<staged-build with="starr" stage="locker" project="library" srcpath="${src.dir}/library" includes="lib.includes"/></target>
1058+
<!-- "mixed" needed for JFunction classes in scala.runtime.java8 -->
1059+
<staged-build with="starr" stage="locker" project="library" srcpath="${src.dir}/library" includes="lib.includes" mixed="true"/></target>
10951060

10961061
<target name="locker.reflect" depends="locker.lib" unless="locker.locked">
10971062
<staged-build with="starr" stage="locker" project="reflect"/></target>
@@ -1112,7 +1077,8 @@ TODO:
11121077
<target name="quick.start" depends="locker.done"/>
11131078

11141079
<target name="quick.lib" depends="quick.start">
1115-
<staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/></target>
1080+
<!-- "mixed" needed for JFunction classes in scala.runtime.java8 -->
1081+
<staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes" mixed="true"/></target>
11161082

11171083
<target name="quick.reflect" depends="quick.lib">
11181084
<staged-build with="locker" stage="quick" project="reflect"/> </target>
@@ -1246,7 +1212,8 @@ TODO:
12461212
BOOTSTRAPPING BUILD (STRAP)
12471213
============================================================================ -->
12481214
<target name="strap.done" depends="pack.done">
1249-
<staged-build with="pack" stage="strap" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/>
1215+
<!-- "mixed" needed for JFunction classes in scala.runtime.java8 -->
1216+
<staged-build with="pack" stage="strap" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes" mixed="true"/>
12501217
<staged-build with="pack" stage="strap" project="reflect"/>
12511218
<staged-build with="pack" stage="strap" project="compiler"/>
12521219
</target>
@@ -1466,9 +1433,9 @@ TODO:
14661433
srcdir="${test.junit.src}"
14671434
destdir="${test.junit.classes}"
14681435
classpathref="test.junit.compiler.build.path"
1469-
target="1.6"
1470-
source="1.5"
1471-
compiler="javac1.6"
1436+
target="1.8"
1437+
source="1.8"
1438+
compiler="javac1.8"
14721439
includes="**/*.java"/>
14731440
<scalacfork
14741441
destdir="${test.junit.classes}"

src/build/bnd/scala-compiler-doc.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ver: @SCALA_COMPILER_DOC_VERSION@
44
Bundle-Version: ${ver}
55
Export-Package: *;version=${ver}
66
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-compiler-interactive.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ver: @SCALA_COMPILER_INTERACTIVE_VERSION@
44
Bundle-Version: ${ver}
55
Export-Package: *;version=${ver}
66
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-compiler.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ Import-Package: jline.*;resolution:=optional, \
99
scala.xml.*;version="${range;[====,====];@XML_VERSION@}";resolution:=optional, \
1010
scala.*;version="${range;[==,=+);${ver}}", \
1111
*
12-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
12+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
13+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-library.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ver: @VERSION@
44
Bundle-Version: ${ver}
55
Export-Package: *;version=${ver}
66
Import-Package: sun.misc;resolution:=optional, *
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-parser-combinators.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ver: @PARSER_COMBINATORS_VERSION@
44
Bundle-Version: ${ver}
55
Export-Package: *;version=${ver}
66
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-reflect.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Export-Package: *;version=${ver}
66
Import-Package: scala.*;version="${range;[==,=+);${ver}}", \
77
scala.tools.nsc;resolution:=optional;version="${range;[==,=+);${ver}}", \
88
*
9-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
9+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
10+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-swing.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ver: @SCALA_SWING_VERSION@
44
Bundle-Version: ${ver}
55
Export-Package: *;version=${ver}
66
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6,JavaSE-1.7
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Include-Resource: @@SOURCE_JARNAME@

src/build/bnd/scala-xml.bnd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ver: @XML_VERSION@
44
Bundle-Version: ${ver}
55
Export-Package: *;version=${ver}
66
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Include-Resource: @@SOURCE_JARNAME@

0 commit comments

Comments
 (0)