@@ -14,7 +14,7 @@ import sbt.internal.util.ConsoleLogger
14
14
import sbt .io .{ IO , RichFile }
15
15
import xsbt .ZincBenchmark .CompilationInfo
16
16
import xsbti ._
17
- import xsbti .compile .SingleOutput
17
+ import xsbti .compile .{ IncOptions , SingleOutput }
18
18
19
19
import scala .util .Try
20
20
@@ -49,7 +49,7 @@ case class ZincSetup(result: ZincBenchmark.Result[List[ProjectSetup]]) {
49
49
/* Classes are defined `private[xsbt]` to avoid scoping issues w/ `CachedCompiler0`. */
50
50
51
51
/** Instantiate a `ZincBenchmark` from a given project. */
52
- private [xsbt] class ZincBenchmark (toCompile : BenchmarkProject ) {
52
+ private [xsbt] class ZincBenchmark (toCompile : BenchmarkProject , zincEnabled : Boolean = true ) {
53
53
import ZincBenchmark .WriteBuildInfo
54
54
55
55
def writeSetup (globalDir : File ): WriteBuildInfo = {
@@ -74,7 +74,7 @@ private[xsbt] class ZincBenchmark(toCompile: BenchmarkProject) {
74
74
75
75
// Set up the compiler and store the current setup
76
76
val javaFile = new RichFile (compilationDir) / " benchmark-target"
77
- val runGen = ZincBenchmark .setUpCompiler(buildInfo, javaFile)
77
+ val runGen = ZincBenchmark .setUpCompiler(buildInfo, javaFile, zincEnabled )
78
78
ProjectSetup (subproject, javaFile, buildInfo, runGen)
79
79
}
80
80
@@ -108,11 +108,14 @@ private[xsbt] object ZincBenchmark {
108
108
/** Set up the compiler to compile `sources` with -cp `classpath` at `targetDir`. */
109
109
def setUpCompiler (
110
110
compilationInfo : CompilationInfo ,
111
- targetDir : File
111
+ targetDir : File ,
112
+ zincEnabled : Boolean
112
113
): Generator = () => {
113
114
IO .delete(targetDir)
114
115
IO .createDirectory(targetDir)
115
- val callback = new xsbti.TestCallback
116
+ val callback : xsbti.TestCallback = new xsbti.TestCallback {
117
+ override def enabled : Boolean = zincEnabled
118
+ }
116
119
val compiler = prepareCompiler(targetDir, callback, compilationInfo)
117
120
new compiler.Run
118
121
}
0 commit comments