Skip to content

Commit

Permalink
simplity gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejohnson7 committed Oct 29, 2023
1 parent 2fb75c8 commit fb245ed
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,16 @@ task("downloadGeoFiles") {
}
}

task("cleanGeoFiles") {
val downloadDir = file(geoFilesDownloadDir)
if(downloadDir.exists()) {
downloadDir.delete();
println("geo-files download cleaned")
}
}

afterEvaluate {
val downloadGeoFilesTask = tasks["downloadGeoFiles"]
val cleanGeoFilesTask = tasks["cleanGeoFiles"]

tasks.forEach {
if (it.name.startsWith("assemble")) {
it.dependsOn(downloadGeoFilesTask)
}
else if (it.name.startsWith("clean")) {
it.dependsOn(cleanGeoFilesTask)
}
}
}

tasks.getByName("clean", type = Delete::class) {
delete(file(geoFilesDownloadDir))
}

0 comments on commit fb245ed

Please sign in to comment.