Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documentation of available Ant tasks for Android?

Tags:

android

ant

I just accidentally discovered the ant task for test coverage reports with emma. I'm now looking for a target that only invokes the unit test and generates unit testing output. Is there a list with the available ant targets somewhere, or is it possible to look them up somewhere inside the code of the SDK?

like image 778
Janusz Avatar asked Apr 01 '10 15:04

Janusz


3 Answers

Is there a list with the available ant targets somewhere, ...

You can get a list of all ant targets with -projecthelp and -verbose. While in the root directory of the project:

$ ant -projecthelp -verbose

The private ones show under the heading "Other targets:", but the targets with a leading dash are impossible to invoke from the command line. You can add a "wrapper" target to your build.xml and simply make it depend on the target you want.

I use ones like this for exposing the main targets to the IntelliJ IDEA platform:

<!-- Wrapper targets for setting up IntelliJ IDEA with Ant Build -->
<target name="Android clean" depends="clean" />

But you could also do something like:

<target name="Generate Resource Source" depends="-resource-src" />
like image 198
ohhorob Avatar answered Oct 17 '22 17:10

ohhorob


Is there a list with the available ant targets somewhere

Not that I am aware of. I can't even see how to get Ant to dump a list. :-(

is it possible to look them up somewhere inside the code of the SDK?

They're on your development machine in $ANDROID_HOME/platforms/$API/templates, where $ANDROID_HOME is where you installed the SDK and $API is some Android version (e.g., android-2.1).

like image 37
CommonsWare Avatar answered Oct 17 '22 18:10

CommonsWare


ant help would display all the available targets with detailed description.

Help target is at the end of ${SDK.HOME}/tools/ant/build.xml

like image 1
Vijay C Avatar answered Oct 17 '22 19:10

Vijay C