Skip to content

Commit

Permalink
Don't rely on sbt.ivy.home.
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg committed Dec 12, 2016
1 parent 04e1949 commit 3b8c88d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
build:
image: scalaplatform/scala:0.5
image: danieletorelli/sbt
environment:
- COURSIER_CACHE=/drone/cache/coursier
commands:
- export SBT_OPTS="-Xmx24G -XX:MaxPermSize=4G -Xss4M"
# configuring ivy.home doesn't seem to work. Maybe related:
# https://github.com/sbt/sbt/issues/1894
# After 10+ experiments I've given up on trying to use sbt.ivy.yhome and
# copy the files myself instead, as recommended here:
# http://readme.drone.io/usage/caching/
- test -d /drone/.sbt && cp -a /drone/.sbt /root
- rm -rf /drone/.sbt

- test -d /drone/.ivy2 && cp -a /drone/.ivy2 /root
- rm -rf /drone/.ivy2

- sbt clean test scripted

- cp -a /root/.ivy2 /drone
- cp -a /root/.sbt /drone
cache:
mount:
- /drone/.git
- /drone/.sbt
- /drone/.ivy2
- /drone/cache
10 changes: 9 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,20 @@ lazy val `scalafix-sbt` = project.settings(
allSettings,
ScriptedPlugin.scriptedSettings,
sbtPlugin := true,
scriptedLaunchOpts ++= {
if (sys.props.contains("CI"))
Seq(
s"-Dsbt.ivy.home=/drone/.ivy2/",
s"-Divy.home=/drone/.ivy2/"
)
else Nil
},
scripted := scripted.dependsOn(publishedArtifacts: _*).evaluated,
scalaVersion := "2.10.5",
moduleName := "sbt-scalafix",
sources in Compile +=
baseDirectory.value / "../core/src/main/scala/scalafix/Versions.scala",
scriptedLaunchOpts := Seq(
scriptedLaunchOpts ++= Seq(
"-Dplugin.version=" + version.value,
// .jvmopts is ignored, simulate here
"-XX:MaxPermSize=256m",
Expand Down

0 comments on commit 3b8c88d

Please sign in to comment.