Skip to content

Commit b0c22ea

Browse files
authored
fix: initialization order (#96)
1 parent b8d5d82 commit b0c22ea

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ object AwsKotlinDependency {
4343
}
4444

4545
// remap aws-sdk-kotlin dependencies to project notation
46-
private val sameProjectDeps = mapOf(
47-
AwsKotlinDependency.AWS_CLIENT_RT_CORE to """project(":client-runtime:aws-client-rt")""",
48-
AwsKotlinDependency.AWS_CLIENT_RT_HTTP to """project(":client-runtime:protocols:http")""",
49-
AwsKotlinDependency.AWS_CLIENT_RT_AUTH to """project(":client-runtime:auth")""",
50-
AwsKotlinDependency.AWS_CLIENT_RT_REGIONS to """project(":client-runtime:regions")""",
51-
AwsKotlinDependency.AWS_CLIENT_RT_JSON_PROTOCOLS to """project(":client-runtime:protocols:aws-json-protocols")"""
52-
)
46+
// NOTE: the lazy wrapper is required here, see: https://github.com/awslabs/aws-sdk-kotlin/issues/95
47+
private val sameProjectDeps: Map<KotlinDependency, String> by lazy {
48+
mapOf(
49+
AwsKotlinDependency.AWS_CLIENT_RT_CORE to """project(":client-runtime:aws-client-rt")""",
50+
AwsKotlinDependency.AWS_CLIENT_RT_HTTP to """project(":client-runtime:protocols:http")""",
51+
AwsKotlinDependency.AWS_CLIENT_RT_AUTH to """project(":client-runtime:auth")""",
52+
AwsKotlinDependency.AWS_CLIENT_RT_REGIONS to """project(":client-runtime:regions")""",
53+
AwsKotlinDependency.AWS_CLIENT_RT_JSON_PROTOCOLS to """project(":client-runtime:protocols:aws-json-protocols")"""
54+
)
55+
}
5356

5457
internal fun KotlinDependency.dependencyNotation(allowProjectNotation: Boolean = true): String {
5558
val dep = this

0 commit comments

Comments
 (0)