Added test example.
This commit is contained in:
parent
2102691d37
commit
c920adf2c5
12 changed files with 512 additions and 0 deletions
|
@ -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.");
|
||||
}
|
||||
}
|
27
examples/test/src/main/java/com/example/Example.java
Normal file
27
examples/test/src/main/java/com/example/Example.java
Normal 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("-----------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue