#1117: add claiming annotation processor

This commit is contained in:
Roel Spilker
2016-06-09 01:55:34 +02:00
parent cc36ab36d1
commit cec8705c3b
3 changed files with 16 additions and 2 deletions
+2 -1
View File
@@ -226,7 +226,8 @@ the common tasks and can be called on to run the main aspects of all the sub-scr
</ivy:compile>
<mkdir dir="build/lombok/META-INF" />
<mkdir dir="build/lombok/META-INF/services" />
<echo file="build/lombok/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor</echo>
<echo file="build/lombok/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor
lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo>
</target>
<target name="dist" description="Builds THE lombok.jar file which contains everything." depends="version, compile">
+1
View File
@@ -3,6 +3,7 @@ Lombok Changelog
### v1.16.9 "Edgy Guinea Pig"
* FEATURE: Added support for JBoss logger [Issue #1103](https://github.com/rzwitserloot/lombok/issues/1103)
* ENHANCEMENT: Running `javac -Xlint:all` would generate a warning about unclaimed annotations [Issue #1117](https://github.com/rzwitserloot/lombok/issues/1117)
### v1.16.8 (March 7th, 2016)
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 The Project Lombok Authors.
* Copyright (C) 2014-2016 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,7 @@ import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Completion;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
@@ -74,4 +75,15 @@ class AnnotationProcessorHider {
}
}
}
@SupportedAnnotationTypes("lombok.*")
public static class ClaimingProcessor extends AbstractProcessor {
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
return true;
}
@Override public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
}
}
}