Skip to content

Commit 9a46dbc

Browse files
committed
fix: finally fix this whole mess
1 parent 77ec52c commit 9a46dbc

File tree

2 files changed

+52
-17
lines changed

2 files changed

+52
-17
lines changed

tests/codegen/build.gradle.kts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ plugins {
88
val libraries = libs
99

1010
subprojects {
11+
tasks.withType<Test> {
12+
useJUnitPlatform()
13+
testLogging {
14+
events("passed", "skipped", "failed")
15+
showStandardStreams = true
16+
showStackTraces = true
17+
showExceptions = true
18+
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
19+
}
20+
}
21+
22+
/*
23+
Don't apply the rest of the configuration to the code generated smoke test services!
24+
Those use the KMP plugin not JVM.
25+
*/
26+
if (project.path.startsWith(":tests:codegen:smoke-tests:services")) return@subprojects
27+
1128
apply(plugin = libraries.plugins.aws.kotlin.repo.tools.smithybuild.get().pluginId)
1229
apply(plugin = libraries.plugins.kotlin.jvm.get().pluginId)
1330

@@ -32,17 +49,14 @@ subprojects {
3249
}
3350
}
3451

35-
val codegen by configurations
52+
val implementation by configurations
53+
val api by configurations
54+
val testImplementation by configurations
3655
dependencies {
3756
codegen(project(":codegen:aws-sdk-codegen"))
3857
codegen(libraries.smithy.cli)
3958
codegen(libraries.smithy.model)
40-
}
4159

42-
val implementation by configurations
43-
val api by configurations
44-
val testImplementation by configurations
45-
dependencies {
4660
implementation(project(":codegen:aws-sdk-codegen"))
4761
implementation(libraries.smithy.kotlin.codegen)
4862

@@ -66,15 +80,4 @@ subprojects {
6680
testImplementation(libraries.smithy.kotlin.telemetry.api)
6781
testImplementation(libraries.smithy.kotlin.http.test)
6882
}
69-
70-
tasks.withType<Test> {
71-
useJUnitPlatform()
72-
testLogging {
73-
events("passed", "skipped", "failed")
74-
showStandardStreams = true
75-
showStackTraces = true
76-
showExceptions = true
77-
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
78-
}
79-
}
8083
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
plugins {
2+
alias(libs.plugins.kotlin.multiplatform)
3+
}
4+
5+
val libraries = libs
6+
subprojects {
7+
apply(plugin = libraries.plugins.kotlin.multiplatform.get().pluginId)
8+
9+
val optinAnnotations = listOf(
10+
"aws.smithy.kotlin.runtime.InternalApi",
11+
"aws.sdk.kotlin.runtime.InternalSdkApi",
12+
"kotlin.RequiresOptIn",
13+
)
14+
kotlin.sourceSets.all {
15+
optinAnnotations.forEach { languageSettings.optIn(it) }
16+
}
17+
18+
kotlin {
19+
sourceSets {
20+
commonMain {
21+
kotlin.srcDir("generated-src/main/kotlin")
22+
23+
dependencies {
24+
implementation(libraries.kotlin.test)
25+
}
26+
}
27+
commonTest {
28+
kotlin.srcDir("generated-src/test/kotlin")
29+
}
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)