@@ -201,6 +201,15 @@ object Build {
201
201
).toList,
202
202
PgpKeys .pgpPassphrase := sys.env.get(" PGP_PW" ).map(_.toCharArray()),
203
203
PgpKeys .useGpgPinentry := true ,
204
+
205
+ javaOptions ++= {
206
+ val ciOptions = // propagate if this is a CI build
207
+ sys.props.get(" dotty.drone.mem" ) match {
208
+ case Some (prop) => List (" -Xmx" + prop)
209
+ case _ => List ()
210
+ }
211
+ agentOptions ::: ciOptions
212
+ }
204
213
)
205
214
206
215
lazy val commonSettings = publishSettings ++ Seq (
@@ -432,29 +441,8 @@ object Build {
432
441
def findArtifactPath (classpath : Def .Classpath , name : String ): String =
433
442
findArtifact(classpath, name).getAbsolutePath
434
443
435
- // Settings shared between dotty-compiler, dotty-compiler-bootstrapped and dotty-staging
436
- lazy val commonDottyJarClasspathSettings = Seq (
437
- // http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala
438
- // packageAll should always be run before tests
439
- javaOptions ++= {
440
- val externalDeps = externalCompilerClasspathTask.value
441
- val jars = packageAll.in(LocalProject (" dotty-compiler" )).value
442
-
443
- List (
444
- " -Ddotty.tests.classes.dottyInterfaces=" + jars(" dotty-interfaces" ),
445
- " -Ddotty.tests.classes.dottyLibrary=" + jars(" dotty-library" ),
446
- " -Ddotty.tests.classes.dottyCompiler=" + jars(" dotty-compiler" ),
447
- " -Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, " compiler-interface" ),
448
- " -Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, " scala-library" ),
449
- " -Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, " scala-asm" ),
450
- " -Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, " jline-terminal" ),
451
- " -Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, " jline-reader" )
452
- )
453
- }
454
- )
455
-
456
444
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
457
- lazy val commonDottyCompilerSettings = commonDottyJarClasspathSettings ++ Seq (
445
+ lazy val commonDottyCompilerSettings = Seq (
458
446
// set system in/out for repl
459
447
connectInput in run := true ,
460
448
outputStrategy := Some (StdoutOutput ),
@@ -509,32 +497,27 @@ object Build {
509
497
// Add git-hash used to package the distribution to the manifest to know it in runtime and report it in REPL
510
498
packageOptions += ManifestAttributes ((" Git-Hash" , VersionUtil .gitHash)),
511
499
512
- // http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala
513
- // packageAll should always be run before tests
514
500
javaOptions ++= {
515
- val ci_build = // propagate if this is a ci build
516
- sys.props.get(" dotty.drone.mem" ) match {
517
- case Some (prop) => List (" -Xmx" + prop)
518
- case _ => List ()
519
- }
520
-
521
- val tuning =
522
- if (sys.props.isDefinedAt(" Oshort" ))
523
- // Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
524
- List (" -XX:+TieredCompilation" , " -XX:TieredStopAtLevel=1" )
525
- else List ()
526
-
527
501
val managedSrcDir = {
528
502
// Populate the directory
529
503
(managedSources in Compile ).value
530
504
531
505
(sourceManaged in Compile ).value
532
506
}
507
+ val externalDeps = externalCompilerClasspathTask.value
508
+ val jars = packageAll.value
533
509
534
- val jarOpt =
535
- " -Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir
536
-
537
- jarOpt :: tuning ::: agentOptions ::: ci_build
510
+ Seq (
511
+ " -Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir,
512
+ " -Ddotty.tests.classes.dottyInterfaces=" + jars(" dotty-interfaces" ),
513
+ " -Ddotty.tests.classes.dottyLibrary=" + jars(" dotty-library" ),
514
+ " -Ddotty.tests.classes.dottyCompiler=" + jars(" dotty-compiler" ),
515
+ " -Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, " compiler-interface" ),
516
+ " -Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, " scala-library" ),
517
+ " -Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, " scala-asm" ),
518
+ " -Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, " jline-terminal" ),
519
+ " -Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, " jline-reader" ),
520
+ )
538
521
},
539
522
540
523
testCompilation := Def .inputTaskDyn {
@@ -707,7 +690,7 @@ object Build {
707
690
708
691
lazy val bootstrapedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq (
709
692
javaOptions += {
710
- val jars = packageAll.in( LocalProject ( " dotty-compiler-bootstrapped " )). value
693
+ val jars = packageAll.value
711
694
" -Ddotty.tests.classes.dottyStaging=" + jars(" dotty-staging" )
712
695
},
713
696
packageAll := {
@@ -769,12 +752,8 @@ object Build {
769
752
dependsOn(dottyCompiler(Bootstrapped ) % " compile->runtime" ).
770
753
dependsOn(dottyCompiler(Bootstrapped ) % " test->test" ).
771
754
settings(commonBootstrappedSettings).
772
- settings(commonDottyJarClasspathSettings).
773
755
settings(
774
- javaOptions ++= {
775
- val jars = packageAll.in(`dotty-compiler-bootstrapped`).value
776
- List (" -Ddotty.tests.classes.dottyStaging=" + jars(" dotty-staging" ))
777
- }
756
+ javaOptions := (javaOptions in `dotty-compiler-bootstrapped`).value
778
757
)
779
758
780
759
lazy val `dotty-sbt-bridge` = project.in(file(" sbt-bridge/src" )).
0 commit comments