Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: Add DSL for BuildConfig fields #110

Open
osipxd opened this issue Jun 21, 2022 · 1 comment
Open

android: Add DSL for BuildConfig fields #110

osipxd opened this issue Jun 21, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@osipxd
Copy link
Collaborator

osipxd commented Jun 21, 2022

It would be nice to have type-safe DSL to add fields to BuildConfig:

buildConfig {
    int("VERSION_CODE", 1) // buildConfigField("int", "VERSION_CODE", "1")
    string("VERSION", "1.0") // buildConfigField("String", "VERSION", "\"1.0\"")
    enum("STAGE", "io.example.Stage.PROD") // buildConfigField("io.example.Stage", "STAGE", "io.example.Stage.PROD")
}
@osipxd osipxd added the enhancement New feature or request label Jun 21, 2022
@osipxd
Copy link
Collaborator Author

osipxd commented Mar 1, 2023

Another possible way to go - create abstraction over build config field. With this approach we can share field between different build types and flavors:

val stage = buildConfig.enumField("STAGE", "io.example.Stage")

debug {
    stage.set("DEV")
}

release {
    stage.set("PROD")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant