You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.6 KiB
75 lines
1.6 KiB
13 years ago
|
package net.yacy.peers.operation;
|
||
16 years ago
|
|
||
|
import java.util.Locale;
|
||
14 years ago
|
import java.util.regex.Pattern;
|
||
|
|
||
13 years ago
|
import net.yacy.peers.operation.yacyBuildProperties;
|
||
|
|
||
16 years ago
|
|
||
16 years ago
|
/**
|
||
|
* Properties set when compiling this release/version
|
||
|
*/
|
||
15 years ago
|
public final class yacyBuildProperties {
|
||
16 years ago
|
private yacyBuildProperties() {
|
||
|
}
|
||
|
|
||
16 years ago
|
/**
|
||
|
* returns the SVN-Revision Number as a String
|
||
|
*/
|
||
|
public static String getSVNRevision() {
|
||
14 years ago
|
final String revision = "@REPL_REVISION_NR@";
|
||
|
if (revision.contains("@") || revision.contains("$")) {
|
||
16 years ago
|
return "0";
|
||
|
}
|
||
14 years ago
|
return revision;
|
||
16 years ago
|
}
|
||
|
|
||
16 years ago
|
/**
|
||
|
* returns the version String (e. g. 0.9)
|
||
|
*/
|
||
16 years ago
|
public static String getVersion() {
|
||
14 years ago
|
if ("@REPL_VERSION@".contains("@") ) {
|
||
16 years ago
|
return "0.1";
|
||
|
}
|
||
16 years ago
|
return "@REPL_VERSION@";
|
||
|
}
|
||
|
|
||
14 years ago
|
public static final Pattern versionMatcher = Pattern.compile("\\A(\\d+\\.\\d{1,3})(\\d{0,5})\\z");
|
||
|
|
||
16 years ago
|
/**
|
||
|
* returns the long version String (e. g. 0.9106712)
|
||
|
*/
|
||
|
public static String getLongVersion() {
|
||
14 years ago
|
return String.format(Locale.US, "%.3f%05d", Float.valueOf(getVersion()), Integer.valueOf(getSVNRevision()));
|
||
16 years ago
|
}
|
||
|
|
||
|
/**
|
||
|
* returns the date, when this release was build
|
||
|
*/
|
||
|
public static String getBuildDate() {
|
||
16 years ago
|
if ("@REPL_DATE@".contains("@")) {
|
||
|
return "19700101";
|
||
|
}
|
||
16 years ago
|
return "@REPL_DATE@";
|
||
16 years ago
|
}
|
||
|
|
||
|
/**
|
||
|
* determines, if this release was compiled and installed
|
||
|
* by a package manager
|
||
|
*/
|
||
|
public static boolean isPkgManager() {
|
||
|
return "@REPL_PKGMANAGER@".equals("true");
|
||
|
}
|
||
16 years ago
|
|
||
|
/**
|
||
|
* returns command to use to restart the YaCy daemon,
|
||
|
* when YaCy was installed with a packagemanger
|
||
|
*/
|
||
|
public static String getRestartCmd() {
|
||
16 years ago
|
if ("@REPL_RESTARTCMD@".contains("@")) {
|
||
|
return "echo 'error'";
|
||
|
}
|
||
16 years ago
|
return "@REPL_RESTARTCMD@";
|
||
|
}
|
||
16 years ago
|
}
|