I am able to do compile time weaving, but is there any way to avoid ant task executions.
I want to avoid ant.taskdef
ant.aijc calls from Gradle task. Seems to be the aspect plugin support is not available in Gradle with higher version.
I wrote a plugin calling the ajc compiler from a task bypassing the need for the ant task.
Unfortunately, I am not allowed to share the code due to licence restrictions. The global idea is:
// Initialize the ajc compiler and forward gradle logger to ajc
Main ajc = new Main()
ajc.holder = new YourAdaptor(project.logger)
// Fill options
List options = []
options << '--encoding' << 'UTF-8'
// ...
ajc.runMain options as String[], false
The ajc compiler reference can be found here: http://www.eclipse.org/aspectj/doc/next/devguide/ajc-ref.html
Most important options to set in my mind are:
-d (output directory)
-aspectpath (where your aspect come from, can use jar files and/or directories)
-inpath (where your point cuts are defined)
-XSet if you need to set some options like avoidFinal=true when running on JBoss Wildfly for example, …
-classpath (self descriptive)
-source and -target
Try your luck on github, I think there might be some open source available there. Also giving a look to the ant task source code might help you.
Good luck