//println("Not adding duplicate entry "+itPath)
} else {
//println("Adding entry "+itPath)
- cp.entries += new Library(fileReference(itPath))
+ def lib = new Library(fileReference(itPath))
+ // check for source jar
+ def sourcePath = file("${j11sourcesDir}/"+it.name.replaceAll(".jar\$","-sources.jar"))
+ if (sourcePath.exists()) {
+ def refFactory = eclipse.classpath.getFileReferenceFactory();
+ def sourceRef = refFactory.fromFile(sourcePath)
+ lib.setSourcePath(sourceRef)
+ }
+ cp.entries += lib
alreadyAddedLibPath.put(itPath, true)
}
}
} // whenMerged
+ /*
+ withXml {
+ xml ->
+ def node = xml.asNode()
+ node.classpathentry.forEach {
+ if (it.@kind == "lib") {
+ println("LIB "+it.toString())
+ }
+ }
+ }
+ */
+
} // file
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'