I’ve found this aspectj plugin not to work very well and have been looking to replace it.
The idea I’ve been pursuing is to stick a weave task between the compile and classes tasks of the java plugin. The weave task invokes ajc on the .class files produced by the compile task to perform Bytecode weaving.
If we do this in-place it alters the class files produced by the normal java task. Which makes compileJava be not up-to-date. Which makes weaveAspect not up-to-date. Which makes everyone unhappy that we’ve hindered the incremental build.
To avoid stomping on the output of the normal compile task, we can have our aspectj task put its outputs elsewhere. But we haven’t figured out how to make subsequent tasks like testCompile or jar look at the woven class files rather than those produced by the regular java compile task.
Does anyone have any advice on this subject? Is there a non-hacky way to do this pursuant to Gradle idiom?