com.android.builder.model
Interface AndroidProject


public interface AndroidProject

Entry point for the model of the Android Projects. This models a single module, whether the module is an app project or a library project.


Field Summary
static java.lang.String ARTIFACT_ANDROID_TEST
           
static java.lang.String ARTIFACT_MAIN
           
static java.lang.String ARTIFACT_UNIT_TEST
           
static java.lang.String FD_GENERATED
           
static java.lang.String FD_INTERMEDIATES
           
static java.lang.String FD_LOGS
           
static java.lang.String FD_OUTPUTS
           
static int GENERATION_COMPONENT
           
static int GENERATION_ORIGINAL
           
static java.lang.String OPTIONAL_COMPILATION_STEPS
           
static java.lang.String PROPERTY_APK_LOCATION
           
static java.lang.String PROPERTY_BUILD_ABI
           
static java.lang.String PROPERTY_BUILD_API
           
static java.lang.String PROPERTY_BUILD_DENSITY
           
static java.lang.String PROPERTY_BUILD_MODEL_ONLY
           
static java.lang.String PROPERTY_BUILD_MODEL_ONLY_ADVANCED
           
static java.lang.String PROPERTY_INVOKED_FROM_IDE
           
static java.lang.String PROPERTY_SIGNING_COLDSWAP_MODE
           
static java.lang.String PROPERTY_SIGNING_KEY_ALIAS
           
static java.lang.String PROPERTY_SIGNING_KEY_PASSWORD
           
static java.lang.String PROPERTY_SIGNING_STORE_FILE
           
static java.lang.String PROPERTY_SIGNING_STORE_PASSWORD
           
static java.lang.String PROPERTY_SIGNING_STORE_TYPE
           
 
Method Summary
 AaptOptions getAaptOptions()
          Returns the aapt options.
 int getApiVersion()
          Returns the model api version.
 java.util.Collection<java.lang.String> getBootClasspath()
          Returns the boot classpath matching the compile target.
 java.io.File getBuildFolder()
          Returns the build folder of this project.
 java.lang.String getBuildToolsVersion()
          Returns the build tools version used by this module.
 java.util.Collection<BuildTypeContainer> getBuildTypes()
          Returns a list of all the BuildType in their container.
 java.lang.String getCompileTarget()
          Returns the compilation target as a string.
 ProductFlavorContainer getDefaultConfig()
          Returns the ProductFlavorContainer for the 'main' default config.
 java.util.Collection<ArtifactMetaData> getExtraArtifacts()
          Returns a list of extra artifacts meta data.
 java.util.Collection<java.lang.String> getFlavorDimensions()
          Returns a list of all the flavor dimensions, may be empty.
 java.util.Collection<java.io.File> getFrameworkSources()
          Returns a list of folders or jar files that contains the framework source code.
 JavaCompileOptions getJavaCompileOptions()
          Returns the compile options for Java code.
 LintOptions getLintOptions()
          Returns the lint options.
 java.lang.String getModelVersion()
          Returns the model version.
 java.lang.String getName()
          Returns the name of the module.
 java.util.Collection<NativeToolchain> getNativeToolchains()
          Returns the collection of toolchains used to create any native libraries.
 int getPluginGeneration()
          Returns the generation of the plugin.
 java.util.Collection<ProductFlavorContainer> getProductFlavors()
          Returns a list of all the ProductFlavor in their container.
 java.lang.String getResourcePrefix()
          Returns the resource prefix to use, if any.
 java.util.Collection<SigningConfig> getSigningConfigs()
          Returns a list of SigningConfig.
 java.util.Collection<SyncIssue> getSyncIssues()
          Returns issues found during sync.
 java.util.Collection<java.lang.String> getUnresolvedDependencies()
          Deprecated. use getSyncIssues()
 java.util.Collection<Variant> getVariants()
          Returns a list of all the variants.
 boolean isLibrary()
          Returns whether this is a library.
 

Field Detail

PROPERTY_BUILD_MODEL_ONLY

static final java.lang.String PROPERTY_BUILD_MODEL_ONLY
See Also:
Constant Field Values

PROPERTY_BUILD_MODEL_ONLY_ADVANCED

static final java.lang.String PROPERTY_BUILD_MODEL_ONLY_ADVANCED
See Also:
Constant Field Values

PROPERTY_BUILD_API

static final java.lang.String PROPERTY_BUILD_API
See Also:
Constant Field Values

PROPERTY_BUILD_ABI

static final java.lang.String PROPERTY_BUILD_ABI
See Also:
Constant Field Values

PROPERTY_BUILD_DENSITY

static final java.lang.String PROPERTY_BUILD_DENSITY
See Also:
Constant Field Values

PROPERTY_INVOKED_FROM_IDE

static final java.lang.String PROPERTY_INVOKED_FROM_IDE
See Also:
Constant Field Values

PROPERTY_SIGNING_STORE_FILE

static final java.lang.String PROPERTY_SIGNING_STORE_FILE
See Also:
Constant Field Values

PROPERTY_SIGNING_STORE_PASSWORD

static final java.lang.String PROPERTY_SIGNING_STORE_PASSWORD
See Also:
Constant Field Values

PROPERTY_SIGNING_KEY_ALIAS

static final java.lang.String PROPERTY_SIGNING_KEY_ALIAS
See Also:
Constant Field Values

PROPERTY_SIGNING_KEY_PASSWORD

static final java.lang.String PROPERTY_SIGNING_KEY_PASSWORD
See Also:
Constant Field Values

PROPERTY_SIGNING_STORE_TYPE

static final java.lang.String PROPERTY_SIGNING_STORE_TYPE
See Also:
Constant Field Values

PROPERTY_SIGNING_COLDSWAP_MODE

static final java.lang.String PROPERTY_SIGNING_COLDSWAP_MODE
See Also:
Constant Field Values

OPTIONAL_COMPILATION_STEPS

static final java.lang.String OPTIONAL_COMPILATION_STEPS
See Also:
Constant Field Values

PROPERTY_APK_LOCATION

static final java.lang.String PROPERTY_APK_LOCATION
See Also:
Constant Field Values

ARTIFACT_MAIN

static final java.lang.String ARTIFACT_MAIN
See Also:
Constant Field Values

ARTIFACT_ANDROID_TEST

static final java.lang.String ARTIFACT_ANDROID_TEST
See Also:
Constant Field Values

ARTIFACT_UNIT_TEST

static final java.lang.String ARTIFACT_UNIT_TEST
See Also:
Constant Field Values

FD_INTERMEDIATES

static final java.lang.String FD_INTERMEDIATES
See Also:
Constant Field Values

FD_LOGS

static final java.lang.String FD_LOGS
See Also:
Constant Field Values

FD_OUTPUTS

static final java.lang.String FD_OUTPUTS
See Also:
Constant Field Values

FD_GENERATED

static final java.lang.String FD_GENERATED
See Also:
Constant Field Values

GENERATION_ORIGINAL

static final int GENERATION_ORIGINAL
See Also:
Constant Field Values

GENERATION_COMPONENT

static final int GENERATION_COMPONENT
See Also:
Constant Field Values
Method Detail

getModelVersion

@NonNull
java.lang.String getModelVersion()
Returns the model version. This is a string in the format X.Y.Z

Returns:
a string containing the model version.

getApiVersion

int getApiVersion()
Returns the model api version.

This is different from getModelVersion() in a way that new model version might increment model version but keep existing api. That means that code which was built against particular 'api version' might be safely re-used for all new model versions as long as they don't change the api.

Every new model version is assumed to return an 'api version' value which is equal or greater than the value used by the previous model version.

Returns:
model's api version

getName

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

Returns:
the name of the module.

isLibrary

boolean isLibrary()
Returns whether this is a library.

Returns:
true for a library module.

