diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/Updater.java b/LaunchServer/src/main/java/ru/gravit/launchserver/Updater.java index 1e98784e..a6d57254 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/Updater.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/Updater.java @@ -65,8 +65,8 @@ public void run() { LogHelper.error(e); } } - - private static final Pattern startingVerPattern = Pattern.compile("\\d+\\.\\d+\\.\\d+"); + + private static final Pattern startingVerPattern = Pattern.compile("\\d+\\.\\d+\\.\\d+\\.?\\d*"); private static final Pattern pointPatternSpltitter = Pattern.compile("\\."); private static Version parseVer(String relS) { @@ -75,11 +75,11 @@ private static Version parseVer(String relS) { String[] ver = pointPatternSpltitter.split(relS.substring(verMatcher.start(), verMatcher.end())); if (ver.length < 3) return VERSION; return new Version(Integer.parseInt(ver[0]), Integer.parseInt(ver[1]), - Integer.parseInt(ver[2]), ver.length > 3 ? Integer.parseInt(ver[3]) : 0, findRelType(relS.substring(verMatcher.end()+1))); + Integer.parseInt(ver[2]), ver.length > 3 ? Integer.parseInt(ver[3]) : 0, findRelType(relS.substring(verMatcher.end()))); } private static Type findRelType(String substring) { - if (substring.length() < 3 || substring.isEmpty()) return Type.UNKNOWN; + if (substring.isEmpty()) return Type.UNKNOWN; String tS = substring; if (tS.startsWith("-")) tS = tS.substring(1); final String wrk = tS.toLowerCase(Locale.ENGLISH); diff --git a/build.gradle b/build.gradle index d359fea1..feb4e53f 100644 --- a/build.gradle +++ b/build.gradle @@ -28,4 +28,8 @@ } } +wrapper { + distributionType = Wrapper.DistributionType.ALL +} + defaultTasks 'build' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 75b8c7c8..ee671127 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/libLauncher/src/main/java/ru/gravit/utils/Version.java b/libLauncher/src/main/java/ru/gravit/utils/Version.java index 1f0a0577..87d90be8 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/Version.java +++ b/libLauncher/src/main/java/ru/gravit/utils/Version.java @@ -97,7 +97,7 @@ public enum Type { public static final Map unModTypes = Collections.unmodifiableMap(types); static { - Arrays.asList(values()).stream().forEach(type -> types.put(type.name().substring(0, type.name().length() < 3 ? type.name().length() : 3), type)); + Arrays.asList(values()).stream().forEach(type -> types.put(type.name().substring(0, type.name().length() < 3 ? type.name().length() : 3).toLowerCase(Locale.ENGLISH), type)); } } }