I want to generate some Scala source code in my sbt build. I wrote the code generator as a subproject in my sbt build and added a Compile / sourceGenerators
line to the main project settings that will invoke the code generator's run
task. I also made sure I only invoke the run
task when the code generator's input files have changed.
The thing is: not only the code generator's inputs can change, but also the code generator itself. I would therefore like to invoke the code generators compile
task and see if anything had to be recompiled. If that's the case, I want to run the code generator again. Is this possible to do? The compile
task returns a CompileAnalysis
object, but how can I find out from this object if anything was recompiled?
question from:
https://stackoverflow.com/questions/65862549/how-to-find-out-if-invoking-the-compile-task-actually-compiled-anything 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…