<?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>
时间: 2024-10-12 13:11:20