diff --git a/build.gradle b/build.gradle index ffc8fe0..8abc193 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ ext { } mainClassName = 'com.webcodepro.applecommander.ui.AppleCommander' -version '1.3.6-BETA' +version "${version}" // Disable default JAR creation jar { @@ -33,7 +33,9 @@ tasks.withType(Javadoc) { tasks.withType(Jar) { manifest { attributes 'Main-Class': 'com.webcodepro.applecommander.ui.AppleCommander' - } + attributes 'Implementation-Title': 'AppleCommander', + 'Implementation-Version': version + } from('LICENSE', 'CONTRIB', 'TODO', 'VERSIONS') } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..716c03b --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +# Universal AppleCommander version number. Used for: +# - Naming JAR file. +# - The build will insert this into a file that is read at run time as well. +version=1.4.0-BETA diff --git a/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java b/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java index 37a9e30..4da4a5e 100644 --- a/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java +++ b/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java @@ -40,8 +40,13 @@ import com.webcodepro.applecommander.util.TextBundle; * @author Rob Greene */ public class AppleCommander { - public static final String VERSION = "1.4.0-BETA"; //$NON-NLS-1$ + public static final String VERSION; private static TextBundle textBundle = UiBundle.getInstance(); + + static { + VERSION = AppleCommander.class.getPackage().getImplementationVersion(); + } + /** * Launch AppleCommander. */