@@ -431,8 +431,29 @@ object Build {
431
431
def findArtifactPath (classpath : Def .Classpath , name : String ): String =
432
432
findArtifact(classpath, name).getAbsolutePath
433
433
434
+ // Settings shared between dotty-compiler, dotty-compiler-bootstrapped and dotty-staging
435
+ lazy val commonDottyJarClasspathSettings = Seq (
436
+ // http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala
437
+ // packageAll should always be run before tests
438
+ javaOptions ++= {
439
+ val externalDeps = externalCompilerClasspathTask.value
440
+ val jars = packageAll.in(LocalProject (" dotty-compiler-bootstrapped" )).value
441
+
442
+ List (
443
+ " -Ddotty.tests.classes.dottyInterfaces=" + jars(" dotty-interfaces" ),
444
+ " -Ddotty.tests.classes.dottyLibrary=" + jars(" dotty-library" ),
445
+ " -Ddotty.tests.classes.dottyCompiler=" + jars(" dotty-compiler" ),
446
+ " -Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, " compiler-interface" ),
447
+ " -Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, " scala-library" ),
448
+ " -Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, " scala-asm" ),
449
+ " -Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, " jline-terminal" ),
450
+ " -Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, " jline-reader" )
451
+ )
452
+ }
453
+ )
454
+
434
455
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
435
- lazy val commonDottyCompilerSettings = Seq (
456
+ lazy val commonDottyCompilerSettings = commonDottyJarClasspathSettings ++ Seq (
436
457
// set system in/out for repl
437
458
connectInput in run := true ,
438
459
outputStrategy := Some (StdoutOutput ),
@@ -490,9 +511,6 @@ object Build {
490
511
// http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala
491
512
// packageAll should always be run before tests
492
513
javaOptions ++= {
493
- val externalDeps = externalCompilerClasspathTask.value
494
- val jars = packageAll.value
495
-
496
514
val ci_build = // propagate if this is a ci build
497
515
sys.props.get(" dotty.drone.mem" ) match {
498
516
case Some (prop) => List (" -Xmx" + prop)
@@ -512,19 +530,10 @@ object Build {
512
530
(sourceManaged in Compile ).value
513
531
}
514
532
515
- val jarOpts = List (
516
- " -Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir,
517
- " -Ddotty.tests.classes.dottyInterfaces=" + jars(" dotty-interfaces" ),
518
- " -Ddotty.tests.classes.dottyLibrary=" + jars(" dotty-library" ),
519
- " -Ddotty.tests.classes.dottyCompiler=" + jars(" dotty-compiler" ),
520
- " -Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, " compiler-interface" ),
521
- " -Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, " scala-library" ),
522
- " -Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, " scala-asm" ),
523
- " -Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, " jline-terminal" ),
524
- " -Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, " jline-reader" )
525
- )
533
+ val jarOpt =
534
+ " -Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir
526
535
527
- jarOpts : :: tuning ::: agentOptions ::: ci_build
536
+ jarOpt :: tuning ::: agentOptions ::: ci_build
528
537
},
529
538
530
539
testCompilation := Def .inputTaskDyn {
@@ -754,23 +763,13 @@ object Build {
754
763
dependsOn(dottyCompiler(Bootstrapped )).
755
764
dependsOn(dottyCompiler(Bootstrapped ) % " test->test" ).
756
765
settings(commonBootstrappedSettings).
766
+ settings(commonDottyJarClasspathSettings).
757
767
settings(
758
768
fork in run := true ,
759
769
fork in Test := true ,
760
770
javaOptions ++= {
761
- val externalDeps = externalCompilerClasspathTask.value
762
771
val jars = packageAll.in(`dotty-compiler-bootstrapped`).value
763
- List (
764
- " -Ddotty.tests.classes.dottyInterfaces=" + jars(" dotty-interfaces" ),
765
- " -Ddotty.tests.classes.dottyLibrary=" + jars(" dotty-library" ),
766
- " -Ddotty.tests.classes.dottyCompiler=" + jars(" dotty-compiler" ),
767
- " -Ddotty.tests.classes.dottyStaging=" + jars(" dotty-staging" ),
768
- " -Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, " compiler-interface" ),
769
- " -Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, " scala-library" ),
770
- " -Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, " scala-asm" ),
771
- " -Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, " jline-terminal" ),
772
- " -Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, " jline-reader" )
773
- )
772
+ List (" -Ddotty.tests.classes.dottyStaging=" + jars(" dotty-staging" ))
774
773
}
775
774
)
776
775
0 commit comments