com.android.builder.model
Interface ProductFlavor

All Superinterfaces:
BaseConfig

public interface ProductFlavor
extends BaseConfig

a Product Flavor. This is only the configuration of the flavor. It does not include the sources or the dependencies. Those are available on the container or in the artifact info.

See Also:
ProductFlavorContainer, BaseArtifact.getDependencies()

Method Summary
 java.lang.String getApplicationId()
          Returns the name of the product flavor.
 java.lang.Integer getMaxSdkVersion()
          Returns the maxSdkVersion.
 ApiVersion getMinSdkVersion()
          Returns the minSdkVersion.
 java.lang.String getName()
          Returns the name of the flavor.
 java.lang.Boolean getRenderscriptNdkModeEnabled()
          Returns whether the renderscript code should be compiled to generate C/C++ bindings.
 java.lang.Boolean getRenderscriptSupportModeEnabled()
          Returns whether the renderscript code should be compiled in support mode to make it compatible with older versions of Android.
 java.lang.Integer getRenderscriptTargetApi()
          Returns the renderscript target api.
 java.util.Collection<java.lang.String> getResourceConfigurations()
          Returns the resource configuration for this variant.
 SigningConfig getSigningConfig()
          Returns the associated signing config or null if none are set on the product flavor.
 ApiVersion getTargetSdkVersion()
          Returns the targetSdkVersion.
 java.lang.String getTestApplicationId()
          Returns the test application id.
 java.lang.Boolean getTestFunctionalTest()
          Returns the functionalTest value.
 java.lang.Boolean getTestHandleProfiling()
          Returns the handlingProfile value.
 java.lang.String getTestInstrumentationRunner()
          Returns the test instrumentation runner.
 java.lang.Integer getVersionCode()
          Returns the version code associated with this flavor or null if none have been set.
 java.lang.String getVersionName()
          Returns the version name.
 
Methods inherited from interface com.android.builder.model.BaseConfig
getBuildConfigFields, getConsumerProguardFiles, getManifestPlaceholders, getMultiDexEnabled, getMultiDexKeepFile, getMultiDexKeepProguard, getProguardFiles, getResValues
 

Method Detail

getName

@NonNull
java.lang.String getName()
Returns the name of the flavor.

Specified by:
getName in interface BaseConfig
Returns:
the name of the flavor.

getApplicationId

@Nullable
java.lang.String getApplicationId()
Returns the name of the product flavor. This is only the value set on this product flavor. To get the final application id name, use AndroidArtifact.getApplicationId().

Returns:
the application id.

getVersionCode

@Nullable
java.lang.Integer getVersionCode()
Returns the version code associated with this flavor or null if none have been set. This is only the value set on this product flavor, not necessarily the actual version code used.

Returns:
the version code, or null if not specified

getVersionName

@Nullable
java.lang.String getVersionName()
Returns the version name. This is only the value set on this product flavor. To get the final value, use Variant.getMergedFlavor() as well as BuildType.getVersionNameSuffix()

Returns:
the version name.

getMinSdkVersion

@Nullable
ApiVersion getMinSdkVersion()
Returns the minSdkVersion. This is only the value set on this product flavor.

Returns:
the minSdkVersion, or null if not specified

getTargetSdkVersion

@Nullable
ApiVersion getTargetSdkVersion()
Returns the targetSdkVersion. This is only the value set on this product flavor.

Returns:
the targetSdkVersion, or null if not specified

getMaxSdkVersion

@Nullable
java.lang.Integer getMaxSdkVersion()
Returns the maxSdkVersion. This is only the value set on this produce flavor.

Returns:
the maxSdkVersion, or null if not specified

getRenderscriptTargetApi

@Nullable
java.lang.Integer getRenderscriptTargetApi()
Returns the renderscript target api. This is only the value set on this product flavor. TODO: make final renderscript target api available through the model

Returns:
the renderscript target api, or null if not specified

getRenderscriptSupportModeEnabled

@Nullable
java.lang.Boolean getRenderscriptSupportModeEnabled()
Returns whether the renderscript code should be compiled in support mode to make it compatible with older versions of Android.

Returns:
true if support mode is enabled, false if not, and null if not specified.

getRenderscriptNdkModeEnabled

@Nullable
java.lang.Boolean getRenderscriptNdkModeEnabled()
Returns whether the renderscript code should be compiled to generate C/C++ bindings.

Returns:
true for C/C++ generation, false for Java, null if not specified.

getTestApplicationId

@Nullable
java.lang.String getTestApplicationId()
Returns the test application id. This is only the value set on this product flavor. To get the final value, use Variant.getExtraAndroidArtifacts() with AndroidProject.ARTIFACT_ANDROID_TEST and then AndroidArtifact.getApplicationId()

Returns:
the test package name.

getTestInstrumentationRunner

@Nullable
java.lang.String getTestInstrumentationRunner()
Returns the test instrumentation runner. This is only the value set on this product flavor. TODO: make test instrumentation runner available through the model.

Returns:
the test package name.

getTestHandleProfiling

@Nullable
java.lang.Boolean getTestHandleProfiling()
Returns the handlingProfile value. This is only the value set on this product flavor.

Returns:
the handlingProfile value.

getTestFunctionalTest

@Nullable
java.lang.Boolean getTestFunctionalTest()
Returns the functionalTest value. This is only the value set on this product flavor.

Returns:
the functionalTest value.

getResourceConfigurations

@NonNull
java.util.Collection<java.lang.String> getResourceConfigurations()
Returns the resource configuration for this variant. TODO implement this. This is the list of -c parameters for aapt.

Returns:
the resource configuration options.

getSigningConfig

@Nullable
SigningConfig getSigningConfig()
Returns the associated signing config or null if none are set on the product flavor.