admin管理员组文章数量:1122850
zip,obfuscate,war的ant脚本
<?xml version="1.0"?><project name="hezi" default="release" basedir=".">
<tstamp>
<format property="date.today" pattern="yyyyMMdd"/>
</tstamp>
<property name="appname" value="hezi"></property>
<property name="warname" value="${appname}.war"></property>
<property name="root.dir" value="WebContent"></property>
<property name="src.dir" value="src"></property>
<property name="server.dir" value="server"></property>
<property name="dist.dir" value="${root.dir}/WEB-INF/classes"></property>
<property name="lib.dir" value="${root.dir}/WEB-INF/lib"></property>
<property name="release.dir" value="release"></property>
<property name="conf.dir" value="common"></property>
<property name="app.dir" value="${release.dir}/${appname}"></property>
<property name="war.dir" value="${release.dir}"></property>
<path id="all-libs">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${dist.dir}"></delete>
<delete dir="${release.dir}"></delete>
</target>
<target name="makedir">
<mkdir dir="${release.dir}"/>
<mkdir dir="${dist.dir}"/>
<copy todir="${dist.dir}" preservelastmodified="true">
<fileset dir="${conf.dir}">
<include name="*/**"/>
</fileset>
</copy>
</target>
<target name="compile" depends="makedir">
<javac srcdir="${src.dir}" destdir="${dist.dir}" encoding="gbk" debug="true" includeantruntime="on">
<classpath refid="all-libs"></classpath>
</javac>
<javac srcdir="${server.dir}" destdir="${dist.dir}" encoding="gbk" debug="true" includeantruntime="on">
<classpath refid="all-libs"></classpath>
</javac>
</target>
<target name="proguard" depends="compile">
<taskdef resource="proguard/ant/task.properties" classpath="${lib.dir}/proguard.jar"/>
<proguard configuration="luntankong.pro">
<injar file="${dist.dir}"/>
<outjar file="${root.dir}/WEB-INF/classes_fix"/>
<libraryjar dir="${lib.dir}"/>
<libraryjar dir="${java.home}/lib/rt.jar"/>
</proguard>
<delete includeemptydirs="true">
<fileset dir="${dist.dir}">
<include name="**/*"/>
</fileset>
</delete>
<move todir="${dist.dir}">
<fileset dir="${root.dir}/WEB-INF/classes_fix">
<include name="**/*"/>
</fileset>
</move>
<delete dir="${root.dir}/WEB-INF/classes_fix"></delete>
</target>
<target name="buildapp">
<copy todir="${app.dir}" preservelastmodified="true">
<fileset dir="${root.dir}">
<include name="*/**"/>
</fileset>
</copy>
</target>
<target name="zipfile">
<zip destfile="${war.dir}/${warname}" compress="true">
<zipfileset prefix="${appname}" dir="${app.dir}">
<exclude name="**/*.svn"/>
</zipfileset>
</zip>
</target>
<target name="warfile">
<war warfile="${war.dir}/${warname}" basedir="${app.dir}" webxml="${app.dir}/WEB-INF/web.xml">
<include name="*/**"/>
</war>
</target>
<target name="release" depends="clean,compile,proguard,buildapp,warfile"></target>
</project>
版权声明:本文标题:zip,obfuscate,war的ant脚本 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1701919251a504425.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论