Skip to content

Commit a2dacff

Browse files
committed
add managedSources to packageSrc / mappings for scalacticDotty
1 parent 0b2e4dc commit a2dacff

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

project/DottyBuild.scala

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ trait DottyBuild { this: BuildCommons =>
3939
customBuildVersion,
4040
moduleName := "scalactic",
4141
initialCommands in console := "import org.scalactic._",
42+
packageSrcGenerated,
4243
sourceGenerators in Compile += {
4344
Def.task{
4445
// From scalactic-macro
@@ -87,6 +88,16 @@ trait DottyBuild { this: BuildCommons =>
8788
)
8889
)
8990

91+
// https://github.com/sbt/sbt/issues/2205#issuecomment-144375501
92+
private lazy val packageSrcGenerated =
93+
mappings in (Compile, packageSrc) ++= { // publish generated sources
94+
val srcs = (managedSources in Compile).value
95+
val sdirs = (managedSourceDirectories in Compile).value
96+
val base = baseDirectory.value
97+
import Path._
98+
(srcs --- sdirs --- base) pair (relativeTo(sdirs) | relativeTo(base) | flat)
99+
}
100+
90101
lazy val scalatestDotty = Project("scalatestDotty", file("scalatest.dotty"))
91102
.enablePlugins(SbtOsgi)
92103
.settings(sharedSettings: _*)
@@ -101,14 +112,7 @@ trait DottyBuild { this: BuildCommons =>
101112
|import Matchers._""".stripMargin,
102113
libraryDependencies ++= scalaXmlDependency(scalaVersion.value),
103114
libraryDependencies ++= scalatestLibraryDependencies,
104-
// https://github.com/sbt/sbt/issues/2205#issuecomment-144375501
105-
mappings in (Compile, packageSrc) ++= { // publish generated sources
106-
val srcs = (managedSources in Compile).value
107-
val sdirs = (managedSourceDirectories in Compile).value
108-
val base = baseDirectory.value
109-
import Path._
110-
(srcs --- sdirs --- base) pair (relativeTo(sdirs) | relativeTo(base) | flat)
111-
},
115+
packageSrcGenerated,
112116
sourceGenerators in Compile += {
113117
Def.task {
114118
GenScalaTestDotty.genScala((sourceManaged in Compile).value, version.value, scalaVersion.value) ++

0 commit comments

Comments
 (0)