@@ -39,6 +39,7 @@ trait DottyBuild { this: BuildCommons =>
39
39
customBuildVersion,
40
40
moduleName := " scalactic" ,
41
41
initialCommands in console := " import org.scalactic._" ,
42
+ packageSrcGenerated,
42
43
sourceGenerators in Compile += {
43
44
Def .task{
44
45
// From scalactic-macro
@@ -87,6 +88,16 @@ trait DottyBuild { this: BuildCommons =>
87
88
)
88
89
)
89
90
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
+
90
101
lazy val scalatestDotty = Project (" scalatestDotty" , file(" scalatest.dotty" ))
91
102
.enablePlugins(SbtOsgi )
92
103
.settings(sharedSettings : _* )
@@ -101,14 +112,7 @@ trait DottyBuild { this: BuildCommons =>
101
112
|import Matchers._""" .stripMargin,
102
113
libraryDependencies ++= scalaXmlDependency(scalaVersion.value),
103
114
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,
112
116
sourceGenerators in Compile += {
113
117
Def .task {
114
118
GenScalaTestDotty .genScala((sourceManaged in Compile ).value, version.value, scalaVersion.value) ++
0 commit comments