Skip to content

Commit d583a90

Browse files
committed
replace buildDir deprecated calls
1 parent d8f89c4 commit d583a90

File tree

9 files changed

+16
-15
lines changed

9 files changed

+16
-15
lines changed

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/resources/ValidateMessages.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ open class ValidateMessages : DefaultTask() {
2121
val paths: ConfigurableFileCollection = project.objects.fileCollection()
2222

2323
@OutputFile
24-
val output: RegularFileProperty = project.objects.fileProperty().convention {
25-
project.buildDir.resolve("validateMessages")
26-
}
24+
val output: RegularFileProperty = project.objects.fileProperty().convention(
25+
project.layout.buildDirectory.file("validateMessages")
26+
)
2727

2828
init {
2929
group = VERIFICATION_GROUP

plugins/amazonq/mynah-ui/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
// mynah build assumes 'build/' belongs to itself, which conflicts with gradle
11-
buildDir = file("gradle_build")
11+
layout.buildDirectory = file("gradle_build")
1212

1313
val buildMynahUI = tasks.register<NpmTask>("buildMynahUI") {
1414
dependsOn(tasks.npmInstall)

plugins/core/resources/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212

1313
sourceSets {
1414
main {
15-
resources.srcDir("$buildDir/downloaded-resources")
15+
resources.srcDir(layout.buildDirectory.dir("downloaded-resources"))
1616
}
1717
}
1818

@@ -26,12 +26,13 @@ tasks.test {
2626
}
2727

2828
val download = tasks.register<Download>("downloadResources") {
29-
dest("$buildDir/downloaded-resources/software/aws/toolkits/resources/")
29+
val resourcesDir = layout.buildDirectory.dir("downloaded-resources/software/aws/toolkits/resources/").get().asFile
30+
dest(resourcesDir)
3031
src(listOf("https://idetoolkits.amazonwebservices.com/endpoints.json"))
3132
onlyIfModified(true)
3233
useETag(true)
3334
doFirst {
34-
mkdir("$buildDir/downloaded-resources/software/aws/toolkits/resources/")
35+
mkdir(resourcesDir)
3536
}
3637
}
3738

plugins/core/sdk-codegen/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
sdkGenerator {
99
c2jFolder.set(file("$projectDir/codegen-resources"))
10-
outputDir.set(file("$buildDir/generated-sources"))
10+
outputDir.set(layout.buildDirectory.dir("generated-sources").get().asFile)
1111
}
1212

1313
dependencies {

plugins/core/webview/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
alias(libs.plugins.node.gradle)
88
}
99

10-
buildDir = file("gradle_build")
10+
layout.buildDirectory = file("gradle_build")
1111

1212
val buildGetStartUI = tasks.register<NpmTask>("buildWebviewUI") {
1313
dependsOn(tasks.npmInstall)

plugins/toolkit/jetbrains-core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies {
4242

4343
val changelog = tasks.register<GeneratePluginChangeLog>("pluginChangeLog") {
4444
includeUnreleased.set(true)
45-
changeLogFile.set(project.file("$buildDir/changelog/change-notes.xml"))
45+
changeLogFile.set(project.layout.buildDirectory.file("changelog/change-notes.xml"))
4646
}
4747

4848
tasks.compileJava {
@@ -113,7 +113,7 @@ val gatewayArtifacts by configurations.creating {
113113
extendsFrom(configurations["implementation"], configurations["runtimeOnly"])
114114
}
115115

116-
val gatewayJar = tasks.create<Jar>("gatewayJar") {
116+
val gatewayJar = tasks.register<Jar>("gatewayJar") {
117117
// META-INF/plugin.xml is a duplicate?
118118
// unclear why the exclude() statement didn't work
119119
duplicatesStrategy = DuplicatesStrategy.WARN

plugins/toolkit/jetbrains-gateway/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ val toolkitInstallationScripts = tasks.register<Tar>("generateTar") {
137137

138138
val gatewayResourcesDir = tasks.register<Sync>("gatewayResourcesDir") {
139139
from("gateway-resources/caws-proxy-command.bat", toolkitInstallationScripts)
140-
into("$buildDir/$name")
140+
into(layout.buildDirectory.dir(name))
141141

142142
includeEmptyDirs = false
143143
}

plugins/toolkit/jetbrains-rider/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ apply<RdGenPlugin>()
9494
tasks.register<RdGenTask>("generateModels")
9595

9696
val resharperPluginPath = File(projectDir, "ReSharper.AWS")
97-
val resharperBuildPath = File(project.buildDir, "dotnetBuild")
97+
val resharperBuildPath = layout.buildDirectory.dir("dotnetBuild").get().asFile
9898

9999
val resharperParts = listOf(
100100
"AWS.Daemon",
@@ -257,7 +257,7 @@ val buildReSharperPlugin = tasks.register("buildReSharperPlugin") {
257257
"normal",
258258
"${resharperPluginPath.canonicalPath}/ReSharper.AWS.sln"
259259
)
260-
exec {
260+
project.providers.exec {
261261
executable = "dotnet"
262262
args = arguments
263263
}

ui-tests/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ tasks.register<Test>("uiTestCore") {
4545
systemProperty("junit.jupiter.extensions.autodetection.enabled", true)
4646

4747
systemProperty("testDataPath", project.rootDir.resolve("testdata").toString())
48-
systemProperty("testReportPath", project.buildDir.resolve("reports").resolve("tests").resolve("testRecordings").toString())
48+
systemProperty("testReportPath", layout.buildDirectory.dir("reports/tests/testRecordings").get().asFile.toString())
4949

5050
systemProperty("GRADLE_PROJECT", "sandbox-all")
5151
useJUnitPlatform {

0 commit comments

Comments
 (0)