ant示例文件1
2015-07-15 15:40
246 查看
<?xml version="1.0" encoding="UTF-8"?>
<project name="test_HelloWorld" basedir="." default="run">
<property name="src" location="src" />
<property name="dest" location="classes" />
<property name="hello_jar" location="hello.jar" />
<!-- 1.初始化,创建构建目录classes -->
<target name="init">
<mkdir dir="${dest}" />
</target>
<!-- 2.java编译 -->
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${dest}"/>
</target>
<!-- 3.java构建,即打成jar包 -->
<target name="build" depends="compile">
<!-- <echo message="${dest}"/> -->
<jar jarfile="${hello_jar}" basedir="${dest}"/>
</target>
<!-- 4.运行程序 -->
<target name="run" depends="build">
<java classname="test.ant.HelloWorld" classpath="${hello_jar}"/>
</target>
<target name="clean">
<delete dir="${dest}"/>
<delete file="${hello_jar}"/>
</target>
<target name="return" depends="clean,run">
<ant target="clean" />
<ant target="run" />
</target>
<target name="ddd">
<antcall target="detect.file" />
<antcall target="echoDemo" />
</target>
</project>
<project name="test_HelloWorld" basedir="." default="run">
<property name="src" location="src" />
<property name="dest" location="classes" />
<property name="hello_jar" location="hello.jar" />
<!-- 1.初始化,创建构建目录classes -->
<target name="init">
<mkdir dir="${dest}" />
</target>
<!-- 2.java编译 -->
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${dest}"/>
</target>
<!-- 3.java构建,即打成jar包 -->
<target name="build" depends="compile">
<!-- <echo message="${dest}"/> -->
<jar jarfile="${hello_jar}" basedir="${dest}"/>
</target>
<!-- 4.运行程序 -->
<target name="run" depends="build">
<java classname="test.ant.HelloWorld" classpath="${hello_jar}"/>
</target>
<target name="clean">
<delete dir="${dest}"/>
<delete file="${hello_jar}"/>
</target>
<target name="return" depends="clean,run">
<ant target="clean" />
<ant target="run" />
</target>
<target name="ddd">
<antcall target="detect.file" />
<antcall target="echoDemo" />
</target>
</project>
相关文章推荐
- swift调用object-c项目遇到的问题与解决方法
- SD卡驱动分析(二)
- 删除Xcode中多余的证书provisioning profile
- php发送请求的方式
- Hadoop入门进阶课程6--MapReduce应用案例
- SD卡驱动分析(二)
- Redis系列-存储篇hash主要操作函数小结
- cocos2d-x lua 学习笔记(1) -- 环境结构
- stl变易算法(三)
- smarty模板中,{assign}的作用
- C语言如何 计算程序运行时间
- c++ 中关于static 关键字几点小结
- Numpy 入门
- SD卡驱动分析(一)
- tomcat在ROOT中配置数据源
- javascript 类型检测
- iOS统计有多少行代码
- 深入浅出 Java Concurrency (6): 锁机制 part 1
- Kth Smallest Element in a BST
- SD卡驱动分析(一)