DSL object used to configure product flavors.
Constructor and description |
---|
ProductFlavor
(String name, org.gradle.api.Project project, org.gradle.internal.reflect.Instantiator instantiator, org.gradle.api.logging.Logger logger) |
Type | Name and description |
---|---|
void |
buildConfigField(String type, String name, String value) Adds a new field to the generated BuildConfig class. |
void |
consumerProguardFiles(Object... proguardFileArray) |
NdkConfig |
getNdkConfig() |
SigningConfig |
getSigningConfig() Signing config used by this product flavor. |
Boolean |
getUseJack() Whether the experimental Jack toolchain should be used. |
void |
maxSdkVersion(int targetSdkVersion) Sets the maximum SDK version to the given value. |
void |
minSdkVersion(int minSdkVersion) Sets minimum SDK version. |
void |
minSdkVersion(String minSdkVersion) Sets minimum SDK version. |
void |
ndk(org.gradle.api.Action<NdkOptions> action) |
void |
proguardFile(Object proguardFile) Adds a new ProGuard configuration file. |
void |
proguardFiles(Object... proguardFileArray) Adds new ProGuard configuration files. |
void |
resConfig(String config) Adds a resource configuration filter. |
void |
resConfigs(String... config) Adds several resource configuration filters. |
void |
resConfigs(Collection<String> config) Adds several resource configuration filters. |
void |
resValue(String type, String name, String value) Adds a new generated resource. |
void |
setConsumerProguardFiles(Iterable<?> proguardFileIterable) Specifies a proguard rule file to be included in the published AAR. |
void |
setMinSdkVersion(int minSdkVersion) |
void |
setMinSdkVersion(String minSdkVersion) |
void |
setProguardFiles(Iterable<?> proguardFileIterable) Sets the ProGuard configuration files. |
com.android.builder.model.ProductFlavor |
setTargetSdkVersion(int targetSdkVersion) |
void |
setTargetSdkVersion(String targetSdkVersion) |
void |
setUseJack(Boolean useJack) Whether the experimental Jack toolchain should be used. |
void |
targetSdkVersion(int targetSdkVersion) Sets the target SDK version to the given value. |
void |
targetSdkVersion(String targetSdkVersion) Sets the target SDK version to the given value. |
void |
testProguardFile(Object proguardFile) Specifies a proguard rule file to be included in the published AAR. |
void |
testProguardFiles(Object... proguardFileArray) Adds new ProGuard configuration files. |
void |
useJack(Boolean useJack) Whether the experimental Jack toolchain should be used. |
Adds a new field to the generated BuildConfig class.
The field is generated as:
type
- the type of the fieldname
- the name of the fieldvalue
- the value of the field
Signing config used by this product flavor.
Whether the experimental Jack toolchain should be used.
See Jack and Jill
Sets the maximum SDK version to the given value.
Sets minimum SDK version.
Sets minimum SDK version.
Adds a new ProGuard configuration file.
proguardFile getDefaultProguardFile('proguard-android.txt')
There are 2 default rules files
They are located in the SDK. Using getDefaultProguardFile(String filename)
will return the
full path to the files. They are identical except for enabling optimizations.
Adds new ProGuard configuration files.
There are 2 default rules files
They are located in the SDK. Using getDefaultProguardFile(String filename)
will return the
full path to the files. They are identical except for enabling optimizations.
Adds a resource configuration filter.
If a qualifier value is passed, then all other resources using a qualifier of the same type but of different value will be ignored from the final packaging of the APK.
For instance, specifying 'hdpi', will ignore all resources using mdpi, xhdpi, etc...
Adds several resource configuration filters.
If a qualifier value is passed, then all other resources using a qualifier of the same type but of different value will be ignored from the final packaging of the APK.
For instance, specifying 'hdpi', will ignore all resources using mdpi, xhdpi, etc...
Adds several resource configuration filters.
If a qualifier value is passed, then all other resources using a qualifier of the same type but of different value will be ignored from the final packaging of the APK.
For instance, specifying 'hdpi', will ignore all resources using mdpi, xhdpi, etc...
Adds a new generated resource.
This is equivalent to specifying a resource in res/values.
See Resource Types.
type
- the type of the resourcename
- the name of the resourcevalue
- the value of the resourceSpecifies a proguard rule file to be included in the published AAR.
This proguard rule file will then be used by any application project that consume the AAR (if proguard is enabled).
This allows AAR to specify shrinking or obfuscation exclude rules.
This is only valid for Library project. This is ignored in Application project.
Sets the ProGuard configuration files.
There are 2 default rules files
They are located in the SDK. Using getDefaultProguardFile(String filename)
will return the
full path to the files. They are identical except for enabling optimizations.
Whether the experimental Jack toolchain should be used.
See Jack and Jill
Sets the target SDK version to the given value.
Sets the target SDK version to the given value.
Specifies a proguard rule file to be included in the published AAR.
This proguard rule file will then be used by any application project that consume the AAR (if proguard is enabled).
This allows AAR to specify shrinking or obfuscation exclude rules.
This is only valid for Library project. This is ignored in Application project.
Adds new ProGuard configuration files.
Whether the experimental Jack toolchain should be used.
See Jack and Jill