From 974e4bc5e860a9ec469c187567b60141d572a003 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Tue, 30 Mar 2021 10:08:44 +0200 Subject: [PATCH] LUCENE-9880: correct task ordering for clean. --- build.gradle | 2 +- gradle/hacks/{gradle.gradle => wipe-temp.gradle} | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) rename gradle/hacks/{gradle.gradle => wipe-temp.gradle} (87%) diff --git a/build.gradle b/build.gradle index f56dd660f19..c3ffce9c0a6 100644 --- a/build.gradle +++ b/build.gradle @@ -183,6 +183,6 @@ apply from: file('gradle/documentation/markdown.gradle') apply from: file('gradle/documentation/render-javadoc.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/turbocharge-jvm-opts.gradle') diff --git a/gradle/hacks/gradle.gradle b/gradle/hacks/wipe-temp.gradle similarity index 87% rename from gradle/hacks/gradle.gradle rename to gradle/hacks/wipe-temp.gradle index acb93947ac6..2b7e56ad947 100644 --- a/gradle/hacks/gradle.gradle +++ b/gradle/hacks/wipe-temp.gradle @@ -19,13 +19,11 @@ // so that it doesn't pollute user's tmp. Wipe it during a clean though. configure(rootProject) { - task cleanGradleTmp(type: Delete) { - delete fileTree(".gradle/tmp").matching { + gradle.buildFinished { + rootProject.delete fileTree(".gradle/tmp").matching { include "gradle-worker-classpath*" } } - - clean.dependsOn cleanGradleTmp } // Make sure we clean up after running tests. @@ -33,7 +31,7 @@ allprojects { plugins.withType(JavaPlugin) { def temps = [] - task cleanTaskTmp() { + task wipeTaskTemp() { doLast { temps.each { temp -> project.delete fileTree(temp).matching { @@ -44,7 +42,7 @@ allprojects { } tasks.withType(Test) { - finalizedBy rootProject.cleanGradleTmp, cleanTaskTmp + finalizedBy wipeTaskTemp temps += temporaryDir } }