parent
c36bdbf78d
commit
347b676b76
@ -0,0 +1,3 @@
|
||||
SVNRevision = @REPL_REVISION_NR@
|
||||
Version = @REPL_VERSION@
|
||||
|
@ -0,0 +1,40 @@
|
||||
package net.yacy.peers.operation;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public final class yacyBuildProperties {
|
||||
|
||||
private static Properties props = new Properties();
|
||||
|
||||
static {
|
||||
try {
|
||||
props.load(new FileInputStream("defaults/yacyBuild.properties"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
props = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSVNRevision() {
|
||||
if (props == null) return "0";
|
||||
final String revision = props.getProperty("SVNRevision");
|
||||
return revision.contains("@") || revision.contains("$") ? "0" : revision;
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
if (props == null) return "0.1";
|
||||
final String version = props.getProperty("Version");
|
||||
return version.contains("@") ? "0.1" : version;
|
||||
}
|
||||
|
||||
public static final Pattern versionMatcher = Pattern.compile("\\A(\\d+\\.\\d{1,3})(\\d{0,5})\\z");
|
||||
|
||||
public static String getLongVersion() {
|
||||
return String.format(Locale.US, "%.3f%05d", Float.valueOf(getVersion()), Integer.valueOf(getSVNRevision()));
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package net.yacy.peers.operation;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
* Properties set when compiling this release/version
|
||||
*/
|
||||
public final class yacyBuildProperties {
|
||||
private yacyBuildProperties() {
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the SVN-Revision Number as a String
|
||||
*/
|
||||
public static String getSVNRevision() {
|
||||
final String revision = "@REPL_REVISION_NR@";
|
||||
if (revision.contains("@") || revision.contains("$")) {
|
||||
return "0";
|
||||
}
|
||||
return revision;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the version String (e. g. 0.9)
|
||||
*/
|
||||
public static String getVersion() {
|
||||
if ("@REPL_VERSION@".contains("@") ) {
|
||||
return "0.1";
|
||||
}
|
||||
return "@REPL_VERSION@";
|
||||
}
|
||||
|
||||
public static final Pattern versionMatcher = Pattern.compile("\\A(\\d+\\.\\d{1,3})(\\d{0,5})\\z");
|
||||
|
||||
/**
|
||||
* returns the long version String (e. g. 0.9106712)
|
||||
*/
|
||||
public static String getLongVersion() {
|
||||
return String.format(Locale.US, "%.3f%05d", Float.valueOf(getVersion()), Integer.valueOf(getSVNRevision()));
|
||||
}
|
||||
}
|
Loading…
Reference in new issue