[GRADLE-825] Using same directory for sources and resources creates duplicate src entry in .classpath file Created: 17/Feb/10  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: René Gröschke (Inactive) Assignee: Adam Murdoch
Resolution: Fixed Votes: 0


 Description   

When running eclipseCp task for a java plugin based build file with a custom sourceset definition like the following:

sourceSets.main.java.srcDirs = ['src']
sourceSets.main.resources.srcDirs = ['src']

creates a duplicate classpath entry element with kind='src' and path ='src'.
The generated .classpath file with this duplicate src definition ends up in an error message in eclipse:

"Build path contains duplicate entry: 'src' for project 'ProjA'"


 Comments   
Comment by René Gröschke (Inactive) [ 17/Feb/10 ]

as workaround I've added the following code to my buildfile:

eclipseCp.doFirst{
	eclipseCp.srcDirs = sourceSets.main.java.srcDirs as List
}
Comment by René Gröschke (Inactive) [ 20/Feb/10 ]

I've pushed a tiny bugfix (with adjusted test file) for that issue to http://github.com/breskeby/gradle/tree/GRADLE-825

Comment by Adam Murdoch [ 21/Feb/10 ]

Applied. Thanks for the patch

Comment by René Gröschke (Inactive) [ 14/Mar/10 ]

Andrew Schetinin posted problems with duplicate src dir entries with the 0.9-20100313081549+0300 snapshot on the mailing list. I evaluated this issue and there are still problems. The patch I have submitted in february only filters duplicate srcDirs and testSrcDir when using the setter of these properties in EclipseClasspathTask.

Comment by René Gröschke (Inactive) [ 14/Mar/10 ]

I've pushed a modified patch for that issue to http://github.com/breskeby/gradle/tree/GRADLE-825

Comment by Adam Murdoch [ 15/Mar/10 ]

I've applied the updated patch.

Generated at Wed Jun 30 11:39:53 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.