Skip to content

Commit be64643

Browse files
authored
Merge pull request #1889 from dotty-staging/fix/dummies-for-sbt
Add dummy scala{-compiler,-reflect,p}
2 parents add9a03 + 76e2cce commit be64643

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

project/Build.scala

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ object DottyBuild extends Build {
9696
// this is only necessary for compatibility with sbt which currently hardcodes the "dotty" artifact name
9797
lazy val dotty = project.in(file(".")).
9898
// FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests
99-
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, dottySbtBridgeRef, `scala-library`).
99+
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, dottySbtBridgeRef,
100+
`scala-library`, `scala-compiler`, `scala-reflect`, `scalap`).
100101
dependsOn(`dotty-compiler`).
101102
dependsOn(`dotty-library`).
102103
settings(
@@ -559,6 +560,32 @@ object DottyInjectedPlugin extends AutoPlugin {
559560
).
560561
settings(publishing)
561562

563+
// sbt >= 0.13.12 will automatically rewrite transitive dependencies on
564+
// any version in any organization of scala{-library,-compiler,-reflect,p}
565+
// to have organization `scalaOrganization` and version `scalaVersion`
566+
// (see https://github.com/sbt/sbt/pull/2634).
567+
// This means that we need to provide dummy artefacts for these projects,
568+
// otherwise users will get compilation errors if they happen to transitively
569+
// depend on one of these projects.
570+
lazy val `scala-compiler` = project.
571+
settings(
572+
crossPaths := false,
573+
libraryDependencies := Seq(scalaCompiler)
574+
).
575+
settings(publishing)
576+
lazy val `scala-reflect` = project.
577+
settings(
578+
crossPaths := false,
579+
libraryDependencies := Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
580+
).
581+
settings(publishing)
582+
lazy val `scalap` = project.
583+
settings(
584+
crossPaths := false,
585+
libraryDependencies := Seq("org.scala-lang" % "scalap" % scalaVersion.value)
586+
).
587+
settings(publishing)
588+
562589
lazy val publishing = Seq(
563590
publishMavenStyle := true,
564591
publishArtifact := true,

0 commit comments

Comments
 (0)