Interface AndroidArtifact

All Superinterfaces:
BaseArtifact

public interface AndroidArtifact extends BaseArtifact
An Android Artifact.

This is the entry point for the output of a Variant. This can be more than one output in the case of multi-apk where more than one APKs are generated from the same set of sources.

  • Method Details

    • getOutputs

      Deprecated.
      Use post-build model instead. See VariantBuildInformation
    • isSigned

      boolean isSigned()
      Returns whether the output file is signed. This can only be true for the main apk of an application project.
      Returns:
      true if the app is signed.
    • getSigningConfigName

      @Nullable String getSigningConfigName()
      Returns the name of the SigningConfig used for the signing. If none are setup or if this is not the main artifact of an application project, then this is null.
      Returns:
      the name of the setup signing config.
    • getApplicationId

      @Deprecated @NonNull String getApplicationId()
      Deprecated.
      Returns the application id of this artifact.

      Deprecated as of 4.2. Application ID is now only provided post-build.

      Returns:
      the application id.
    • getSourceGenTaskName

      @NonNull String getSourceGenTaskName()
      Returns the name of the task used to generate the source code. The actual value might depend on the build system front end.
      Returns:
      the name of the code generating task.
    • getGeneratedSourceFolders

      @NonNull Collection<File> getGeneratedSourceFolders()
      Returns all the source folders that are generated. This is typically folders for the R, the aidl classes, and the renderscript classes.

      Deprecated, as of 1.2, present in super interface.

      Specified by:
      getGeneratedSourceFolders in interface BaseArtifact
      Returns:
      a list of folders.
    • getGeneratedResourceFolders

      @NonNull Collection<File> getGeneratedResourceFolders()
      Returns all the resource folders that are generated. This is typically the renderscript output and the merged resources.
      Returns:
      a list of folder.
    • getAbiFilters

      @Nullable Set<String> getAbiFilters()
      Returns the ABI filters associated with the artifact, or null if there are no filters.

      If the list contains values, then the artifact only contains these ABIs and excludes others.

    • getNativeLibraries

      @Nullable @Deprecated Collection<NativeLibrary> getNativeLibraries()
      Deprecated.
      Returns the native libraries associated with the artifact.

      Deprecated since ndk-compile has been deprecated.

    • getResValues

      @NonNull @Deprecated Map<String,ClassField> getResValues()
      Deprecated.
      Map of generated res values where the key is the res name. This method is deprecated and will always return an empty map
      Returns:
      empty map
    • getInstantRun

      @NonNull InstantRun getInstantRun()
      Returns the InstantRun feature related model.
      Returns:
      the model for all InstantRun related information.
    • getAdditionalRuntimeApks

      @NonNull Collection<File> getAdditionalRuntimeApks()
      Returns a list of additional APKs that need to installed on the device for this artifact to work correctly.

      For test artifacts, these will be "buddy APKs" from the androidTestUtil configuration.

      Since:
      3.0
    • getTestOptions

      @Nullable TestOptions getTestOptions()
      Returns the test options only if the variant type is testing.
      Since:
      3.0
    • getInstrumentedTestTaskName

      @Nullable String getInstrumentedTestTaskName()
      Returns the name of the task used to run instrumented tests or null if the variant is not a test variant.
      Returns:
      name of the task used to run instrumented tests
      Since:
      3.1
    • getBundleTaskName

      @Nullable String getBundleTaskName()
      Returns the name of the task used to generate the bundle file (.aab), or null if the task is not supported.
      Returns:
      name of the task used to generate the bundle file (.aab)
      Since:
      3.2
    • getBundleTaskOutputListingFile

      @Nullable String getBundleTaskOutputListingFile()
      Returns the path to the listing file generated after each getBundleTaskName() task execution. The listing file will contain a reference to the produced bundle file (.aab). Returns null when getBundleTaskName() returns null.
      Returns:
      the file path for the bundle model file.
      Since:
      4.0
    • getApkFromBundleTaskName

      @Nullable String getApkFromBundleTaskName()
      Returns the name of the task used to generate APKs via the bundle file (.aab), or null if the task is not supported.
      Returns:
      name of the task used to generate the APKs via the bundle
      Since:
      3.2
    • getApkFromBundleTaskOutputListingFile

      @Nullable String getApkFromBundleTaskOutputListingFile()
      Returns the path to the model file generated after each getApkFromBundleTaskName() task execution. The model will contain a reference to the folder where APKs from bundle are placed into. Returns null when getApkFromBundleTaskName() returns null.
      Returns:
      the file path for the getApkFromBundleTaskName() output model.
      Since:
      4.0
    • getCodeShrinker

      @Nullable CodeShrinker getCodeShrinker()
      Returns the code shrinker used by this artifact or null if no shrinker is used to build this artifact.