码迷,mamicode.com
首页 > Web开发 > 详细

build.xml of apache ant

时间:2016-05-15 12:22:53      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

<?xml version="1.0"?>
<project name="InsideGPS"  default="run" basedir="." >
   
   <property name="src.dir"     value="src"  />
    <property name="build" value="build" />
	<property name="classes" value="build/classes" />
    <property name="lib.dir" value="WebContent/WEB-INF/lib" />
	<property name="jar.dir"     value="${build}/jar" />
	<property name="main-class"  value="edu.sse.ustc.manager.Server"/>
	
	 <path id="classpath">
        <fileset dir="${lib.dir}" includes="**/*.jar"/>
    </path>
	
    <target name="clean">
       <delete dir="bin"/>
    </target>

   <target name="compile" depends="clean">
       <mkdir dir="build/classes"/>
       <javac srcdir="src" destdir="build/classes" classpathref="classpath" />
	   <copy todir="${classes}">
            <fileset dir="${src.dir}" excludes="**/*.java"/>
        </copy>
    </target>
	
	<target name="jar" depends="compile">
	   <mkdir dir="${jar.dir}" />
       <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes}" >
	       <manifest>
		      <attribute name="Main-class" value="${main-class}" />
		   </manifest>
	   
       </jar>  	   
	
	</target>
	

    <target name="run" depends="jar">
       <java  fork="true" classname="${main-class}" >
           <classpath>
		           <path refid="classpath" />
				   <path location="${jar.dir}/${ant.project.name}.jar" />
           </classpath>		   
	  </java>
    </target>
	
	 <target name="clean-build" depends="clean,jar"/>
    <target name="main" depends="clean,run"/>
	
</project>

  

build.xml of apache ant

标签:

原文地址:http://www.cnblogs.com/castlehappiness/p/5494885.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!