Skip to content

Commit de5d34a

Browse files
committed
Compile the bootstrapped dotty without publish anything
Before this commit, `dotty-sbt-bridge` had to be published locally to be able to compile bootstrapped projects. This is no longer the case, instead the local `dotty-sbt-bridge` is used, this also requires calling `cleanSbtBridge` before packaging `dotty-sbt-bridge` instead of before publishing it.
1 parent 6e28fee commit de5d34a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

project/Build.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ object Build {
129129
scalaOrganization := dottyOrganization,
130130
scalaBinaryVersion := "0.1",
131131

132+
// Avoid having to run `dotty-sbt-bridge/publishLocal` before compiling a bootstrapped project
133+
scalaCompilerBridgeSource :=
134+
(dottyOrganization %% "dotty-sbt-bridge" % "NOT_PUBLISHED" % Configurations.Component.name)
135+
.artifacts(Artifact.sources("dotty-sbt-bridge").copy(url =
136+
// We cannot use the `packageSrc` task because a setting cannot depend
137+
// on a task. Instead, we make `compile` below depend on the bridge `packageSrc`
138+
Some((artifactPath in (`dotty-sbt-bridge`, Compile, packageSrc)).value.toURI.toURL))),
139+
compile in Compile := (compile in Compile)
140+
.dependsOn(packageSrc in (`dotty-sbt-bridge`, Compile)).value,
141+
132142
// Use the same name as the non-bootstrapped projects for the artifacts
133143
moduleName ~= { _.stripSuffix("-bootstrapped") },
134144

@@ -660,7 +670,7 @@ object Build {
660670
IO.delete(file(home) / ".ivy2" / "cache" / sbtOrg / s"$org-$artifact-$dottySbtBridgeVersion-bin_${dottyVersion}__$classVersion")
661671
IO.delete(file(home) / ".sbt" / "boot" / s"scala-$sbtScalaVersion" / sbtOrg / "sbt" / sbtV / s"$org-$artifact-$dottySbtBridgeVersion-bin_${dottyVersion}__$classVersion")
662672
},
663-
publishLocal := (publishLocal.dependsOn(cleanSbtBridge)).value,
673+
packageSrc in Compile := (packageSrc in Compile).dependsOn(cleanSbtBridge).value,
664674
description := "sbt compiler bridge for Dotty",
665675
resolvers += Resolver.typesafeIvyRepo("releases"), // For org.scala-sbt stuff
666676
libraryDependencies ++= Seq(

0 commit comments

Comments
 (0)