Skip to content

Instantly share code, notes, and snippets.

@xinthink
Created November 15, 2017 01:17
Show Gist options
  • Save xinthink/da9e17bf2cbde018d37814268dffeefe to your computer and use it in GitHub Desktop.
Save xinthink/da9e17bf2cbde018d37814268dffeefe to your computer and use it in GitHub Desktop.
Accessing extra properties in Kotlin DSL
// Declarations
ext["deps"] = mapOf(
"support" to mapOf(
"appCompat" to "com.android.support:appcompat-v7:26.0.2",
"design" to "com.android.support:design:26.0.2"
),
"picasso" to "com.squareup.picasso:picasso:2.5.2"
)
// References
implementation(((ext["deps"] as Map<*, *>)["support"] as Map<*, *>)["design"]!!)
@xinthink
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment