Ant构建GWT 项目

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="gwtc-no-depend" name="KFwebEDI">
 <property environment="env" />

 <property name="serverSRC.link" value="../KFGWTServer/src" />
 <property name="kitSRC.link" value="../KFJavaKit/src" />
 <property name="clientSRC.link" value="../KFGWTClient/src" />
 <property name="ECLIPSE_HOME" value="D:/down/eclipse/eclipse" />
 <property name="debuglevel" value="source,lines,vars" />
 <property name="target" value="1.6" />
 <property name="source" value="1.6" />
 <property name="debuglevel" value="source,lines,vars" />
 <property name="target" value="1.5" />
 <property name="source" value="1.5" />

 <property name="disp.path" value="dist" />
 <property name="webapps.path" value="com.kf.webedi.KFwebEDI" />
 <property name="webinf.lib.path" value="${webapps.path}/WEB-INF/lib" />

 <property name="KFJavaKit.path" value="../KFJavaKit" />
 <property name="KFGWTServer.path" value="../KFGWTServer" />
 <property name="KFCRMServer.path" value="../KFCRMServer" />
 <property name="KFGWTClient.path" value="../KFGWTClient" />
 <property name="KFDBEntity.path" value="../KFDBEntity" />
 <property name="KFCreator.path" value="../KFCreator" />

 <property name="serverFileName" value="KFGWTServer.jar" />
 <property name="crmFileName" value="KFCRMServer.jar" />
 <property name="javaKitFileName" value="KFJavaKit.jar" />
 <property name="clientFileName" value="KFGWTClient.jar" />
 <property name="entityFileName" value="KFDBEntity.jar" />
 <property name="creatorFileName" value="KFCreator.jar" />
 <property name="ConfigGoeJar" value="DBConfigGoe.jar" />
 <property name="ConfigMaxJar" value="DBConfigMax.jar" />

 <property name="Project.path" value="../KFwebEDI" />
 <property name="gwt.path" value="${Project.path}/lib" />
 <property name="war.name" value="login.war" />
 <property name="war.dir" value="login" />

 <property name="original.gwt.jar.lib" value="${gwt.path}/gwt-user.jar" />
 <property name="max.peace.path" value="//192.168.1.11/KFwebEDI-temp" />
 <property name="max.Release.path" value="//192.168.1.11/KFwebEDI-temp/Release" />
 <property name="temp.dir" value="./tempDir" />
 <property name="maxtomcat" value="//192.168.1.11/webapps" />
 <property name="goeeee" value="E:/u/webedi_update" />
 <property name="tomcat.webapp.path" value="C:/Apache/Tomcat 6.0/webapps" />

 <path id="JUnit 4.libraryclasspath">
  <pathelement location="${ECLIPSE_HOME}/plugins/org.junit4_4.3.1/junit.jar" />
 </path>
 <path id="userclasspath">
  <pathelement location="${webinf.lib.path}/activation.jar" />
  <pathelement location="${webinf.lib.path}/ant-1.6.5.jar" />
  <pathelement location="${webinf.lib.path}/ant-antlr-1.6.5.jar" />
  <pathelement location="${webinf.lib.path}/ant-junit-1.6.5.jar" />
  <pathelement location="${webinf.lib.path}/ant-launcher-1.6.5.jar" />
  <pathelement location="${webinf.lib.path}/antlr-2.7.6.jar" />
  <pathelement location="${webinf.lib.path}/ant-swing-1.6.5.jar" />
  <pathelement location="${webinf.lib.path}/asm.jar" />
  <pathelement location="${webinf.lib.path}/asm-attrs.jar" />
  <pathelement location="${webinf.lib.path}/c3p0-0.9.1.2.jar" />
  <pathelement location="${webinf.lib.path}/c3p0-oracle-thin-extras-0.9.1.2.jar" />
  <pathelement location="${webinf.lib.path}/cglib-2.1.3.jar" />
  <pathelement location="${webinf.lib.path}/checkstyle-all.jar" />
  <pathelement location="${webinf.lib.path}/cleanimports.jar" />
  <pathelement location="${webinf.lib.path}/commons-beanutils.jar" />
  <pathelement location="${webinf.lib.path}/commons-collections-2.1.1.jar" />
  <pathelement location="${webinf.lib.path}/commons-fileupload-1.1.1.jar" />
  <pathelement location="${webinf.lib.path}/commons-io-1.2.jar" />
  <pathelement location="${webinf.lib.path}/commons-logging-1.0.4.jar" />
  <pathelement location="${webinf.lib.path}/concurrent-1.3.2.jar" />
  <pathelement location="${webinf.lib.path}/connector.jar" />
  <pathelement location="${webinf.lib.path}/dom4j-1.6.1.jar" />
  <pathelement location="${webinf.lib.path}/ehcache-1.2.3.jar" />
  <pathelement location="${webinf.lib.path}/ejb3-persistence.jar" />
  <pathelement location="${webinf.lib.path}/fonts.jar" />
  <pathelement location="${webinf.lib.path}/gwt-user.jar" />
  <pathelement location="${webinf.lib.path}/hibernate3.jar" />
  <pathelement location="${webinf.lib.path}/hibernate-annotations.jar" />
  <pathelement location="${webinf.lib.path}/hibernate-commons-annotations.jar" />
  <pathelement location="${webinf.lib.path}/hibernate-entitymanager.jar" />
  <pathelement location="${webinf.lib.path}/hibernate-validator.jar" />
  <pathelement location="${webinf.lib.path}/itext-1.4.5.jar" />
  <pathelement location="${webinf.lib.path}/jaas.jar" />
  <pathelement location="${webinf.lib.path}/jacc-1_0-fr.jar" />
  <pathelement location="${webinf.lib.path}/javassist.jar" />
  <pathelement location="${webinf.lib.path}/jaxen-1.1-beta-7.jar" />
  <pathelement location="${webinf.lib.path}/jboss-archive-browsing.jar" />
  <pathelement location="${webinf.lib.path}/jboss-cache.jar" />
  <pathelement location="${webinf.lib.path}/jboss-common.jar" />
  <pathelement location="${webinf.lib.path}/jboss-jmx.jar" />
  <pathelement location="${webinf.lib.path}/jboss-system.jar" />
  <pathelement location="${webinf.lib.path}/jdbc2_0-stdext.jar" />
  <pathelement location="${webinf.lib.path}/jgroups-2.2.8.jar" />
  <pathelement location="${webinf.lib.path}/jta.jar" />
  <pathelement location="${webinf.lib.path}/junit-3.8.1.jar" />
  <pathelement location="${webinf.lib.path}/jxl.jar" />
  <pathelement location="${webinf.lib.path}/log4j-1.2.11.jar" />
  <pathelement location="${webinf.lib.path}/mysql-connector-java-5.0.3-bin.jar" />
  <pathelement location="${webinf.lib.path}/ojdbc14.jar" />
  <pathelement location="${webinf.lib.path}/oscache-2.1.jar" />
  <pathelement location="${webinf.lib.path}/proxool-0.8.3.jar" />
  <pathelement location="${webinf.lib.path}/swarmcache-1.0rc2.jar" />
  <pathelement location="${webinf.lib.path}/syndiag2.jar" />
  <pathelement location="${webinf.lib.path}/versioncheck.jar" />
  <pathelement location="${webinf.lib.path}/xerces-2.6.2.jar" />
  <pathelement location="${webinf.lib.path}/xml-apis.jar" />
  <pathelement location="${webinf.lib.path}/mail.jar" />
 </path>

 <path id="gwt1.4.userclasspath">
  <!--<pathelement location="${gwt.path}/gwt-benchmark-viewer.jar" />-->
  <pathelement location="${gwt.path}/gwt-dev-windows.jar" />
  <!--<pathelement location="${gwt.path}/gwt-servlet.jar" />-->
  <pathelement location="${gwt.path}/gwt-user.jar" />
 </path>

 <path id="gwtant.lib">
  <path refid="gwt1.4.userclasspath">
  </path>
  <pathelement location="src" />
  <pathelement location="${KFGWTClient.path}/src" />
  <!--<pathelement location="${webinf.lib.path}/${javaKitFileName}" />-->
  <!--<pathelement location="${webinf.lib.path}/${clientFileName}" />-->
  <!--<pathelement location="${webinf.lib.path}/${entityFileName}" />-->
  <!--<pathelement location="${webinf.lib.path}/${serverFileName}" />-->
  <!--<pathelement location="${webinf.lib.path}/${crmFileName}" />-->
  <!--<pathelement location="${webinf.lib.path}/${creatorFileName}" />-->
 </path>

 <path id="Project.classpath">
  <pathelement location="${webapps.path}/WEB-INF/classes" />
  <path refid="JUnit 4.libraryclasspath" />
  <path refid="userclasspath" />
  <path refid="gwt1.4.userclasspath" />
 </path>

 <path id="run.Project.classpath">
  <pathelement location="src" />
  <path refid="Project.classpath" />
 </path>

 <target name="init">
  <mkdir dir="${disp.path}/lib" />
  <mkdir dir="${webapps.path}/WEB-INF/classes" />
  <copy includeemptydirs="false" todir="${webapps.path}/WEB-INF/classes">
   <fileset dir="src" excludes="**/*.launch, **/*.java" />
  </copy>
 </target>

 <target name="clean">
  <delete defaultexcludes="false">
   <fileset dir="${webapps.path}">
    <exclude name="WEB-INF/lib/**" />
   </fileset>
  </delete>
 </target>

 <target name="stripGWT-lib">
  <mkdir dir="${temp.dir}" />
  <unjar src="${original.gwt.jar.lib}" dest="${temp.dir}">
   <patternset>
    <exclude name="javax/**/*.*" />
   </patternset>
  </unjar>
  <jar destfile="${webinf.lib.path}/gwt-user.jar" basedir="${temp.dir}" />
  <delete dir="${temp.dir}" />
 </target>

 <target name="getlib">
  <mkdir dir="${webinf.lib.path}" />
  <antcall target="deletelib" />
  <copy todir="${webinf.lib.path}">
   <fileset dir="${max.peace.path}/lib-debug">
    <include name="*.*" />
   </fileset>
  </copy>
  <copy todir="${webinf.lib.path}">
   <fileset dir="${max.peace.path}/lib-hibernate">
    <include name="*.jar" />
   </fileset>
  </copy>
  <copy todir="${webinf.lib.path}">
   <fileset dir="${max.peace.path}/lib-common">
    <include name="*.jar" />
   </fileset>
  </copy>
  <copy todir="lib">
   <fileset dir="${max.peace.path}/lib-gwt">
    <include name="**" />
   </fileset>
  </copy>
 </target>

 <target name="DeployToMax">
  <delete file="${max.Release.path}/${war.name}" />
  <copy todir="${max.Release.path}" file="${disp.path}/lib/${war.name}" overwrite="true">
  </copy>
 </target>

 <target name="DeployToTomcat">
  <delete file="${tomcat.webapp.path}/${war.name}" />
  <delete dir="${tomcat.webapp.path}/${war.dir}" />
  <copy todir="${tomcat.webapp.path}" file="${disp.path}/lib/${war.name}">
  </copy>
 </target>

 <target name="DeployToMaxTomcat">
  <delete file="${maxtomcat}/${war.name}" />
  <delete dir="${maxtomcat}/${war.dir}" />
  <copy todir="${maxtomcat}" file="${disp.path}/lib/${war.name}">
  </copy>
 </target>

 <target name="DeployToGoeeee">
  <copy todir="${goeeee}" file="${disp.path}/lib/${war.name}">
  </copy>
 </target>

 <target name="copylib">
  <antcall target="deletelib" />
  <copy todir="${webinf.lib.path}" overwrite="true">
   <fileset dir="${KFGWTClient.path}/dist/lib">
    <include name="*.jar" />
   </fileset>
   <fileset dir="${KFGWTServer.path}/dist/lib">
    <include name="*.jar" />
   </fileset>
   <fileset dir="${KFJavaKit.path}/dist/lib">
    <include name="*.jar" />
   </fileset>
   <fileset dir="${KFDBEntity.path}/dist/lib">
    <include name="*.jar" />
   </fileset>
   <!--<fileset dir="${max.peace.path}/lib-debug">
    <include name="${ConfigGoeJar}" />
   </fileset>-->
  </copy>
 </target>

 <target name="deletelib">
  <delete>
   <fileset dir="${webinf.lib.path}">
    <include name="${clientFileName}" />
    <include name="${serverFileName}" />
    <include name="${javaKitFileName}" />
    <!--<include name="${ConfigGoeJar}" />-->
    <!--<include name="${entityFileName}" />-->
   </fileset>
  </delete>
 </target>

 <target name="gwtc" depends="clean,init,getlib,stripGWT-lib" description="Compile to JavaScript">
  <java classname="com.google.gwt.dev.GWTCompiler" fork="yes" failοnerrοr="true" maxmemory="256m">
   <classpath>
    <path refid="gwtant.lib" />
   </classpath>
   <arg value="-style" />
   <arg value="OBFUSCATED" />
   <arg value="-out" />
   <arg file="." />
   <arg value="${webapps.path}" />
  </java>
 </target>

 <target name="gwtc-no-depend" description="Compile to JavaScript">
  <delete defaultexcludes="false">
   <fileset dir="${webapps.path}">
    <exclude name="WEB-INF/**/**" />
   </fileset>
  </delete>

  <java classname="com.google.gwt.dev.GWTCompiler" fork="yes" failοnerrοr="true" maxmemory="256m">
   <classpath>
    <path refid="gwtant.lib" />
   </classpath>
   <arg value="-style" />
   <arg value="OBFUSCATED" />
   <arg value="-out" />
   <arg file="." />
   <arg value="${webapps.path}" />
  </java>
 </target>

 <target name="war" depends="gwtc">
  <delete file="${disp.path}/lib/${war.name}" />
  <jar destfile="${disp.path}/lib/${war.name}" basedir="${webapps.path}" duplicate="preserve" />
 </target>

 <target name="war-no-depend" depends="copylib">
  <delete file="${disp.path}/lib/${war.name}" />
  <jar destfile="${disp.path}/lib/${war.name}" basedir="${webapps.path}" duplicate="preserve">
   <exclude name="WEB-INF/lib/activation.jar" />
   <exclude name="WEB-INF/lib/ant-1.6.5.jar" />
   <exclude name="WEB-INF/lib/ant-antlr-1.6.5.jar" />
   <exclude name="WEB-INF/lib/ant-junit-1.6.5.jar" />
   <exclude name="WEB-INF/lib/ant-launcher-1.6.5.jar" />
   <exclude name="WEB-INF/lib/antlr-2.7.6.jar" />
   <exclude name="WEB-INF/lib/ant-swing-1.6.5.jar" />
   <exclude name="WEB-INF/lib/asm.jar" />
   <exclude name="WEB-INF/lib/asm-attrs.jar" />
   <exclude name="WEB-INF/lib/c3p0-0.9.1.2.jar" />
   <exclude name="WEB-INF/lib/c3p0-oracle-thin-extras-0.9.1.2.jar" />
   <exclude name="WEB-INF/lib/cglib-2.1.3.jar" />
   <exclude name="WEB-INF/lib/checkstyle-all.jar" />
   <exclude name="WEB-INF/lib/cleanimports.jar" />
   <exclude name="WEB-INF/lib/commons-beanutils.jar" />
   <exclude name="WEB-INF/lib/commons-collections-2.1.1.jar" />
   <exclude name="WEB-INF/lib/commons-fileupload-1.1.1.jar" />
   <exclude name="WEB-INF/lib/commons-io-1.2.jar" />
   <exclude name="WEB-INF/lib/commons-logging-1.0.4.jar" />
   <exclude name="WEB-INF/lib/concurrent-1.3.2.jar" />
   <exclude name="WEB-INF/lib/connector.jar" />
   <exclude name="WEB-INF/lib/dom4j-1.6.1.jar" />
   <exclude name="WEB-INF/lib/ehcache-1.2.3.jar" />
   <exclude name="WEB-INF/lib/ejb3-persistence.jar" />
   <exclude name="WEB-INF/lib/ejb-3_0-api.jar" />
   <exclude name="WEB-INF/lib/fonts.jar" />
   <exclude name="WEB-INF/lib/gwt-user.jar" />
   <exclude name="WEB-INF/lib/hibernate3.jar" />
   <exclude name="WEB-INF/lib/hibernate-annotations.jar" />
   <exclude name="WEB-INF/lib/hibernate-commons-annotations.jar" />
   <exclude name="WEB-INF/lib/hibernate-entitymanager.jar" />
   <exclude name="WEB-INF/lib/hibernate-validator.jar" />
   <exclude name="WEB-INF/lib/itext-1.4.5.jar" />
   <exclude name="WEB-INF/lib/jaas.jar" />
   <exclude name="WEB-INF/lib/jacc-1_0-fr.jar" />
   <exclude name="WEB-INF/lib/javassist.jar" />
   <exclude name="WEB-INF/lib/jaxen-1.1-beta-7.jar" />
   <exclude name="WEB-INF/lib/jboss-archive-browsing.jar" />
   <exclude name="WEB-INF/lib/jboss-cache.jar" />
   <exclude name="WEB-INF/lib/jboss-common.jar" />
   <exclude name="WEB-INF/lib/jboss-jmx.jar" />
   <exclude name="WEB-INF/lib/jboss-system.jar" />
   <exclude name="WEB-INF/lib/jdbc2_0-stdext.jar" />
   <exclude name="WEB-INF/lib/jgroups-2.2.8.jar" />
   <exclude name="WEB-INF/lib/jta.jar" />
   <exclude name="WEB-INF/lib/junit-3.8.1.jar" />
   <exclude name="WEB-INF/lib/jxl.jar" />
   <exclude name="WEB-INF/lib/log4j-1.2.11.jar" />
   <exclude name="WEB-INF/lib/lucene-core-2.0.0.jar" />
   <exclude name="WEB-INF/lib/mysql-connector-java-5.0.3-bin.jar" />
   <exclude name="WEB-INF/lib/ojdbc14.jar" />
   <exclude name="WEB-INF/lib/oscache-2.1.jar" />
   <exclude name="WEB-INF/lib/proxool-0.8.3.jar" />
   <exclude name="WEB-INF/lib/swarmcache-1.0rc2.jar" />
   <exclude name="WEB-INF/lib/syndiag2.jar" />
   <exclude name="WEB-INF/lib/versioncheck.jar" />
   <exclude name="WEB-INF/lib/xerces-2.6.2.jar" />
   <exclude name="WEB-INF/lib/xml-apis.jar" />
   <exclude name="WEB-INF/lib/mail.jar" />
  </jar>
  <antcall target="deletelib" />
 </target>

 <target name="compile-client-javakit-server" description="编译 client、javakit、server">
  <ant antfile="${KFJavaKit.path}/build.xml" inheritall="false" />
  <ant antfile="${KFGWTClient.path}/build.xml" inheritall="false" />
  <ant antfile="${KFDBEntity.path}/build.xml" inheritall="false" />
  <ant antfile="${KFGWTServer.path}/build.xml" inheritall="false" />
 </target>

 <target name="deploy-compile-all-local" depends="compile-client-javakit-server,gwtc-no-depend,war-no-depend">
  <description> 完整的编译整个程序,并发布到对应的地方。此编译不包含程序运行所需的外部包的复制
  </description>
  <antcall target="DeployToMaxTomcat" />
  <!--<antcall target="DeployToMax" />-->
 </target>

 <target name="deploy-all-local" depends="gwtc-no-depend,war-no-depend">
  <description> 完整的编译整个程序,并发布到对应的地方。此编译不包含程序运行所需的外部包的复制
  </description>
  <!--<antcall target="DeployToMaxTomcat" />-->
  <antcall target="DeployToMax" />
 </target>

</project>
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值