nikialeksey / porflavor Goto Github PK
View Code? Open in Web Editor NEWPorFlavor - is the gradle plugin for extending android productFlavors
License: MIT License
PorFlavor - is the gradle plugin for extending android productFlavors
License: MIT License
... 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 ....
}
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']
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?
Currently the library only supports buildConfigField
s, which are useful for runtime use-cases. It would be great to also support resValue
fields, since those can be used directly inside the AndroidManifest
at compile time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.