Trigger custom clean tasks whenever running "./gradlew clean"

A cleaned tree is now much closer to a pristine tree that has just
been checked out and never built.  The only extra created files that
are left behind are ".gradle", "buildSrc/.gradle", and
"buildSrc/build".
This commit is contained in:
Ben Liblit 2018-01-28 15:27:35 -06:00
parent 51cef18bc9
commit da90d1cf5a
7 changed files with 29 additions and 0 deletions

View File

@ -25,3 +25,4 @@ task verifyJLex(type: VerifyWithStamp, dependsOn: downloadJLex) {
}
compileTestJava.dependsOn verifyJLex
clean.dependsOn cleanDownloadJLex

View File

@ -38,6 +38,7 @@ task cleanUnpackNodeJSLib(type: Delete) {
}
processResources.dependsOn unpackNodeJSLib
clean.dependsOn cleanUnpackNodeJSLib
sourceSets.main {
java.srcDirs = ['src']

View File

@ -24,3 +24,10 @@ test {
environment 'TRAVIS', 1
maxHeapSize = '800M'
}
task cleanTest(type: Delete) {
delete 'actual.dump'
delete 'expected.dump'
}
clean.dependsOn cleanTest

View File

@ -103,3 +103,4 @@ task copyJarsIntoLib(type: Sync) {
}
assemble.dependsOn copyJarsIntoLib
clean.dependsOn cleanCopyJarsIntoLib

View File

@ -45,6 +45,8 @@ task cleanExtractBcel(type: Delete) {
delete files(extractBcel)[0]
}
clean.dependsOn cleanExtractBcel
////////////////////////////////////////////////////////////////////////
@ -67,6 +69,8 @@ task verifyJavaCup(type: VerifyWithStamp, dependsOn: downloadJavaCup) {
checksum '2bda8c40abd0cbc295d3038643d6e4ec'
}
clean.dependsOn cleanDownloadJavaCup
////////////////////////////////////////////////////////////////////////
//
@ -84,6 +88,8 @@ task cleanCollectJLex(type: Delete) {
delete collectJLex
}
clean.dependsOn cleanCollectJLex
////////////////////////////////////////////////////////////////////////
//
@ -123,8 +129,11 @@ task generateHelloHash(type: JavaExec, dependsOn: unpackOcamlJava) {
task cleanGenerateHelloHash(type: Delete) {
delete generateHelloHash
delete fileTree('ocaml') { exclude '*.ml' }
}
clean.dependsOn cleanGenerateHelloHash
////////////////////////////////////////////////////////////////////////
//
@ -144,6 +153,8 @@ task cleanCollectTestData(type: Delete) {
delete collectTestData
}
clean.dependsOn cleanCollectTestData
////////////////////////////////////////////////////////////////////////
//

View File

@ -41,3 +41,9 @@ test {
exclude '**/GetTargetsTest.class'
exclude '**/PruneArrayOutOfBoundExceptionEdge.class'
}
task cleanTest(type: Delete) {
delete 'report'
}
clean.dependsOn cleanTest

View File

@ -50,6 +50,8 @@ task copyDxJar(type: Sync) {
into 'lib'
}
clean.dependsOn cleanCopyDxJar
processTestResources {
dependsOn cloneDroidBench
dependsOn copyDxJar