How can you attach the sources to the compile configuration so that the
eclipse plugin adds the sources (via the sourcepath attribute) to the proper
jar entry in the .classpath file?
>
This should work (it's not pretty) :
task src(type: Copy) {
from {
// Copy the compile configuration and replace the main
artifact with the source artifact for each dep
def conf = configurations.compile.copyRecursive { it
instanceof ExternalModuleDependency }
conf.dependencies.each { dep ->
dep.artifact {
group = dep.group
name = dep.name
version = dep.version
classifier = 'sources'
type = 'jar'
}
}
conf
}
into 'lib/source'
// Add this to clean the target dir first. For Gradle 0.9, you'd
use the Sync task instead
doFirst {
ant.delete(dir: destinationDir)
}
}
--
View this message in context:
http://old.nabble.com/Downloading-*-sources-tp26529227p26945506.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email