Added workDirectory to examples

This commit is contained in:
Erik C. Thauvin 2023-04-28 19:49:41 -07:00
parent 3e7250b7bb
commit 7b7ce43626
4 changed files with 16 additions and 5 deletions

View file

@ -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();
}
```

2
examples/.idea/.name generated
View file

@ -1 +1 @@
bld-generated-version-example
bld-generated-version-examples

View file

@ -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();
}
}

View file

@ -1,16 +1,27 @@
/*
* 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.");
}