diff --git a/README.md b/README.md index f3dc6a5..4385ae5 100755 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ You can specified your own template using some or all of the template value tags public void genver() throws Exception { new GeneratedVersionOperation() .fromProject(this) - .classTemplate(new File(".", "myversion.txt")) + .classTemplate(new File(workDirectory, "myversion.txt")) .execute(); } ``` diff --git a/examples/.idea/.name b/examples/.idea/.name index 84c8d99..c67cd99 100644 --- a/examples/.idea/.name +++ b/examples/.idea/.name @@ -1 +1 @@ -bld-generated-version-example +bld-generated-version-examples diff --git a/examples/src/bld/java/com/example/SampleBuild.java b/examples/src/bld/java/com/example/SampleBuild.java index a09224b..3ec22cb 100644 --- a/examples/src/bld/java/com/example/SampleBuild.java +++ b/examples/src/bld/java/com/example/SampleBuild.java @@ -39,7 +39,7 @@ public class SampleBuild extends Project { public void genver() throws Exception { new GeneratedVersionOperation() .fromProject(this) -// .classTemplate(new File(".", "myversion.txt")) +// .classTemplate(new File(workDirectory, "myversion.txt")) .execute(); } } \ No newline at end of file diff --git a/examples/src/main/java/com/example/GeneratedVersion.java b/examples/src/main/java/com/example/GeneratedVersion.java index 90b566f..b2f59fe 100644 --- a/examples/src/main/java/com/example/GeneratedVersion.java +++ b/examples/src/main/java/com/example/GeneratedVersion.java @@ -1,17 +1,28 @@ +/* + * This file is automatically generated. + * Do not modify! -- ALL CHANGES WILL BE ERASED! + */ + package com.example; import java.util.Date; +/** + * Provides project version information. + */ public final class GeneratedVersion { public static final String PROJECT = "Sample"; - public static final Date BUILD_DATE = new Date(1682700481013L); + public static final Date BUILD_DATE = new Date(1682736440919L); public static final int MAJOR = 1; public static final int MINOR = 0; public static final int REVISION = 1; public static final String QUALIFIER = "rc1"; public static final String VERSION = "1.0.1-rc1"; + /** + * Disables the default constructor. + */ private GeneratedVersion() { throw new UnsupportedOperationException("Illegal constructor call."); } -} \ No newline at end of file +}