From 16fbf1c9cd0e30d5c12be54ca0e6fa41e63581b4 Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Fri, 24 Nov 2023 14:27:21 +0800 Subject: [PATCH 1/4] initial implementation idea --- .../first/gradlerio/simulation/NativeSimulationTask.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java b/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java index 1b4c88b9..e675a361 100644 --- a/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java +++ b/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java @@ -49,9 +49,16 @@ public NativeSimulationTask() { @TaskAction @Override protected void exec() { + for (NativeBinarySpec binary : binaries) { + if (!(binary instanceof NativeExecutableBinarySpec)) { + binaries.remove(binary); + } + } + if (binaries.size() != 1) { - throw new GradleException("Must have 1 and only 1 binary"); + throw new GradleException("Must have 1 and only 1 binary"); } + NativeExecutableBinarySpec binary = (NativeExecutableBinarySpec)binaries.get(0); InstallExecutable install = (InstallExecutable)binary.getTasks().getInstall(); From 7884715433de2df531f9ba5f6192bf699c85a607 Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Fri, 24 Nov 2023 14:39:43 +0800 Subject: [PATCH 2/4] improve error message --- .../first/gradlerio/simulation/NativeSimulationTask.java | 6 +++++- testing/asm/build.gradle | 2 +- testing/cpp/build.gradle | 2 +- testing/java/build.gradle | 2 +- testing/jni/build.gradle | 2 +- testing/kotlin/build.gradle | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java b/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java index e675a361..c0708c2e 100644 --- a/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java +++ b/src/main/java/edu/wpi/first/gradlerio/simulation/NativeSimulationTask.java @@ -55,10 +55,14 @@ protected void exec() { } } - if (binaries.size() != 1) { + if (binaries.size() != 1 && binaries.size() != 0) { throw new GradleException("Must have 1 and only 1 binary"); } + if (binaries.size() == 0) { + throw new GradleException("No binaries found, maybe your project isn't an executable?"); + } + NativeExecutableBinarySpec binary = (NativeExecutableBinarySpec)binaries.get(0); InstallExecutable install = (InstallExecutable)binary.getTasks().getInstall(); diff --git a/testing/asm/build.gradle b/testing/asm/build.gradle index 32775fc0..5ae562c6 100644 --- a/testing/asm/build.gradle +++ b/testing/asm/build.gradle @@ -1,7 +1,7 @@ plugins { id "assembler" - id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" } def projectFolder = project.buildFile.parentFile diff --git a/testing/cpp/build.gradle b/testing/cpp/build.gradle index ebfa1bf6..08ac4849 100644 --- a/testing/cpp/build.gradle +++ b/testing/cpp/build.gradle @@ -2,7 +2,7 @@ plugins { id "cpp" id "google-test-test-suite" - id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" } def projectFolder = project.buildFile.parentFile diff --git a/testing/java/build.gradle b/testing/java/build.gradle index 7d2c6cbc..e97d229c 100644 --- a/testing/java/build.gradle +++ b/testing/java/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" } def projectFolder = project.buildFile.parentFile diff --git a/testing/jni/build.gradle b/testing/jni/build.gradle index c22859a7..137d6faf 100644 --- a/testing/jni/build.gradle +++ b/testing/jni/build.gradle @@ -1,7 +1,7 @@ plugins { id "java" id "cpp" - id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" id 'edu.wpi.first.GradleJni' version '0.10.1' } diff --git a/testing/kotlin/build.gradle b/testing/kotlin/build.gradle index 207f8636..5928b1f9 100644 --- a/testing/kotlin/build.gradle +++ b/testing/kotlin/build.gradle @@ -1,6 +1,6 @@ plugins { id "org.jetbrains.kotlin.jvm" version "1.3.50" - id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" } def ROBOT_MAIN_CLASS = "frc.team0000.robot.MainKt" From 48d746fe769ba10218e9ef24adb1f18d71e8b8f3 Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Fri, 24 Nov 2023 15:59:07 +0800 Subject: [PATCH 3/4] fix publish still not working --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5983a0ec..4fd91a18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version = 2024.1.1-beta-3 +version = 2024.1.2-beta-3 From 44eb6a71ba4592bce891bd45515d60f460e73484 Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Mon, 27 Nov 2023 09:35:39 +0800 Subject: [PATCH 4/4] fix versions --- gradle.properties | 2 +- testing/asm/build.gradle | 2 +- testing/cpp/build.gradle | 2 +- testing/java/build.gradle | 2 +- testing/jni/build.gradle | 2 +- testing/kotlin/build.gradle | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4fd91a18..5983a0ec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version = 2024.1.2-beta-3 +version = 2024.1.1-beta-3 diff --git a/testing/asm/build.gradle b/testing/asm/build.gradle index 5ae562c6..32775fc0 100644 --- a/testing/asm/build.gradle +++ b/testing/asm/build.gradle @@ -1,7 +1,7 @@ plugins { id "assembler" - id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" } def projectFolder = project.buildFile.parentFile diff --git a/testing/cpp/build.gradle b/testing/cpp/build.gradle index 08ac4849..ebfa1bf6 100644 --- a/testing/cpp/build.gradle +++ b/testing/cpp/build.gradle @@ -2,7 +2,7 @@ plugins { id "cpp" id "google-test-test-suite" - id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" } def projectFolder = project.buildFile.parentFile diff --git a/testing/java/build.gradle b/testing/java/build.gradle index e97d229c..7d2c6cbc 100644 --- a/testing/java/build.gradle +++ b/testing/java/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" } def projectFolder = project.buildFile.parentFile diff --git a/testing/jni/build.gradle b/testing/jni/build.gradle index 137d6faf..c22859a7 100644 --- a/testing/jni/build.gradle +++ b/testing/jni/build.gradle @@ -1,7 +1,7 @@ plugins { id "java" id "cpp" - id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" id 'edu.wpi.first.GradleJni' version '0.10.1' } diff --git a/testing/kotlin/build.gradle b/testing/kotlin/build.gradle index 5928b1f9..207f8636 100644 --- a/testing/kotlin/build.gradle +++ b/testing/kotlin/build.gradle @@ -1,6 +1,6 @@ plugins { id "org.jetbrains.kotlin.jvm" version "1.3.50" - id "edu.wpi.first.GradleRIO" version "2024.1.2-beta-3" + id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" } def ROBOT_MAIN_CLASS = "frc.team0000.robot.MainKt"