com.android.builder.core
Class DefaultProductFlavor

java.lang.Object
  extended by com.android.builder.internal.BaseConfigImpl
      extended by com.android.builder.core.DefaultProductFlavor
All Implemented Interfaces:
com.android.builder.model.BaseConfig, com.android.builder.model.ProductFlavor, java.io.Serializable

public class DefaultProductFlavor
extends com.android.builder.internal.BaseConfigImpl
implements com.android.builder.model.ProductFlavor

The configuration of a product flavor. This is also used to describe the default configuration of all builds, even those that do not contain any flavors.

See Also:
Serialized Form

Constructor Summary
DefaultProductFlavor(java.lang.String name)
          Creates a ProductFlavor with a given name.
 
Method Summary
 void addResourceConfiguration(java.lang.String configuration)
           
 void addResourceConfigurations(java.util.Collection<java.lang.String> configurations)
           
 void addResourceConfigurations(java.lang.String... configurations)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getApplicationId()
           
 java.lang.Integer getMaxSdkVersion()
           
 com.android.builder.model.ApiVersion getMinSdkVersion()
           
 java.lang.String getName()
           
 com.android.builder.model.NdkConfig getNdkConfig()
           
 boolean getRenderscriptNdkMode()
           
 boolean getRenderscriptSupportMode()
           
 int getRenderscriptTargetApi()
           
 java.util.Collection<java.lang.String> getResourceConfigurations()
           
 com.android.builder.model.SigningConfig getSigningConfig()
           
 com.android.builder.model.ApiVersion getTargetSdkVersion()
           
 java.lang.String getTestApplicationId()
           
 java.lang.Boolean getTestFunctionalTest()
           
 java.lang.Boolean getTestHandleProfiling()
           
 java.lang.String getTestInstrumentationRunner()
           
 int getVersionCode()
           
 java.lang.String getVersionName()
           
 int hashCode()
           
 com.android.builder.model.ProductFlavor setApplicationId(java.lang.String applicationId)
          Sets the application id.
 com.android.builder.model.ProductFlavor setMaxSdkVersion(java.lang.Integer maxSdkVersion)
           
 com.android.builder.model.ProductFlavor setMinSdkVersion(com.android.builder.model.ApiVersion minSdkVersion)
          Sets the minSdkVersion to the given value.
 void setRenderscriptNdkMode(boolean renderscriptNdkMode)
          Sets whether the renderscript code should be compiled to generate C/C++ bindings.
 void setRenderscriptSupportMode(boolean renderscriptSupportMode)
          Sets whether the renderscript code should be compiled in support mode to make it compatible with older versions of Android.
 void setRenderscriptTargetApi(int renderscriptTargetApi)
          Sets the renderscript target API to the given value.
 com.android.builder.model.ProductFlavor setSigningConfig(com.android.builder.model.SigningConfig signingConfig)
          Sets the signing configuration.
 com.android.builder.model.ProductFlavor setTargetSdkVersion(com.android.builder.model.ApiVersion targetSdkVersion)
          Sets the targetSdkVersion to the given value.
 com.android.builder.model.ProductFlavor setTestApplicationId(java.lang.String applicationId)
          Sets the test package name.
 com.android.builder.model.ProductFlavor setTestFunctionalTest(boolean functionalTest)
           
 com.android.builder.model.ProductFlavor setTestHandleProfiling(boolean handleProfiling)
           
 com.android.builder.model.ProductFlavor setTestInstrumentationRunner(java.lang.String testInstrumentationRunner)
          Sets the test instrumentation runner to the given value.
 com.android.builder.model.ProductFlavor setVersionCode(int versionCode)
          Sets the version code.
 com.android.builder.model.ProductFlavor setVersionName(java.lang.String versionName)
          Sets the version name.
 java.lang.String toString()
           
 
Methods inherited from class com.android.builder.internal.BaseConfigImpl
_initWith, addBuildConfigField, addManifestPlaceHolders, addResValue, getBuildConfigFields, getConsumerProguardFiles, getManifestPlaceholders, getProguardFiles, getResValues, setManifestPlaceholders
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.android.builder.model.BaseConfig
getBuildConfigFields, getConsumerProguardFiles, getManifestPlaceholders, getProguardFiles, getResValues
 

Constructor Detail

DefaultProductFlavor

public DefaultProductFlavor(@NonNull
                            java.lang.String name)
Creates a ProductFlavor with a given name. Names can be important when dealing with flavor groups.

Parameters:
name - the name of the flavor.
See Also:
BuilderConstants.MAIN
Method Detail

getName

@NonNull
public java.lang.String getName()
Specified by:
getName in interface com.android.builder.model.BaseConfig
Specified by:
getName in interface com.android.builder.model.ProductFlavor

setApplicationId

@NonNull
public com.android.builder.model.ProductFlavor setApplicationId(java.lang.String applicationId)
Sets the application id.

Parameters:
applicationId - the application id
Returns:
the flavor object

getApplicationId

@Nullable
public java.lang.String getApplicationId()
Specified by:
getApplicationId in interface com.android.builder.model.ProductFlavor

setVersionCode

@NonNull
public com.android.builder.model.ProductFlavor setVersionCode(int versionCode)
Sets the version code. If the value is -1, it is considered not set.

Parameters:
versionCode - the version code
Returns:
the flavor object

