@@ -32,6 +32,7 @@ import xsbti.{
32
32
33
33
import sbt .util .InterfaceUtil
34
34
import sbt .util .Logger
35
+ import xsbt .Log .debug
35
36
36
37
/**
37
38
* Define a Java compiler that reports on any discovered source dependencies or
@@ -165,18 +166,19 @@ final class AnalyzingJavaCompiler private[sbt] (
165
166
options,
166
167
scalaInstance,
167
168
classpathOptions
168
- )
169
+ ).toArray
169
170
val javaSources : Array [VirtualFile ] =
170
171
sources.sortBy(_.id).toArray
172
+ debug(log, prettyPrintCompilationArguments(args))
171
173
val success =
172
- javac.run(javaSources, args.toArray , output, incToolOptions, reporter, log)
174
+ javac.run(javaSources, args, output, incToolOptions, reporter, log)
173
175
if (! success) {
174
176
/* Assume that no Scalac problems are reported for a Javac-related
175
177
* reporter. This relies on the incremental compiler will not run
176
178
* Javac compilation if Scala compilation fails, which means that
177
179
* the same reporter won't be used for `AnalyzingJavaCompiler`. */
178
180
val msg = " javac returned non-zero exit code"
179
- throw new CompileFailed (args.toArray , msg, reporter.problems())
181
+ throw new CompileFailed (args, msg, reporter.problems())
180
182
}
181
183
}
182
184
@@ -264,4 +266,7 @@ final class AnalyzingJavaCompiler private[sbt] (
264
266
log.debug(label + " took " + (elapsed / 1e9 ) + " s" )
265
267
result
266
268
}
269
+
270
+ private def prettyPrintCompilationArguments (args : Array [String ]) =
271
+ args.mkString(" [zinc] The Java compiler is invoked with:\n\t " , " \n\t " , " " )
267
272
}
0 commit comments