-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delay Java compilation during pipelining #843
Conversation
To validate this pull request against other sbt modules, please visit this link. |
This implements an Analysis-aware `compileAllJava(...)`. ```scala def compileAllJava(in: Inputs, logger: Logger): CompileResult = ... ``` How this is realized is more complicated than one might expect because we need all the wiring to get AnalysisCallback going to reuse the `Incremental` + `MixedAnalyzingCompiler` harness (This is so the *downstream* subproject can get the incremental goodness).
val f = for { | ||
_ <- Future.traverse(dependsOnRef)(_.compile(i)) | ||
a <- futureAnalysis | ||
pj <- wholeDeps | ||
a0 <- futureScalaAnalysis | ||
a <- futureJavaAnalysis(pj, a0) | ||
} yield a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the part that waits for upstream whole compilation and self Scala compilation for scripted tests.
Note this requires build tools to call `incrementalCompiler.compileAllJava(in, log)` at the right timing.
if (config.incOptions.pipelining) { | ||
compileScala() | ||
if (scalaSrcs.nonEmpty) { | ||
log.debug("done compiling Scala sources") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java compilation is turned off when incOptions.pipelining
is turned on.
Treating this as another |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of incHandlerOpt.getOrElse(sys.error("incHandler was expected"))
, but it's a minor downside when compared to the rest of the change. Very nice work.
I just had a couple of easy questions/requests.
This is a follow-up to #744. (This actually makes pipelining usable)
This implements an Analysis-aware
compileAllJava(...)
.How this is realized is more complicated than one might expect because we need all the wiring to get AnalysisCallback going to reuse the
Incremental
+MixedAnalyzingCompiler
harness (This is so the downstream subprojects can get the incremental goodness).Note: If incOptions pipelining is enabled, the build tool must call
compileAllJava(in, logger)
after both*.class
compilation has completed && hasModified.