English 中文(简体)
安德森和安特,特别是任务和塔吉斯。 jar
原标题:Android and Ant - specifically taskdef and anttasks.jar
  • 时间:2010-11-02 21:05:06
  •  标签:
  • android
  • ant

我 way想在我的Eclipse来源的基础上做一纸空文。 最终目标是,在投入和产出完全超出Eclipse档案结构的情况下,将Eclipse来源投入到一个倍数。

这是自我使用Ant语以来的一段时期,因此Im逐渐发表评论,然后从标准建筑的Xml中分离出在你从指挥线建造一个样本项目时产生的参数。 我会作很多回响,以确保它能够在我实际上让它做些什么之前获得这些名录。 我开始在建筑顶端有一个简单的司法目标,而这个目标只是同司法部门一样的。

当时,我没有讨论这个范畴:

   <!-- Custom Android task to deal with the project target, and import the
         proper rules.
         This requires ant 1.6.0 or above. -->
    <path id="android.antlibs">
        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
    </path>

    <taskdef name="setup"
        classname="com.android.ant.SetupTask"
        classpathref="android.antlibs" />
    <!-- Lots of commented out stuff -->

    <setup />

Once I let this run, then the echo I did have disappears and I get the following output

[setup] Android SDK Tools Revision 7
[setup] Project Target: Google APIs
[setup] Vendor: Google Inc.
[setup] Platform Version: 2.1-update1
[setup] API level: 7
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] ------------------
[setup] Ordered libraries:
[setup] ------------------
[setup]

I m expecting it to fail of course, because I haven t set up any input/output/lib directories in the .properties files. I am curious to know why the taskdef itself runs when I only invoke the junk target. I d also like to know what the SetupTask and all the others in the anttasks.jar actually do and where I can find some documentation for them.

最佳回答

包含在建筑档案顶级的任何任务(即超出任何目标)都自动列入一个隐含的初始目标,即每当建筑投入运行时,无论你具体指明的实际目标如何。

因此,设定任务的<代码>taskdef要素宣布了这项任务,但随后的下行,即:<setup />,因为它是建筑档案的顶级,因此,每当你在建筑档案上运行时,将完成这项任务。

问题回答

在我建造的食堂上,有一条线,紧靠你的切截点,即:

<setup />

如果是的话,那就把你pri。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签