Skip to content

Commit

Permalink
Merge branch 'main' into remove-kotlin-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse authored Nov 8, 2024
2 parents 54c3b6f + c2f5e86 commit 850433b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/edu/wpi/first/gradlerio/wpi/WPIExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
import org.gradle.api.provider.Provider;
import org.gradle.internal.os.OperatingSystem;
import org.gradle.nativeplatform.plugins.NativeComponentPlugin;
import org.gradle.plugins.ide.eclipse.EclipsePlugin;
import org.gradle.plugins.ide.eclipse.model.ClasspathEntry;
import org.gradle.plugins.ide.eclipse.model.EclipseClasspath;
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
import org.gradle.plugins.ide.eclipse.model.SourceFolder;

import edu.wpi.first.gradlerio.wpi.java.WPIJavaExtension;
import edu.wpi.first.gradlerio.wpi.cpp.WPINativeExtension;
Expand Down Expand Up @@ -85,6 +90,20 @@ public WPIExtension(Project project) {

project.getPlugins().withType(JavaPlugin.class, p -> {
java = factory.newInstance(WPIJavaExtension.class, project, sim, versions);

project.getPluginManager().apply(EclipsePlugin.class);
EclipseModel eclipse = project.getExtensions().getByType(EclipseModel.class);
EclipseClasspath eclipseClasspath = eclipse.getClasspath();
eclipseClasspath.containers("org.eclipse.buildship.core.gradleclasspathcontainer");
eclipseClasspath.getFile().whenMerged(cp -> {
if (cp instanceof org.gradle.plugins.ide.eclipse.model.Classpath ecp) {
List<ClasspathEntry> entries = ecp.getEntries();
// TODO make this grab the build folder dynamically, and include everything else necessary
SourceFolder src = new SourceFolder("build/generated/sources/annotationProcessor/java/main", null);
entries.add(src);
}
});

});

maven = factory.newInstance(WPIMavenExtension.class, project);
Expand Down

0 comments on commit 850433b

Please sign in to comment.