Skip to content

Commit

Permalink
Use projectDir if buildDir is used as string
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong committed Dec 14, 2024
1 parent 696ac2a commit a14b212
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,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("${layout.buildDirectory}")
destinationDirectory = file("${projectDir}/build")

options.annotationProcessorPath = files(project(':checker').tasks.shadowJar.archiveFile)
options.compilerArgs += [
Expand Down Expand Up @@ -1053,7 +1053,7 @@ subprojects {

def injected = project.objects.newInstance(InjectedExecOps)

String jtregOutput = "${layout.buildDirectory.get()}/jtreg"
String jtregOutput = "${projectDir}/build/jtreg"
String name = 'all'
String tests = '.'
doLast {
Expand Down
14 changes: 7 additions & 7 deletions checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ clean {
}

clean.doLast {
while (layout.buildDirectory.exists()) {
while (layout.buildDirectory.asFile.get().exists()) {
sleep(10000) // wait 10 seconds
layout.buildDirectory.deleteDir()
}
Expand Down Expand Up @@ -383,7 +383,7 @@ task jtregJdk11Tests(dependsOn: ':downloadJtreg', group: 'Verification') {

def injected = project.objects.newInstance(InjectedExecOps)

String jtregOutput = "${layout.buildDirectory.get()}/jtregJdk11"
String jtregOutput = "${projectDir}/build/jtregJdk11"

String name = 'all'
doLast {
Expand Down Expand Up @@ -471,7 +471,7 @@ task ainferTestCheckerGenerateStubs(type: Test) {
dependsOn(compileTestJava)
doFirst {
delete('tests/ainfer-testchecker/annotated')
delete("${layout.buildDirectory}/ainfer-testchecker/")
delete("${projectDir}/build/ainfer-testchecker/")
}
outputs.upToDateWhen { false }
include '**/AinferTestCheckerStubsGenerationTest.class'
Expand Down Expand Up @@ -530,7 +530,7 @@ task ainferTestCheckerGenerateAjava(type: Test) {
dependsOn(compileTestJava)
doFirst {
delete('tests/ainfer-testchecker/annotated')
delete("${layout.buildDirectory}/ainfer-testchecker/")
delete("${projectDir}/build/ainfer-testchecker/")
}
outputs.upToDateWhen { false }
include '**/AinferTestCheckerAjavaGenerationTest.class'
Expand Down Expand Up @@ -736,7 +736,7 @@ task ainferIndexGenerateAjava(type: Test) {
dependsOn(compileTestJava)
doFirst {
delete('tests/ainfer-index/annotated')
delete("${layout.buildDirectory}/ainfer-index/")
delete("${projectDir}/build/ainfer-index/")
}
outputs.upToDateWhen { false }
include '**/AinferIndexAjavaGenerationTest.class'
Expand Down Expand Up @@ -782,7 +782,7 @@ task ainferNullnessGenerateAjava(type: Test) {
dependsOn(compileTestJava)
doFirst {
delete('tests/ainfer-nullness/annotated')
delete("${layout.buildDirectory}/ainfer-nullness/")
delete("${projectDir}/build/ainfer-nullness/")
}
outputs.upToDateWhen { false }
include '**/AinferNullnessAjavaGenerationTest.class'
Expand Down Expand Up @@ -828,7 +828,7 @@ task ainferResourceLeakGenerateAjava(type: Test) {
dependsOn(compileTestJava)
doFirst {
delete('tests/ainfer-resourceleak/annotated')
delete("${layout.buildDirectory}/ainfer-resourceleak/")
delete("${projectDir}/build/ainfer-resourceleak/")
}
outputs.upToDateWhen { false }
include '**/AinferResourceLeakAjavaGenerationTest.class'
Expand Down
2 changes: 1 addition & 1 deletion dataflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def createDataflowShaded(shadedPkgName) {
from shadowJar.source
configurations = shadowJar.configurations

destinationDirectory = file("${layout.buildDirectory}/shadow/dataflow${shadedPkgName}")
destinationDirectory = file("${projectDir}/build/shadow/dataflow${shadedPkgName}")


relocate('org.checkerframework', "org.checkerframework.${shadedPkgName}") {
Expand Down
2 changes: 1 addition & 1 deletion framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "${layout.buildDirectory}/generated/resources/annotated-jdk/"
def outputDir = "${projectDir}/build/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"

Expand Down

0 comments on commit a14b212

Please sign in to comment.