Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <project name="gwt-base" default="dist" basedir=".">
- <description>
- GWT/GAE build file
- </description>
- <property environment="env" />
- <!-- Build and dist -->
- <property name="webapp.dir" location="war" />
- <property name="classes" location="${webapp.dir}/WEB-INF/classes" />
- <property name="lib.dir" location="${webapp.dir}/WEB-INF/lib" />
- <property name="devmode.lib.dir" location="lib" />
- <property name="apt.lib.dir" location="apt" />
- <property name="build.dir" location="build" />
- <property name="test.classes" location="${build.dir}/test-classes" />
- <property name="war.file" location="${build.dir}/webapp.war" />
- <!-- Source dirs -->
- <property name="src" location="src" />
- <property name="gen" location="gen" />
- <property name="test" location="test" />
- <property name="test.gen" location="${build.dir}/test.gen" />
- <property name="delombok" location="${build.dir}/src" />
- <property name="test.delombok" location="${build.dir}/test" />
- <!-- Gwt's classpath -->
- <path id="gwt.classpath">
- <pathelement location="${gwt.home}/gwt-user.jar" />
- <pathelement location="${gwt.home}/gwt-dev.jar" />
- <pathelement location="${gwt.home}/validation-api-1.0.0.GA-sources.jar" />
- </path>
- <!-- Appengine's classpath -->
- <path id="gae.classpath">
- <pathelement location="${appengine.home}/lib/appengine-tools-api.jar" />
- <fileset dir="${appengine.home}/lib/tools">
- <include name="**/asm-*.jar" />
- <include name="**/datanucleus-enhancer-*.jar" />
- </fileset>
- </path>
- <!-- Compile classpath -->
- <path id="compile.classpath">
- <path refid="gwt.classpath" />
- <fileset dir="${lib.dir}" />
- <fileset dir="${devmode.lib.dir}" />
- <pathelement location="${src}" />
- <pathelement location="${gen}" />
- <pathelement location="${classes}" />
- <pathelement location="${test.classes}" />
- </path>
- <!-- Devmode classpath -->
- <path id="run.classpath">
- <path refid="compile.classpath" />
- </path>
- <!-- Devmode classpath -->
- <path id="devmode.gae.classpath">
- <path refid="compile.classpath" />
- <path refid="gae.classpath" />
- </path>
- <!-- Test classpath -->
- <path id="test.classpath">
- <path refid="compile.classpath" />
- <pathelement location="${test}" />
- </path>
- <!-- Apt classpath -->
- <path id="gen.classpath">
- <path refid="compile.classpath" />
- <fileset dir="${apt.lib.dir}" />
- </path>
- <!-- Cleans generated folders -->
- <target name="clean" description="Cleaning">
- <delete dir="${classes}" />
- <delete dir="${gen}" />
- <delete dir="${test.classes}" />
- <delete dir="${delombok}" />
- <delete dir="${test.gen}" />
- <delete dir="${build.dir}" />
- <mkdir dir="${classes}" />
- <mkdir dir="${gen}" />
- <mkdir dir="${build.dir}" />
- <mkdir dir="${delombok}" />
- <mkdir dir="${test.classes}" />
- <mkdir dir="${test.gen}" />
- </target>
- <!-- Copy resources to classpath -->
- <target name="resources" depends="clean">
- <copy todir="${classes}">
- <fileset dir="${src}">
- <exclude name="**/*.java" />
- <exclude name="**/*.ui.xml" />
- </fileset>
- </copy>
- </target>
- <!-- Run annotation processors -->
- <target name="compile" depends="resources">
- <taskdef classname="lombok.delombok.ant.DelombokTask" classpath="${devmode.lib.dir}/lombok.jar" name="delombok" />
- <javac srcdir="${src}:${gen}" fork="true" encoding="UTF-8" classpathref="gen.classpath" includeantruntime="false">
- <compilerarg value="-proc:only" />
- <compilerarg value="-s" />
- <compilerarg path="${gen}" />
- </javac>
- <delombok verbose="false" classpathref="compile.classpath" encoding="UTF-8" to="${delombok}" from="${src}" />
- <javac srcdir="${delombok}:${gen}" fork="true" destdir="${classes}" encoding="UTF-8" classpathref="compile.classpath" includeantruntime="false">
- <compilerarg value="-proc:none" />
- </javac>
- <javac srcdir="${test}" fork="true" encoding="UTF-8" classpathref="gen.classpath" includeantruntime="false">
- <compilerarg value="-proc:only" />
- <compilerarg value="-s" />
- <compilerarg path="${test.gen}" />
- </javac>
- <delombok verbose="false" classpathref="test.classpath" encoding="UTF-8" to="${test.delombok}" from="${test}" />
- <javac srcdir="${test.delombok}" fork="true" destdir="${test.classes}" encoding="UTF-8" classpathref="compile.classpath" includeantruntime="false">
- <compilerarg value="-proc:none" />
- </javac>
- </target>
- <!-- Compiles gwt -->
- <target name="gwt">
- <java classname="com.google.gwt.dev.Compiler" failonerror="true" classpath="${classes}" fork="yes" classpathref="run.classpath">
- <jvmarg line="-Xmx1024m -javaagent:${devmode.lib.dir}/lombok.jar=ECJ" />
- <arg line="-logLevel INFO -war ${webapp.dir} ${gwt.module} -localWorkers 2" />
- </java>
- </target>
- <!-- Run tests -->
- <target name="test">
- <junit>
- <classpath refid="test.classpath" />
- <formatter type="brief" usefile="false" />
- <batchtest>
- <fileset dir="${test.classes}">
- <include name="**/*Test.class" />
- </fileset>
- </batchtest>
- </junit>
- </target>
- <!-- Copy GWT dependencies -->
- <target name="gwt.jars">
- <copy file="${gwt.home}/gwt-servlet.jar" tofile="${lib.dir}/gwt-servlet.jar" />
- <copy file="${gwt.home}/validation-api-1.0.0.GA.jar" tofile="${lib.dir}/validation-api-1.0.0.GA.jar" />
- <copy todir="${lib.dir}" flatten="true">
- <fileset dir="${appengine.home}/lib/user" includes="**/*.jar" />
- </copy>
- </target>
- <!-- Copy GAE dependencies -->
- <target name="gae.jars">
- <copy todir="${lib.dir}" flatten="true">
- <fileset dir="${appengine.home}/lib/user" includes="**/*.jar" />
- </copy>
- </target>
- <!-- Creates war file -->
- <target name="dist">
- <war destfile="${war.file}" basedir="${webapp.dir}" webxml="${webapp.dir}/WEB-INF/web.xml" />
- </target>
- <!-- Runs devmode -->
- <target name="devmode">
- <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode" classpathref="run.classpath">
- <jvmarg value="-Dgwt.nowarn.webapp.classpath" />
- <jvmarg value="-Xmx1024m" />
- <jvmarg value="-XX:MaxPermSize=512M" />
- <jvmarg value="-javaagent:${devmode.lib.dir}/lombok.jar=ECJ" />
- <arg value="-logLevel" />
- <arg value="INFO" />
- <arg value="-war" />
- <arg value="${webapp.dir}" />
- <arg value="-startupUrl" />
- <arg value="${gwt.html}" />
- <arg value="${gwt.module}" />
- </java>
- </target>
- <!-- Runs devmode with gae -->
- <target name="devmode.gae">
- <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode" classpathref="devmode.gae.classpath">
- <jvmarg value="-Dgwt.nowarn.webapp.classpath" />
- <jvmarg value="-Xmx1024m" />
- <jvmarg value="-XX:MaxPermSize=512M" />
- <jvmarg value="-javaagent:${devmode.lib.dir}/lombok.jar=ECJ" />
- <jvmarg value="-javaagent:${appengine.home}/lib/agent/appengine-agent.jar" />
- <arg value="-logLevel" />
- <arg value="INFO" />
- <arg value="-war" />
- <arg value="${webapp.dir}" />
- <arg value="-startupUrl" />
- <arg value="${gwt.html}" />
- <arg value="-server" />
- <arg value="com.google.appengine.tools.development.gwt.AppEngineLauncher" />
- <arg value="${gwt.module}" />
- </java>
- </target>
- <target name="deploy">
- <exec executable="${appengine.home}/bin/appcfg.sh">
- <arg value="-e" />
- <arg value="${appengine.email}" />
- <arg value="update" />
- <arg value="war" />
- </exec>
- </target>
- </project>
Advertisement
Add Comment
Please, Sign In to add comment