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 FD_GENERATED
           
static java.lang.String FD_INTERMEDIATES
           
static java.lang.String FD_OUTPUTS
           
static java.lang.String PROPERTY_APK_LOCATION
           
static java.lang.String PROPERTY_BUILD_MODEL_ONLY
           
static java.lang.String PROPERTY_INVOKED_FROM_IDE
           
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.
 java.util.Collection<java.lang.String> getBootClasspath()
          Returns the boot classpath matching the compile target.
 java.io.File getBuildFolder()
           
 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.io.File> getFrameworkSources()
          Returns a list of folders or jar files that contains the framework source code.
 JavaCompileOptions getJavaCompileOptions()
           
 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<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<java.lang.String> getUnresolvedDependencies()
          Returns the dependencies that were not successfully resolved.
 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_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_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

FD_INTERMEDIATES

static final java.lang.String FD_INTERMEDIATES
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
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.

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.

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.

Returns:
a list of folders or jar files that contains the framework source code.

getSigningConfigs

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

Returns:
a map of signing config

getAaptOptions

@NonNull
AaptOptions getAaptOptions()
Returns the aapt options.

Returns:
the aapt options.

getLintOptions

@NonNull
LintOptions getLintOptions()
Returns the lint options.

Returns:
the lint options.

getUnresolvedDependencies

@NonNull
java.util.Collection<java.lang.String> getUnresolvedDependencies()
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.

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