Giter Site home page Giter Site logo

porflavor's People

Contributors

jonatanplesko avatar nikialeksey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

porflavor's Issues

Does not works with lower case flavor names

... something like this

    productFlavors {
        brand1 {
            dimension 'brand'
        }
        brand2 {
            dimension 'brand'
        }
        brand3 {
            dimension 'brand'
        }
        store {
            dimension 'version'
        }
        staging {
            dimension 'version'
        }
    }

and using title case flavor name break dependencies implementation flavor specific like that:

dependencies {
    storeImplementation ....
    stagingImplementation ....
}

move "apply plugin" on top of gradle file

actually if we do we receive this error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '#####/app/build.gradle' line: 8

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.nikialeksey.porflavor']
   > java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

CONFIGURE FAILED in 0s
Failed to apply plugin [id 'com.nikialeksey.porflavor']

default buildConfigField for non-specific combinations

In our app we currently have 6 productFlavors

productFlavors {
    create("local") {} // the first three are dimension `environment`
    create("staging") {}
    create("production") {}
    create("type1") {} // this and the following are dimension `app`
    create("type2") {}
    create("type3") {}
    create("type4") {}
 }

Then inside the porflavor block, we specify for only a few combinations some BuildConfigFields:

porflavor {
   create("localType1") { 
       buildConfigField("String", "CLIENT_ID", """"id"""")
    }
   create("stagingType1") { 
       buildConfigField("String", "CLIENT_ID", """"id"""")
    }
   create("stagingType2") { 
       buildConfigField("String", "CLIENT_ID", """"id"""")
    }
   create("stagingType3") { 
       buildConfigField("String", "CLIENT_ID", """"id"""")
    }
   create("productionType2") { 
       buildConfigField("String", "CLIENT_ID", """"id"""")
    }
}

But for some of the combinations possible, some of the buildConfigField are missing, and when selecting one of the lacking BuildVariants from Android Studio, or when running the generic ./gradlew build (which I'm trying to setup on CI, the builds fail as there is no BuildConfig.CLIENT_ID specified.

Should I specify all the BuildConfigField for every possible combination?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.