GradleRIO icon indicating copy to clipboard operation
GradleRIO copied to clipboard

Cannot compile projects with a path containing an apostrophe

Open nathanmutin opened this issue 5 years ago • 7 comments

When I try to create a project in a folder containing an apostrophe, this project failed to build. For example, a project named "test" in a folder named "Robo'Lyon" give me this output :

> Task :compileFrcUserProgramExecutableFrcUserProgramCpp FAILED
C:\Users\Nathan\Documents\Robo'Lyon\test\src\main\cpp\Robot.cpp:8:19: fatal error: Robot.h: No such file or directory

nathanmutin avatar Dec 09 '18 13:12 nathanmutin

I'm not actually surprised that has an issue, but that might be an issue internal to Gradle itself. Can you send a few files?

The build.gradle and src folders. Inside the build folder, there is a folder called tmp. Can you send everything from that except for the expandedArchives folder.

ThadHouse avatar Dec 09 '18 15:12 ThadHouse

@nathanmutin out of curiousity, did this work back in eclipse?

ThadHouse avatar Dec 10 '18 00:12 ThadHouse

Through more testing, this is an issue deep inside Gradle that we will likely not be able to fix for the season. So for now, move the project outside of the folder with the special character. We will keep this open in hope of an internal Gradle fix at some point.

ThadHouse avatar Dec 10 '18 03:12 ThadHouse

Maybe I should post the issue on vscode-wpilib so that the project creator refuse paths containing apostrophe ?

nathanmutin avatar Dec 10 '18 16:12 nathanmutin

Sure, you can do that and I'll get to it for the season.

ThadHouse avatar Dec 10 '18 17:12 ThadHouse

Gradle now appears to work with apostrophes in the path, but deploying doesn't update the robotCommand (even though deploy appears successful

echo '/usr/local/frc/JRE/bin/java -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/local/frc/third-party/lib -Djava.lang.invoke.stringConcat=BC_SB  -jar "/home/lvuser/2022'NewCommandJava.jar" ' > /home/lvuser/robotCommand

The apostrophe probably needs to be escaped

sciencewhiz avatar Oct 31 '21 01:10 sciencewhiz