LUCENE-9880: correct task ordering for clean.

This commit is contained in:
Dawid Weiss 2021-03-30 10:08:44 +02:00
parent 00e57f8c8a
commit 974e4bc5e8
2 changed files with 5 additions and 7 deletions

View File

@ -183,6 +183,6 @@ apply from: file('gradle/documentation/markdown.gradle')
apply from: file('gradle/documentation/render-javadoc.gradle') apply from: file('gradle/documentation/render-javadoc.gradle')
apply from: file('gradle/hacks/gradle-archives.gradle') apply from: file('gradle/hacks/gradle-archives.gradle')
apply from: file('gradle/hacks/gradle.gradle') apply from: file('gradle/hacks/wipe-temp.gradle')
apply from: file('gradle/hacks/hashmapAssertions.gradle') apply from: file('gradle/hacks/hashmapAssertions.gradle')
apply from: file('gradle/hacks/turbocharge-jvm-opts.gradle') apply from: file('gradle/hacks/turbocharge-jvm-opts.gradle')

View File

@ -19,13 +19,11 @@
// so that it doesn't pollute user's tmp. Wipe it during a clean though. // so that it doesn't pollute user's tmp. Wipe it during a clean though.
configure(rootProject) { configure(rootProject) {
task cleanGradleTmp(type: Delete) { gradle.buildFinished {
delete fileTree(".gradle/tmp").matching { rootProject.delete fileTree(".gradle/tmp").matching {
include "gradle-worker-classpath*" include "gradle-worker-classpath*"
} }
} }
clean.dependsOn cleanGradleTmp
} }
// Make sure we clean up after running tests. // Make sure we clean up after running tests.
@ -33,7 +31,7 @@ allprojects {
plugins.withType(JavaPlugin) { plugins.withType(JavaPlugin) {
def temps = [] def temps = []
task cleanTaskTmp() { task wipeTaskTemp() {
doLast { doLast {
temps.each { temp -> temps.each { temp ->
project.delete fileTree(temp).matching { project.delete fileTree(temp).matching {
@ -44,7 +42,7 @@ allprojects {
} }
tasks.withType(Test) { tasks.withType(Test) {
finalizedBy rootProject.cleanGradleTmp, cleanTaskTmp finalizedBy wipeTaskTemp
temps += temporaryDir temps += temporaryDir
} }
} }