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.util.Map<java.lang.String,java.lang.String> getManifestPlaceholders()
          Returns the map of key value pairs for placeholder substitution in the android manifest file.
 ApiVersion getMinSdkVersion()
          Returns the minSdkVersion.
 java.lang.String getName()
          Returns the name of the flavor.
 NdkConfig getNdkConfig()
          Returns the NDK configuration.
 boolean getRenderscriptNdkMode()
          Returns whether the renderscript code should be compiled to generate C/C++ bindings.
 boolean getRenderscriptSupportMode()
          Returns whether the renderscript code should be compiled in support mode to make it compatible with older versions of Android.
 int getRenderscriptTargetApi()
          Returns the renderscript target api.
 java.util.Collection<java.lang.String> getResourceConfigurations()
          Returns the resource configuration for this variant.
 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.
 int getVersionCode()
          Returns the version code.
 java.lang.String getVersionName()
          Returns the version name.
 
Methods inherited from interface com.android.builder.model.BaseConfig
getBuildConfigFields, getConsumerProguardFiles, 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

int getVersionCode()
Returns the version code. This is only the value set on this product flavor. To get the final value, use Variant.getMergedFlavor()

Returns:
the version code, or -1 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

getRenderscriptTargetApi

int 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 -1 if not specified

getRenderscriptSupportMode

boolean getRenderscriptSupportMode()
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.

getRenderscriptNdkMode

boolean getRenderscriptNdkMode()
Returns whether the renderscript code should be compiled to generate C/C++ bindings.

Returns:
true for C/C++ generation, false for Java

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.

getNdkConfig

@Nullable
NdkConfig getNdkConfig()
Returns the NDK configuration.

Returns:
the ndk config.

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.

getManifestPlaceholders

@NonNull
java.util.Map<java.lang.String,java.lang.String> getManifestPlaceholders()
Returns the map of key value pairs for placeholder substitution in the android manifest file. This map will be used by the manifest merger.

Returns:
the map of key value pairs.