Skip to content

Commit 699b0d8

Browse files
Add META-INF resources to eclipse classpath (#868)
Required for avaje annotations in team code to work with VSCode simulation
1 parent a8028e1 commit 699b0d8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/main/java/org/wpilib/gradlerio/wpi/WPIExtension.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,15 @@ public WPIExtension(Project project) {
9494
eclipseClasspath.getFile().whenMerged(cp -> {
9595
if (cp instanceof org.gradle.plugins.ide.eclipse.model.Classpath ecp) {
9696
List<ClasspathEntry> entries = ecp.getEntries();
97-
// TODO make this grab the build folder dynamically, and include everything else necessary
97+
// TODO make this grab the build folder dynamically
9898
SourceFolder src = new SourceFolder("build/generated/sources/annotationProcessor/java/main", null);
9999
entries.add(src);
100+
// Annotation processors write resources such as META-INF/services to the class output,
101+
// not the generated sources directory. Without them, ServiceLoader-based libraries
102+
// (e.g. avaje-jsonb) fail when run from VS Code, such as with Simulate Robot Code.
103+
SourceFolder res = new SourceFolder("build/classes/java/main", null);
104+
res.setIncludes(List.of("META-INF/**"));
105+
entries.add(res);
100106
}
101107
});
102108

0 commit comments

Comments
 (0)