Skip to content

Commit

Permalink
Check if gradle upgrade is cancelled
Browse files Browse the repository at this point in the history
Check if the request to upgrade gradle is cancelled,
right before making any changes to the gradle build files.

See eclipse-jdtls#2415

Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Feb 8, 2023
1 parent fecf51c commit 342caaf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ public static String upgradeGradleVersion(String projectUri, String gradleVersio
properties.setProperty("zipStoreBase", "GRADLE_USER_HOME");
properties.setProperty("zipStorePath", "wrapper/dists");
}
if (monitor.isCanceled()) {
return null;
}
try {
properties.store(new FileOutputStream(propertiesFile), null);
} catch (Exception e) {
Expand All @@ -581,6 +584,7 @@ public static String upgradeGradleVersion(String projectUri, String gradleVersio
} catch (Exception e) {
// Do nothing
}

return propertiesFile.getAbsolutePath();
}

Expand Down

0 comments on commit 342caaf

Please sign in to comment.