-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace deprecated buildDir
#898
base: master
Are you sure you want to change the base?
Conversation
Okay, looks like more build logic is needed here. |
layout.buildDirectory
to replace deprecated builddir
builddir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this!
build.gradle
Outdated
@@ -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("${buildDir}") | |||
destinationDirectory = file("${projectDir}/build") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the recommended fix suggested in https://docs.gradle.org/current/userguide/upgrading_version_8.html#project_builddir
Wouldn't it be nicer to use the suggested replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this update!
@@ -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}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destinationDirectory = file("${layout.buildDirectory.get().asFile}") | |
destinationDirectory = layout.buildDirectory.get().asFile |
Wouldn't that already be a file?
@@ -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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between asFile.get()
and get().asFile
used elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't layout.buildDirectory.file('jtreg.zip').get().asFile
be more idiomatic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between asFile.get() and get().asFile used elsewhere?
That's a good question. I will ask gradle people on slack. Looks like both of them return a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't matter, pick one ordering and consistently use it.
builddir
is deprecated since gradle 8.2 https://docs.gradle.org/current/userguide/upgrading_version_8.html#deprecated_project_builddir_can_cause_script_compilation_failure