@@ -135,9 +135,13 @@ class ScalaCompilerForUnitTesting {
135135 * The sequence of temporary files corresponding to passed snippets and analysis
136136 * callback is returned as a result.
137137 */
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 = {
139139 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 )
141145 val testProgress = new TestCompileProgress
142146 val classesOutput =
143147 if (compileToJar) {
@@ -174,7 +178,7 @@ class ScalaCompilerForUnitTesting {
174178 bridge.run(
175179 virtualSrcFiles,
176180 new TestDependencyChanges ,
177- Array (" -Yforce-sbt-phases " , " - classpath" , classesOutputPath, " -usejavacp" , " -d" , classesOutputPath) ++ maybeSourcePath,
181+ (forceSbtArgs ++: Array (" -classpath" , classesOutputPath, " -usejavacp" , " -d" , classesOutputPath) ) ++ maybeSourcePath,
178182 output,
179183 analysisCallback,
180184 new TestReporter ,
@@ -193,6 +197,10 @@ class ScalaCompilerForUnitTesting {
193197 compileSrcs(List (srcs.toList))
194198 }
195199
200+ def compileSrcsNoInc (srcs : String * ): CompileOutput = {
201+ compileSrcs(List (srcs.toList), incEnabled = false )
202+ }
203+
196204 def compileSrcsToJar (srcs : String * ): CompileOutput =
197205 compileSrcs(List (srcs.toList), compileToJar = true )
198206
@@ -202,4 +210,3 @@ class ScalaCompilerForUnitTesting {
202210 new TestVirtualFile (srcFile.toPath)
203211 }
204212}
205-
0 commit comments