Open BR88C opened 1 week ago
bin/generated-sources/
This is not a directory generated by Gradle. Generated sources are in build/generated/sources, which you report are correct. I don't know what would be generating this bin directory, nor why it would be included in the build and apparently overriding the correct files
Thats the folder where the redhat Java extension compiles into. When running the debugger, it uses those files, and not the Jar compiled by gradle. We don't control that behavior.
potential related issue: https://github.com/redhat-developer/vscode-java/issues/2981
Generated Epilogue logging classes unpredictably throw runtime errors.
Project setup
Robot.java
```java @Logged public final class Robot extends TimedRobot { private final ExampleSubsystem exampleSubsystem; public Robot() { exampleSubsystem = new ExampleSubsystem(); } @Override public void robotPeriodic() { Epilogue.update(this); } } ```ExampleSubsystem.java
```java @Logged public class ExampleSubsystem extends SubsystemBase { private int foo = 0; public void setFoo(int newFoo) { foo = newFoo; } public int getFoo() { return foo; } } ```This example when run in simulation typically throws an error at startup.
The behavior is sporadic; making a code change and rebuilding + restarting the simulation will occasionally fix the issue temporarily.
./gradlew clean
has also occasionally solved it, at worst I have gone as far as manually purging all build directories (.gradle/
,bin/
,build/
) to resolve runtime errors. Repeatedly rebuilding without any intervention does not mitigate the issue. IfExampleSubsystem
is excluded, issues are much more seldom but still occur. Runtime errors are sensibly reflected inbin/generated-sources/
, but interestingly artifacts inbuild/generated/sources/
never have problems. I'm not an expert on how annotation processors and gradle interact in the slightest, however my blind intuition is that there exists a race condition between Epilogue finishing logger generation and gradle compiling.Desktop
build.gradle
:wpi.maven.useLocal = false wpi.maven.useDevelopment = true wpi.versions.wpilibVersion = '2025.+' wpi.versions.wpimathVersion = '2025.+'
// ...
dependencies { annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() // ... }
Project Version: 2025.0.0-alpha-2 VS Code Version: 1.85.1 WPILib Extension Version: 2024.3.2 C++ Extension Version: 1.20.0 Java Extension Version: 1.26.2023121408 Java Debug Extension Version: 0.55.2023121302 Java Dependencies Extension Version 0.23.2023120100 Java Version: 17 Java Location: C:\Users\Public\wpilib\2024\jdk Vendor Libraries: WPILib-New-Commands (1.0.0)