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

flavor support #8

Closed
yshrsmz opened this issue Feb 5, 2019 · 3 comments · Fixed by #9
Closed

flavor support #8

yshrsmz opened this issue Feb 5, 2019 · 3 comments · Fixed by #9

Comments

@yshrsmz
Copy link
Owner

yshrsmz commented Feb 5, 2019

Some thing like Android's product flavor could be useful.
But since Kotlin MPP does not support it, we need to come up with some workaround.

buildkonfig {
  targetConfigs {
    android {
      flavor = "dev"
    }
    android {
      flavor = "release"
    }

    ios {
      flavor = "dev"
    }
    ios {
      flavor = "release"
    }
  }
}
@yshrsmz
Copy link
Owner Author

yshrsmz commented Feb 5, 2019

passing value via command line will work, but I'm not sure how I can do that in Android Studio/IntelliJ IDEA

$ ./gradlew -Pbuildkonfig.flavor=dev build

@yshrsmz
Copy link
Owner Author

yshrsmz commented Feb 5, 2019

  • Setting default value in gradle.properties
  • Edit gradle.properties while development
  • overwrite by passing -P in CI

This should work

@yshrsmz
Copy link
Owner Author

yshrsmz commented Feb 7, 2019

NamedDomainObjectContainer is Set, so duplicated name is not allowed.

buildkonfig {
  defaultConfigs("dev") {}
  defaultConfigs("release") {}

  // void targetConfigs(String flavor, Closure closure)
  targetConfigs("dev") {
    android {
    }
    ios {
    }
  }
  targetConfigs("release") {
    android {
    }
    ios {
    }
  }
}

Also, defaultConfigs should be configurable per flavor

@yshrsmz yshrsmz mentioned this issue Feb 7, 2019
2 tasks
@yshrsmz yshrsmz closed this as completed in #9 Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant