Skip to content

Commit e5163bd

Browse files
committed
fix(codegen): correct environment variable name for DSL constants generation
- Update environment variable from DSL_CONSTANTS_GENERATION to AWS_SDK_KOTLIN_GENERATE_DSL_CONSTANTS - Add ENV_VAR_NAME constant for consistency - Update system property name to match naming convention - Verified integration works correctly with Lambda and S3 services 🤖 Assisted by Amazon Q Developer
1 parent bd523a7 commit e5163bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/DslConstantsIntegration.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ class DslConstantsIntegration : KotlinIntegration {
3333
companion object {
3434
const val INTEGRATION_NAME = "dsl-constants"
3535
private const val DSL_CONSTANTS_OUTPUT_DIR = "aws-custom-sdk-build-plugin/src/main/resources/dsl-constants"
36+
private const val ENV_VAR_NAME = "AWS_SDK_KOTLIN_GENERATE_DSL_CONSTANTS"
3637
}
3738

3839
override val order: Byte = 127 // Run last to ensure all other processing is complete
3940

4041
override fun enabledForService(model: Model, settings: KotlinSettings): Boolean {
41-
// Only generate constants if the DSL_CONSTANTS_GENERATION environment variable is set
42+
// Only generate constants if the environment variable is set to "true"
4243
// This allows us to control when constants are generated during the build process
43-
return System.getenv("DSL_CONSTANTS_GENERATION") == "true" ||
44-
System.getProperty("aws.dsl.constants.generation") == "true"
44+
return System.getenv(ENV_VAR_NAME) == "true" ||
45+
System.getProperty("aws.sdk.kotlin.generate.dsl.constants") == "true"
4546
}
4647

4748
override fun writeAdditionalFiles(ctx: CodegenContext, delegator: KotlinDelegator) {

0 commit comments

Comments
 (0)