Skip to content

Commit e01e970

Browse files
committed
Propagate memory setting to tests
1 parent a04b458 commit e01e970

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pipeline:
33
image: felixmulder/dotty:0.2
44
commands:
55
- ln -s /var/cache/drone/scala-scala scala-scala
6-
- sbt -mem 4096 -ivy /var/cache/drone/ivy2 "${TEST}"
6+
- sbt -Ddotty.drone.mem=4096m -ivy /var/cache/drone/ivy2 "${TEST}"
77

88
matrix:
99
TEST:

project/Build.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ object DottyBuild extends Build {
1717
val jenkinsMemLimit = List("-Xmx1500m")
1818

1919
val JENKINS_BUILD = "dotty.jenkins.build"
20+
val DRONE_MEM = "dotty.drone.mem"
2021

2122
val scalaCompiler = "me.d-d" % "scala-compiler" % "2.11.5-20160322-171045-e19b30b3cd"
2223

@@ -335,9 +336,11 @@ object DottyBuild extends Build {
335336
path.contains("sbt-interface")
336337
} yield "-Xbootclasspath/p:" + path
337338

338-
val travis_build = // propagate if this is a travis build
339+
val ci_build = // propagate if this is a ci build
339340
if (sys.props.isDefinedAt(JENKINS_BUILD))
340341
List(s"-D$JENKINS_BUILD=${sys.props(JENKINS_BUILD)}") ::: jenkinsMemLimit
342+
else if (sys.props.isDefinedAt(DRONE_MEM))
343+
List("-Xmx" + sys.props(DRONE_MEM))
341344
else List()
342345

343346
val tuning =
@@ -346,7 +349,7 @@ object DottyBuild extends Build {
346349
List("-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1")
347350
else List()
348351

349-
("-DpartestParentID=" + pid) :: tuning ::: agentOptions ::: travis_build ::: path.toList
352+
("-DpartestParentID=" + pid) :: tuning ::: agentOptions ::: ci_build ::: path.toList
350353
}
351354
).
352355
settings(publishing)
@@ -530,12 +533,14 @@ object DottyInjectedPlugin extends AutoPlugin {
530533
val fullpath = ("-Xbootclasspath/a:" + bin) :: path.toList
531534
// System.err.println("BOOTPATH: " + fullpath)
532535

533-
val travis_build = // propagate if this is a travis build
536+
val ci_build = // propagate if this is a ci build
534537
if (sys.props.isDefinedAt(JENKINS_BUILD))
535538
List(s"-D$JENKINS_BUILD=${sys.props(JENKINS_BUILD)}")
539+
else if (sys.props.isDefinedAt(DRONE_MEM))
540+
List("-Xmx" + sys.props(DRONE_MEM))
536541
else
537542
List()
538-
val res = agentOptions ::: travis_build ::: fullpath
543+
val res = agentOptions ::: ci_build ::: fullpath
539544
println("Running with javaOptions: " + res)
540545
res
541546
}

0 commit comments

Comments
 (0)