Skip to content

Commit 6be183f

Browse files
authored
chore: refactor ep2.0 (#1052)
1 parent 3042bbc commit 6be183f

File tree

7 files changed

+34
-8
lines changed

7 files changed

+34
-8
lines changed

codegen/smithy-aws-kotlin-codegen/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies {
3131
api("software.amazon.smithy:smithy-aws-iam-traits:$smithyVersion")
3232
api("software.amazon.smithy:smithy-aws-cloudformation-traits:$smithyVersion")
3333
api("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
34-
implementation("software.amazon.smithy:smithy-rules-engine:$smithyVersion")
34+
implementation("software.amazon.smithy:smithy-aws-endpoints:$smithyVersion")
3535

3636
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
3737
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")

codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsEndpointDelegator.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class AwsEndpointDelegator : EndpointDelegator {
5656
},
5757
)
5858
}
59+
5960
if (rules != null) {
6061
ctx.delegator.useFileWriter(defaultProviderSymbol) {
6162
DefaultEndpointProviderGenerator(it, rules, defaultProviderSymbol, providerSymbol, paramsSymbol, ctx.settings, endpointFunctions, awsEndpointPropertyRenderers).render()

codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/core/AwsHttpBindingProtocolGenerator.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,30 @@ abstract class AwsHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
5252
}
5353

5454
override fun generateProtocolUnitTests(ctx: ProtocolGenerator.GenerationContext) {
55+
val ignoredTests = TestMemberDelta(
56+
setOf(
57+
// FIXME - compression not yet supported, see https://github.com/awslabs/smithy-kotlin/issues/955
58+
"SDKAppliedContentEncoding_awsJson1_0",
59+
"SDKAppliedContentEncoding_awsJson1_1",
60+
"SDKAppliedContentEncoding_awsQuery",
61+
"SDKAppliedContentEncoding_ec2Query",
62+
"SDKAppliedContentEncoding_restJson1",
63+
"SDKAppliedContentEncoding_restXml",
64+
"SDKAppendedGzipAfterProvidedEncoding_restJson1",
65+
"SDKAppendedGzipAfterProvidedEncoding_restXml",
66+
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0",
67+
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1",
68+
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery",
69+
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query",
70+
71+
// FIXME - missing Content-Type on restXml empty payloads, see https://github.com/awslabs/aws-sdk-kotlin/issues/1050
72+
"RestXmlHttpPayloadWithUnsetUnion",
73+
74+
// FIXME - xmlns incorrect in XML maps, see https://github.com/awslabs/smithy-kotlin/issues/957
75+
"RestXmlXmlMapWithXmlNamespace",
76+
),
77+
)
78+
5579
// The following can be used to generate only a specific test by name.
5680
// val targetedTest = TestMemberDelta(setOf("RestJsonComplexErrorWithNoMessage"), TestContainmentMode.RUN_TESTS)
5781

@@ -64,6 +88,7 @@ abstract class AwsHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
6488
requestTestBuilder,
6589
responseTestBuilder,
6690
errorTestBuilder,
91+
ignoredTests,
6792
).generateProtocolTests()
6893
}
6994

codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/endpoints/DefaultEndpointProviderExt.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import software.amazon.smithy.kotlin.codegen.rendering.endpoints.ExpressionRende
1212
import software.amazon.smithy.kotlin.codegen.utils.getOrNull
1313
import software.amazon.smithy.model.node.Node
1414
import software.amazon.smithy.model.node.ObjectNode
15-
import software.amazon.smithy.rulesengine.language.syntax.expr.Expression
15+
import software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
1616
import java.util.*
1717

1818
val awsEndpointFunctions = mapOf(
@@ -24,9 +24,6 @@ val awsEndpointPropertyRenderers = mapOf(
2424
"authSchemes" to ::renderAuthSchemes,
2525
)
2626

27-
// valid auth scheme names that can appear in a smithy endpoint's properties
28-
private val validAuthSchemeNames = setOf("sigv4", "sigv4a")
29-
3027
private fun String.toSigningContextClassName(): String? =
3128
when (this) {
3229
"sigv4" -> "SigV4"

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2G
99
sdkVersion=0.32.3-SNAPSHOT
1010

1111
# codegen
12-
smithyVersion=1.29.0
12+
smithyVersion=1.39.0
1313
smithyGradleVersion=0.6.0
1414
# smithy-kotlin codegen and runtime are versioned together
15-
smithyKotlinVersion=0.27.4
15+
smithyKotlinVersion=0.27.5-SNAPSHOT
1616

1717
# kotlin
1818
kotlinVersion=1.8.22
@@ -37,4 +37,4 @@ mockkVersion=1.13.3
3737
slf4jVersion=2.0.6
3838

3939
# dokka config (values specified at build-time as needed)
40-
smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/
40+
smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/

gradle/sdk-plugins/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Properties
66
buildscript {
77
repositories {
8+
mavenLocal()
89
mavenCentral()
910
}
1011
}
@@ -15,6 +16,7 @@ plugins {
1516
}
1617

1718
repositories {
19+
mavenLocal()
1820
mavenCentral()
1921
gradlePluginPortal()
2022
}

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
pluginManagement {
77
repositories {
8+
mavenLocal()
89
mavenCentral()
910
gradlePluginPortal()
1011
}

0 commit comments

Comments
 (0)