I am creating an Annotation Processor in Java and I want to be able to check if the user triggers a full rebuild. I want to be able distingush between a full rebuild and just building a few files.
Is this possible? Or are there any workarounds for this?
Edit1:
I am going to explain what I want to achieve. I have an annotation processor and 10 annotations. 8 of these Annotations generate a config file called plugin.yml
. 3 of these annotations (one annotation is used in both processes) are used to generate a sourcefile called AutoRegister.java
. This works like a charm when I trigger a full rebuild and all my annotations get processed. Now the problem arises when I only compile, lets say 3 of the 15 classes using my annotations. Then the plugin.yml
and the AutoRegister.java
get generated based on the Annotations of the 3 files, thus beeing incomplete.
My workaround is to create a cache file, which contains information about all the other classes, which need to be insertet to the two files plugin.yml
and AutoRegister.java
. This somewhat works but makes it impossible to remove data from the cache, for example when I remove an annotation from a class. So the only way to remove data from the cache is to remove the cache file and to trigger a full rebuild.