Skip to content

Commit bcbc62e

Browse files
cleanBridge command to clean sbt cache
1 parent e19c1a9 commit bcbc62e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

project/Build.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,28 @@ object DottyBuild extends Build {
207207
).
208208
settings(publishing)
209209

210+
// until sbt/sbt#2402 is fixed (https://github.com/sbt/sbt/issues/2402)
211+
lazy val cleanBridge = TaskKey[Unit]("clean-sbt-bridge", "delete dotty-sbt-bridge cache")
212+
210213
lazy val `dotty-bridge` = project.in(file("bridge")).
211214
dependsOn(dotty).
212215
settings(
213216
overrideScalaVersionSetting,
214217

218+
cleanBridge := {
219+
val dottyBridgeVersion = version.value
220+
val dottyVersion = (version in dotty).value
221+
val classVersion = System.getProperty("java.class.version")
222+
val sbtV = sbtVersion.value
223+
val home = System.getProperty("user.home")
224+
val org = organization.value
225+
val artifact = moduleName.value
226+
227+
IO.delete(file(home) / ".ivy2" / "cache" / "org.scala-sbt" / s"$org-$artifact-$dottyBridgeVersion-bin_${dottyVersion}__$classVersion")
228+
IO.delete(file(home) / ".sbt" / "boot" / "scala-2.10.6" / "org.scala-sbt" / "sbt" / sbtV / s"$org-$artifact-$dottyBridgeVersion-bin_${dottyVersion}__$classVersion")
229+
},
230+
publishLocal <<= publishLocal.dependsOn(cleanBridge),
231+
215232
description := "sbt compiler bridge for Dotty",
216233
resolvers += Resolver.typesafeIvyRepo("releases"),
217234
libraryDependencies ++= Seq(

0 commit comments

Comments
 (0)