ant n build.xml之间是什么关系? [英] what is the relationship between ant n build.xml?

查看:86
本文介绍了ant n build.xml之间是什么关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows 7中安装并设置了变量,但是仍然没有得到必须在哪里放置build.xml以及如何对其进行编码的信息.谁能向我解释一下?当我作为ant选项运行时,它说构建成功.这里是我的build.xml代码

I have installed and set variables in windows 7. but still I did not get where do I have to place the build.xml and how to code that. Can anyone explain this to me? when I run as ant option It saiy build successfull.here my build.xml code

<?xml version="1.0" encoding="UTF-8"?>

<project>

    <target name="clean">
        <delete dir="build"/>
    </target>

    <target name="compile">
        <mkdir dir="build/classes"/>
        <javac srcdir="src" destdir="build/classes"/>
    </target>

    <target name="jar">
        <mkdir dir="build/jar"/>
        <jar destfile="build/jar/BankDemo.jar" basedir="build/classes">
            <manifest>
                <attribute name="Main-Class" value="oata.BankDemo"/>
            </manifest>
        </jar>
    </target>

    <target name="run">
        <java jar="build/jar/BankDemo.jar" fork="true"/>
    </target>

</project>

推荐答案

首先,在这里进行浏览: http://ant.apache.org/manual/index.html [ ^ ],并仔细阅读.

通常,您对放置此xml的位置没有任何限制.您需要运行它.好吧,您需要运行将处理任务的主管.您可以使用命令行(请参阅手册),但是像Eclipse这样的许多IDE都具有Ant的内置执行程序(请在此处检查:
First of all, take a tour here: http://ant.apache.org/manual/index.html[^], and read it carefully.

In general you don''t have any restriction where to put this xml. You need to run it. Well, you need to run an executive that will process the tasks. You can use the command line (see manual), but many IDEs like Eclipse have built-in executives for Ant (check here: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-81_basics.htm[^]).


这篇关于ant n build.xml之间是什么关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