getVersionCode

public int getVersionCode()
Specified by:
getVersionCode in interface com.android.builder.model.ProductFlavor

setVersionName

@NonNull
public com.android.builder.model.ProductFlavor setVersionName(java.lang.String versionName)
Sets the version name.

Parameters:
versionName - the version name
Returns:
the flavor object

getVersionName

@Nullable
public java.lang.String getVersionName()
Specified by:
getVersionName in interface com.android.builder.model.ProductFlavor

setMinSdkVersion

@NonNull
public com.android.builder.model.ProductFlavor setMinSdkVersion(com.android.builder.model.ApiVersion minSdkVersion)
Sets the minSdkVersion to the given value.


getMinSdkVersion

public com.android.builder.model.ApiVersion getMinSdkVersion()
Specified by:
getMinSdkVersion in interface com.android.builder.model.ProductFlavor

setTargetSdkVersion

@NonNull
public com.android.builder.model.ProductFlavor setTargetSdkVersion(com.android.builder.model.ApiVersion targetSdkVersion)
Sets the targetSdkVersion to the given value.


getTargetSdkVersion

public com.android.builder.model.ApiVersion getTargetSdkVersion()
Specified by:
getTargetSdkVersion in interface com.android.builder.model.ProductFlavor

setMaxSdkVersion

@NonNull
public com.android.builder.model.ProductFlavor setMaxSdkVersion(java.lang.Integer maxSdkVersion)

getMaxSdkVersion

public java.lang.Integer getMaxSdkVersion()
Specified by:
getMaxSdkVersion in interface com.android.builder.model.ProductFlavor

getRenderscriptTargetApi

public int getRenderscriptTargetApi()
Specified by:
getRenderscriptTargetApi in interface com.android.builder.model.ProductFlavor

setRenderscriptTargetApi

public void setRenderscriptTargetApi(int renderscriptTargetApi)
Sets the renderscript target API to the given value.


getRenderscriptSupportMode

public boolean getRenderscriptSupportMode()
Specified by:
getRenderscriptSupportMode in interface com.android.builder.model.ProductFlavor

setRenderscriptSupportMode

public void setRenderscriptSupportMode(boolean renderscriptSupportMode)
Sets whether the renderscript code should be compiled in support mode to make it compatible with older versions of Android.


getRenderscriptNdkMode

public boolean getRenderscriptNdkMode()
Specified by:
getRenderscriptNdkMode in interface com.android.builder.model.ProductFlavor

setRenderscriptNdkMode

public void setRenderscriptNdkMode(boolean renderscriptNdkMode)
Sets whether the renderscript code should be compiled to generate C/C++ bindings.


setTestApplicationId

@NonNull
public com.android.builder.model.ProductFlavor setTestApplicationId(java.lang.String applicationId)
Sets the test package name.


getTestApplicationId

@Nullable
public java.lang.String getTestApplicationId()
Specified by:
getTestApplicationId in interface com.android.builder.model.ProductFlavor

setTestInstrumentationRunner

@NonNull
public com.android.builder.model.ProductFlavor setTestInstrumentationRunner(java.lang.String testInstrumentationRunner)
Sets the test instrumentation runner to the given value.


getTestInstrumentationRunner

@Nullable
public java.lang.String getTestInstrumentationRunner()
Specified by:
getTestInstrumentationRunner in interface com.android.builder.model.ProductFlavor

getTestHandleProfiling

@Nullable
public java.lang.Boolean getTestHandleProfiling()
Specified by:
getTestHandleProfiling in interface com.android.builder.model.ProductFlavor

setTestHandleProfiling

@NonNull
public com.android.builder.model.ProductFlavor setTestHandleProfiling(boolean handleProfiling)

getTestFunctionalTest

@Nullable
public java.lang.Boolean getTestFunctionalTest()
Specified by:
getTestFunctionalTest in interface com.android.builder.model.ProductFlavor

setTestFunctionalTest

@NonNull
public com.android.builder.model.ProductFlavor setTestFunctionalTest(boolean functionalTest)

getSigningConfig

@Nullable
public com.android.builder.model.SigningConfig getSigningConfig()

setSigningConfig

@NonNull
public com.android.builder.model.ProductFlavor setSigningConfig(com.android.builder.model.SigningConfig signingConfig)
Sets the signing configuration. e.g.: signingConfig signingConfigs.myConfig


getNdkConfig

@Nullable
public com.android.builder.model.NdkConfig getNdkConfig()
Specified by:
getNdkConfig in interface com.android.builder.model.ProductFlavor

addResourceConfiguration

public void addResourceConfiguration(@NonNull
                                     java.lang.String configuration)

addResourceConfigurations

public void addResourceConfigurations(@NonNull
                                      java.lang.String... configurations)

addResourceConfigurations

public void addResourceConfigurations(@NonNull
                                      java.util.Collection<java.lang.String> configurations)

getResourceConfigurations

@NonNull
public java.util.Collection<java.lang.String> getResourceConfigurations()
Specified by:
getResourceConfigurations in interface com.android.builder.model.ProductFlavor

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class com.android.builder.internal.BaseConfigImpl

hashCode

public int hashCode()
Overrides:
hashCode in class com.android.builder.internal.BaseConfigImpl

toString

@NonNull
public java.lang.String toString()
Overrides:
toString in class java.lang.Object