Skip to content

Instantly share code, notes, and snippets.

@fleficher
Created December 24, 2019 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fleficher/ccf118de16383c5333397298f55f50a4 to your computer and use it in GitHub Desktop.
Save fleficher/ccf118de16383c5333397298f55f50a4 to your computer and use it in GitHub Desktop.
build config fields KTX
// For flavors usage
fun BaseFlavor.buildConfigBoolean(name: String, value: Boolean) =
buildConfigField("Boolean", name, value.toString())
fun BaseFlavor.buildConfigString(name: String, value: String) =
buildConfigField("String", name, "\"$value\"")
// For build types usage
fun BuildType.buildConfigString(name: String, value: String) =
buildConfigField("String", name, "\"$value\"")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment