Skip to content

Commit fbb3dd5

Browse files
committed
Checkoint 2
1 parent 285c08b commit fbb3dd5

File tree

5 files changed

+137
-263
lines changed

5 files changed

+137
-263
lines changed

settings.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ include(":hll:hll-codegen")
5252
include(":hll:hll-mapping-core")
5353
include(":services")
5454
include(":tests")
55+
include(":tests:codegen")
5556
include(":tests:codegen:event-stream")
5657
include(":tests:codegen:rules-engine")
5758
include(":tests:e2e-test-util")
58-
include(":tests:codegen:smoke-tests")
59-
include(":tests:codegen:smoke-tests:services")
59+
//include(":tests:codegen:smoke-tests")
60+
//include(":tests:codegen:smoke-tests:services")
6061

6162
// generated services
6263
val File.isServiceDir: Boolean

tests/codegen/build.gradle.kts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import aws.sdk.kotlin.gradle.codegen.dsl.generateSmithyProjections
2+
import aws.sdk.kotlin.gradle.codegen.dsl.smithyKotlinPlugin
3+
import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionSrcDir
4+
//import aws.sdk.kotlin.gradle.kmp.kotlin
5+
6+
plugins {
7+
alias(libs.plugins.kotlin.jvm) apply false
8+
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild) apply false
9+
// alias(libs.plugins.aws.kotlin.repo.tools.kmp) apply false
10+
}
11+
12+
val librares = libs
13+
14+
subprojects {
15+
apply(plugin = librares.plugins.kotlin.jvm.get().pluginId)
16+
apply(plugin = librares.plugins.aws.kotlin.repo.tools.smithybuild.get().pluginId)
17+
// apply(plugin = librares.plugins.aws.kotlin.repo.tools.kmp.get().pluginId)
18+
19+
val codegen by configurations
20+
21+
dependencies {
22+
codegen(project(":codegen:aws-sdk-codegen"))
23+
codegen(librares.smithy.cli)
24+
codegen(librares.smithy.model)
25+
}
26+
27+
tasks.generateSmithyProjections {
28+
doFirst {
29+
// ensure the generated tests use the same version of the runtime as the aws aws-runtime
30+
val smithyKotlinRuntimeVersion = librares.versions.smithy.kotlin.runtime.version.get()
31+
System.setProperty("smithy.kotlin.codegen.clientRuntimeVersion", smithyKotlinRuntimeVersion)
32+
}
33+
}
34+
35+
// val optinAnnotations = listOf(
36+
// "kotlin.RequiresOptIn",
37+
// "aws.smithy.kotlin.runtime.InternalApi",
38+
// "aws.sdk.kotlin.runtime.InternalSdkApi",
39+
// )
40+
// kotlin.sourceSets.all {
41+
// optinAnnotations.forEach { languageSettings.optIn(it) }
42+
// }
43+
44+
// kotlin.sourceSets.getByName("test") {
45+
// smithyBuild.projections.forEach {
46+
// kotlin.srcDir(smithyBuild.smithyKotlinProjectionSrcDir(it.name))
47+
// }
48+
// }
49+
50+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
51+
dependsOn(tasks.generateSmithyProjections)
52+
kotlinOptions.allWarningsAsErrors = false
53+
}
54+
55+
val implementation by configurations
56+
val testImplementation by configurations
57+
val api by configurations
58+
dependencies {
59+
implementation(librares.kotlinx.coroutines.core)
60+
61+
testImplementation(librares.kotlin.test)
62+
testImplementation(librares.kotlin.test.junit5)
63+
testImplementation(librares.kotlinx.coroutines.test)
64+
testImplementation(librares.smithy.kotlin.smithy.test)
65+
testImplementation(librares.smithy.kotlin.aws.signing.default)
66+
testImplementation(librares.smithy.kotlin.telemetry.api)
67+
68+
/* We have to manually add all the dependencies of the generated client(s).
69+
Doing it this way (as opposed to doing what we do for protocol-tests) allows the tests to work without a
70+
publish to maven-local step at the cost of maintaining this set of dependencies manually. */
71+
implementation(librares.bundles.smithy.kotlin.service.client)
72+
implementation(librares.smithy.kotlin.aws.event.stream)
73+
implementation(project(":aws-runtime:aws-http"))
74+
implementation(librares.smithy.kotlin.aws.json.protocols)
75+
implementation(librares.smithy.kotlin.serde.json)
76+
api(project(":aws-runtime:aws-config"))
77+
api(project(":aws-runtime:aws-core"))
78+
api(project(":aws-runtime:aws-endpoint"))
79+
}
80+
}

tests/codegen/common.gradle.kts

Lines changed: 0 additions & 158 deletions
This file was deleted.

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

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import aws.sdk.kotlin.gradle.codegen.dsl.generateSmithyProjections
77
import aws.sdk.kotlin.gradle.codegen.dsl.smithyKotlinPlugin
88
import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionSrcDir
99

