什么什么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


相关推荐

  • 微型计算机原理与接口技术——8086指令系统之移位指令

    微型计算机原理与接口技术——8086指令系统之移位指令移位指令移动一位时由指令直接给出;移动两位及以上,则移位次数由CL指定。要求操作数不能是立即数;这类指令的执行大多会影响6个状态标志位。非循环移位指令逻辑左移SHL(ShiftLogicLeft)算术左移SAL(ShiftArithmeticLeft)逻辑右移SHR(ShiftLogicRight)算术右移SAR(ShiftArithmeticRight)4条指令的格式完全相同,可实现对8位或16位寄存器操作数或内存操作数进行指定次数的移位。逻辑移位指令针对的

    2022年5月11日
    58
  • Mysql5.7在忘记密码的情况下如何修改密码?

    Mysql5.7在忘记密码的情况下如何修改密码?

    2021年10月19日
    36
  • linux防火墙_专业的linux web应用防火墙国内排名推荐「建议收藏」

    linux防火墙_专业的linux web应用防火墙国内排名推荐「建议收藏」对于站长来说,网站的安全维护管理是重中之重,但是在建站后我们发现,再配置齐全的网站也会遭遇各种攻击扫描.这时候你就感觉服务器是一个裸奔的鸡蛋,惯性思维会想和普通电脑一样安装防护软件,这里需要注意了,很多方面不是应该就要做,而需要方法和技巧.我们先简单说下,对于网站防火墙,有两种形式:第一种是服务器提供商的硬件防火墙,购买大厂商云服务器,比如阿里云,百度云等都有专业级的硬件防火墙,能够防护加入云厂…

    2022年6月2日
    69
  • android思维导图软件推荐,好用的思维导图软件,安卓思维导图软件哪个好

    android思维导图软件推荐,好用的思维导图软件,安卓思维导图软件哪个好MindMaster 思维导图软件是一款新发布的手机 APP 它适合在安卓手机 iPhone 手机和 iPad 平板上使用 在本篇文章中 小编将会为你详细介绍这款软件的特点 打开 MindMaster 思维导图 APP 会发现界面底部布局着四个功能 最近浏览 云文件 导图社区 我的 除此以外还有一个显眼的符号 最近浏览 和 我的 功能大家一定很熟悉 那么下面就为你重点介绍其他三块功能 创作 云文件和导图

    2026年3月17日
    2
  • python 数据合并函数merge( )[通俗易懂]

    python 数据合并函数merge( )[通俗易懂]python中的merge函数与sql中的join用法非常类似,以下是merge()函数中的参数:merge(left,right,how=’inner’,on=None,left_on=None,right_on=None,left_index=False,right_index=False,sort=False,suffixes=(‘_x’,’_y’),cop…

    2022年4月28日
    552
  • pycharm使用anaconda环境可以直接导入包吗_anaconda pycharm环境配置

    pycharm使用anaconda环境可以直接导入包吗_anaconda pycharm环境配置PyCharm使用Anaconda环境使用pycharm进行python脚本开发,特别是进行科学计算时,需要引入大量的第三方脚本,此时如果每次都需要去逐一下载,无疑浪费了许多时间。这时可以使用Anaconda来快速的搭建一个开发环境什么是AnacondaAnaconda(官方网站)就是可以便捷获取包且对包能够进行管理,同时对环境可以统一管理的发行版本。Anaconda包含了conda、Python在内的超过180个科学包及其依赖项。上图为Anaconda完成安装之后的页面,可以看到右侧已经

    2022年8月29日
    3

发表回复

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

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