-
Notifications
You must be signed in to change notification settings - Fork 55
Description
AWS services are supposed to get a custom gradle file that is generated with "project" dependency notation.
This stopped working after #94.
This was handled internally by remapping dependencies to their equivalent project notation:
// remap aws-sdk-kotlin dependencies to project notation
private val sameProjectDeps = mapOf(
AwsKotlinDependency.AWS_CLIENT_RT_CORE to """project(":client-runtime:aws-client-rt")""",
AwsKotlinDependency.AWS_CLIENT_RT_HTTP to """project(":client-runtime:protocols:http")""",
AwsKotlinDependency.AWS_CLIENT_RT_AUTH to """project(":client-runtime:auth")""",
AwsKotlinDependency.AWS_CLIENT_RT_REGIONS to """project(":client-runtime:regions")""",
AwsKotlinDependency.AWS_CLIENT_RT_JSON_PROTOCOLS to """project(":client-runtime:protocols:aws-json-protocols")"""
)
The problem seems to be related to the order of initialization, when this map is created now the references to AwsKotlinDependency.* are all null so this map effectively becomes a map of null -> last entry added (aws-json-protocols).
I don't have time to dive into this right now to see if there is something nuanced in the language spec about order of initialization or if this is a compiler bug. The quick fix is to just wrap it in a lazy block such that object AwsKotlinDependency {} can be initialized.
I'm guessing this was triggered by this change somehow:
// prior to PR:94
const val AWS_CLIENT_RT_VERSION: String = "0.1.0"
// after PR:94
val AWS_CLIENT_RT_VERSION: String = getDefaultRuntimeVersion()
Debug screenshot at the time the map is initialized, you can see the expression for AwsKotlinDependency.AWS_CLIENT_RT_CORE is null at this time.
