From 52b07c2bc8380e5bb8947fe02a6a6e9896fb24f1 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Thu, 16 Feb 2023 11:21:24 -0800 Subject: [PATCH] Add feature flag for the crate reorganization (#2388) --- .../smithy/rust/codegen/client/smithy/ClientRustSettings.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt index 5fb6eb1d1b..a33fa4f9e7 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt @@ -86,6 +86,8 @@ data class ClientCodegenConfig( val addMessageToErrors: Boolean = defaultAddMessageToErrors, // TODO(EventStream): [CLEANUP] Remove this property when turning on Event Stream for all services val eventStreamAllowList: Set = defaultEventStreamAllowList, + // TODO(CrateReorganization): Remove this once we commit to the breaking change + val enableNewCrateOrganizationScheme: Boolean = defaultEnableNewCrateOrganizationScheme, ) : CoreCodegenConfig( formatTimeoutSeconds, debugMode, ) { @@ -94,6 +96,7 @@ data class ClientCodegenConfig( private const val defaultIncludeFluentClient = true private const val defaultAddMessageToErrors = true private val defaultEventStreamAllowList: Set = emptySet() + private const val defaultEnableNewCrateOrganizationScheme = false fun fromCodegenConfigAndNode(coreCodegenConfig: CoreCodegenConfig, node: Optional) = if (node.isPresent) { @@ -106,12 +109,14 @@ data class ClientCodegenConfig( renameExceptions = node.get().getBooleanMemberOrDefault("renameErrors", defaultRenameExceptions), includeFluentClient = node.get().getBooleanMemberOrDefault("includeFluentClient", defaultIncludeFluentClient), addMessageToErrors = node.get().getBooleanMemberOrDefault("addMessageToErrors", defaultAddMessageToErrors), + enableNewCrateOrganizationScheme = node.get().getBooleanMemberOrDefault("enableNewCrateOrganizationScheme", false), ) } else { ClientCodegenConfig( formatTimeoutSeconds = coreCodegenConfig.formatTimeoutSeconds, debugMode = coreCodegenConfig.debugMode, eventStreamAllowList = defaultEventStreamAllowList, + enableNewCrateOrganizationScheme = defaultEnableNewCrateOrganizationScheme, ) } }