Fixed projectName setter

This commit is contained in:
Erik C. Thauvin 2023-04-29 14:17:11 -07:00
parent 2fa5864c21
commit eef391e90c
4 changed files with 7 additions and 17 deletions

View file

@ -12,6 +12,6 @@ public final class {{v className/}} {
public static final String VERSION = "{{v version/}}";
private {{v className/}}() {
throw new UnsupportedOperationException("Illegal constructor call.");
// no-op
}
}

View file

@ -39,6 +39,7 @@ public class SampleBuild extends Project {
public void genver() throws Exception {
new GeneratedVersionOperation()
.fromProject(this)
// .projectName("My App")
// .classTemplate(new File(workDirectory, "myversion.txt"))
.execute();
}

View file

@ -1,28 +1,17 @@
/*
* 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(1682736440919L);
public static final String PROJECT = "My App";
public static final Date BUILD_DATE = new Date(1682802935888L);
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-op
}
}

View file

@ -194,7 +194,7 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
* Sets the project name.
*/
public GeneratedVersionOperation projectName(String projectName) {
generatedVersion.setPackageName(projectName);
generatedVersion.setProjectName(projectName);
return this;
}
}