Skip to content

Commit 17ff94f

Browse files
committed
configure KMP properly; handle duplicate resources
1 parent c243d2c commit 17ff94f

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

runtime/build.gradle.kts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ plugins {
1515

1616
val sdkVersion: String by project
1717

18-
// Apply KMP configuration from build plugin
19-
configureKmpTargets()
20-
2118
// capture locally - scope issue with custom KMP plugin
2219
val libraries = libs
2320

@@ -33,6 +30,9 @@ subprojects {
3330

3431
println("Project $name: hasNative=$hasNative, NATIVE_ENABLED=$NATIVE_ENABLED")
3532

33+
// Apply KMP configuration from build plugin
34+
configureKmpTargets()
35+
3636
configurePublishing("smithy-kotlin", "smithy-lang")
3737
kotlin {
3838
explicitApi()
@@ -64,7 +64,11 @@ subprojects {
6464
kotlin.sourceSets.all {
6565
// Allow subprojects to use internal APIs
6666
// See https://kotlinlang.org/docs/reference/opt-in-requirements.html#opting-in-to-using-api
67-
listOf("kotlin.RequiresOptIn", "kotlinx.cinterop.ExperimentalForeignApi").forEach { languageSettings.optIn(it) }
67+
languageSettings.optIn("kotlin.RequiresOptIn")
68+
69+
if (!name.contains("metadata", ignoreCase = true)) {
70+
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
71+
}
6872
}
6973

7074
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
@@ -118,6 +122,15 @@ subprojects {
118122
tasks.withType<KotlinNativeSimulatorTest> {
119123
enabled = false
120124
}
125+
126+
tasks.withType<ProcessResources> {
127+
// FIXME this shouldn't be necessary but without it the following message is observed:
128+
// Execution failed for task ':runtime:auth:aws-signing-tests:metadataCommonMainProcessResources'.
129+
// > Entry aws-signing-test-suite/README.md is a duplicate but no duplicate handling strategy has been set.
130+
// Please refer to https://docs.gradle.org/8.14.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy
131+
// for details.
132+
duplicatesStrategy = DuplicatesStrategy.WARN
133+
}
121134
}
122135

123136
// configureIosSimulatorTasks()

0 commit comments

Comments
 (0)