Created
October 4, 2019 15:06
-
-
Save hollygood/9d4a0118e7e5d1c4f07fb4ba78a44483 to your computer and use it in GitHub Desktop.
Kotlin For Gradle Build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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