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..c0708c2e 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,20 @@ public NativeSimulationTask() { @TaskAction @Override protected void exec() { - if (binaries.size() != 1) { - throw new GradleException("Must have 1 and only 1 binary"); + for (NativeBinarySpec binary : binaries) { + if (!(binary instanceof NativeExecutableBinarySpec)) { + binaries.remove(binary); + } } + + 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();