aboutsummaryrefslogtreecommitdiff
path: root/project/Build.scala
diff options
context:
space:
mode:
authorGuillaume Massé <masgui@gmail.com>2016-09-21 13:59:55 -0400
committerGuillaume Massé <masgui@gmail.com>2016-09-21 13:59:55 -0400
commitbcbc62ec8940fb9639da51778282cc805c23f84a (patch)
tree03f48b47d90f4ea75536ef941091dacbbdddea8a /project/Build.scala
parente19c1a9fa1376cab41e2cc52eba6683bdec1ecd3 (diff)
downloaddotty-bcbc62ec8940fb9639da51778282cc805c23f84a.tar.gz
dotty-bcbc62ec8940fb9639da51778282cc805c23f84a.tar.bz2
dotty-bcbc62ec8940fb9639da51778282cc805c23f84a.zip
cleanBridge command to clean sbt cache
Diffstat (limited to 'project/Build.scala')
-rw-r--r--project/Build.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/project/Build.scala b/project/Build.scala
index 1412556a9..e32e3bbd6 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -207,11 +207,28 @@ object DottyBuild extends Build {
).
settings(publishing)
+ // until sbt/sbt#2402 is fixed (https://github.com/sbt/sbt/issues/2402)
+ lazy val cleanBridge = TaskKey[Unit]("clean-sbt-bridge", "delete dotty-sbt-bridge cache")
+
lazy val `dotty-bridge` = project.in(file("bridge")).
dependsOn(dotty).
settings(
overrideScalaVersionSetting,
+ cleanBridge := {
+ val dottyBridgeVersion = version.value
+ val dottyVersion = (version in dotty).value
+ val classVersion = System.getProperty("java.class.version")
+ val sbtV = sbtVersion.value
+ val home = System.getProperty("user.home")
+ val org = organization.value
+ val artifact = moduleName.value
+
+ IO.delete(file(home) / ".ivy2" / "cache" / "org.scala-sbt" / s"$org-$artifact-$dottyBridgeVersion-bin_${dottyVersion}__$classVersion")
+ IO.delete(file(home) / ".sbt" / "boot" / "scala-2.10.6" / "org.scala-sbt" / "sbt" / sbtV / s"$org-$artifact-$dottyBridgeVersion-bin_${dottyVersion}__$classVersion")
+ },
+ publishLocal <<= publishLocal.dependsOn(cleanBridge),
+
description := "sbt compiler bridge for Dotty",
resolvers += Resolver.typesafeIvyRepo("releases"),
libraryDependencies ++= Seq(