mirror of
https://github.com/ethauvin/version-processor.git
synced 2025-04-24 23:47:11 -07:00
Change package name.
This commit is contained in:
parent
465d145f1d
commit
135bd465e1
6 changed files with 28 additions and 33 deletions
2
.idea/.name
generated
2
.idea/.name
generated
|
@ -1 +1 @@
|
||||||
apt-example
|
version-processor
|
|
@ -1,29 +0,0 @@
|
||||||
package com.beust.apt.example;
|
|
||||||
|
|
||||||
import com.beust.apt.processor.Version;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
@Version(fileName = "example/src/main/properties/version.properties", propertyName = "example.version")
|
|
||||||
class Example {
|
|
||||||
public Example() {
|
|
||||||
System.out.println("Instantiating Example");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] argv) throws Exception {
|
|
||||||
String root = "/Users/cbeust/java/java-apt-example/";
|
|
||||||
String[] args = new String[] {
|
|
||||||
"-classpath",
|
|
||||||
root + "processor/kobaltBuild/libs/processor-0.1.jar",
|
|
||||||
"-processor", "com.beust.apt.processor.VersionProcessor",
|
|
||||||
root + "example/src/main/java/com/beust/apt/example/Example.java"
|
|
||||||
};
|
|
||||||
// Uncomment this line and launch this class to debug the annotation processor.
|
|
||||||
// You need $JDK_HOME/lib/tools.jar for this
|
|
||||||
// com.sun.tools.javac.Main.main(args);
|
|
||||||
|
|
||||||
File file = new File(".");
|
|
||||||
System.out.println("Version generated: " + GeneratedVersion.VERSION);
|
|
||||||
// new Example();
|
|
||||||
}
|
|
||||||
}
|
|
24
example/src/main/java/com/beust/version/example/Example.java
Normal file
24
example/src/main/java/com/beust/version/example/Example.java
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
package com.beust.version.example;
|
||||||
|
|
||||||
|
import com.beust.version.Version;
|
||||||
|
|
||||||
|
@Version(fileName = "example/src/main/properties/version.properties", propertyName = "example.version")
|
||||||
|
class Example {
|
||||||
|
public static void main(String[] argv) throws Exception {
|
||||||
|
// Set this to true and launch this class if you want to debug the annotation processor.
|
||||||
|
boolean debug = false;
|
||||||
|
if (debug) {
|
||||||
|
String root = "/Users/cbeust/java/java-apt-example/";
|
||||||
|
String[] args = new String[]{
|
||||||
|
"-classpath",
|
||||||
|
root + "processor/kobaltBuild/libs/processor-0.1.jar",
|
||||||
|
"-processor", "com.beust.version.VersionProcessor",
|
||||||
|
root + "example/src/main/java/com/beust/apt/example/Example.java"
|
||||||
|
};
|
||||||
|
// You need $JDK_HOME/lib/tools.jar for this
|
||||||
|
// com.sun.tools.javac.Main.main(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Version generated: " + GeneratedVersion.VERSION);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.beust.apt.processor;
|
package com.beust.version;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.beust.apt.processor;
|
package com.beust.version;
|
||||||
|
|
||||||
import javax.annotation.processing.*;
|
import javax.annotation.processing.*;
|
||||||
import javax.lang.model.SourceVersion;
|
import javax.lang.model.SourceVersion;
|
|
@ -1 +1 @@
|
||||||
com.beust.apt.processor.VersionProcessor
|
com.beust.version.VersionProcessor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue