[GRADLE-1727] Artifacts in the new cache has some issues with FileCollections Created: 06/Aug/11 Updated: 04/Jan/13 Resolved: 06/Oct/11 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-4 |
Fix Version/s: | 1.0-milestone-5 |
Type: | Bug | ||
Reporter: | Szczepan Faber | Assignee: | Adam Murdoch |
Resolution: | Fixed | Votes: | 0 |
Description |
New cache format takes advantage of symlinks and this may lead to trouble with the FileCollections. It seems that when the artifact is symlinked it does not play fully fair with FileCollections. See below: FileCollection classpath = ... //contains jars from gradle cache. File fooJar = classpath.find { it.name.startsWith('foo-') } assert fooJar //passes assert fooJar.exists() //passes assert classpath.contains(fooJar) //fails even though the file exists and is found in the collection def newClasspath = classpath - files(fooJar) //has no effect: newClasspath still contains the fooJar For the real-life example see maven.gradle test.doFirst in Gradle codebase. |