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:
12
build.gradle
12
build.gradle
@@ -51,11 +51,13 @@ subprojects {
|
|||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
|
|
||||||
def shadowJar = it.tasks.findByName('shadowJar')
|
afterEvaluate {
|
||||||
if (shadowJar != null && shadowJar.hasProperty('archivePath') && project.name != 'core') {
|
def shadowJar = project.tasks.findByName('shadowJar')
|
||||||
def rootTask = rootProject.tasks.shadowJar
|
if (shadowJar != null && shadowJar.hasProperty('archivePath') && project.name != 'core') {
|
||||||
rootTask.dependsOn shadowJar
|
def rootTask = rootProject.tasks.shadowJar
|
||||||
rootTask.from shadowJar.archivePath
|
rootTask.dependsOn shadowJar
|
||||||
|
rootTask.from shadowJar.archivePath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user