Commit 15bcf188 authored by Jakob Schöttl's avatar Jakob Schöttl

Use Version class in HashGenerator

parent 3a7950ba
...@@ -2,6 +2,8 @@ package org.vadere.simulator.projects.io; ...@@ -2,6 +2,8 @@ package org.vadere.simulator.projects.io;
import org.apache.log4j.LogManager; import org.apache.log4j.LogManager;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.vadere.simulator.entrypoints.Version;
import java.io.InputStream; import java.io.InputStream;
import java.util.Scanner; import java.util.Scanner;
...@@ -9,7 +11,6 @@ public class HashGenerator { ...@@ -9,7 +11,6 @@ public class HashGenerator {
private static Logger logger = LogManager.getLogger(HashGenerator.class); private static Logger logger = LogManager.getLogger(HashGenerator.class);
private static final String CURRENT_RELEASE_NUMBER_RESOURCE = "/current_release_number.txt";
private static final String CURRENT_COMMIT_HASH_RESOURCE = "/current_commit_hash.txt"; private static final String CURRENT_COMMIT_HASH_RESOURCE = "/current_commit_hash.txt";
public static boolean isCommitHashAvailable() { public static boolean isCommitHashAvailable() {
...@@ -28,14 +29,7 @@ public class HashGenerator { ...@@ -28,14 +29,7 @@ public class HashGenerator {
} }
public static String releaseNumber() { public static String releaseNumber() {
String releaseNumber = getFirstStringTokenFromResource(CURRENT_RELEASE_NUMBER_RESOURCE); return Version.latest().label();
if (releaseNumber == null) {
releaseNumber = "warning: no release number";
logger.warn("No release number found. The project will not contain software release version.");
}
return releaseNumber;
} }
private static String getFirstStringTokenFromResource(String resource) { private static String getFirstStringTokenFromResource(String resource) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment