|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.builder.VariantConfiguration
public class VariantConfiguration
A Variant configuration.
Nested Class Summary | |
---|---|
static class |
VariantConfiguration.Type
|
Constructor Summary | |
---|---|
VariantConfiguration(DefaultProductFlavor defaultConfig,
com.android.builder.model.SourceProvider defaultSourceProvider,
DefaultBuildType buildType,
com.android.builder.model.SourceProvider buildTypeSourceProvider)
Creates the configuration with the base source sets. |
|
VariantConfiguration(DefaultProductFlavor defaultConfig,
com.android.builder.model.SourceProvider defaultSourceProvider,
DefaultBuildType buildType,
com.android.builder.model.SourceProvider buildTypeSourceProvider,
VariantConfiguration.Type type)
Creates the configuration with the base source sets for a given VariantConfiguration.Type . |
|
VariantConfiguration(DefaultProductFlavor defaultConfig,
com.android.builder.model.SourceProvider defaultSourceProvider,
DefaultBuildType buildType,
com.android.builder.model.SourceProvider buildTypeSourceProvider,
VariantConfiguration.Type type,
VariantConfiguration testedConfig)
Creates the configuration with the base source sets, and an optional tested variant. |
Method Summary | |
---|---|
VariantConfiguration |
addProductFlavor(DefaultProductFlavor productFlavor,
com.android.builder.model.SourceProvider sourceProvider,
java.lang.String dimensionName)
Add a new configured ProductFlavor. |
void |
checkSourceProviders()
Checks the SourceProviders to ensure that they don't use the same folders. |
java.util.List<java.io.File> |
getAidlImports()
Returns all the aidl import folder that are outside of the current project. |
java.util.List<java.io.File> |
getAidlSourceList()
|
java.util.List<LibraryDependency> |
getAllLibraries()
Returns all the library dependencies, direct and transitive. |
java.util.List<com.android.ide.common.res2.AssetSet> |
getAssetSets(boolean includeDependencies)
Returns the dynamic list of AssetSet based on the configuration, its dependencies,
as well as tested config if applicable (test of a library). |
java.lang.String |
getBaseName()
Returns the full, unique name of the variant, including BuildType, flavors and test, dash separated. |
java.util.List<java.lang.Object> |
getBuildConfigItems()
Returns a list of items for the BuildConfig class. |
DefaultBuildType |
getBuildType()
|
com.android.builder.model.SourceProvider |
getBuildTypeSourceSet()
The SourceProvider for the BuildType. |
java.util.Set<java.io.File> |
getCompileClasspath()
Returns the compile classpath for this config. |
java.util.List<java.lang.Object> |
getConsumerProguardFiles()
|
DefaultProductFlavor |
getDefaultConfig()
|
com.android.builder.model.SourceProvider |
getDefaultSourceSet()
|
java.util.List<LibraryDependency> |
getDirectLibraries()
Returns the direct library dependencies |
java.lang.String |
getDirName()
Returns a unique directory name (can include multiple folders) for the variant, based on build type, flavor and test. |
java.util.List<DefaultProductFlavor> |
getFlavorConfigs()
|
java.lang.String |
getFlavorName()
Returns the flavor name of the variant, including all flavors in camel case (starting with a lower case). |
java.util.List<java.lang.String> |
getFlavorNamesWithDimensionNames()
Return the names of the applied flavors. |
java.util.List<com.android.builder.model.SourceProvider> |
getFlavorSourceProviders()
Returns the list of SourceProviders for the flavors. |
java.lang.String |
getFullName()
Returns the full, unique name of the variant in camel case (starting with a lower case), including BuildType, Flavors and Test (if applicable). |
java.lang.Boolean |
getFunctionalTest()
Returns functionalTest value to use to test this variant, or if the variant is a test, the one to use to test the tested variant. |
java.lang.Boolean |
getHandleProfiling()
Returns handleProfiling value to use to test this variant, or if the variant is a test, the one to use to test the tested variant. |
java.lang.String |
getInstrumentationRunner()
Returns the instrumentationRunner to use to test this variant, or if the variant is a test, the one to use to test the tested variant. |
java.util.Collection<JarDependency> |
getJars()
Returns the list of jar dependencies |
java.util.List<java.io.File> |
getJniLibsList()
|
java.util.List<java.io.File> |
getJniSourceList()
|
java.util.List<java.io.File> |
getLibraryJniFolders()
|
java.io.File |
getMainManifest()
|
java.util.List<java.io.File> |
getManifestOverlays()
|
static java.lang.String |
getManifestPackage(java.io.File manifestFile)
Parses the manifest file and return the package name. |
DefaultProductFlavor |
getMergedFlavor()
|
int |
getMinSdkVersion()
Return the minSdkVersion for this variant. |
com.android.builder.model.SourceProvider |
getMultiFlavorSourceProvider()
|
com.android.builder.model.NdkConfig |
getNdkConfig()
|
java.lang.String |
getOriginalPackageName()
Returns the original package name before any overrides from flavors. |
java.util.Set<java.io.File> |
getPackagedJars()
Returns the list of packaged jars for this config. |
java.lang.String |
getPackageFromManifest()
Reads the package name from the manifest. |
java.lang.String |
getPackageName()
Returns the package name for this variant. |
java.lang.String |
getPackageOverride()
Returns the package override values coming from the Product Flavor and/or the Build Type. |
java.util.List<java.lang.Object> |
getProguardFiles(boolean includeLibraries)
|
java.util.List<java.io.File> |
getProvidedOnlyJars()
Returns the list of provided-only jars for this config. |
java.util.List<java.io.File> |
getRenderscriptImports()
Returns all the renderscript import folder that are outside of the current project. |
java.util.List<java.io.File> |
getRenderscriptSourceList()
Returns all the renderscript source folder from the main config, the flavors and the build type. |
java.util.List<com.android.ide.common.res2.ResourceSet> |
getResourceSets(java.util.List<java.io.File> generatedResFolders,
boolean includeDependencies)
Returns the dynamic list of ResourceSet based on the configuration, its dependencies,
as well as tested config if applicable (test of a library). |
java.util.List<java.lang.Object> |
getResValues()
Returns a list of generated resource values. |
com.android.builder.model.SigningConfig |
getSigningConfig()
|
java.util.List<com.android.builder.model.BaseConfig> |
getSortedBaseConfigs()
|
java.util.List<com.android.builder.model.SourceProvider> |
getSortedSourceProviders()
Returns a list of sorted SourceProvider in order of ascending order, meaning, the earlier items are meant to be overridden by later items. |
java.util.Set<java.lang.String> |
getSupportedAbis()
List of supported ABIs. |
int |
getTargetSdkVersion()
Return the targetSdkVersion for this variant. |
VariantConfiguration |
getTestedConfig()
|
java.lang.String |
getTestedPackageName()
Returns the tested package name. |
VariantConfiguration.Type |
getType()
|
com.android.builder.model.SourceProvider |
getVariantSourceProvider()
Returns the variant specific source provider |
int |
getVersionCode()
Returns the version code for this variant. |
int |
getVersionCodeFromManifest()
Reads the version code from the manifest. |
java.lang.String |
getVersionName()
Returns the version name for this variant. |
java.lang.String |
getVersionNameFromManifest()
Reads the version name from the manifest. |
boolean |
hasFlavors()
|
boolean |
hasLibraries()
|
boolean |
isSigningReady()
|
VariantConfiguration |
setDependencies(DependencyContainer container)
Sets the dependencies |
VariantConfiguration |
setMultiFlavorSourceProvider(com.android.builder.model.SourceProvider sourceProvider)
Sets the variant-specific source provider. |
VariantConfiguration |
setOutput(LibraryDependency output)
Sets the output of this variant. |
VariantConfiguration |
setVariantSourceProvider(com.android.builder.model.SourceProvider sourceProvider)
Sets the variant-specific source provider. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VariantConfiguration(@NonNull DefaultProductFlavor defaultConfig, @NonNull com.android.builder.model.SourceProvider defaultSourceProvider, @NonNull DefaultBuildType buildType, @Nullable com.android.builder.model.SourceProvider buildTypeSourceProvider)
VariantConfiguration.Type.DEFAULT
type.
defaultConfig
- the default configuration. Required.defaultSourceProvider
- the default source provider. RequiredbuildType
- the build type for this variant. Required.buildTypeSourceProvider
- the source provider for the build type. Required.public VariantConfiguration(@NonNull DefaultProductFlavor defaultConfig, @NonNull com.android.builder.model.SourceProvider defaultSourceProvider, @NonNull DefaultBuildType buildType, @Nullable com.android.builder.model.SourceProvider buildTypeSourceProvider, @NonNull VariantConfiguration.Type type)
VariantConfiguration.Type
.
defaultConfig
- the default configuration. Required.defaultSourceProvider
- the default source provider. RequiredbuildType
- the build type for this variant. Required.buildTypeSourceProvider
- the source provider for the build type.type
- the type of the project.public VariantConfiguration(@NonNull DefaultProductFlavor defaultConfig, @NonNull com.android.builder.model.SourceProvider defaultSourceProvider, @NonNull DefaultBuildType buildType, @Nullable com.android.builder.model.SourceProvider buildTypeSourceProvider, @NonNull VariantConfiguration.Type type, @Nullable VariantConfiguration testedConfig)
defaultConfig
- the default configuration. Required.defaultSourceProvider
- the default source provider. RequiredbuildType
- the build type for this variant. Required.buildTypeSourceProvider
- the source provider for the build type.type
- the type of the project.testedConfig
- the reference to the tested project. Required if type is Type.TESTMethod Detail |
---|
@Nullable public static java.lang.String getManifestPackage(@NonNull java.io.File manifestFile)
manifestFile
- the manifest file
@NonNull public java.lang.String getFullName()
@NonNull public java.lang.String getFlavorName()
@NonNull public java.lang.String getBaseName()
@NonNull public java.lang.String getDirName()
@NonNull public java.util.List<java.lang.String> getFlavorNamesWithDimensionNames()
@NonNull public VariantConfiguration addProductFlavor(@NonNull DefaultProductFlavor productFlavor, @NonNull com.android.builder.model.SourceProvider sourceProvider, @NonNull java.lang.String dimensionName)
productFlavor
- the configured product flavorsourceProvider
- the source provider for the product flavordimensionName
- the name of the dimension associated with the flavor
public void checkSourceProviders()
java.lang.RuntimeException
- if a dup is found.public VariantConfiguration setVariantSourceProvider(@Nullable com.android.builder.model.SourceProvider sourceProvider)
sourceProvider
- the source provider for the product flavor
public VariantConfiguration setMultiFlavorSourceProvider(@Nullable com.android.builder.model.SourceProvider sourceProvider)
sourceProvider
- the source provider for the product flavor
@Nullable public com.android.builder.model.SourceProvider getVariantSourceProvider()
@Nullable public com.android.builder.model.SourceProvider getMultiFlavorSourceProvider()
@NonNull public VariantConfiguration setDependencies(@NonNull DependencyContainer container)
container
- a DependencyContainer.
@NonNull public java.util.Collection<JarDependency> getJars()
@NonNull public VariantConfiguration setOutput(LibraryDependency output)
output
- the output of the library as an LibraryDependency that will provides the
location of all the created items.
@NonNull public DefaultProductFlavor getDefaultConfig()
@NonNull public com.android.builder.model.SourceProvider getDefaultSourceSet()
@NonNull public DefaultProductFlavor getMergedFlavor()
@NonNull public DefaultBuildType getBuildType()
@Nullable public com.android.builder.model.SourceProvider getBuildTypeSourceSet()
public boolean hasFlavors()
@NonNull public java.util.List<DefaultProductFlavor> getFlavorConfigs()
@NonNull public java.util.List<com.android.builder.model.SourceProvider> getFlavorSourceProviders()
public boolean hasLibraries()
@NonNull public java.util.List<LibraryDependency> getDirectLibraries()
@NonNull public java.util.List<LibraryDependency> getAllLibraries()
@NonNull public VariantConfiguration.Type getType()
@Nullable public VariantConfiguration getTestedConfig()
@Nullable public java.lang.String getOriginalPackageName()
@NonNull public java.lang.String getPackageName()
getPackageName
in interface TestData
@Nullable public java.lang.String getTestedPackageName()
TestData
getTestedPackageName
in interface TestData
@Nullable public java.lang.String getPackageOverride()
@Nullable public java.lang.String getVersionName()
public int getVersionCode()
@NonNull public java.lang.String getInstrumentationRunner()
getInstrumentationRunner
in interface TestData
@NonNull public java.lang.Boolean getHandleProfiling()
getHandleProfiling
in interface TestData
@NonNull public java.lang.Boolean getFunctionalTest()
getFunctionalTest
in interface TestData
@Nullable public java.lang.String getPackageFromManifest()
@Nullable public java.lang.String getVersionNameFromManifest()
public int getVersionCodeFromManifest()
public int getMinSdkVersion()
getMinSdkVersion
in interface TestData
public int getTargetSdkVersion()
@Nullable public java.io.File getMainManifest()
@NonNull public java.util.List<com.android.builder.model.SourceProvider> getSortedSourceProviders()
@NonNull public java.util.List<com.android.builder.model.BaseConfig> getSortedBaseConfigs()
@NonNull public java.util.List<java.io.File> getManifestOverlays()
@NonNull public java.util.List<com.android.ide.common.res2.ResourceSet> getResourceSets(@NonNull java.util.List<java.io.File> generatedResFolders, boolean includeDependencies)
ResourceSet
based on the configuration, its dependencies,
as well as tested config if applicable (test of a library).
The list is ordered in ascending order of importance, meaning the first set is meant to be
overridden by the 2nd one and so on. This is meant to facilitate usage of the list in a
ResourceMerger
.
generatedResFolders
- a list of generated res foldersincludeDependencies
- whether to include in the result the resources of the dependencies
@NonNull public java.util.List<com.android.ide.common.res2.AssetSet> getAssetSets(boolean includeDependencies)
AssetSet
based on the configuration, its dependencies,
as well as tested config if applicable (test of a library).
The list is ordered in ascending order of importance, meaning the first set is meant to be
overridden by the 2nd one and so on. This is meant to facilitate usage of the list in a
AssetMerger
.
@NonNull public java.util.List<java.io.File> getLibraryJniFolders()
@NonNull public java.util.List<java.io.File> getRenderscriptImports()
@NonNull public java.util.List<java.io.File> getRenderscriptSourceList()
@NonNull public java.util.List<java.io.File> getAidlImports()
@NonNull public java.util.List<java.io.File> getAidlSourceList()
@NonNull public java.util.List<java.io.File> getJniSourceList()
@NonNull public java.util.List<java.io.File> getJniLibsList()
@NonNull public java.util.Set<java.io.File> getCompileClasspath()
@NonNull public java.util.Set<java.io.File> getPackagedJars()
@NonNull public java.util.List<java.io.File> getProvidedOnlyJars()
@NonNull public java.util.List<java.lang.Object> getBuildConfigItems()
ClassField
)
or comments (instance of String).
@NonNull public java.util.List<java.lang.Object> getResValues()
ClassField
)
or comments (instance of String).
@Nullable public com.android.builder.model.SigningConfig getSigningConfig()
public boolean isSigningReady()
@NonNull public java.util.List<java.lang.Object> getProguardFiles(boolean includeLibraries)
@NonNull public java.util.List<java.lang.Object> getConsumerProguardFiles()
@NonNull public com.android.builder.model.NdkConfig getNdkConfig()
@Nullable public java.util.Set<java.lang.String> getSupportedAbis()
TestData
getSupportedAbis
in interface TestData
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |