mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
put forceDelete() function to common build scripts, use it in IDEA build script
This commit is contained in:
@@ -35,7 +35,7 @@ target(compile: "Compile project") {
|
||||
loadProject()
|
||||
|
||||
project.stage("Cleaning up sandbox folder")
|
||||
ant.delete(dir: paths.sandbox)
|
||||
forceDelete(paths.sandbox)
|
||||
|
||||
[paths.sandbox, paths.distWin, paths.distAll, paths.distUnix, paths.distMac, paths.artifacts, paths.artifacts_core].each {
|
||||
ant.mkdir(dir: it)
|
||||
|
||||
@@ -195,6 +195,29 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
|
||||
|
||||
})
|
||||
|
||||
binding.setVariable("forceDelete", { String dirPath ->
|
||||
// if wasn't deleted - retry several times
|
||||
attempt = 1
|
||||
while (attempt < 21 && (new File(dirPath).exists())) {
|
||||
if (attempt > 1) {
|
||||
ant.echo "Deleting $dirPath ... (attempt=$attempt)"
|
||||
|
||||
// let's wait a bit and try again - may be help
|
||||
// in some cases on our windows 7 agents
|
||||
sleep(2000)
|
||||
}
|
||||
|
||||
ant.delete(failonerror: false, dir: dirPath)
|
||||
|
||||
attempt++
|
||||
}
|
||||
|
||||
if (new File(dirPath).exists()) {
|
||||
ant.project.log ("Cannot delete directory: $dirPath" )
|
||||
System.exit (1)
|
||||
}
|
||||
})
|
||||
|
||||
binding.setVariable("patchPropertiesFile", { String where ->
|
||||
ant.echo(file: "$where/bin/idea.properties", append: "true", message:
|
||||
isEap() ?
|
||||
|
||||
Reference in New Issue
Block a user