@@ -135,11 +135,15 @@ class ScalaCompilerForUnitTesting {
135
135
* The sequence of temporary files corresponding to passed snippets and analysis
136
136
* callback is returned as a result.
137
137
*/
138
- def compileSrcs (groupedSrcs : List [List [String ]], sourcePath : List [String ] = Nil , compileToJar : Boolean = false ): CompileOutput = {
138
+ def compileSrcs (groupedSrcs : List [List [String ]], sourcePath : List [String ] = Nil , compileToJar : Boolean = false , incEnabled : Boolean = true ): CompileOutput = {
139
139
val temp = IO .createTemporaryDirectory
140
- val analysisCallback = new TestCallback
140
+ val (forceSbtArgs, analysisCallback) =
141
+ if (incEnabled)
142
+ (Seq (" -Yforce-sbt-phases" ), new TestCallback )
143
+ else
144
+ (Seq .empty, new TestCallbackNoInc )
141
145
val testProgress = new TestCompileProgress
142
- val classesOutput =
146
+ val classesOutput =
143
147
if (compileToJar) {
144
148
val jar = new File (temp, " classes.jar" )
145
149
jar.createNewFile()
@@ -174,7 +178,7 @@ class ScalaCompilerForUnitTesting {
174
178
bridge.run(
175
179
virtualSrcFiles,
176
180
new TestDependencyChanges ,
177
- Array (" -Yforce-sbt-phases " , " - classpath" , classesOutputPath, " -usejavacp" , " -d" , classesOutputPath) ++ maybeSourcePath,
181
+ (forceSbtArgs ++: Array (" -classpath" , classesOutputPath, " -usejavacp" , " -d" , classesOutputPath) ) ++ maybeSourcePath,
178
182
output,
179
183
analysisCallback,
180
184
new TestReporter ,
@@ -193,6 +197,10 @@ class ScalaCompilerForUnitTesting {
193
197
compileSrcs(List (srcs.toList))
194
198
}
195
199
200
+ def compileSrcsNoInc (srcs : String * ): CompileOutput = {
201
+ compileSrcs(List (srcs.toList), incEnabled = false )
202
+ }
203
+
196
204
def compileSrcsToJar (srcs : String * ): CompileOutput =
197
205
compileSrcs(List (srcs.toList), compileToJar = true )
198
206
@@ -202,4 +210,3 @@ class ScalaCompilerForUnitTesting {
202
210
new TestVirtualFile (srcFile.toPath)
203
211
}
204
212
}
205
-
0 commit comments