diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index 53460ba9ceb..7a963ac829e 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -49,14 +49,6 @@ fun baseTest(service: String, module: String, imports: List = listOf()): "includeFluentClient": false, "nullabilityCheckMode": "${getNullabilityCheckMode()}" """, - extraConfig = """ - , "customizationConfig": { - "awsSdk": { - "generateReadme": false, - "requireEndpointResolver": false - } - } - """, ) } diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SdkSettings.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SdkSettings.kt index 43081d1823a..e523c960ac3 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SdkSettings.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SdkSettings.kt @@ -30,8 +30,8 @@ class SdkSettings private constructor(private val awsSdk: ObjectNode?) { get() = awsSdk?.getStringMember("partitionsConfigPath")?.orNull()?.value?.let { Paths.get(it) } - val productionSdkBuild: Boolean - get() = awsSdk?.getBooleanMember("productionSdkBuild")?.orNull()?.value ?: false + val awsSdkBuild: Boolean + get() = awsSdk?.getBooleanMember("awsSdkBuild")?.orNull()?.value ?: false /** Path to AWS SDK integration tests */ val integrationTestPath: String @@ -45,11 +45,10 @@ class SdkSettings private constructor(private val awsSdk: ObjectNode?) { /** Whether to generate a README */ val generateReadme: Boolean - get() = - awsSdk?.getBooleanMember("generateReadme")?.orNull()?.value ?: false + get() = awsSdkBuild val requireEndpointResolver: Boolean - get() = awsSdk?.getBooleanMember("requireEndpointResolver")?.orNull()?.value ?: true + get() = awsSdkBuild } fun ClientCodegenContext.sdkSettings() = SdkSettings.from(this.settings) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/endpoints/AwsEndpointsStdLib.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/endpoints/AwsEndpointsStdLib.kt index 497af58f95d..942381f521f 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/endpoints/AwsEndpointsStdLib.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/endpoints/AwsEndpointsStdLib.kt @@ -32,8 +32,8 @@ class AwsEndpointsStdLib() : ClientCodegenDecorator { if (partitionsCache == null) { val partitionsJson = when (val path = sdkSettings.partitionsConfigPath) { null -> { - if (sdkSettings.productionSdkBuild) { - PANIC("cannot use hardcoded partitions in AWS SDK production build") + if (sdkSettings.awsSdkBuild) { + PANIC("cannot use hardcoded partitions in AWS SDK build") } ( javaClass.getResource("/default-partitions.json") diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/RegionProviderConfigTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/RegionProviderConfigTest.kt index 62312b3ae01..a0c12525533 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/RegionProviderConfigTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/RegionProviderConfigTest.kt @@ -13,7 +13,7 @@ import software.amazon.smithy.rust.codegen.core.testutil.unitTest internal class RegionProviderConfigTest { @Test fun `generates a valid config`() { - awsSdkIntegrationTest(SdkCodegenIntegrationTest.model) { _ctx, crate -> + awsSdkIntegrationTest(SdkCodegenIntegrationTest.model) { _, crate -> crate.unitTest { rustTemplate("let conf: Option = None; let _reg: Option = conf.and_then(|c|c.region().cloned());") } diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TestUtil.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TestUtil.kt index ad08e25aebf..e6b61d6397e 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TestUtil.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/TestUtil.kt @@ -42,7 +42,7 @@ fun awsSdkIntegrationTest( ) = clientIntegrationTest( model, - awsIntegrationTestParams(), + params, test = test, ) @@ -55,8 +55,10 @@ fun awsIntegrationTestParams() = IntegrationTestParams( .withMember( "awsSdk", ObjectNode.builder() - .withMember("generateReadme", false) + .withMember("awsSdkBuild", true) .withMember("integrationTestPath", "../sdk/integration-tests") + .withMember("partitionsConfigPath", "../sdk/aws-models/sdk-endpoints.json") + .withMember("awsConfigVersion", "1") .build(), ).build(), ) diff --git a/aws/sdk/build.gradle.kts b/aws/sdk/build.gradle.kts index a06098cda14..0aa887883da 100644 --- a/aws/sdk/build.gradle.kts +++ b/aws/sdk/build.gradle.kts @@ -117,10 +117,9 @@ fun generateSmithyBuild(services: AwsServices): String { "license": "Apache-2.0", "customizationConfig": { "awsSdk": { - "generateReadme": true, + "awsSdkBuild": true, "awsConfigVersion": "$awsConfigVersion", "defaultConfigPath": "${services.defaultConfigPath}", - "productionSdkBuild": true, "partitionsConfigPath": "${services.partitionsConfigPath}", "integrationTestPath": "${project.projectDir.resolve("integration-tests")}" }