Questions tagged [freefair-aspectj]

The Freefair Gradle build plugins for AspectJ enable developers to use eitzher compile-time or post-compile (binary) weaving. It is similar to what AspectJ Maven Plugin is to Maven users.

https://docs.freefair.io/gradle-plugins/current/reference/#_aspectj_plugins

7 questions
9
votes
2 answers

How to make an AspectJ Aspect work in a Gradle project?

I am using the following sample code to understand AspectJ: public class Account { int balance = 20; public boolean withdraw(int amount) { if (balance < amount) { return false; } balance = balance -…
F. K.
  • 694
  • 3
  • 9
  • 23
2
votes
1 answer

Is it possible to exclude aspects with io.freefair.aspectj.post-compile-weaving?

I have a Gradle 7.3.3 aspect library and a Gradle 7.3.3 project which consumes that library. I am applying the io.freefair.aspectj.post-compile-weaving Gradle plugin in the project. plugins { id 'io.freefair.aspectj.post-compile-weaving' version…
Aaron B
  • 53
  • 3
2
votes
2 answers

How to set "-aspectpath" for the FreeFair AspectJ Gradle Plugin?

I am trying to use an AspectJ Annotation that is in a Library, that I am pulling into my project. My project uses Gradle, so I am attempting to use FreeFair AspectJ Gradle Plugin. I need to be able to set the AspectJ -aspectpath argument, to the…
Brandon Dudek
  • 849
  • 1
  • 8
  • 18
1
vote
0 answers

How to solve "Cannot set the value of read-only property 'classpath' for object of type ..." error in Gradle

I have: compileJava { ajc { enabled = true classpath = configurations.aspectj options { aspectpath = configurations.aspect compilerArgs = [] } } …
0
votes
1 answer

Post-Compile weaving not working to test code

I'm using Gradle 7.4 and applying the io.freefair.aspectj.post-compile-weaving plugin. I want to test my aspect so I wrote a test class including an static inner class which should be advised by my aspect but my aspect does not advise it. I also…
avenue68
  • 43
  • 7
0
votes
0 answers

Set freefair aspectj inpath in android studio project

I have a .jar file (lets say example.jar) that contains classes to weave as well as an aspect. I want to use this jar in another project. Using intelliJ I achieved this very easily by adding the freefair.aspectj plugin to my build.gradle and adding…
Dani
  • 49
  • 6
0
votes
1 answer

How to import aspectJ into project?

I need to use aspectJ. How can I use the functionality of this lib / framework? This is my build.gradle file plugins { id "com.diffplug.eclipse.apt" version "3.22.0" id "com.github.johnrengelman.shadow" version "7.0.0" id…