10-
plugins {
11-
alias(libs.plugins.kotlin.jvm)
12-
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
13-
}
1410

1511
description = "Event stream codegen integration test suite"
1612

@@ -76,27 +72,12 @@ smithyBuild {
7672
}
7773
}
7874

79-
val codegen by configurations.getting
80-
dependencies {
81-
codegen(project(":codegen:aws-sdk-codegen"))
82-
codegen(libs.smithy.cli)
83-
codegen(libs.smithy.model)
84-
}
85-
8675
tasks.generateSmithyBuild {
8776
doFirst {
8877
tests.forEach { test -> fillInModel(test.model, test.protocolName, test.modelTemplate) }
8978
}
9079
}
9180

92-
tasks.generateSmithyProjections {
93-
doFirst {
94-
// ensure the generated tests use the same version of the runtime as the aws aws-runtime
95-
val smithyKotlinRuntimeVersion = libs.versions.smithy.kotlin.runtime.version.get()
96-
System.setProperty("smithy.kotlin.codegen.clientRuntimeVersion", smithyKotlinRuntimeVersion)
97-
}
98-
}
99-
10081
val optinAnnotations = listOf(
10182
"kotlin.RequiresOptIn",
10283
"aws.smithy.kotlin.runtime.InternalApi",
@@ -112,12 +93,6 @@ kotlin.sourceSets.getByName("test") {
11293
}
11394
}
11495

115-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
116-
dependsOn(tasks.generateSmithyProjections)
117-
// generated clients have quite a few warnings
118-
kotlinOptions.allWarningsAsErrors = false
119-
}
120-
12196
tasks.test {
12297
useJUnitPlatform()
12398
testLogging {
@@ -129,30 +104,30 @@ tasks.test {
129104
}
130105
}
131106

132-
dependencies {
133-
134-
implementation(libs.kotlinx.coroutines.core)
135-
136-
testImplementation(libs.kotlin.test)
137-
testImplementation(libs.kotlin.test.junit5)
138-
testImplementation(libs.kotlinx.coroutines.test)
139-
140-
testImplementation(libs.smithy.kotlin.smithy.test)
141-
testImplementation(libs.smithy.kotlin.aws.signing.default)
142-
testImplementation(libs.smithy.kotlin.telemetry.api)
143-
144-
// have to manually add all the dependencies of the generated client(s)
145-
// doing it this way (as opposed to doing what we do for protocol-tests) allows
146-
// the tests to work without a publish to maven-local step at the cost of maintaining
147-
// this set of dependencies manually
148-
// <-- BEGIN GENERATED DEPENDENCY LIST -->
149-
implementation(libs.bundles.smithy.kotlin.service.client)
150-
implementation(libs.smithy.kotlin.aws.event.stream)
151-
implementation(project(":aws-runtime:aws-http"))
152-
implementation(libs.smithy.kotlin.aws.json.protocols)
153-
implementation(libs.smithy.kotlin.serde.json)
154-
api(project(":aws-runtime:aws-config"))
155-
api(project(":aws-runtime:aws-core"))
156-
api(project(":aws-runtime:aws-endpoint"))
157-
// <-- END GENERATED DEPENDENCY LIST -->
158-
}
107+
//dependencies {
108+
//
109+
// implementation(libs.kotlinx.coroutines.core)
110+
//
111+
// testImplementation(libs.kotlin.test)
112+
// testImplementation(libs.kotlin.test.junit5)
113+
// testImplementation(libs.kotlinx.coroutines.test)
114+
//
115+
// testImplementation(libs.smithy.kotlin.smithy.test)
116+
// testImplementation(libs.smithy.kotlin.aws.signing.default)
117+
// testImplementation(libs.smithy.kotlin.telemetry.api)
118+
//
119+
// // have to manually add all the dependencies of the generated client(s)
120+
// // doing it this way (as opposed to doing what we do for protocol-tests) allows
121+
// // the tests to work without a publish to maven-local step at the cost of maintaining
122+
// // this set of dependencies manually
123+
// // <-- BEGIN GENERATED DEPENDENCY LIST -->
124+
// implementation(libs.bundles.smithy.kotlin.service.client)
125+
// implementation(libs.smithy.kotlin.aws.event.stream)
126+
// implementation(project(":aws-runtime:aws-http"))
127+
// implementation(libs.smithy.kotlin.aws.json.protocols)
128+
// implementation(libs.smithy.kotlin.serde.json)
129+
// api(project(":aws-runtime:aws-config"))
130+
// api(project(":aws-runtime:aws-core"))
131+
// api(project(":aws-runtime:aws-endpoint"))
132+
// // <-- END GENERATED DEPENDENCY LIST -->
133+
//}

0 commit comments

Comments
 (0)