From 1e8fe69c0d5b41f3fe0fa7d4d5133b1496e41027 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Tue, 4 Jun 2024 10:51:40 -0700 Subject: [PATCH] Remove usages of deprecated Gradle `buildDir` property (#78) --- library/build.gradle.kts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 6f4a826..9910833 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -79,11 +79,11 @@ kotlin { getByName("androidMain") { dependsOn(bundledMain) - kotlin.srcDir("$buildDir/generated/sources/datadog/$name/kotlin") + kotlin.srcDir(layout.buildDirectory.file("generated/sources/datadog/$name/kotlin")) } getByName("iosMain") { - kotlin.srcDir("$buildDir/generated/sources/datadog/$name/kotlin") + kotlin.srcDir(layout.buildDirectory.file("generated/sources/datadog/$name/kotlin")) dependencies { api(libs.nserrorkt) } @@ -91,7 +91,7 @@ kotlin { getByName("jsMain") { dependsOn(bundledMain) - kotlin.srcDir("$buildDir/generated/sources/datadog/$name/kotlin") + kotlin.srcDir(layout.buildDirectory.file("generated/sources/datadog/$name/kotlin")) } } } @@ -102,7 +102,7 @@ multiplatformSwiftPackage { targetPlatforms { iOS { v("14") } } - outputDirectory(File(buildDir, "swiftpackage")) + outputDirectory(layout.buildDirectory.file("swiftpackage").get().asFile) zipFileName("sample-library") } @@ -127,7 +127,7 @@ tasks.register("datadogClientTokens") { listOf("android", "ios", "js",).forEach { target -> val property = "datadog.clientToken.$target" val token = properties.getOrElse(property) { error("Missing $property in $projectDir/local.properties") } - val path = file("$buildDir/generated/sources/datadog/${target}Main/kotlin") + val path = layout.buildDirectory.file("generated/sources/datadog/${target}Main/kotlin").get().asFile val sourceFile = file("$path/DatadogClientToken.kt") path.createDirectory() sourceFile.createNewFile()