ant build.xml例子

<?xml version="1.0"?>
<project default="clean" basedir=".">
	<property file="build.properties"/>
	<path id="classpath">
		<fileset dir="${dir.lib}">
			<include name="**/*.jar" />
		</fileset>
	</path>
	<target name="clear">
		<delete dir="${dir.build}"/>
		<delete dir="${dir.dist}"/>
		<delete dir="${dir.gen}"/>
	</target>
	<target name="echo">
		<echo message="Build a ${mpay.buildType} version!"/>
	</target>
	<target name="mkdir" depends="echo, clear">
		<mkdir dir="${dir.build}"/>
		<mkdir dir="${dir.dist}"/>
		<mkdir dir="${dir.gen}"/>
	</target>
	<target name="generate" depends="mkdir">
		<taskdef name="ibator" classname="org.apache.ibatis.ibator.ant.IbatorAntTask"/>
		<ibator overwrite="true" configfile="${dir.config}/ibatorConfig.xml" verbose="false" >
			<propertyset>
				<propertyref name="generated.source.dir"/>
			</propertyset>
		</ibator>
	</target>
	<target name="compile" depends="generate">
		<javac srcdir="${dir.gen};${dir.src}"  failonerror="true" destdir="build" classpathref="classpath"/>
	</target>
	<target name="jar" depends="compile">
		<jar destfile="${dir.dist}/${mpay.dist}.jar" basedir="${dir.build}">
			<manifest>
				<attribute name="Main-class" value="${mpay.main}"/>
			</manifest>
		</jar>
	</target>
</project>

你可能感兴趣的:(xml,ant)