Skip to content

Commit

Permalink
Migrate deprecated buildDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler authored Aug 17, 2023
1 parent e22197b commit e4c7e78
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tasks.withType(Test).configureEach {
maxHeapSize "1g"
}

systemProperty 'java.io.tmpdir', buildDir.absolutePath
systemProperty 'java.io.tmpdir', project.layout.buildDirectory.asFile.get().absolutePath

// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ShadowApplicationPlugin implements Plugin<Project> {
startScripts.classpath = project.files(jar)
startScripts.conventionMapping.mainClassName = { javaApplication.mainClass.get() }
startScripts.conventionMapping.applicationName = { javaApplication.applicationName }
startScripts.conventionMapping.outputDir = { new File(project.buildDir, 'scriptsShadow') }
startScripts.conventionMapping.outputDir = { new File(project.layout.buildDirectory.asFile.get(), 'scriptsShadow') }
startScripts.conventionMapping.defaultJvmOpts = { javaApplication.applicationDefaultJvmArgs }
startScripts.inputs.files project.objects.fileCollection().from { -> jar }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ShadowPluginSpec extends PluginSpecification {
ShadowJar shadow = project.tasks.findByName('shadowJar')
assert shadow
assert shadow.archiveBaseName.get() == projectName
assert shadow.destinationDirectory.get().asFile == new File(project.buildDir, 'libs')
assert shadow.destinationDirectory.get().asFile == new File(project.layout.buildDirectory.asFile.get(), 'libs')
assert shadow.archiveVersion.get() == version
assert shadow.archiveClassifier.get() == 'all'
assert shadow.archiveExtension.get() == 'jar'
Expand Down Expand Up @@ -1078,7 +1078,7 @@ class ShadowPluginSpec extends PluginSpecification {
implementation 'shadow:a:1.0'
}
def generatedResourcesDir = new File(project.buildDir, "generated-resources")
def generatedResourcesDir = new File(project.layout.buildDirectory.asFile.get(), "generated-resources")
task generateResources {
doLast {
Expand Down

0 comments on commit e4c7e78

Please sign in to comment.