Backport sbt java output fixes into zinc

Review Request #2810 - Created Sept. 14, 2015 and submitted

Information
Stu Hood
pants
10675a7...
Reviewers
pants-reviews
benjyw, fkorotkov, jsirois, zundel

This backports a fix that Fedor committed upstream to sbt, but which won't be available for consumption until sbt 0.13.10.

  • Import LocalJavaCompiler as ZincLocalJavaCompiler (with no changes: this is just to get access to the necessary API)
  • Import DiagnosticsReporter as ZincDiagnosticsReporter; this is where the fix actually lives
  • Use ZincLocalJavaCompiler when creating compilers.

built a local zinc release and tested that the fix results in complete line output for the testcase that Eric added:

./pants --config-override=pants.ini.isolated compile testprojects/src/java/org/pantsbuild/testproject/dummies::

[info] Compiling 1 Java source to /Users/stuhood/src/pants/.pants.d/compile/jvm/zinc/isolated-classes/testprojects.src.java.org.pantsbuild.testproject.dummies.compilation_failure_target...
[warn] bootstrap class path not set in conjunction with -source 1.6
[warn] /Users/stuhood/src/pants/testprojects/src/java/org/pantsbuild/testproject/dummies/CompilationFailure.java:4: sun.security.x509.X500Name is internal proprietary API and may be removed in a future release
[warn] import sun.security.x509.X500Name;
[error] /Users/stuhood/src/pants/testprojects/src/java/org/pantsbuild/testproject/dummies/CompilationFailure.java:13: package System2 does not exist
[error]     System2.out.println("Hello World!");
[error] Compile failed at Sep 14, 2015 8:44:49 AM [0.111s]
Stu Hood
Eric Ayers
Stu Hood
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as a88a995bc2d52aa86b736620097f4820ae64370c

John Sirois

   
src/scala/sbt/compiler/javac/BUILD (Diff revision 1)
 
 
sbt/inc sets the precedent, so this seems fine, but it would be cheap going forward to just re-package when importing a handful of files and re-exporting.
Doing a chmod 444 on this file and the next might be a good idea if not done already.
Loading...