I have (yes another) odd case I cannot quite figur...
# plugin-development
s
I have (yes another) odd case I cannot quite figure out. It has to do with source generation that is based on compilation. I have 2 tasks: •
generateJpaMetamodel
- uses the compiled project classes to generate some source •
compileJpaMetamodel
- compiles the source generated by
generateJpaMetamodel
This works fine if those 2 tasks are executed directly. I'm trying to improve this by hooking them into the
classes
task but running into 2 problems: 1.
classes
is dependent on the actual SourceSet, but the SourceSet is configurable. This leads to a chicken-egg issue I am unsure how to fix - specifically, how can I define a task dependency lazily based on a Property value? 2. In terms of inter-task dependencies, I am unsure how to avoid the circularity that comes up, although the circularity is implicit from somewhere (I believe from the use of FileSets related to compilation, but not sure). Ideally I'd have: a.
generateJpaMetamodel
depend on each language compile task (java, kotlin, etc) b.
compileJpaMetamodel
depend on
generateJpaMetamodel
c.
classes
depend on
compileJpaMetamodel
I know that's a lot of info - thanks in advance for any pointers 🙂