Package com.android.builder.model.level2
Interface Library
public interface Library
Represent a variant/module/artifact dependency.
- Since:
- 2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionReturns the location of the aidl import folder.Returns the artifact location.Returns the artifact address in a unique way.Returns the location of the assets folder.Returns the build id.Returns the location of the jar file to use for compilation.Returns the location of the external annotations zip file (which may not exist) Only valid for Android Library wheregetType()isLIBRARY_ANDROIDReturns the location of the unzipped bundle folder.Returns the location of the jar file to use for compiling and packaging.Returns the location of the jni libraries folder.Returns the location of the lint jar.Returns the list of local Jar files that are included in the dependency.Returns the location of the manifest relative to the folder.Returns the location of the proguard files.Returns the gradle path.Returns the location of an optional file that lists the only resources that should be considered public.Returns the location of the renderscript import folder.Returns the location of the res folder.Returns the location of the namespaced resources static library (res.apk).Returns the location of the text symbol file Only valid for Android Library wheregetType()isLIBRARY_ANDROIDintgetType()The type of the dependencyReturns an optional variant name if the consumed artifact of the library is associated to one.
-
Field Details
-
LIBRARY_ANDROID
static final int LIBRARY_ANDROID- See Also:
-
LIBRARY_JAVA
static final int LIBRARY_JAVA- See Also:
-
LIBRARY_MODULE
static final int LIBRARY_MODULE- See Also:
-
-
Method Details
-
getType
int getType()The type of the dependency- Returns:
- the type
- See Also:
-
getArtifactAddress
Returns the artifact address in a unique way. This is either a module path for sub-modules (with optional variant name), or a maven coordinate for external dependencies. -
getArtifact
Returns the artifact location. -
getBuildId
Returns the build id.This is only valid if the
getProjectPath()is not null. However this can still be null if this is the root project.- Returns:
- the build id or null.
-
getProjectPath
Returns the gradle path. Only valid for Android Library wheregetType()isLIBRARY_MODULE -
getVariant
Returns an optional variant name if the consumed artifact of the library is associated to one. Only valid for Android Library wheregetType()isLIBRARY_MODULE -
getFolder
Returns the location of the unzipped bundle folder. Only valid for Android Library wheregetType()isLIBRARY_ANDROID -
getManifest
Returns the location of the manifest relative to the folder. Only valid for Android Library wheregetType()isLIBRARY_ANDROID -
getJarFile
Returns the location of the jar file to use for compiling and packaging.Only valid for Android Library where
getType()isLIBRARY_ANDROID.- Returns:
- the path to the jar file. The path may not point to an existing file.
-
getCompileJarFile
Returns the location of the jar file to use for compilation.Only valid for Android Library where
getType()isLIBRARY_ANDROID.- Returns:
- path to the jar file used for compilation. The path may not point to an existing file.
-
getResFolder
Returns the location of the res folder. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the res folder. The file may not point to an existing folder.
-
getResStaticLibrary
Returns the location of the namespaced resources static library (res.apk).Only valid for Android Library where
getType()isLIBRARY_ANDROIDTODO(b/109854607): When rewriting dependencies, this should be populated with the rewritten artifact, which will not be in the exploded AAR directory.
- Returns:
- the static library apk. Null if the library is not namespaced.
-
getAssetsFolder
Returns the location of the assets folder.Only valid for Android Library where
getType()isLIBRARY_ANDROID- Returns:
- a File for the assets folder. The file may not point to an existing folder.
-
getLocalJars
Returns the list of local Jar files that are included in the dependency. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a list of File. May be empty but not null.
-
getJniFolder
Returns the location of the jni libraries folder. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the folder. The file may not point to an existing folder.
-
getAidlFolder
Returns the location of the aidl import folder. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the folder. The file may not point to an existing folder.
-
getRenderscriptFolder
Returns the location of the renderscript import folder. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the folder. The file may not point to an existing folder.
-
getProguardRules
Returns the location of the proguard files. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the file. The file may not point to an existing file.
-
getLintJar
Returns the location of the lint jar. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the jar file. The file may not point to an existing file.
-
getExternalAnnotations
Returns the location of the external annotations zip file (which may not exist) Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the zip file. The file may not point to an existing file.
-
getPublicResources
Returns the location of an optional file that lists the only resources that should be considered public. Only valid for Android Library wheregetType()isLIBRARY_ANDROID- Returns:
- a File for the file. The file may not point to an existing file.
-
getSymbolFile
Returns the location of the text symbol file Only valid for Android Library wheregetType()isLIBRARY_ANDROID
-