Remove HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING

This commit is contained in:
yushijinhun
2018-07-29 19:07:48 +08:00
parent a88c8ed85f
commit e1b6c18017
2 changed files with 3 additions and 4 deletions

View File

@@ -30,9 +30,6 @@ dependencies {
task generateSources(type: Sync) {
from 'src/main/java'
into "$buildDir/generated-src"
filter(ReplaceTokens, tokens: [
'HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING': mavenVersion
])
}
compileJava.setSource "$buildDir/generated-src"

View File

@@ -17,13 +17,15 @@
*/
package org.jackhuang.hmcl;
import java.util.Optional;
/**
* Stores metadata about this application.
*/
public final class Metadata {
private Metadata() {}
public static final String VERSION = System.getProperty("hmcl.version.override", "@HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING@");
public static final String VERSION = System.getProperty("hmcl.version.override", Optional.ofNullable(Metadata.class.getPackage().getImplementationVersion()).orElse("@develop@"));
public static final String NAME = "HMCL";
public static final String TITLE = NAME + " " + VERSION;