Adding a version to the BT API.

This commit is contained in:
Rob Greene 2018-06-08 22:42:11 -05:00
parent 0a6c669907
commit 9446fe4126
2 changed files with 16 additions and 1 deletions

View File

@ -10,6 +10,15 @@ dependencies {
testImplementation 'junit:junit:4.12'
}
jar {
manifest {
attributes(
'Implementation-Title': 'B/BAS Tokenizer',
'Implementation-Version': "${version} (${new Date().format('yyyy-MM-dd HH:mm')})"
)
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc

View File

@ -1,10 +1,16 @@
package io.github.applecommander.bastokenizer.tools.bt;
import io.github.applecommander.applesingle.AppleSingle;
import io.github.applecommander.bastokenizer.api.BasTokenizer;
import picocli.CommandLine.IVersionProvider;
/** Display version information. Note that this is dependent on Gradle configuration. */
public class VersionProvider implements IVersionProvider {
public String[] getVersion() {
return new String[] { Main.class.getPackage().getImplementationVersion() };
return new String[] {
String.format("BT CLI: %s", Main.class.getPackage().getImplementationVersion()),
String.format("BT API: %s", BasTokenizer.VERSION),
String.format("AppleSingle API: %s", AppleSingle.VERSION)
};
}
}