开发者

Documentation of available Ant tasks for Android?

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 ther开发者_StackOverflowe a list with the available ant targets somewhere, or is it possible to look them up somewhere inside the code of the SDK?


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" />


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).


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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