Added test example.

This commit is contained in:
Erik C. Thauvin 2019-05-25 14:30:33 -07:00
parent 2102691d37
commit c920adf2c5
12 changed files with 512 additions and 0 deletions

View file

@ -0,0 +1,21 @@
/*
* This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED!
*/
package com.example;
import java.util.Date;
public final class ExampleVersion {
public static final String PROJECT = "Java Example";
public static final Date BUILDDATE = new Date(1558819540129L);
public static final String VERSION = "8.4.97-alpha+T800";
/**
* Disables the default constructor.
*/
private ExampleVersion() {
throw new UnsupportedOperationException("Illegal constructor call.");
}
}

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