mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Warn if can't delete dir.
This commit is contained in:
parent
654e5d0f65
commit
d70376b912
1 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,7 @@ import com.beust.kobalt.maven.*
|
||||||
import com.beust.kobalt.misc.KFiles
|
import com.beust.kobalt.misc.KFiles
|
||||||
import com.beust.kobalt.misc.KobaltExecutors
|
import com.beust.kobalt.misc.KobaltExecutors
|
||||||
import com.beust.kobalt.misc.log
|
import com.beust.kobalt.misc.log
|
||||||
|
import com.beust.kobalt.misc.warn
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -77,7 +78,11 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
||||||
|
|
||||||
@Task(name = TASK_CLEAN, description = "Clean the project", runBefore = arrayOf("compile"))
|
@Task(name = TASK_CLEAN, description = "Clean the project", runBefore = arrayOf("compile"))
|
||||||
fun taskClean(project : Project ) : TaskResult {
|
fun taskClean(project : Project ) : TaskResult {
|
||||||
java.io.File(project.buildDirectory).deleteRecursively()
|
java.io.File(project.directory, project.buildDirectory).let { dir ->
|
||||||
|
if (! dir.deleteRecursively()) {
|
||||||
|
warn("Couldn't delete $dir")
|
||||||
|
}
|
||||||
|
}
|
||||||
return TaskResult()
|
return TaskResult()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue