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

Issue/8 flavor support #9

Merged
merged 11 commits into from
Feb 8, 2019
Merged

Issue/8 flavor support #9

merged 11 commits into from
Feb 8, 2019

Conversation

yshrsmz
Copy link
Owner

@yshrsmz yshrsmz commented Feb 7, 2019

close #8

  • README
  • Test

final API:

buildkonfig {
  packageName = "com.example"

  defaultConfigs {
    // this is the default of defaultConfigs
  }
  defaultConfigs("dev") {}
  defaultConfigs("release") {}

  targetConfigs {
    // targetConfigs without flavor acts as a default for each target
  }
  targetConfigs("dev") {
    android {
    }
    ios {
    }
  }
  targetConfigs("release") {
    android {
    }
    // you don't need to configure each target.
    // non-configured target will be fallback to default configs
  }
}

you can specify flavor via property buildkonfig.flavor, like

$ ./gradlew build -Pbuildkonfig.flavor=dev

Or you can provide it via gradle.properties

@yshrsmz yshrsmz changed the title [WIP] Issue/8 flavor support Issue/8 flavor support Feb 8, 2019
@yshrsmz yshrsmz merged commit 636bbd4 into master Feb 8, 2019
@yshrsmz yshrsmz deleted the issue/8-flavor branch February 8, 2019 09:35
@benlancaster
Copy link

benlancaster commented Nov 27, 2020

Do you have an example of how to use this with build.gradle.kts?

    targetConfigs("usa") {
        android {
            dependencies {
                implementation(project(":usaGreeter"))
            }
        }
    })

yields:

Type mismatch: inferred type is () -> Unit but Closure<*> was expected

With

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 this pull request may close these issues.

flavor support
2 participants