Skip to content

Instantly share code, notes, and snippets.

@hollygood
Created October 4, 2019 15:06
Show Gist options
  • Save hollygood/9d4a0118e7e5d1c4f07fb4ba78a44483 to your computer and use it in GitHub Desktop.
Save hollygood/9d4a0118e7e5d1c4f07fb4ba78a44483 to your computer and use it in GitHub Desktop.
Kotlin For Gradle Build
Define variable in root project and access it in subprojects by using extra
1) val foo: String by extra["hello"]
2) extra["foo"] = "hello"
3)
buildScript {
extra.apply {
set("foo", "hello")
}
}
// Access the extra variables in subprojects:
rootProject.extra["foo"] as String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment