什么什么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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 如何让pycharm运行Java代码[通俗易懂]

    如何让pycharm运行Java代码[通俗易懂]第一步,jpype库的下载我使用的编辑器是pycharm,所以,直接importjpype即可,但是他会报错,说没有这个库,这个时候,你把名字改成importjpype1,然后下载,pycharm会给你自动下载的。注意,下载完之后,你使用的还是importjpype我是这样的第二步,将你要用的java类打包成一个jar文件第三步,如下代码调用importjpypejvmPath=r”D:\jdk-15.0.2\bin\server\jvm.dll”#java虚拟机的路径

    2022年8月26日
    9
  • 《Unity开发实战》——2.8节用Shuriken制作粒子效果

    《Unity开发实战》——2.8节用Shuriken制作粒子效果本节书摘来自华章社区 Unity 开发实战 一书中的第 2 章 第 2 8 节用 Shuriken 制作粒子效果 作者 爱尔兰 MattSmith 巴西 ChicoQueiroz 更多章节内容可以访问云栖社区 华章社区 公众号查看 2 8 用 Shuriken 制作粒子效果从 Unity3 5 起 可以用粒子系统制作很多令人惊叹的效果 之前很多需要用脚本实现的效果现

    2025年11月14日
    5
  • Linux中,常常会用到 vim ,其中 q ,wq wq!的区别,以及 vim -r 的作用[通俗易懂]

    w->表示保存退出wq!->表示强制保存退出,可以保存”readonly”只读文件q->在vim中表示退出q!->表示强制不保存退出,不对文件进行保存wq和wq!的区别如下:有些文件设置了只读,一般不是修改文件的,但是如果你是文件的owner或者root的话,通过wq!还是能保存文件退出如果文件设置为只读了的话,用:wq命令是不能保存并退出的,但是最高权限者可通过wq!来进行文件的保存并退出文件。已设定选项‘readonly’(请加!强制执行)!.

    2022年4月13日
    101
  • HTML5新增及移除的元素

    HTML经过10多年的发展,其元素经历了废弃与不断重新定义的过程。为了更好的处理现在的互联网应用,HTML5新增了图形绘制、多媒体播放、页面结构、应用程序存储、网络工作等新元素。http://hove

    2021年12月27日
    51
  • USB协议详解

    USB协议详解本博客整理自网络,仅供学习参考,如有侵权,联系删除。邮箱:rom100@163.com一个transfer(传输)由一个或多个transaction(事务)构成,一个transaction(事务)由一个或多个packet(包)构成,一个packet(包)由一个或多个sync(域)构成。1.传输数据通信USB的数据通讯首先是基于传输(transfer)的,传输的类型有:中断传输、批量传输…

    2022年6月29日
    45
  • 多节点服务器定时任务重复处理的问题

    多节点服务器定时任务重复处理的问题项目中有使用Spring定时执行任务的需求,用户可以自定义时间(半小时或整点)去生成需要的报表并发送邮件到用户自己的邮箱。项目里面提供的时间是半小时或整点去执行Spring定时任务,查询数据库中有哪些Schedule是满足要求的,然后去执行那些符合条件的任务。一切功能表现正常,但是项目部署在服务器上后,用户反映在同一时间会收到两封相同的邮件。我们检查了代码和SpringSchedule本

    2022年10月8日
    5

发表回复

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

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