Geogi / CriojoSC

CriojoSC is an implementation of CRIOJO, a CHAM-based engine for running concurrent applications with guaranteed causal order.
GNU General Public License v3.0
2 stars 0 forks source link

Make source generation part of the main build #38

Open Geogi opened 11 years ago

Geogi commented 11 years ago

SBT has a sourceGenerators hook (task) that can be used to run the source generation before the main build.

This can be achieved by putting the code of Generate into the main Build.scala, taking a directory parameter, returning the sequence of generated files, and registering the hook in the main build.sbt. A work-around has to be made to inject SBT's classpath into Scalate's. See ab4aa9bd6a575b0ce0fed21e0dc9aa653d2467a7 for an almost working stub.

However, this won't work because of a Scala version mismatch:

It'd be nice to solve that because it would simplify the build process (by making SBT as simple as Maven was before we got macros and code gen, compiling with a single command), but that's not a priority.

Geogi commented 11 years ago

https://groups.google.com/forum/?fromgroups=#!topic/simple-build-tool/iCCuekP2ouE

This looks promising.

Geogi commented 11 years ago

Alternatively (and probably better): let generate be a separate project and add a custom task that monitors file changes on *.ssp, then run Generate on those files. Make that task part of source-generate, compile or whatever in the main build.