jar {
exclude "**/common/**"
manifest {
'Class-Path': <- Need name of commonJar here
}
}
task commonJar(type: Jar) {
from sourceSets.main.output
include '**/common/**'
}
I need the name of the commonJar in the manifest classpath of the other jar. How would I accomplish that.
task commonJar(type: Jar) {
from sourceSets.main.output
include '**/common/**'
}
jar {
exclude "**/common/**"
manifest {
attributes( 'Class-Path': tasks.commonJar.archiveFileName )
}
}
The docs for Manifest.attributes says “The values can be any object. For evaluating the value objects their toString() method is used.” However, the implementation also handles objects of type Provider and calls their get() method instead. The archiveFileName property is a Provider.