Skip to content

Commit

Permalink
Add some sanitizers for companion app version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
tth05 committed May 20, 2023
1 parent 62ee510 commit c452a8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ if (enableModernJavaSyntax.toBoolean()) {
if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) {
return
}
sourceCompatibility = 17 // for the IDE support
sourceCompatibility = 8 // for the IDE support
options.release.set(8)

javaCompiler.set(javaToolchains.compilerFor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private void downloadCompanionApp(String version) {

TotalDebug.LOGGER.info("Successfully downloaded companion app version {}", version);
} catch (IOException e) {
TotalDebug.LOGGER.error("Unable to download and unzip file", e);
TotalDebug.LOGGER.error("Unable to reach github. Does this release exist? " + version, e);
}
}

Expand Down Expand Up @@ -534,6 +534,11 @@ private void loadNewestCompanionAppVersion() {
}

private static boolean areVersionsCompatible(String totalDebugVersion, String companionAppVersion) {
if (totalDebugVersion.contains("-")) // Dev environment
totalDebugVersion = totalDebugVersion.substring(0, totalDebugVersion.indexOf("-"));
if (companionAppVersion.startsWith("v")) // Migration
companionAppVersion = companionAppVersion.substring(1);

String[] totalDebugVersionSplit = StringUtils.split(totalDebugVersion, '.');
String[] companionAppVersionSplit = StringUtils.split(companionAppVersion, '.');

Expand Down

0 comments on commit c452a8f

Please sign in to comment.