- <project name="build_rtf" default="jar" basedir=".">
- <!-- class文件路径-->
- <property name="class.dir" value="bin"/>
- <!-- 生成的jar存放路径-->
- <property name="build.dir" value="jar" />
- <!--生成的jar文件名称-->
- <property name="jar.name" value="uc.jar" />
- <!--依赖的jar-->
- <property name="lib" value="lib" />
- <!--可执行jar需要指定入口类-->
- <property name="mainclass" value="com.inspur.uc.HsfServer" />
- <path id="classpath">
- <fileset dir="${lib}" includes="**/*.jar"/>
- </path>
- <target name="init">
- <echo message="+--- init start ---+" />
- <tstamp />
- <delete dir="${build.dir}" />
- <mkdir dir="${build.dir}" />
- <echo message="+--- init end ---+" />
- </target>
- <target name="jar" depends="init" >
- <echo message="+--- jar *.class files start ---+" />
- <pathconvert property="mf.classpath" pathsep=" lib/">
- <path refid="classpath" />
- <flattenmapper />
- </pathconvert>
- <jar destfile="${build.dir}/${jar.name}" update="true">
- <fileset dir="${class.dir}" includes="com/**">
- </fileset>
- <fileset dir="${class.dir}" includes="org/**">
- </fileset>
- <manifest>
- <attribute name="Main-Class" value="${mainclass}"/>
- <attribute name="Class-Path" value="./ lib/${mf.classpath}"/>
- </manifest>
- </jar>
- <echo message="+--- jar *.class files end ---+" />
- </target>
- </project>