mirror of
https://github.com/ethauvin/version-processor.git
synced 2025-04-29 01:28:13 -07:00
Initial commit
This commit is contained in:
commit
71c48e2f65
19 changed files with 326 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
package com.beust.apt.processor;
|
||||
|
||||
import javax.annotation.processing.AbstractProcessor;
|
||||
import javax.annotation.processing.RoundEnvironment;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class MainProcessor extends AbstractProcessor {
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
|
||||
System.out.println("Processing annotations $annotations");
|
||||
return true;
|
||||
}
|
||||
|
||||
public Set<String> getSupportedAnnotationTypes() {
|
||||
Set<String> result = new HashSet<>();
|
||||
result.add("Version");
|
||||
return result;
|
||||
}
|
||||
}
|
12
processor/src/main/java/com/beust/apt/processor/Version.java
Normal file
12
processor/src/main/java/com/beust/apt/processor/Version.java
Normal file
|
@ -0,0 +1,12 @@
|
|||
package com.beust.apt.processor;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Version {
|
||||
String value();
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
com.beust.apt.processor.MainProcessor
|
Loading…
Add table
Add a link
Reference in a new issue