Details
-
Type:
Bug
-
Status:
Open
-
Resolution: Unresolved
-
Affects Version/s: 1.0
-
Fix Version/s: None
Description
In a setup where java sources and other resources are kept in the same folder and separated by include directives, the eclipseClasspath task fails to generate a classpathentry node for the actual java sources.
Consider the following build.gradle file:
apply plugin: 'java'
apply plugin: 'eclipse'
sourceSets {
main {
java {
srcDir file('src')
include '**/*.java'
}
resources {
srcDir file('src')
include '**/*.png'
}
}
}
The affected gradle version will generate the following .classpath file:
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="output" path="bin"/> <classpathentry including="**/*.png" kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/> </classpath>
It should generate this instead:
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="output" path="bin"/> <classpathentry including="**/*.java" kind="src" path="src"/> <classpathentry including="**/*.png" kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/> </classpath>
Sorry. As it turns out, Eclipse does not allow multiple classpathentry nodes with the same path attribute. Still, just falling back to the last seen filter setting might not be the way to go.