So, I want to add some testing and registration features to my libgdx game.
So, I added the following main desktop dependencies gradle.
compile 'org.aspectj:aspectjweaver:1.8.2' compile "org.aspectj:aspectjrt:1.8.2"
Initially, he did not find a dependency, but this was solved both by turning off the offline mode and closing and reopening my IntelliJ project (the Gradle sync button did not work).
My understanding is that the animator file must be loaded as a Java agent. So I found where it displays gradle, loaded it and added the following VM runtime configuration options
-javaagent:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.8.2/4963c0bef4748d5ad039cc26c1ac32a082eb755e/aspectjweaver-1.8.2.jar
Surprisingly, this gives me the following warning message
objc[66447]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
This message is missing without the -javaagent line.
I tried to run this example for the boot example. http://andrewclement.blogspot.co.uk/2009/02/load-time-weaving-basics.html
However, I do not need a separate reusable aspect, so I just created the base aop.xml file in the src directory with the following contents.
<aspectj> <weaver options="-verbose"/> </aspectj>
Obviously, nothing has been created for me yet, I just want to confirm that the setup works. There are enough differences between this tutorial and my target environment, which, I think, a lot can go wrong.
Actually, I don't mind if compilation time or class loading will take place if it works in the libgdx / gradle environment. I decided to look into the decision to load classes because of my unfamiliarity with the environment and the requirements of libgdx / gradle.
Thanx in advance.
Update : let's try to make my way through this http://www.breskeby.com/2010/02/using-gradle-with-aspectj/
... but the not-so-familiar iajc mentioned in the tutorial, and knowing how to use this in libgdx build scripts also seems complicated.