diff --git a/build.gradle b/build.gradle index 73a9d578bd3..39b64b83f8e 100644 --- a/build.gradle +++ b/build.gradle @@ -583,7 +583,7 @@ def createCheckTypeTask(projectName, taskName, checker, args = []) { outputs.upToDateWhen { false } source = project("${projectName}").sourceSets.main.java classpath = files(project("${projectName}").compileJava.classpath,project(':checker-qual').sourceSets.main.output) - destinationDirectory = file("${buildDir}") + destinationDirectory = file("${layout.buildDirectory.get().asFile}") options.annotationProcessorPath = files(project(':checker').tasks.shadowJar.archiveFile) options.compilerArgs += [ @@ -769,7 +769,7 @@ task downloadJtreg(type: Download) { // dest new File(buildDir, 'jtreg-4.2.0-tip.tar.gz') // src 'https://builds.shipilev.net/jtreg/jtreg4.2-b16.zip' src 'https://builds.shipilev.net/jtreg/jtreg-7.5+1.zip' - dest new File(buildDir, 'jtreg.zip') + dest new File(layout.buildDirectory.asFile.get(), 'jtreg.zip') overwrite true retries 3 @@ -1061,7 +1061,7 @@ subprojects { def isFramework = project.name.is('framework') def isChecker = project.name.is('checker') - String jtregOutput = "${buildDir}/jtreg" + String jtregOutput = "${layout.buildDirectory.get().asFile}/jtreg" String name = 'all' String tests = '.' diff --git a/checker/build.gradle b/checker/build.gradle index 4d7e95d65be..0bc6fb722e8 100644 --- a/checker/build.gradle +++ b/checker/build.gradle @@ -272,9 +272,9 @@ clean { } clean.doLast { - while (buildDir.exists()) { + while (layout.buildDirectory.asFile.get().exists()) { sleep(10000) // wait 10 seconds - buildDir.deleteDir() + layout.buildDirectory.deleteDir() } } @@ -383,7 +383,8 @@ task jtregJdk11Tests(dependsOn: ':downloadJtreg', group: 'Verification') { def injected = project.objects.newInstance(InjectedExecOps) - String jtregOutput = "${buildDir}/jtregJdk11" + String jtregOutput = "${layout.buildDirectory.get().asFile}/jtregJdk11" + String name = 'all' doLast { if (isJava8) { @@ -470,7 +471,7 @@ task ainferTestCheckerGenerateStubs(type: Test) { dependsOn(compileTestJava) doFirst { delete('tests/ainfer-testchecker/annotated') - delete("${buildDir}/ainfer-testchecker/") + delete("${layout.buildDirectory.get().asFile}/ainfer-testchecker/") } outputs.upToDateWhen { false } include '**/AinferTestCheckerStubsGenerationTest.class' @@ -529,7 +530,7 @@ task ainferTestCheckerGenerateAjava(type: Test) { dependsOn(compileTestJava) doFirst { delete('tests/ainfer-testchecker/annotated') - delete("${buildDir}/ainfer-testchecker/") + delete("${layout.buildDirectory.get().asFile}/ainfer-testchecker/") } outputs.upToDateWhen { false } include '**/AinferTestCheckerAjavaGenerationTest.class' @@ -735,7 +736,7 @@ task ainferIndexGenerateAjava(type: Test) { dependsOn(compileTestJava) doFirst { delete('tests/ainfer-index/annotated') - delete("${buildDir}/ainfer-index/") + delete("${layout.buildDirectory.get().asFile}/ainfer-index/") } outputs.upToDateWhen { false } include '**/AinferIndexAjavaGenerationTest.class' @@ -781,7 +782,7 @@ task ainferNullnessGenerateAjava(type: Test) { dependsOn(compileTestJava) doFirst { delete('tests/ainfer-nullness/annotated') - delete("${buildDir}/ainfer-nullness/") + delete("${layout.buildDirectory.get().asFile}/ainfer-nullness/") } outputs.upToDateWhen { false } include '**/AinferNullnessAjavaGenerationTest.class' @@ -827,7 +828,7 @@ task ainferResourceLeakGenerateAjava(type: Test) { dependsOn(compileTestJava) doFirst { delete('tests/ainfer-resourceleak/annotated') - delete("${buildDir}/ainfer-resourceleak/") + delete("${layout.buildDirectory.get().asFile}/ainfer-resourceleak/") } outputs.upToDateWhen { false } include '**/AinferResourceLeakAjavaGenerationTest.class' @@ -978,11 +979,11 @@ task wpiManyTest(group: 'Verification') { outputs.upToDateWhen { false } doFirst { - delete("${project.projectDir}/build/wpi-many-tests-results/") + delete("${layout.buildDirectory.get().asFile}/wpi-many-tests-results/") // wpi-many.sh is run in skip mode so that logs are preserved, but // we don't actually want to skip previously-failing tests when we // re-run the tests locally. - delete fileTree("${project.projectDir}/build/wpi-many-tests") { + delete fileTree("${layout.buildDirectory.get().asFile}/wpi-many-tests") { include '**/.cannot-run-wpi' } } @@ -991,13 +992,13 @@ task wpiManyTest(group: 'Verification') { doLast { // Run wpi-many.sh - def typecheckFilesDir = "${project.projectDir}/build/wpi-many-tests-results/" + def typecheckFilesDir = "${layout.buildDirectory.get().asFile}/wpi-many-tests-results/" try { injected.execOps.exec { environment CHECKERFRAMEWORK: "${projectDir}/.." commandLine 'bin/wpi-many.sh', '-i', "${project.projectDir}/tests/wpi-many/testin.txt", - '-o', "${project.projectDir}/build/wpi-many-tests", + '-o', "${layout.buildDirectory.get().asFile}/wpi-many-tests", '-s', '--', '--checker', 'nullness,interning,lock,regex,signature,calledmethods,resourceleak', @@ -1069,7 +1070,7 @@ task wpiManyTest(group: 'Verification') { // check that WPI causes the expected builds to succeed typecheckFiles.visit { FileVisitDetails details -> - def filename = "${project.projectDir}/build/wpi-many-tests-results/" + details.getName() + def filename = "${layout.buildDirectory.get().asFile}/wpi-many-tests-results/" + details.getName() def file = details.getFile() if (file.length() == 0) { throw new GradleException('Failure: WPI produced empty typecheck file ' + filename) diff --git a/dataflow/build.gradle b/dataflow/build.gradle index 3179ba9e2db..23710e61548 100644 --- a/dataflow/build.gradle +++ b/dataflow/build.gradle @@ -47,7 +47,7 @@ def createDataflowShaded(shadedPkgName) { from shadowJar.source configurations = shadowJar.configurations - destinationDirectory = file("${buildDir}/shadow/dataflow${shadedPkgName}") + destinationDirectory = file("${layout.buildDirectory.get().asFile}/shadow/dataflow${shadedPkgName}") relocate('org.checkerframework', "org.checkerframework.${shadedPkgName}") { diff --git a/framework/build.gradle b/framework/build.gradle index c6b4ed07177..e507b4c17ac 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -127,7 +127,7 @@ task cloneAnnotatedJdk() { task copyAndMinimizeAnnotatedJdkFiles(dependsOn: cloneAnnotatedJdk, group: 'Build') { dependsOn ':framework:compileJava', project(':javacutil').tasks.jar def inputDir = "${annotatedJdkHome}/src" - def outputDir = "${buildDir}/generated/resources/annotated-jdk/" + def outputDir = "${layout.buildDirectory.get().asFile}/generated/resources/annotated-jdk/" description = "Copy annotated JDK files to ${outputDir}. Removes private and package-private methods, method bodies, comments, etc. from the annotated JDK"