Interface Library


public interface Library
Represent a variant/module/artifact dependency.
Since:
2.3
  • Field Details

  • Method Details

    • getType

      int getType()
      The type of the dependency
      Returns:
      the type
      See Also:
    • getArtifactAddress

      @NonNull String 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

      @NonNull File getArtifact()
      Returns the artifact location.
    • getBuildId

      @Nullable String 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

      @Nullable String getProjectPath()
      Returns the gradle path. Only valid for Android Library where getType() is LIBRARY_MODULE
    • getVariant

      @Nullable String getVariant()
      Returns an optional variant name if the consumed artifact of the library is associated to one. Only valid for Android Library where getType() is LIBRARY_MODULE
    • getFolder

      @NonNull File getFolder()
      Returns the location of the unzipped bundle folder. Only valid for Android Library where getType() is LIBRARY_ANDROID
    • getManifest

      @NonNull String getManifest()
      Returns the location of the manifest relative to the folder. Only valid for Android Library where getType() is LIBRARY_ANDROID
    • getJarFile

      @NonNull String getJarFile()
      Returns the location of the jar file to use for compiling and packaging.

      Only valid for Android Library where getType() is LIBRARY_ANDROID.

      Returns:
      the path to the jar file. The path may not point to an existing file.
    • getCompileJarFile

      @NonNull String getCompileJarFile()
      Returns the location of the jar file to use for compilation.

      Only valid for Android Library where getType() is LIBRARY_ANDROID.

      Returns:
      path to the jar file used for compilation. The path may not point to an existing file.
    • getResFolder

      @NonNull String getResFolder()
      Returns the location of the res folder. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the res folder. The file may not point to an existing folder.
    • getResStaticLibrary

      @Nullable File getResStaticLibrary()
      Returns the location of the namespaced resources static library (res.apk).

      Only valid for Android Library where getType() is LIBRARY_ANDROID

      TODO(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

      @NonNull String getAssetsFolder()
      Returns the location of the assets folder.

      Only valid for Android Library where getType() is LIBRARY_ANDROID

      Returns:
      a File for the assets folder. The file may not point to an existing folder.
    • getLocalJars

      @NonNull Collection<String> getLocalJars()
      Returns the list of local Jar files that are included in the dependency. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a list of File. May be empty but not null.
    • getJniFolder

      @NonNull String getJniFolder()
      Returns the location of the jni libraries folder. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the folder. The file may not point to an existing folder.
    • getAidlFolder

      @NonNull String getAidlFolder()
      Returns the location of the aidl import folder. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the folder. The file may not point to an existing folder.
    • getRenderscriptFolder

      @NonNull String getRenderscriptFolder()
      Returns the location of the renderscript import folder. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the folder. The file may not point to an existing folder.
    • getProguardRules

      @NonNull String getProguardRules()
      Returns the location of the proguard files. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the file. The file may not point to an existing file.
    • getLintJar

      @NonNull String getLintJar()
      Returns the location of the lint jar. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the jar file. The file may not point to an existing file.
    • getExternalAnnotations

      @NonNull String getExternalAnnotations()
      Returns the location of the external annotations zip file (which may not exist) Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the zip file. The file may not point to an existing file.
    • getPublicResources

      @NonNull String getPublicResources()
      Returns the location of an optional file that lists the only resources that should be considered public. Only valid for Android Library where getType() is LIBRARY_ANDROID
      Returns:
      a File for the file. The file may not point to an existing file.
    • getSymbolFile

      @NonNull String getSymbolFile()
      Returns the location of the text symbol file Only valid for Android Library where getType() is LIBRARY_ANDROID