sbt/sbt — pull request #1362 by jroper (2014-05-27 04:52:53+00:00)
Title: Allow bytecode enhancement to update analysis before it's saved

See https://github.com/playframework/playframework/pull/2237 for a more in depth discussion on this.

Essentially, it should be possible for byte code enhancement tasks to do their work and update the analysis before it's saved. Currently, the compile task saves the analysis to disk before it completes, so any byte code enhancement that happens after that, and hence needs to update the analysis (to prevent incremental compilation from invalidating the enhanced classes), needs to save the analysis again.

@gkossakowski suggested that we have the following tasks:

readAnalysis <- compileIncremental <- saveAnalysis <- compile

This would allow byte code enhancers to override the compileIncremental task.

A similar approach might be:

readAnalysis <- compileIncremental <- byteCodeEnhance <- saveAnalysis <- compile

Where `byteCodeEnhance` is a task that takes a sequence of byte code enhancers, and runs them in sequence. This would allow multiple byte code enhancer plugins to automatically plug themselves in, the order being random based on plugin load order, but then also allow the user to override that, explicitly defining the order of that sequence if it matters.