Cordapps now exclude the META-INF of dependencies. (#988)

* Cordapps now exclude the META-INF of dependencies.

* Only exclude files that cause issues with signed JAR detection.
This commit is contained in:
Clinton 2017-07-07 15:37:28 +01:00 committed by GitHub
parent fb0a043485
commit 74c8346863
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
gradlePluginsVersion=0.13.1
gradlePluginsVersion=0.13.2
kotlinVersion=1.1.1
guavaVersion=21.0
bouncycastleVersion=1.57

View File

@ -24,7 +24,11 @@ class Cordformation implements Plugin<Project> {
// Note: project.afterEvaluate did not have full dependency resolution completed, hence a task is used instead
def task = project.task('configureCordappFatJar') {
doLast {
project.tasks.jar.from getDirectNonCordaDependencies(project).collect { project.zipTree(it) }.flatten()
project.tasks.jar.from(getDirectNonCordaDependencies(project).collect { project.zipTree(it)}) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
}
project.tasks.jar.dependsOn task
@ -43,7 +47,7 @@ class Cordformation implements Plugin<Project> {
}, filePathInJar).asFile()
}
static def getDirectNonCordaDependencies(Project project) {
private static def getDirectNonCordaDependencies(Project project) {
def coreCordaNames = ['jfx', 'mock', 'rpc', 'core', 'corda', 'cordform-common', 'corda-webserver', 'finance', 'node', 'node-api', 'node-schemas', 'test-utils', 'jackson', 'verifier', 'webserver', 'capsule', 'webcapsule']
def excludes = coreCordaNames.collect { [group: 'net.corda', name: it] } + [
[group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib'],