diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 7e0a3c7..7c26c8e 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -4,5 +4,6 @@
import net.thauvin.erik.semver.Version;
-@Version(major = 1, minor = 0, patch = 0, preRelease = "beta")
+@Version(major = 2, minor = 1, patch = 1, preRelease = "beta")
public class A {
-// ...
@Version(properties = "version.properties")
public class A {
-// ...
+// ...
+ }
# version.properties
version.major=1
@@ -200,7 +203,8 @@ processor will automatically look for it.
@Version(template = "version.mustache")
public class A {
-// ...
+// ...
+ }
The default @@ -479,7 +483,7 @@ keys may be assigned custom values:
@Version(
= "example.properties",
- properties = "example."
+ keysPrefix = "example.",
keysPrefix = "maj",
majorKey = "min",
minorKey = "build",
@@ -488,7 +492,8 @@ class="sourceCode java"> patchKey projectKey = "project"
)
public class Example {
-// ...
# example.properties
example.project=Example
@@ -514,7 +519,7 @@ follows:
class="sourceCode xml">dependency>
<groupId>net.thauvin.erik</groupId>
<artifactId>semver</artifactId>
- <version>1.2.0</version>
+ <version>1.2.1-SNAPSHOT</version>
<dependency> </
Please look at pom.xml @@ -523,24 +528,40 @@ href="https://github.com/ethauvin/semver/tree/master/examples/java">examples/jav directory for a sample:
mvn verify
To install and run from bld, just +add the dependency to your build file:
+public class ExampleBuild extends Project {
+public ExampleBuild() {
+ // ...
+ scope(compile)
+ .include(dependency("net.thauvin.erik", "semver", version(1, 2, 1, "SNAPSHOT")));
+ }
+ }
Please look at ExamapleBuild +in the examples/java/bld +directory for a sample.
To install and run from Gradle, add the following to build.gradle:
-{
- repositories mavenCentral()
- }
-
-{
- dependencies 'net.thauvin.erik:semver:1.2.0'
- annotationProcessor 'net.thauvin.erik:semver:1.2.0'
- compileOnly }
-
-.withType(JavaCompile) {
- tasks.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
- options}
{
+ repositories mavenCentral()
+ }
+
+{
+ dependencies 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
+ annotationProcessor 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
+ compileOnly }
+
+.withType(JavaCompile) {
+ tasks.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
+ options}
The directory containing the configuration files
(version.properties
, version.mustache
) must be
specified using the semver.project.dir
processor
@@ -550,18 +571,18 @@ href="https://github.com/ethauvin/semver/blob/master/examples/java/src/generated
class will be automatically created in the build/generated
directory upon compiling.
Please look at build.gradle +href="https://github.com/ethauvin/semver/blob/master/examples/java/gradle/build.gradle">build.gradle in the examples/java +href="https://github.com/ethauvin/semver/tree/master/examples/java/gradle">examples/java/gradle directory for a sample.
In order to also incorporate the generated source code into the
source tree
, add the following to build.gradle:
.withType(JavaCompile) {
- tasks.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
- options}
.withType(JavaCompile) {
+ tasks.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
+ options}
The GeneratedVersion.java
file will now be located in src/generated
.
src/generated
.
href="https://kotlinlang.org/">Kotlin.
To generate a Kotlin version file, simply specify the
type
as follows:
import net.thauvin.erik.semver.Version
-
-@Version(properties = "version.properties", type="kt")
-open class Main {
-// ...
import net.thauvin.erik.semver.Version
+
+@Version(properties = "version.properties", type="kt")
+open class Main {
+// ...
+ }
The Kotlin default template implements the same static fields and functions as @@ -589,19 +611,19 @@ sample.
To install and run from Gradle, add the following to build.gradle.kts:
-var semverProcessor = "net.thauvin.erik:semver:1.2.0"
-
-{
- dependencies (semverProcessor)
- kapt(semverProcessor)
- compileOnly}
-
-{
- kapt {
- arguments ("semver.project.dir", projectDir)
- arg}
- }
var semverProcessor = "net.thauvin.erik:semver:1.2.1-SNAPSHOT"
+
+{
+ dependencies (semverProcessor)
+ kapt(semverProcessor)
+ compileOnly}
+
+{
+ kapt {
+ arguments ("semver.project.dir", projectDir)
+ arg}
+ }
The directory containing the configuration files
(
+ * To incorporate the generated source code into the source tree, add this directory as an additional source
+ * location in your IDE.
+ */
+ @Override
+ public void compile() throws Exception {
+ var generated = new File(buildDirectory(), "generated");
+ var ignore = generated.mkdir();
+ this.compileOperation().compileOptions().addAll(List.of("-s", generated.getAbsolutePath()));
+ super.compile();
+ }
+
+ @BuildCommand(summary = "Run the example")
+ public void runExample() throws Exception {
+ runOperation().fromProject(this).mainClass("com.example.Example").execute();
+ }
}
diff --git a/examples/java/bld/src/main/java/com/example/App.java b/examples/java/bld/src/main/java/com/example/App.java
index 9875a22..91134b7 100644
--- a/examples/java/bld/src/main/java/com/example/App.java
+++ b/examples/java/bld/src/main/java/com/example/App.java
@@ -13,7 +13,7 @@ public final class App {
* @param args The command line parameters.
*/
public static void main(final String... args) {
- final SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
+ final var sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
System.out.println("-----------------------------------------------------");
diff --git a/examples/java/bld/src/main/java/com/example/Example.java b/examples/java/bld/src/main/java/com/example/Example.java
index 63a4b53..1829d52 100644
--- a/examples/java/bld/src/main/java/com/example/Example.java
+++ b/examples/java/bld/src/main/java/com/example/Example.java
@@ -9,7 +9,7 @@ import java.util.Locale;
keysPrefix = "example.")
public class Example {
public static void main(final String... args) {
- final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
+ final var sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
System.out.println("-- From Example -------------------------------------");
diff --git a/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java b/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java
index 1f3cf42..943ebb0 100644
--- a/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java
+++ b/examples/java/gradle/src/generated/java/com/example/ExampleVersion.java
@@ -9,7 +9,7 @@ import java.util.Date;
public final class ExampleVersion {
public static final String PROJECT = "Java Example";
- public static final Date BUILDDATE = new Date(1692423608415L);
+ public static final Date BUILDDATE = new Date(1692564205424L);
public static final String VERSION = "8.4.97-alpha+T800";
/**
diff --git a/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java b/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java
index 03423f9..28b778b 100644
--- a/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java
+++ b/examples/java/gradle/src/generated/java/com/example/GeneratedVersion.java
@@ -14,7 +14,7 @@ import java.util.Date;
*/
public final class GeneratedVersion {
public static final String PROJECT = "Java App";
-public static final Date BUILDDATE = new Date(1692423608452L);
+public static final Date BUILDDATE = new Date(1692564205452L);
public static final int MAJOR = 11;
public static final int MINOR = 11;
public static final int PATCH = 20;
diff --git a/examples/java/gradle/src/main/java/com/example/App.java b/examples/java/gradle/src/main/java/com/example/App.java
index 9875a22..91134b7 100644
--- a/examples/java/gradle/src/main/java/com/example/App.java
+++ b/examples/java/gradle/src/main/java/com/example/App.java
@@ -13,7 +13,7 @@ public final class App {
* @param args The command line parameters.
*/
public static void main(final String... args) {
- final SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
+ final var sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
System.out.println("-----------------------------------------------------");
diff --git a/examples/java/gradle/src/main/java/com/example/Example.java b/examples/java/gradle/src/main/java/com/example/Example.java
index c8c8c0b..ce7b795 100644
--- a/examples/java/gradle/src/main/java/com/example/Example.java
+++ b/examples/java/gradle/src/main/java/com/example/Example.java
@@ -14,7 +14,7 @@ public final class Example {
* @param args The command line parameters.
*/
public static void main(final String... args) {
- final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
+ final var sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
System.out.println("-- From Example -------------------------------------");
diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar
index e96bdc7..605e3e4 100644
Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
index 5daccca3..3d087eb 100644
--- a/lib/bld/bld-wrapper.properties
+++ b/lib/bld/bld-wrapper.properties
@@ -6,4 +6,4 @@ bld.extensions-testng=com.uwyn.rife2:bld-testng:0.9.1-SNAPSHOT
bld.repositories=MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
bld.sourceDirectories=
-bld.version=1.7.1
+bld.version=1.7.2
diff --git a/src/main/java/net/thauvin/erik/semver/VersionProcessor.java b/src/main/java/net/thauvin/erik/semver/VersionProcessor.java
index 1c9f150..57422d2 100644
--- a/src/main/java/net/thauvin/erik/semver/VersionProcessor.java
+++ b/src/main/java/net/thauvin/erik/semver/VersionProcessor.java
@@ -34,7 +34,6 @@ package net.thauvin.erik.semver;
import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache;
-import com.github.mustachejava.MustacheFactory;
import com.github.mustachejava.MustacheNotFoundException;
import javax.annotation.processing.*;
@@ -79,6 +78,11 @@ public class VersionProcessor extends AbstractProcessor {
return template;
}
+ private Mustache compileTemplate(final File dir, final String template) {
+ final var mf = new DefaultMustacheFactory(dir);
+ return mf.compile(template);
+ }
+
private void error(final String s) {
log(Diagnostic.Kind.ERROR, s);
}
@@ -89,16 +93,16 @@ public class VersionProcessor extends AbstractProcessor {
}
private VersionInfo findValues(final Version version) throws IOException {
- final VersionInfo versionInfo = new VersionInfo(version);
+ final var versionInfo = new VersionInfo(version);
if (!version.properties().isEmpty()) {
- final File propsFile = getLocalFile(version.properties());
+ final var propsFile = getLocalFile(version.properties());
if (propsFile.isFile() && propsFile.canRead()) {
note("Found properties: " + propsFile.getName() + " (" + propsFile.getAbsoluteFile().getParent() + ')');
- final Properties p = new Properties();
+ final var p = new Properties();
- try (InputStreamReader reader = new InputStreamReader(
+ try (var reader = new InputStreamReader(
Files.newInputStream(propsFile.toPath()), StandardCharsets.UTF_8)) {
p.load(reader);
@@ -139,7 +143,7 @@ public class VersionProcessor extends AbstractProcessor {
private File getLocalFile(final String fileName) {
if (processingEnv != null) { // null when testing.
- final String prop = processingEnv.getOptions().get(Constants.SEMVER_PROJECT_DIR_ARG);
+ final var prop = processingEnv.getOptions().get(Constants.SEMVER_PROJECT_DIR_ARG);
if (prop != null) {
return new File(prop, fileName);
}
@@ -181,20 +185,20 @@ public class VersionProcessor extends AbstractProcessor {
*/
@Override
public boolean process(final Set extends TypeElement> annotations, final RoundEnvironment roundEnv) {
- final boolean isLocalTemplate = getLocalFile(Constants.DEFAULT_TEMPLATE_NAME).exists();
+ final var isLocalTemplate = getLocalFile(Constants.DEFAULT_TEMPLATE_NAME).exists();
for (final Element element : roundEnv.getElementsAnnotatedWith(Version.class)) {
- final Version version = element.getAnnotation(Version.class);
+ final var version = element.getAnnotation(Version.class);
if (element.getKind() == ElementKind.CLASS) {
- final Element enclosingElement = element.getEnclosingElement();
+ final var enclosingElement = element.getEnclosingElement();
if (enclosingElement.getKind() == ElementKind.PACKAGE) {
- final PackageElement packageElement = (PackageElement) enclosingElement;
+ final var packageElement = (PackageElement) enclosingElement;
try {
- final VersionInfo versionInfo = findValues(version);
+ final var versionInfo = findValues(version);
if (Constants.EMPTY.equals(version.packageName())) {
versionInfo.setPackageName(packageElement.getQualifiedName().toString());
}
note("Found version: " + versionInfo.getVersion());
- final String template = getTemplate(isLocalTemplate, version);
+ final var template = getTemplate(isLocalTemplate, version);
writeTemplate(version.type(), versionInfo, template);
} catch (IOException | MustacheNotFoundException e) {
@@ -232,28 +236,27 @@ public class VersionProcessor extends AbstractProcessor {
private void writeTemplate(final String type, final VersionInfo versionInfo, final String template)
throws IOException {
- final File dir = getLocalFile("");
- final MustacheFactory mf = new DefaultMustacheFactory(dir);
- final Mustache mustache = mf.compile(template);
+ final var dir = getLocalFile("");
+ final var mustache = compileTemplate(dir, template);
- final String templateName = switch (mustache.getName()) {
+ final var templateName = switch (mustache.getName()) {
case Constants.DEFAULT_JAVA_TEMPLATE -> "default (Java)";
case Constants.DEFAULT_KOTLIN_TEMPLATE -> "default (Kotlin)";
default -> mustache.getName() + " (" + dir.getAbsolutePath() + ')';
};
note("Loaded template: " + templateName);
- final String fileName = versionInfo.getClassName() + '.' + type;
+ final var fileName = versionInfo.getClassName() + '.' + type;
if (Constants.KOTLIN_TYPE.equalsIgnoreCase(type)) {
- final String kaptGenDir = processingEnv.getOptions().get(Constants.KAPT_KOTLIN_GENERATED_OPTION_NAME);
+ final var kaptGenDir = processingEnv.getOptions().get(Constants.KAPT_KOTLIN_GENERATED_OPTION_NAME);
if (kaptGenDir == null) {
throw new IOException("Could not find the target directory for generated Kotlin files.");
}
- final File ktFile = new File(kaptGenDir, fileName);
+ final var ktFile = new File(kaptGenDir, fileName);
if (!ktFile.getParentFile().exists() && !ktFile.getParentFile().mkdirs()) {
note("Could not create target directory: " + ktFile.getParentFile().getAbsolutePath());
}
- try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(ktFile.toPath()),
+ try (var osw = new OutputStreamWriter(Files.newOutputStream(ktFile.toPath()),
StandardCharsets.UTF_8)) {
mustache.execute(osw, versionInfo).flush();
}
@@ -261,7 +264,7 @@ public class VersionProcessor extends AbstractProcessor {
} else {
final FileObject jfo = filer.createSourceFile(
versionInfo.getPackageName() + '.' + versionInfo.getClassName());
- try (Writer writer = jfo.openWriter()) {
+ try (var writer = jfo.openWriter()) {
mustache.execute(writer, versionInfo).flush();
}
note("Generated source: " + fileName + " (" + new File(jfo.getName()).getAbsoluteFile().getParent() + ')');
diff --git a/src/test/java/net/thauvin/erik/semver/ConstantsTest.java b/src/test/java/net/thauvin/erik/semver/ConstantsTest.java
index b6c2907..b407441 100644
--- a/src/test/java/net/thauvin/erik/semver/ConstantsTest.java
+++ b/src/test/java/net/thauvin/erik/semver/ConstantsTest.java
@@ -66,7 +66,7 @@ class ConstantsTest {
templates.add(Constants.DEFAULT_KOTLIN_TEMPLATE);
templates.add(Constants.DEFAULT_TEMPLATE_NAME);
- for (final String tp : templates) {
+ for (final var tp : templates) {
assertTrue(tp.endsWith(".mustache"), tp);
}
}
diff --git a/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java b/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java
index ad3b742..5a05f69 100644
--- a/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java
+++ b/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java
@@ -32,13 +32,16 @@
package net.thauvin.erik.semver;
+import com.github.mustachejava.Mustache;
import org.junit.jupiter.api.Test;
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.Properties;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.*;
/**
* The version.properties
, version.mustache
) must be
specified using the semver.project.dir
processor
diff --git a/examples/java/bld/.idea/app.iml b/examples/java/bld/.idea/app.iml
index 787b59b..082bb1c 100644
--- a/examples/java/bld/.idea/app.iml
+++ b/examples/java/bld/.idea/app.iml
@@ -9,6 +9,7 @@
+ *
+ */
public class ExampleBuild extends Project {
public ExampleBuild() {
pkg = "com.example";
@@ -20,16 +29,29 @@ public class ExampleBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
- scope(compile)
- .include(dependency("net.thauvin.erik", "semver", version(1, 2, 1, "SNAPSHOT")));
- }
-
- @BuildCommand(summary = "Run the example")
- public void runExample() throws Exception {
- runOperation().executeOnce(() -> runOperation().fromProject(this).mainClass("com.example.Example"));
+ scope(compile).include(dependency("net.thauvin.erik", "semver", version(1, 2, 1, "SNAPSHOT")));
}
public static void main(String[] args) {
new ExampleBuild().start(args);
}
+
+ /**
+ * Saves generated source files in the {@code build/generated} directory.
+ * VersionProcessorTest
class.
@@ -49,29 +52,99 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
class VersionProcessorTest {
private final VersionProcessor processor = new VersionProcessor();
- private final Version version = new VersionTest();
+ private final VersionTest version = new VersionTest();
+
+ @SuppressWarnings("PMD.AvoidAccessibilityAlteration")
+ @Test
+ void testCompileTemplate()
+ throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException {
+ final var method = processor.getClass().getDeclaredMethod("compileTemplate", File.class, String.class);
+ method.setAccessible(true);
+
+ final var mustache = (Mustache) method.invoke(processor, new File("src/main/resources"),
+ Constants.DEFAULT_JAVA_TEMPLATE);
+
+ assertEquals(Constants.DEFAULT_JAVA_TEMPLATE, mustache.getName(), Constants.DEFAULT_JAVA_TEMPLATE);
+
+ try (var writer = new StringWriter()) {
+ mustache.execute(writer, version).flush();
+ assertEquals(String.format("""
+ /*
+ * This file is automatically generated.
+ * Do not modify! -- ALL CHANGES WILL BE ERASED!
+ */
+
+ package %s;
+
+ import java.util.Date;
+
+ /**
+ * Provides semantic version information.
+ *
+ * @author Semantic Version Annotation Processor
+ */
+ public final class MyTest {
+ public static final String PROJECT = "%s";
+ public static final Date BUILDDATE = new Date(L);
+ public static final int MAJOR = %d;
+ public static final int MINOR = %d;
+ public static final int PATCH = %d;
+ public static final String PRERELEASE = "%s";
+ public static final String PRERELEASE_PREFIX = "%s";
+ public static final String BUILDMETA = "%s";
+ public static final String BUILDMETA_PREFIX = "%s";
+ public static final String SEPARATOR = "%s";
+ public static final String VERSION = "";
+
+ /**
+ * Disables the default constructor.
+ */
+ private MyTest() {
+ throw new UnsupportedOperationException("Illegal constructor call.");
+ }
+ }
+ """, version.packageName(), version.project(), version.major(), version.minor(), version.patch(),
+ version.preRelease(), version.preReleasePrefix(), version.buildMeta(),
+ version.buildMetaPrefix(), version.separator()),
+ writer.toString());
+ }
+ }
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
@Test
void testFindValues() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
- final Method method = processor.getClass().getDeclaredMethod("findValues", Version.class);
+ final var method = processor.getClass().getDeclaredMethod("findValues", Version.class);
method.setAccessible(true);
- final VersionInfo versionInfo = (VersionInfo) method.invoke(processor, version);
+ final var versionInfo = (VersionInfo) method.invoke(processor, version);
assertEquals("0-0-7:vodka++martini", versionInfo.getVersion(), "getVersion(0-0-7:vodka++martin)");
assertEquals("James Bond", versionInfo.getProject(), "getProject(James Bond)");
}
+ @SuppressWarnings("PMD.AvoidAccessibilityAlteration")
+ @Test
+ void testGetTemplate() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+ final var method = processor.getClass().getDeclaredMethod("getTemplate", boolean.class, Version.class);
+ method.setAccessible(true);
+
+ assertEquals(version.template(), method.invoke(processor, true, version), version.template);
+ version.setTemplate(Constants.DEFAULT_JAVA_TEMPLATE);
+ assertEquals(Constants.DEFAULT_TEMPLATE_NAME, method.invoke(processor, true, version),
+ "default");
+ assertEquals(Constants.DEFAULT_KOTLIN_TEMPLATE, method.invoke(processor, false, version),
+ "kotlin");
+ }
+
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
@Test
void testParseIntProperty() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
- final Properties p = new Properties();
+ final var p = new Properties();
p.setProperty("1", "1");
p.setProperty("2", "2.1");
p.setProperty("3", "zero");
p.setProperty("4", " 4 ");
- final Method method = processor.getClass().getDeclaredMethod("parseIntProperty", Properties.class, String.class,
+ final var method = processor.getClass().getDeclaredMethod("parseIntProperty", Properties.class, String.class,
int.class);
method.setAccessible(true);
diff --git a/src/test/java/net/thauvin/erik/semver/VersionTest.java b/src/test/java/net/thauvin/erik/semver/VersionTest.java
index 0153b1d..e14f359 100644
--- a/src/test/java/net/thauvin/erik/semver/VersionTest.java
+++ b/src/test/java/net/thauvin/erik/semver/VersionTest.java
@@ -43,6 +43,8 @@ import java.lang.annotation.Annotation;
*/
@SuppressWarnings({"ClassExplicitlyAnnotation", "SameReturnValue", "java:S2187", "PMD.TestClassWithoutTestCases"})
class VersionTest implements Version {
+ String template = "myversion.mustache";
+
@Override
public Class extends Annotation> annotationType() {
return null;
@@ -160,11 +162,15 @@ class VersionTest implements Version {
@Override
public String template() {
- return "myversion.mustache";
+ return template;
}
@Override
public String type() {
return "kt";
}
+
+ public void setTemplate(final String template) {
+ this.template = template;
+ }
}