From bcbc62ec8940fb9639da51778282cc805c23f84a Mon Sep 17 00:00:00 2001 From: Guillaume Massé Date: Wed, 21 Sep 2016 13:59:55 -0400 Subject: cleanBridge command to clean sbt cache --- project/Build.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'project') 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( -- cgit v1.2.3