`
Aga
  • 浏览: 218678 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

ant build.xml例子

    博客分类:
  • J2SE
阅读更多
<?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>
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics