Skip to content

Commit

Permalink
Remove usages of deprecated Gradle buildDir property (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Jun 4, 2024
1 parent c383be1 commit 1e8fe69
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ 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)
}
}

getByName("jsMain") {
dependsOn(bundledMain)
kotlin.srcDir("$buildDir/generated/sources/datadog/$name/kotlin")
kotlin.srcDir(layout.buildDirectory.file("generated/sources/datadog/$name/kotlin"))
}
}
}
Expand All @@ -102,7 +102,7 @@ multiplatformSwiftPackage {
targetPlatforms {
iOS { v("14") }
}
outputDirectory(File(buildDir, "swiftpackage"))
outputDirectory(layout.buildDirectory.file("swiftpackage").get().asFile)
zipFileName("sample-library")
}

Expand All @@ -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()
Expand Down

0 comments on commit 1e8fe69

Please sign in to comment.