Fix :shadowJar task. Take 2.

This time, wait for the subprojects to be evaluated before trying
to get their shadowJar tasks (otherwise they won't be there).
This commit is contained in:
Jonas Herzig
2019-05-06 13:31:50 +02:00
parent 1d21002eb0
commit 2094c518a0

View File

@@ -51,12 +51,14 @@ subprojects {
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
def shadowJar = it.tasks.findByName('shadowJar') afterEvaluate {
def shadowJar = project.tasks.findByName('shadowJar')
if (shadowJar != null && shadowJar.hasProperty('archivePath') && project.name != 'core') { if (shadowJar != null && shadowJar.hasProperty('archivePath') && project.name != 'core') {
def rootTask = rootProject.tasks.shadowJar def rootTask = rootProject.tasks.shadowJar
rootTask.dependsOn shadowJar rootTask.dependsOn shadowJar
rootTask.from shadowJar.archivePath rootTask.from shadowJar.archivePath
} }
}
} }
// Workaround specific to CI build to guarantee correct ordering of // Workaround specific to CI build to guarantee correct ordering of