diff --git a/gradle/build-complete.gradle b/gradle/build-complete.gradle index fcb3d27bfde58..86ad6d4504312 100644 --- a/gradle/build-complete.gradle +++ b/gradle/build-complete.gradle @@ -3,36 +3,36 @@ import java.nio.file.Files String buildNumber = System.getenv('BUILD_NUMBER') if (buildNumber) { - File uploadFile = file("build/${buildNumber}.tar.bz2") - project.gradle.buildFinished { result -> - println "build complete, generating: $uploadFile" - if (uploadFile.exists()) { - project.delete(uploadFile) - } - - try { - ant.tar(destfile: uploadFile, compression: "bzip2", longfile: "gnu") { - fileset(dir: projectDir) { - fileTree(projectDir) - .include("**/*.hprof") - .include("**/reaper.log") - .include("**/build/testclusters/**") - .exclude("**/build/testclusters/**/data/**") - .exclude("**/build/testclusters/**/distro/**") - .exclude("**/build/testclusters/**/repo/**") - .exclude("**/build/testclusters/**/extract/**") - .filter { Files.isRegularFile(it.toPath()) } - .each { - include(name: projectDir.toPath().relativize(it.toPath())) - } - } + File uploadFile = file("build/${buildNumber}.tar.bz2") + project.gradle.buildFinished { result -> + println "build complete, generating: $uploadFile" + if (uploadFile.exists()) { + project.delete(uploadFile) + } - fileset(dir: "${gradle.gradleUserHomeDir}/daemon/${gradle.gradleVersion}", followsymlinks: false) { - include(name: "**/daemon-${ProcessHandle.current().pid()}*.log") - } + try { + ant.tar(destfile: uploadFile, compression: "bzip2", longfile: "gnu") { + fileset(dir: projectDir) { + fileTree(projectDir) + .include("**/*.hprof") + .include("**/reaper.log") + .include("**/build/testclusters/**") + .exclude("**/build/testclusters/**/data/**") + .exclude("**/build/testclusters/**/distro/**") + .exclude("**/build/testclusters/**/repo/**") + .exclude("**/build/testclusters/**/extract/**") + .filter { Files.isRegularFile(it.toPath()) } + .each { + include(name: projectDir.toPath().relativize(it.toPath())) } - } catch (Exception e) { - logger.lifecycle("Failed to archive additional logs", e) } + + fileset(dir: "${gradle.gradleUserHomeDir}/daemon/${gradle.gradleVersion}", followsymlinks: false) { + include(name: "**/daemon-${ProcessHandle.current().pid()}*.log") + } + } + } catch (Exception e) { + logger.lifecycle("Failed to archive additional logs", e) } + } }