我的build.xml

<project name="GoTo1234" default="build-zip">

<!-- <property file="build.properties" /> -->
<property name="project.dir" value="${basedir}" />
<property name="output.dir" value="${basedir}/build/goto1234" />
<property name="war.name" value="goto1234.war" />
<property name="zip.name" value="goto1234.zip" />
<!-- <property name="zip.output" value="build" /> -->
<property name="zip.output" value="D:\Personal\Desktop" />

<path id="gwt.compiler.class.path">
<pathelement location="${project.dir}/domain/src" />
<pathelement location="${project.dir}/gwt/src" />
<pathelement location="${project.dir}/gwt-hibernate-patch" />
<pathelement location="${project.dir}/server/src" />
<pathelement location="${project.dir}/classes" />
<pathelement location="${project.dir}/lib/htmlparser.jar" />
<pathelement location="${project.dir}/lib/gwt1.5/gwt-dev-windows.jar" />
<pathelement location="${project.dir}/lib/gwt1.5/gwt-user.jar" />
</path>

<macrodef name="gwt-compile">
<attribute name="moduleName" />
<sequential>
<echo message="Compile gwt module:@{moduleName}" />
<java classname="com.google.gwt.dev.GWTCompiler" fork="true">
<classpath refid="gwt.compiler.class.path" />
<jvmarg value="-Xmx1024m" />
<jvmarg value="-Xms512m" />
<!-- <jvmarg value="-Ddebug=true" /> -->
<arg value="-out" />
<arg value="${output.dir}" />
<!-- <arg value="-style" /> -->
<!-- <arg value="pretty" /> -->
<arg value="@{moduleName}" />
</java>
</sequential>
</macrodef>

<target name="compile-gwt-modules">
<tstamp>
<format property="now" pattern="yyyy-MM-dd hh:mm:ss" />
</tstamp>
<echo message="Start compile gwt modules ${now}" />

<parallel threadcount="1">
<gwt-compile modulename="com.goto1234.gwt.index.Index" />
</parallel>

<tstamp>
<format property="now2" pattern="yyyy-MM-dd hh:mm:ss" />
</tstamp>
<echo message="Complete compile gwt modules ${now2}" />
</target>

<target name="build-unfold-war" depends="clear, compile-gwt-modules">
<mkdir dir="${output.dir}/WEB-INF" />
<mkdir dir="${output.dir}/WEB-INF/lib" />
<mkdir dir="${output.dir}/WEB-INF/classes" />

<copy todir="${output.dir}">
<fileset dir="${output.dir}/web" includes="*.*" />
</copy>

<!-- develop config file -->
<copy file="${project.dir}/develop/config.properties" tofile="${output.dir}/WEB-INF/classes/config.properties" overwrite="true" />

<delete dir="${output.dir}/web" />
<delete dir="${output.dir}/web-aux" />
<delete dir="${output.dir}/.gwt-tmp" />

<copy todir="${output.dir}/WEB-INF/classes">
<fileset dir="${project.dir}/classes" />
</copy>

<!--
<copy todir="${output.dir}/WEB-INF/lib">
<fileset dir="${project.dir}/lib" includes="*.jar" />
<fileset dir="${project.dir}/lib/ejb3" includes="*.jar" />
<fileset dir="${project.dir}/lib/gwt1.5" includes="gwt-servlet.jar" />
<fileset dir="${project.dir}/lib/hibernate3.3" includes="*.jar" />
<fileset dir="${project.dir}/lib/jakarta" includes="*.jar" />
<fileset dir="${project.dir}/lib/mysql" includes="*.jar" />
<fileset dir="${project.dir}/lib/spring2.5" includes="*.jar" />
</copy>
-->

<copy file="${project.dir}/etc/web.xml" tofile="${output.dir}/WEB-INF/web.xml" />
</target>

<target name="clear">
<delete dir="${output.dir}" />
<mkdir dir="${output.dir}" />
</target>

<!-- prepare-host -->
<target name="prepare-host">
<echo message="Prepare GWT Host environment" />
<mkdir dir="tomcat/webapps/ROOT/WEB-INF" />
<copy todir="tomcat/webapps/ROOT/WEB-INF" overwrite="true">
<fileset dir="server/src" includes="*.xml" />
</copy>
<copy file="etc/hosted-web.xml" tofile="tomcat/webapps/ROOT/WEB-INF/web.xml" overwrite="true" />
</target>

<!-- do not used -->
<target name="build-war" depends="build-unfold-war">
<delete file="build/${war.name}" />

<war destfile="$build/${war.name}" webxml="${output.dir}/WEB-INF/web.xml">
<fileset dir="${output.dir}">
<exclude name="WEB-INF/web.xml" />
</fileset>
</war>
</target>

<property environment="env" />

<target name="build-zip" depends="build-unfold-war">
<delete file="${zip.output}/${zip.name}" />

<zip destfile="${zip.output}/${zip.name}" basedir="${output.dir}" />
</target>

<target name="build-unzip">
<unzip src="build/${zip.name}" dest="${env.TOMCAT_HOME}/webapps/" overwrite="true" />
</target>

<target name="build-jar">
<jar destfile="${output.dir}/WEB-INF/lib/goto1234.jar" basedir="${project.dir}/classes" />
</target>

<!-- rsync -->
<macrodef name="rsync">
<attribute name="local" />
<attribute name="remote" />
<sequential>
<echo message="Run DOS Command PLS" />
<echo message="rsync -avz --delete -e 'ssh -l root' @{local} @{remote}" />
</sequential>
</macrodef>

<!-- deploy -->
<target name="deploy-to-server">
<rsync local="/cygdrive/E/workspace/com.hotye.web3.1.website/build/website/web" remote="www.hotye.com:/website/" />
<!-- /usr/local/apache/bin/apachectl restart -->
</target>


</project>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值