diff --git a/src/main/resources/semver-kt.mustache b/src/main/resources/semver-kt.mustache index 0a58f86..cf53df5 100644 --- a/src/main/resources/semver-kt.mustache +++ b/src/main/resources/semver-kt.mustache @@ -1,38 +1,38 @@ /* -* This file is automatically generated. -* Do not modify! -- ALL CHANGES WILL BE ERASED! -*/ + * This file is automatically generated. + * Do not modify! -- ALL CHANGES WILL BE ERASED! + */ package {{packageName}} import java.util.Date /** -* Provides semantic version information. -* -* @author Semantic Version Annotation Processor -*/ + * Provides semantic version information. + * + * @author Semantic Version Annotation Processor + */ object {{className}} { -@JvmField -val PROJECT = "{{project}}" -@JvmField -val BUILDDATE = Date({{epoch}}L) -@JvmField -val MAJOR = {{major}} -@JvmField -val MINOR = {{minor}} -@JvmField -val PATCH = {{patch}} -@JvmField -val PRERELEASE = "{{preRelease}}" -@JvmField -val PRERELEASE_PREFIX = "{{preReleasePrefix}}" -@JvmField -val BUILDMETA = "{{buildMeta}}" -@JvmField -val BUILDMEATA_PREFIX = "{{buildMetaPrefix}}" -@JvmField -val SEPARATOR = "{{separator}}" -@JvmField -val VERSION = "{{version}}" + @JvmField + val PROJECT = "{{project}}" + @JvmField + val BUILDDATE = Date({{epoch}}L) + @JvmField + val MAJOR = {{major}} + @JvmField + val MINOR = {{minor}} + @JvmField + val PATCH = {{patch}} + @JvmField + val PRERELEASE = "{{preRelease}}" + @JvmField + val PRERELEASE_PREFIX = "{{preReleasePrefix}}" + @JvmField + val BUILDMETA = "{{buildMeta}}" + @JvmField + val BUILDMEATA_PREFIX = "{{buildMetaPrefix}}" + @JvmField + val SEPARATOR = "{{separator}}" + @JvmField + val VERSION = "{{version}}" } diff --git a/src/main/resources/semver.mustache b/src/main/resources/semver.mustache index cd7c567..d9eb417 100644 --- a/src/main/resources/semver.mustache +++ b/src/main/resources/semver.mustache @@ -1,34 +1,34 @@ /* -* This file is automatically generated. -* Do not modify! -- ALL CHANGES WILL BE ERASED! -*/ + * This file is automatically generated. + * Do not modify! -- ALL CHANGES WILL BE ERASED! + */ package {{packageName}}; import java.util.Date; /** -* Provides semantic version information. -* -* @author Semantic Version Annotation Processor -*/ + * Provides semantic version information. + * + * @author Semantic Version Annotation Processor + */ public final class {{className}} { -public static final String PROJECT = "{{project}}"; -public static final Date BUILDDATE = new Date({{epoch}}L); -public static final int MAJOR = {{major}}; -public static final int MINOR = {{minor}}; -public static final int PATCH = {{patch}}; -public static final String PRERELEASE = "{{preRelease}}"; -public static final String PRERELEASE_PREFIX = "{{preReleasePrefix}}"; -public static final String BUILDMETA = "{{buildMeta}}"; -public static final String BUILDMETA_PREFIX = "{{buildMetaPrefix}}"; -public static final String SEPARATOR = "{{separator}}"; -public static final String VERSION = "{{version}}"; + public static final String PROJECT = "{{project}}"; + public static final Date BUILDDATE = new Date({{epoch}}L); + public static final int MAJOR = {{major}}; + public static final int MINOR = {{minor}}; + public static final int PATCH = {{patch}}; + public static final String PRERELEASE = "{{preRelease}}"; + public static final String PRERELEASE_PREFIX = "{{preReleasePrefix}}"; + public static final String BUILDMETA = "{{buildMeta}}"; + public static final String BUILDMETA_PREFIX = "{{buildMetaPrefix}}"; + public static final String SEPARATOR = "{{separator}}"; + public static final String VERSION = "{{version}}"; -/** -* Disables the default constructor. -*/ -private {{className}}() { -throw new UnsupportedOperationException("Illegal constructor call."); -} + /** + * Disables the default constructor. + */ + private {{className}}() { + throw new UnsupportedOperationException("Illegal constructor call."); + } } diff --git a/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java b/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java index f1a457e..97622d8 100644 --- a/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java +++ b/src/test/java/net/thauvin/erik/semver/VersionProcessorTest.java @@ -71,42 +71,42 @@ class VersionProcessorTest { mustache.execute(writer, version).flush(); assertEquals(String.format(""" /* - * This file is automatically generated. - * Do not modify! -- ALL CHANGES WILL BE ERASED! - */ + * 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 = ""; + * Provides semantic version information. + * + * @author Semantic Version Annotation Processor + */ + public final class %s { + 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."); + /** + * Disables the default constructor. + */ + private %s() { + 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()), + """, version.packageName(), version.className(), version.project(), version.major(), + version.minor(), version.patch(), version.preRelease(), version.preReleasePrefix(), + version.buildMeta(), version.buildMetaPrefix(), version.separator(), version.className()), writer.toString()); } }