什么什么ant(初级会计的职称是什么)

2019独角兽企业重金招聘Python工程师标准>>>…

大家好,又见面了,我是你们的朋友全栈君。

一、简介:
ANT是一个基于Java的生成工具,类似于Make。
生成工具在软件开发中用来将源代码和其他输入文件转换为可执行文件的形式(也有可能转换为可安装的产品映像形式)。随着应用程序的生成过程变得更加复杂,确保在每次生成期间都使用精确相同的生成步骤,同时实现尽可能多的自动化,以便及时产生一致的生成版本。

二、ANT如何工作
在安装好ant的环境中执行命令 ant,ant会开始在当前目录寻找build.xml文件(与Makefile文件类似),然后根据build.xml里定义的规则来生成工程。

三、buildfile(build.xml)
实例如下
<project name="MyProject" default="dist" basedir=".">
    <description>
        simple example build file
    </description>
  <!-- set global properties for this build -->
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>
  </target>

  <target name="dist" depends="compile"
        description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
  </target>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>

buildfile是XML文件,每个buildfile包含一个project节点(根节点),至少一个Target元素,以及任意个Property元素。
四、Targets
Target对象组织一组要执行的命令(也叫Task)。例如:
<target name=”
compile ” description=”compile the source” >
<javac srcdir=”${src}” destdir=”${build}”/>
</target>
执行ant命令时,可以通过指定target名来控制执行某一组命令。例如:ant clean
可执行命令列表
http://ant.apache.org/manual/tasklist.html
五、Property
Property标签是用来自定义生成过程,以及简化字符串(类似于C语言里的宏定义)的工具。
内置Property,无需定义,可以直接使用的属性
basedir                            the absolute path of the project's basedir (as set with the basedir attribute of <project>).
ant.file            the absolute path of the buildfile.
ant.version         the version of Ant
ant.project.name    the name of the project that is currently executing;
                    it is set in the name attribute of <project>.
ant.project.default-target
                    the name of the currently executing project's
                    default target;  it is set via the default
                    attribute of <project>.
ant.project.invoked-targets
                    a comma separated list of the targets that have
                    been specified on the command line (the IDE,
                    an <ant> task ...) when invoking the current
                    project.
ant.java.version    the JVM version Ant detected; currently it can hold
                    the values "1.2", "1.3",
                    "1.4",  "1.5" and "1.6".
ant.core.lib        the absolute path of the ant.jar file.
ant.home            home directory of Ant
ant.library.dir     the directory that has been used to load Ant's
                    jars from.  In most cases this is ANT_HOME/lib.

参考资料
Ant官网:
http://ant.apache.org/
Ant帮助文档:
http://ant.apache.org/manual/

转载于:https://my.oschina.net/shiw019/blog/144160

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/128371.html原文链接:https://javaforall.net

(0)
上一篇 2022年4月16日 上午6:20
下一篇 2022年4月16日 上午6:20


相关推荐

  • Hibernate官网下载最新版jar包[通俗易懂]

    Hibernate官网下载最新版jar包[通俗易懂]官网地址:http://hibernate.org/1、点击HibernateORM的More2、点击下载最新版3、向下滚动,下载自己所需要的版本,点击Download4、等待几秒后弹出下载5、如果下载其他旧版本,可以在第一步后,点解页面中的otherseries.6、更老的版本点击seeolderseries7、下载4.2版本,点击Moreinfo8…

    2025年6月13日
    5
  • poe交换机可以当网络交换机吗_家用需要网管交换机吗

    poe交换机可以当网络交换机吗_家用需要网管交换机吗PoE交换机是一种新型的多功能交换机,随着PoE交换机的广泛应用,人们对PoE交换机有了一定的了解。然而,很多人认为PoE交换机可以自行发电,这种说法并不正确,通常所讲的PoE交换机供电指的是PoE交换机通过网线来给其他设备供电,与此同时也不丢失传输数据的功能。那么,PoE交换机可以当普通交换机用吗?下面就由飞畅科技的小编为大家来详细介绍下这个问题,一起来看看吧!PoE交换机是具有PoE功能的交换机,与普通的交换机之间可以进行连接。它可以在供电的同时传输数据,而普通交换机的主要作用是交换数据,并不具备供

    2022年10月5日
    5
  • 广告联盟刷流量方法[通俗易懂]

    广告联盟刷流量方法[通俗易懂]其实并不难,我我上次刷过一个联盟www.79cm.com  用软件刷的量,结果收到一些钱呵呵

    2026年4月17日
    4
  • ubuntu 主题

    ubuntu 主题ubuntu的Mac主题——[链接地址]

    2026年2月22日
    4
  • SQL 函数 TIMESTAMPDIFF

    SQL 函数 TIMESTAMPDIFF①求时间差TIMESTAMPDIFF(单位,开始时间,结束时间)==开始时间-结束时间,eg。TIMESTAMPDIFF(MINUTE,begin_time,IFNULL(over_time,NOW()))注释:如果over_time不为空则用现在时间减去begin_time,得到的值的单位为分钟转载于:https://www.cnblogs…

    2022年5月7日
    73
  • OAuth2.0 原理流程及其单点登录和权限控制

    点击上方“全栈程序员社区”,星标公众号 重磅干货,第一时间送达 作者:王克锋 kefeng.wang/2018/04/06/oauth2-sso 单点登录是多域名企业站点流行的登录…

    2021年6月28日
    93

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号