Add bld example

This commit is contained in:
Erik C. Thauvin 2023-08-18 23:52:02 -07:00
parent 0ec7a6ee13
commit 11a47e7e0b
64 changed files with 425 additions and 54 deletions

View file

@ -0,0 +1,31 @@
package com.example;
import net.thauvin.erik.semver.Version;
import java.text.SimpleDateFormat;
import java.util.Locale;
@Version(properties = "version.properties")
public final class App {
/**
* Command line interface.
*
* @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);
System.out.println("-----------------------------------------------------");
System.out.println(" Version: " + GeneratedVersion.PROJECT + ' ' + GeneratedVersion.VERSION);
System.out.println(" Built on: " + sdf.format(GeneratedVersion.BUILDDATE));
System.out.println(" Major: " + GeneratedVersion.MAJOR);
System.out.println(" Minor: " + GeneratedVersion.MINOR);
System.out.println(" Patch: " + GeneratedVersion.PATCH);
System.out.println(" PreRelease: " + GeneratedVersion.PRERELEASE);
System.out.println(" BuildMetaData: " + GeneratedVersion.BUILDMETA);
System.out.println("-----------------------------------------------------");
}
}

View file

@ -0,0 +1,27 @@
package com.example;
import net.thauvin.erik.semver.Version;
import java.text.SimpleDateFormat;
import java.util.Locale;
@Version(properties = "example.properties", template = "example.mustache", className = "ExampleVersion",
keysPrefix = "example.")
public final class Example {
/**
* Command line interface.
*
* @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);
System.out.println("-- From Example -------------------------------------");
System.out.println(" " + ExampleVersion.PROJECT + ' ' + ExampleVersion.VERSION
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
System.out.println("-----------------------------------------------------");
}
}