getDefaultConfig

@NonNull
ProductFlavorContainer getDefaultConfig()
Returns the ProductFlavorContainer for the 'main' default config.

Returns:
the product flavor.

getBuildTypes

@NonNull
java.util.Collection<BuildTypeContainer> getBuildTypes()
Returns a list of all the BuildType in their container.

Returns:
a list of build type containers.

getProductFlavors

@NonNull
java.util.Collection<ProductFlavorContainer> getProductFlavors()
Returns a list of all the ProductFlavor in their container.

Returns:
a list of product flavor containers.

getVariants

@NonNull
java.util.Collection<Variant> getVariants()
Returns a list of all the variants. This does not include test variant. Test variants are additional artifacts in their respective variant info.

Returns:
a list of the variants.

getFlavorDimensions

@NonNull
java.util.Collection<java.lang.String> getFlavorDimensions()
Returns a list of all the flavor dimensions, may be empty.

Returns:
a list of the flavor dimensions.

getExtraArtifacts

@NonNull
java.util.Collection<ArtifactMetaData> getExtraArtifacts()
Returns a list of extra artifacts meta data. This does not include the main artifact.

Returns:
a list of extra artifacts

getCompileTarget

@NonNull
java.lang.String getCompileTarget()
Returns the compilation target as a string. This is the full extended target hash string. (see com.android.sdklib.IAndroidTarget#hashString())

Returns:
the target hash string

getBootClasspath

@NonNull
java.util.Collection<java.lang.String> getBootClasspath()
Returns the boot classpath matching the compile target. This is typically android.jar plus other optional libraries.

Returns:
a list of jar files.

getFrameworkSources

@NonNull
java.util.Collection<java.io.File> getFrameworkSources()
Returns a list of folders or jar files that contains the framework source code.


getNativeToolchains

@NonNull
java.util.Collection<NativeToolchain> getNativeToolchains()
Returns the collection of toolchains used to create any native libraries.

Returns:
collection of toolchains.

getSigningConfigs

@NonNull
java.util.Collection<SigningConfig> getSigningConfigs()
Returns a list of SigningConfig.


getAaptOptions

@NonNull
AaptOptions getAaptOptions()
Returns the aapt options.


getLintOptions

@NonNull
LintOptions getLintOptions()
Returns the lint options.


getUnresolvedDependencies

@Deprecated
@NonNull
java.util.Collection<java.lang.String> getUnresolvedDependencies()
Deprecated. use getSyncIssues()

Returns the dependencies that were not successfully resolved. The returned list gets populated only if the system property PROPERTY_BUILD_MODEL_ONLY has been set to true.

Each value of the collection has the format group:name:version, for example: com.google.guava:guava:15.0.2

Returns:
the dependencies that were not successfully resolved.

getSyncIssues

@NonNull
java.util.Collection<SyncIssue> getSyncIssues()
Returns issues found during sync. The returned list gets populated only if the system property PROPERTY_BUILD_MODEL_ONLY has been set to true.


getJavaCompileOptions

@NonNull
JavaCompileOptions getJavaCompileOptions()
Returns the compile options for Java code.


getBuildFolder

@NonNull
java.io.File getBuildFolder()
Returns the build folder of this project.


getResourcePrefix

@Nullable
java.lang.String getResourcePrefix()
Returns the resource prefix to use, if any. This is an optional prefix which can be set and which is used by the defaults to automatically choose new resources with a certain prefix, warn if resources are not using the given prefix, etc. This helps work with resources in the app namespace where there could otherwise be unintentional duplicated resource names between unrelated libraries.

Returns:
the optional resource prefix, or null if not set

getBuildToolsVersion

@NonNull
java.lang.String getBuildToolsVersion()
Returns the build tools version used by this module.

Returns:
the build tools version.

getPluginGeneration

int getPluginGeneration()
Returns the generation of the plugin. 1: original plugin 2: component based plugin (AKA experimental)

Returns:
the generation value