mirror of
https://github.com/ethauvin/version-processor.git
synced 2025-04-25 07:57:12 -07:00
Initial commit
This commit is contained in:
commit
71c48e2f65
19 changed files with 326 additions and 0 deletions
13
processor/processor.iml
Normal file
13
processor/processor.iml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -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