Added build time to version info, cleanup manifest files;

This commit is contained in:
Oleg Agafonov 2018-12-15 18:29:10 +04:00
parent 498edb4138
commit 0a2f312da7
19 changed files with 243 additions and 205 deletions

View file

@ -3,7 +3,6 @@ package mage.utils;
import java.io.Serializable;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class MageVersion implements Serializable, Comparable<MageVersion> {
@ -14,22 +13,30 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 32;
public final static String MAGE_EDITION_INFO = ""; // set "-beta" for 1.4.32-betaV0
public final static String MAGE_VERSION_MINOR_PATCH = "V0";
public final static String MAGE_VERSION_INFO = "";
private final int major;
private final int minor;
private final int patch;
private final String minorPatch; // doesn't matter for compatibility
private final String buildTime;
private String editionInfo;
private final boolean showBuildTime = true;
private String info = "";
public MageVersion(Class sourceClass) {
this(MAGE_VERSION_MAJOR, MAGE_VERSION_MINOR, MAGE_VERSION_PATCH, MAGE_VERSION_MINOR_PATCH, MAGE_EDITION_INFO, sourceClass);
}
public MageVersion(int major, int minor, int patch, String minorPatch, String info) {
public MageVersion(int major, int minor, int patch, String minorPatch, String editionInfo, Class sourceClass) {
this.major = major;
this.minor = minor;
this.patch = patch;
this.minorPatch = minorPatch;
this.info = info;
this.editionInfo = editionInfo;
// build time
this.buildTime = showBuildTime ? JarVersion.getBuildTime(sourceClass) : "";
}
public int getMajor() {
@ -50,7 +57,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
@Override
public String toString() {
return major + "." + minor + '.' + patch + info + minorPatch;
// 1.4.32-betaV0 (build: time)
return major + "." + minor + '.' + patch + editionInfo + minorPatch + (!this.buildTime.isEmpty() ? " (build: " + this.buildTime + ")" : "");
}
@Override
@ -64,7 +72,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
if (patch != o.patch) {
return patch - o.patch;
}
return info.compareTo(o.info);
return editionInfo.compareTo(o.editionInfo);
}
}