Ignore "-SNAPSHOT" in snapshot build versions

This commit is contained in:
libraryaddict 2019-03-05 17:47:21 +13:00
parent 94f8371772
commit ae9419d234

View File

@ -108,9 +108,9 @@ public class UpdateChecker {
} }
private boolean isNewerVersion(String currentVersion, String newVersion) { private boolean isNewerVersion(String currentVersion, String newVersion) {
// Remove 'v' from string, split by decimal points // Remove 'v' and '-SNAPSHOT' from string, split by decimal points
String[] cSplit = currentVersion.replace("v", "").split("\\."); String[] cSplit = currentVersion.replaceAll("(v)|(-SNAPSHOT)", "").split("\\.");
String[] nSplit = newVersion.replace("v", "").split("\\."); String[] nSplit = newVersion.replaceAll("(v)|(-SNAPSHOT)", "").split("\\.");
// Iterate over the versions from left to right // Iterate over the versions from left to right
for (int i = 0; i < Math.max(cSplit.length, nSplit.length); i++) { for (int i = 0; i < Math.max(cSplit.length, nSplit.length); i++) {