Hi,
I'm trying to implement the aspectj plugin for gradle (meaning real plugin
as scala one).
I think I have quite everything done but I realized few things that stops
me.
Aspectj works that compiles *.aj files (also possible to compile the *.java
files) and than modifies the generated *.class files. Also the aspect can be
written as *.java file with annotations that are recognized by the aspectj
compiler and the *.class file is modified too (more class files can be
generated).
I thoght that I take the destination of the javaCompile task and took
another dir (eg. src/main/aspectj) as source and generate the result to the
same destination. So the destination (build/classes/main) will be source and
destination ...
Now I have problem, that the task is not run when the source (which is the
src/main/aspectj) contains no files (My AspectjCompile extends
AbstractCompile that extends SourceTask that annotates the getSource method
with @SkipWhenEmpty and I can't override this annotation ... adding
getSource method without this annotation has not helped)? Should I
reimplement all the stuff that is in AbstractCompile and SourceTask?
Another question is whether there can arise problems that the same directory
is input and output (the destinationDir)?
AspectjCompile:
class AspectjCompile extends AbstractCompile {
@OutputDirectory
@InputDirectory
@Override
public File getDestinationDir() {
return super.destinationDir;
}
@InputFiles
@Override
public FileTree getSource() {
super.source
}
}
The output from running gradle is:
[INFO] [org.gradle.api.internal.tasks.DefaultTaskExecuter] Execution stopped
by some action with message: Main Aspectj source does not contain any files.
Thanks a lot for any help
--
Jiří Mareš