Skip to content

Commit 77ec52c

Browse files
committed
fix: everything works except smoke-tests:services
1 parent 6a7ec2f commit 77ec52c

File tree

21 files changed

+48
-84
lines changed

21 files changed

+48
-84
lines changed

buildSrc/src/main/kotlin/aws/sdk/kotlin/shared/CodegenTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ data class CodegenTest(
1414
*/
1515
data class Model(
1616
val fileName: String,
17-
val path: String = "src/commonTest/resources/",
17+
val path: String = "src/test/resources/",
1818
)

tests/codegen/build.gradle.kts

Lines changed: 37 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ import aws.sdk.kotlin.gradle.codegen.dsl.generateSmithyProjections
22

33
plugins {
44
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
5-
alias(libs.plugins.kotlin.multiplatform)
6-
}
7-
8-
kotlin {
9-
jvm()
5+
alias(libs.plugins.kotlin.jvm)
106
}
117

128
val libraries = libs
139

1410
subprojects {
1511
apply(plugin = libraries.plugins.aws.kotlin.repo.tools.smithybuild.get().pluginId)
16-
apply(plugin = libraries.plugins.kotlin.multiplatform.get().pluginId)
12+
apply(plugin = libraries.plugins.kotlin.jvm.get().pluginId)
1713

1814
val optinAnnotations = listOf(
1915
"aws.smithy.kotlin.runtime.InternalApi",
@@ -43,54 +39,42 @@ subprojects {
4339
codegen(libraries.smithy.model)
4440
}
4541

46-
kotlin {
47-
jvm {
48-
compilations.all {
49-
kotlinOptions.jvmTarget = "1.8"
50-
}
51-
}
52-
sourceSets {
53-
commonMain {
54-
dependencies {
55-
implementation(project(":codegen:aws-sdk-codegen"))
56-
implementation(libraries.smithy.kotlin.codegen)
42+
val implementation by configurations
43+
val api by configurations
44+
val testImplementation by configurations
45+
dependencies {
46+
implementation(project(":codegen:aws-sdk-codegen"))
47+
implementation(libraries.smithy.kotlin.codegen)
48+
49+
/* We have to manually add all the dependencies of the generated client(s).
50+
Doing it this way (as opposed to doing what we do for protocol-tests) allows the tests to work without a
51+
publish to maven-local step at the cost of maintaining this set of dependencies manually. */
52+
implementation(libraries.kotlinx.coroutines.core)
53+
implementation(libraries.bundles.smithy.kotlin.service.client)
54+
implementation(libraries.smithy.kotlin.aws.event.stream)
55+
implementation(project(":aws-runtime:aws-http"))
56+
implementation(libraries.smithy.kotlin.aws.json.protocols)
57+
implementation(libraries.smithy.kotlin.serde.json)
58+
api(project(":aws-runtime:aws-config"))
59+
api(project(":aws-runtime:aws-core"))
60+
api(project(":aws-runtime:aws-endpoint"))
61+
62+
testImplementation(libraries.kotlin.test)
63+
testImplementation(libraries.kotlinx.coroutines.test)
64+
testImplementation(libraries.smithy.kotlin.smithy.test)
65+
testImplementation(libraries.smithy.kotlin.aws.signing.default)
66+
testImplementation(libraries.smithy.kotlin.telemetry.api)
67+
testImplementation(libraries.smithy.kotlin.http.test)
68+
}
5769

58-
/* We have to manually add all the dependencies of the generated client(s).
59-
Doing it this way (as opposed to doing what we do for protocol-tests) allows the tests to work without a
60-
publish to maven-local step at the cost of maintaining this set of dependencies manually. */
61-
implementation(libraries.kotlinx.coroutines.core)
62-
implementation(libraries.bundles.smithy.kotlin.service.client)
63-
implementation(libraries.smithy.kotlin.aws.event.stream)
64-
implementation(project(":aws-runtime:aws-http"))
65-
implementation(libraries.smithy.kotlin.aws.json.protocols)
66-
implementation(libraries.smithy.kotlin.serde.json)
67-
api(project(":aws-runtime:aws-config"))
68-
api(project(":aws-runtime:aws-core"))
69-
api(project(":aws-runtime:aws-endpoint"))
70-
}
71-
}
72-
commonTest {
73-
dependencies {
74-
implementation(libraries.kotlin.test)
75-
implementation(libraries.kotlinx.coroutines.test)
76-
implementation(libraries.smithy.kotlin.smithy.test)
77-
implementation(libraries.smithy.kotlin.aws.signing.default)
78-
implementation(libraries.smithy.kotlin.telemetry.api)
79-
implementation(libraries.smithy.kotlin.http.test)
80-
}
81-
}
82-
jvmTest {
83-
tasks.withType<Test> {
84-
useJUnitPlatform()
85-
testLogging {
86-
events("passed", "skipped", "failed")
87-
showStandardStreams = true
88-
showStackTraces = true
89-
showExceptions = true
90-
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
91-
}
92-
}
93-
}
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
9478
}
9579
}
9680
}

tests/codegen/checksums/build.gradle.kts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@ smithyBuild {
3131
}
3232
}
3333

34-
kotlin {
35-
sourceSets {
36-
commonTest {
37-
smithyBuild.projections.forEach {
38-
kotlin.srcDir(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
39-
}
40-
}
34+
kotlin.sourceSets.getByName("test") {
35+
smithyBuild.projections.forEach {
36+
kotlin.srcDir(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
4137
}
4238
}

tests/codegen/event-stream/build.gradle.kts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,8 @@ smithyBuild {
5454
}
5555
}
5656

57-
kotlin {
58-
sourceSets {
59-
commonTest {
60-
smithyBuild.projections.forEach {
61-
kotlin.srcDir(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
62-
}
63-
}
57+
kotlin.sourceSets.getByName("test") {
58+
smithyBuild.projections.forEach {
59+
kotlin.srcDir(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
6460
}
6561
}

0 commit comments

Comments
 (0)