Hi, I have a java project which produces 2 jar files. I'm putting a manifest
into the main jar with a classpath. I need to include the clientJar in the
manifest classpath of the main jar but I can't figure out how to do this.
I've tried adding a dependency in jar to the clientJar task, but this isn't
adding the clientJar to the classpath.
task clientJar(type: Jar, dependsOn: classes) {
from sourceSets.main.classesDir
include clientJarInclude
exclude clientJarExcludeList
baseName = 'core_client'
}
manifestExclusions = ['main', 'appserv-rt.jar', 'expression.jar',
'j2ee.jar', 'quartz.jar', 'xml_utils.jar']
manifestClasspath = sourceSets.main.runtimeClasspath.filter {
it.isFile() && !(it.getName() in manifestExclusions) }
//use doFirst so manifest added at execution time rather than
configuration time (at configuration time some of the JAR's haven't been
built)
jar.doFirst {
manifest {
attributes(
//FIXME I need to add core_client.jar to the manifest
classpath (produced by clientJar task)
"Class-Path": manifestClasspath.collect { File file ->
file.name }.sort().join(' ') )
}
}
--
View this message in context:
http://gradle.1045684.n5.nabble.com/adding-clientJar-to-manifest-classpath-of-Jar-tp3344182p3344182.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