Technical docs‎ > ‎

Ant Tasks


Current Custom task list:
  • AaptExecTask
  • AidlExecTask
  • ApkBuilderTask
  • BuildConfigTask
  • DexExecTask
  • IfElseTask
  • PropertyByReplaceTask
  • RenderScriptTask
  • SignApkTask
  • XPathTask
  • ZipAlignTask
New in r20 (some of this replace NewSetupTask)
  • CheckEnvTask
  • ComputeDependencyTask
  • ComputeProjectClasspathTask
  • GetEmmaFilterTask
  • GetLibraryListTask
  • GetTargetTask
  • GetTypeTask
  • ManifestMergerTask

Base (abstract) task used by the main tasks above:
  • BuildTypedTask
  • MultiFilesTask
  • SingleDependencyTask
  • SingleInputOutputTask


com.android.ant.CheckEnvTask: <checkenv>

Does a simple check of the environment looking for:
  • Version of Ant
  • Existence of the platform-tools folder inside the SDK.
No attributes option.


com.android.ant.GetTypeTask <gettype>

Queries the project and returns its project type. Possible types are:
  • "app"
  • "library"
  • "test"
  • "test-app"
 AttributeDescriptionRequired 
 projectTypeOutthe name of the property in which to store the project typeYes


com.android.ant.GetTargetTask <gettarget>

Resolves the project targets and returns some target dependent values necessary for building.

AttributeDescriptionRequired
androidJarFileOutthe name of the property in which to store the location of the project's build target android.jarYes
androidAidlFileOutthe name of the property in which to store the location of the project's build target framework.aidlYes
bootClassPathOutthe name of the property in which to store a Path object that contains all boot jar files (android.jar + add-on APIs)Yes
targetApiOutthe name of the property in which to store the API level of the project's build target API level.Yes
minSdkVersionOutthe name of the property in which to store the app minSdkVersion value.Yes


com.android.ant.GetLibraryListTask <getlibs>

Compute the list of Library Projects the project depends on. This looks at all the direct and undirect dependencies and builds a list in the specific order.

AttributeDescriptionRequired
libraryFolderPathOutthe name of the property in which to store a Path object that contains all the Library Project folders.
This is ordered in compilation order.
Yes



com.android.ant.ComputeDependencyTask <dependency>

Computes the project dependencies. This handles details about Library Projects but also gather and sanitize all the jar libraries needed by the main project and its Library Projects.
This is sanitized using the dependency resolution mentioned here.

AttributeDescriptionRequired
libraryFolderPathOutthe name of the property in which to store a Path object that contains all the Library Project folders.
This is ordered in compilation order.
Yes
libraryPackagesOutthe name of the property in which to store the package names of all the Library Projects.
This is a semicolon separated value.
Yes
libraryManifestFilePathOut the name of the property in which to store a Path object that contains all the Library Manifest files.Yes 
libraryResFolderPathOutthe name of the property in which to store a Path object that contains all the Library Project resource folders.
This is ordered in aapt order. This is opposite order of libraryFolderPathOut
Yes
libraryNativeFolderPathOutthe name of the property in which to store a Path object that contains all the Library Project native folders.Yes
jarLibraryPathOutthe name of the property in which to store a Path object that contains all the jar libraries required for build.Yes
targetApithe project's build target API level.Yes
verbosebuild verbosity levelNo

Other Tasks to come later.