com.android.build.gradle.api
[Java] Interface ApkVariant

com.android.build.gradle.api.ApkVariant
  com.android.build.gradle.api.BaseVariant
All Superinterfaces:
BaseVariant

public interface ApkVariant
extends BaseVariant

A Build variant and all its public data.


Method Summary
ZipAlign createZipAlignTask(java.lang.String taskName, java.io.File inputFile, java.io.File outputFile)

java.util.Collection getApkLibraries()

Returns the list of jar files that are packaged in the APK.

java.util.Collection getCompileLibraries()

Returns the list of jar files that are on the compile classpath.

Dex getDex()

Returns the Dex task.

DefaultTask getInstall()

Returns the installation task.

PackageApplication getPackageApplication()

Returns the APK packaging task.

java.util.List getProductFlavors()

Returns the list of com.android.builder.DefaultProductFlavor for this build variant.

SigningConfig getSigningConfig()

Returns the SigningConfig for this build variant, if one has been specified.

DefaultTask getUninstall()

Returns the uinstallation task.

int getVersionCode()

Return the app versionCode.

java.lang.String getVersionName()

Return the app versionName or null if none found.

ZipAlign getZipAlign()

Returns the Zip align task.

boolean isSigningReady()

Returns true if this variant has the information it needs to create a signed APK.

 
Methods inherited from interface BaseVariant
addJavaSourceFoldersToModel, addJavaSourceFoldersToModel, getAidlCompile, getAssemble, getBaseName, getBuildType, getCheckManifest, getDescription, getDirName, getFlavorName, getGenerateBuildConfig, getJavaCompile, getMergeAssets, getMergeResources, getMergedFlavor, getName, getNdkCompile, getOutputFile, getPackageName, getPreBuild, getProcessJavaResources, getProcessManifest, getProcessResources, getProguard, getRenderscriptCompile, getSourceSets, registerJavaGeneratingTask, registerJavaGeneratingTask, setOutputFile
 

Method Detail

createZipAlignTask

@NonNull
public ZipAlign createZipAlignTask(@NonNull java.lang.String taskName, @NonNull java.io.File inputFile, @NonNull java.io.File outputFile)


getApkLibraries

@NonNull
public java.util.Collection getApkLibraries()
Returns the list of jar files that are packaged in the APK.


getCompileLibraries

@NonNull
public java.util.Collection getCompileLibraries()
Returns the list of jar files that are on the compile classpath. This does not include the runtime.


getDex

@Nullable
public Dex getDex()
Returns the Dex task.


getInstall

@Nullable
public DefaultTask getInstall()
Returns the installation task. Even for variant for regular project, this can be null if the app cannot be signed.


getPackageApplication

@Nullable
public PackageApplication getPackageApplication()
Returns the APK packaging task.


getProductFlavors

@NonNull
public java.util.List getProductFlavors()
Returns the list of com.android.builder.DefaultProductFlavor for this build variant. This is always non-null but could be empty.


getSigningConfig

@Nullable
public SigningConfig getSigningConfig()
Returns the SigningConfig for this build variant, if one has been specified.


getUninstall

@Nullable
public DefaultTask getUninstall()
Returns the uinstallation task. For non-library project this is always true even if the APK is not created because signing isn't setup.


getVersionCode

public int getVersionCode()
Return the app versionCode. Even the value is not found, then 1 is returned as this is the implicit value that the platform would use.


getVersionName

@Nullable
public java.lang.String getVersionName()
Return the app versionName or null if none found.


getZipAlign

@Nullable
public ZipAlign getZipAlign()
Returns the Zip align task.


isSigningReady

public boolean isSigningReady()
Returns true if this variant has the information it needs to create a signed APK.


 

Copyright (C) 2012 The Android Open Source Project