diff --git a/ToolchainPlugin/build.gradle b/ToolchainPlugin/build.gradle index 93989bdd..aab40c3c 100644 --- a/ToolchainPlugin/build.gradle +++ b/ToolchainPlugin/build.gradle @@ -18,7 +18,7 @@ dependencies { // For some utility classes. We don't actually apply DeployUtils to the FRCToolchain, // but we do in GradleRIO api 'edu.wpi.first:DeployUtils:2025.2.0' - api 'de.undercouch:gradle-download-task:4.0.1' + api 'de.undercouch:gradle-download-task:5.6.0' testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0') { exclude group: 'org.codehaus.groovy' diff --git a/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/DefaultToolchainInstaller.java b/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/DefaultToolchainInstaller.java index dd12eee3..673fff5f 100644 --- a/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/DefaultToolchainInstaller.java +++ b/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/DefaultToolchainInstaller.java @@ -11,6 +11,7 @@ import java.io.File; import java.io.IOException; import java.net.URL; +import java.util.concurrent.ExecutionException; public class DefaultToolchainInstaller extends AbstractToolchainInstaller { @@ -39,9 +40,14 @@ public void install(Project project) { action.src(source); action.dest(dst); action.overwrite(false); - action.execute(); + action.retries(1); + action.execute().get(); } catch (IOException e) { throw new GradleException("Could not download toolchain", e); + } catch (InterruptedException e) { + throw new GradleException("Could not download toolchain, interrupted", e); + } catch (ExecutionException e) { + throw new GradleException("Could not download toolchain, failed", e); } if (action.isUpToDate()) { diff --git a/build.gradle b/build.gradle index 26d704a8..6250baf8 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ java { allprojects { group = "edu.wpi.first" - version = "2025.12.4" + version = "2026.0.0" if (project.hasProperty('publishVersion')) { version = project.publishVersion diff --git a/src/main/java/edu/wpi/first/nativeutils/vendordeps/VendorDepTask.java b/src/main/java/edu/wpi/first/nativeutils/vendordeps/VendorDepTask.java index c0a1efa7..c0e8ffa0 100644 --- a/src/main/java/edu/wpi/first/nativeutils/vendordeps/VendorDepTask.java +++ b/src/main/java/edu/wpi/first/nativeutils/vendordeps/VendorDepTask.java @@ -6,6 +6,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.util.concurrent.ExecutionException; import org.gradle.api.DefaultTask; import org.gradle.api.file.Directory; @@ -39,10 +40,12 @@ public void update() { /** * Installs the JSON file - * @throws java.io.IOException throws on ioexception + * @throws ExecutionException if completed exceptionally + * @throws InterruptedException if cancelled + * @throws IOException if the download fails */ @TaskAction - public void install() throws IOException { + public void install() throws IOException, InterruptedException, ExecutionException { if (update) { Gson gson = new GsonBuilder().create(); Object property = getProject().findProperty(WPIVendorDepsExtension.NATIVEUTILS_VENDOR_FOLDER_PROPERTY); @@ -167,10 +170,13 @@ private void copyLocal(String filename, Path dest) { /** * Download a vendor JSON file from a URL * @param dest the destination file + * @throws ExecutionException if completed exceptionally + * @throws InterruptedException if cancelled + * @throws IOException if the download fails */ - private void downloadRemote(Path dest) throws IOException { + private void downloadRemote(Path dest) throws IOException, InterruptedException, ExecutionException { downloadAction.src(url); downloadAction.dest(dest.toFile()); - downloadAction.execute(); + downloadAction.execute().get(); } } diff --git a/testing/cpp/build.gradle b/testing/cpp/build.gradle index 67ee1052..22b25c02 100644 --- a/testing/cpp/build.gradle +++ b/testing/cpp/build.gradle @@ -3,7 +3,7 @@ import edu.wpi.first.nativeutils.vendordeps.WPIVendorDepsPlugin plugins { id "cpp" - id "edu.wpi.first.NativeUtils" version "2025.12.4" + id "edu.wpi.first.NativeUtils" version "2026.0.0" } nativeUtils.addWpiNativeUtils()