@@ -30,6 +30,7 @@ import scala.util.Properties.isJavaAtLeast
30
30
31
31
object Build {
32
32
val scalacVersion = " 2.12.8"
33
+ val referenceVersion = " 0.14.0-bin-20190321-bb0a1ed-NIGHTLY"
33
34
34
35
val baseVersion = " 0.14.0"
35
36
val baseSbtDottyVersion = " 0.3.2"
@@ -182,21 +183,27 @@ object Build {
182
183
// Settings used for projects compiled only with Java
183
184
lazy val commonJavaSettings = commonSettings ++ Seq (
184
185
version := dottyVersion,
185
- scalaVersion := scalacVersion ,
186
+ scalaVersion := referenceVersion ,
186
187
// Do not append Scala versions to the generated artifacts
187
188
crossPaths := false ,
188
189
// Do not depend on the Scala library
189
190
autoScalaLibrary := false
190
191
)
191
192
192
- // Settings used when compiling dotty using Scala 2
193
- lazy val commonNonBootstrappedSettings = commonSettings ++ Seq (
193
+ // Settings used when compiling dotty (both non-boostrapped and bootstrapped)
194
+ lazy val commonDottySettings = commonSettings ++ Seq (
195
+ // Manually set the standard library to use
196
+ autoScalaLibrary := false
197
+ )
198
+
199
+ // Settings used when compiling dotty with the reference compiler
200
+ lazy val commonNonBootstrappedSettings = commonDottySettings ++ Seq (
194
201
version := dottyNonBootstrappedVersion,
195
- scalaVersion := scalacVersion
202
+ scalaVersion := referenceVersion
196
203
)
197
204
198
205
// Settings used when compiling dotty with a non-bootstrapped dotty
199
- lazy val commonBootstrappedSettings = commonSettings ++ Seq (
206
+ lazy val commonBootstrappedSettings = commonDottySettings ++ Seq (
200
207
version := dottyVersion,
201
208
scalaVersion := dottyNonBootstrappedVersion,
202
209
@@ -219,11 +226,6 @@ object Build {
219
226
// sbt gets very unhappy if two projects use the same target
220
227
target := baseDirectory.value / " .." / " out" / " bootstrap" / name.value,
221
228
222
- // The non-bootstrapped dotty-library is not necessary when bootstrapping dotty
223
- autoScalaLibrary := false ,
224
- // ...but scala-library is
225
- libraryDependencies += " org.scala-lang" % " scala-library" % scalacVersion,
226
-
227
229
// Compile using the non-bootstrapped and non-published dotty
228
230
managedScalaInstance := false ,
229
231
scalaInstance := {
@@ -466,7 +468,7 @@ object Build {
466
468
" -Ddotty.tests.classes.dottyLibrary=" + jars(" dotty-library" ),
467
469
" -Ddotty.tests.classes.dottyCompiler=" + jars(" dotty-compiler" ),
468
470
" -Ddotty.tests.classes.compilerInterface=" + findLib(attList, " compiler-interface" ),
469
- " -Ddotty.tests.classes.scalaLibrary=" + findLib(attList, " scala-library" ),
471
+ " -Ddotty.tests.classes.scalaLibrary=" + findLib(attList, " scala-library- " ),
470
472
" -Ddotty.tests.classes.scalaAsm=" + findLib(attList, " scala-asm" ),
471
473
" -Ddotty.tests.classes.scalaXml=" + findLib(attList, " scala-xml" ),
472
474
" -Ddotty.tests.classes.jlineTerminal=" + findLib(attList, " jline-terminal" ),
@@ -506,9 +508,6 @@ object Build {
506
508
} else if (scalaLib == " " ) {
507
509
println(" Couldn't find scala-library on classpath, please run using script in bin dir instead" )
508
510
} else if (args.contains(" -with-compiler" )) {
509
- if (! isDotty.value) {
510
- throw new MessageOnlyException (" -with-compiler can only be used with a bootstrapped compiler" )
511
- }
512
511
val args1 = args.filter(_ != " -with-compiler" )
513
512
val asm = findLib(attList, " scala-asm" )
514
513
val dottyCompiler = jars(" dotty-compiler" )
@@ -558,7 +557,7 @@ object Build {
558
557
def runCompilerMain (repl : Boolean = false ) = Def .inputTaskDyn {
559
558
val attList = (dependencyClasspath in Runtime ).value
560
559
val jars = packageAll.value
561
- val scalaLib = findLib(attList, " scala-library" )
560
+ val scalaLib = findLib(attList, " scala-library- " )
562
561
val dottyLib = jars(" dotty-library" )
563
562
val dottyCompiler = jars(" dotty-compiler" )
564
563
val args0 : List [String ] = spaceDelimited(" <arg>" ).parsed.toList
@@ -576,12 +575,8 @@ object Build {
576
575
577
576
var extraClasspath = s " $scalaLib${File .pathSeparator}$dottyLib"
578
577
if ((decompile || printTasty) && ! args.contains(" -classpath" )) extraClasspath += s " ${File .pathSeparator}. "
579
- if (args0.contains(" -with-compiler" )) {
580
- if (! isDotty.value) {
581
- throw new MessageOnlyException (" -with-compiler can only be used with a bootstrapped compiler" )
582
- }
578
+ if (args0.contains(" -with-compiler" ))
583
579
extraClasspath += s " ${File .pathSeparator}$dottyCompiler"
584
- }
585
580
586
581
val fullArgs = main :: insertClasspathInArgs(args, extraClasspath)
587
582
@@ -642,8 +637,12 @@ object Build {
642
637
// Settings shared between dotty-library and dotty-library-bootstrapped
643
638
lazy val dottyLibrarySettings = Seq (
644
639
libraryDependencies += " org.scala-lang" % " scala-library" % scalacVersion,
640
+
641
+ // Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
642
+ scalacOptions in Compile ++= Seq (" -sourcepath" , (scalaSource in Compile ).value.getAbsolutePath),
643
+
645
644
// Add version-specific source directories:
646
- // - files in src-non-bootstrapped will only be compiled by the reference compiler (scalac)
645
+ // - files in src-non-bootstrapped will only be compiled by the reference compiler
647
646
// - files in src-bootstrapped will only be compiled by the current dotty compiler (non-bootstrapped and bootstrapped)
648
647
unmanagedSourceDirectories in Compile += {
649
648
val baseDir = baseDirectory.value
@@ -1149,11 +1148,7 @@ object Build {
1149
1148
settings(dottyCompilerSettings)
1150
1149
1151
1150
def asDottyLibrary (implicit mode : Mode ): Project = project.withCommonSettings.
1152
- settings(dottyLibrarySettings).
1153
- bootstrappedSettings(
1154
- // Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called.
1155
- scalacOptions in Compile ++= Seq (" -sourcepath" , (scalaSource in Compile ).value.getAbsolutePath)
1156
- )
1151
+ settings(dottyLibrarySettings)
1157
1152
1158
1153
def asDottyDoc (implicit mode : Mode ): Project = project.withCommonSettings.
1159
1154
dependsOn(dottyCompiler, dottyCompiler % " test->test" ).
0 commit comments