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


相关推荐

  • 激光SLAM原理_激光打标机

    激光SLAM原理_激光打标机在机器人运动控制系统架构中,可分为最底层、中间通信层和决策层三大层面,最底层包含了机器人本身的电机驱动和控制部分,中间通信层是底层部分和决策层的通信通路,而决策层则是实现机器人的定位建图及导航。在机器人定位导航中,目前主要涉及到激光SLAM与视觉SLAM,激光SLAM在理论、技术和产品落地上都较为成熟,因而成为现下最为主流的定位导航方式,在家用扫地机器人及商用送餐机器人等服务机器人中普遍采用了…

    2022年8月23日
    2
  • pycham2021版本激活码【在线破解激活】

    pycham2021版本激活码【在线破解激活】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月16日
    47
  • [转][Web测试]- Fiddler 教程

    [转][Web测试]- Fiddler 教程

    2021年8月16日
    38
  • Delphi XE5如何读写INI文件

    Delphi XE5如何读写INI文件首先usesinifiles然后写文件procedureTHolidaySet.Button2Click(Sender:TObject);varIniFile:TIniFile;Count:Integer;begintryIniFile:=TIniFile.Create(TP…

    2022年7月18日
    10
  • Spring Boot 日志管理

    Spring Boot 日志管理在代码有问题的时候,很多人应该都是通过debug的方式去排查,往往忽略了日志的重要性。好的日志管理可以快速定位问题出现的位置,也可以提高代码的阅读性。这篇博文主要介绍一下SpringBoot中关于日志方面的知识。一、Logging介绍SpringBoot为JavaUtilLogging,Log4J2和Logback提供了默认配置。每个日志框架,都默认配置了控…

    2022年5月29日
    60
  • Git高阶实战技巧(4)

    Git高阶实战技巧(4)

    2021年5月24日
    101

发表回复

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

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