blob: 858db118c6fad87660f437349e4a84d6c6f375fe [file] [log] [blame]
fabbott@google.com71e72af2009-06-13 02:28:21 +00001<project name="GWT" default="dist" basedir=".">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +00002 <property name="gwt.root" location="." />
3 <property name="project.tail" value="" />
4 <import file="${gwt.root}/common.ant.xml" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +00005
fabbott@google.com0e2dc6282008-08-22 16:09:01 +00006 <!-- "build" is the default when subprojects are directly targetted -->
7 <property name="target" value="build" />
jlabanca@google.com47db6912009-07-26 21:05:25 +00008 <property name="emma.merged.out" value="${project.build}/emma-coverage" />
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +00009
fabbott@google.com71e72af2009-06-13 02:28:21 +000010 <!--
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000011 Convenience for the lateral calls we make. Use gwt.ant to
12 descend into another directory, and this to call in the same build.xml.
13 NOTE THE USE OF $TARGET, here and in common's gwt.ant. This has the
14 effect of dividing rules into subdirectory rules (using gwt.ant and
15 sensitive to $target) and action rules (using call-subproject and
16 setting $target)... but it is Bad for a subdirectory rule to depend
17 on another one, as they are both sensitive to $target, but you probably
18 mean that subdirB needed subdirA to be _built_, not $target'ed (tested,
19 etc.)
20
21 In other words, DO NOT USE DEPENDS=... IN A TARGET WITH GWT.ANT.
fabbott@google.com71e72af2009-06-13 02:28:21 +000022 -->
23 <macrodef name="call-subproject">
24 <attribute name="subproject" />
25 <attribute name="subtarget" />
26 <sequential>
27 <antcall target="@{subproject}">
28 <param name="target" value="@{subtarget}" />
29 </antcall>
30 </sequential>
31 </macrodef>
32
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000033 <property name="gwt.apicheck.config"
amitmanjhi@google.com83b76232009-05-19 19:47:16 +000034 location="tools/api-checker/config/gwt16_20userApi.conf"/>
fabbott@google.com831b44c2008-04-28 15:22:02 +000035
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000036 <target name="buildonly"
37 description="[action] Minimal one-platform devel build, without distro packaging">
38 <call-subproject subproject="dev-one" subtarget="build" />
39 <call-subproject subproject="user" subtarget="build" />
40 <call-subproject subproject="servlet" subtarget="build" />
41 <call-subproject subproject="jni-one" subtarget="build" />
fabbott@google.com71e72af2009-06-13 02:28:21 +000042 </target>
43
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000044 <target name="dist" depends="build, doc" description="[action] Make all the distributions">
jat@google.com04912f22008-11-26 00:21:22 +000045 <gwt.ant dir="distro-source" />
46 </target>
47
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000048 <target name="dist-one" depends="buildonly, tools, samples, doc" description="[action] Make only this platform's distribution">
fabbott@google.com71e72af2009-06-13 02:28:21 +000049 <gwt.ant dir="distro-source" target="${build.host.platform}" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000050 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000051
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000052 <target name="dist-dev" depends="buildonly" description="[action] Make this platform's distribution, minus doc and samples">
fabbott@google.com71e72af2009-06-13 02:28:21 +000053 <gwt.ant dir="distro-source" target="${build.host.platform}" />
54 </target>
55
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000056 <target name="dev" description="[subdir] Builds (or runs ${target} if set) all the dev libraries">
57 <call-subproject subproject="buildtools" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000058 <gwt.ant dir="dev" />
59 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000060
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000061 <target name="dev-one" description="[subdir] Builds only the dev library for this platform">
62 <call-subproject subproject="buildtools" subtarget="build" />
fabbott@google.com71e72af2009-06-13 02:28:21 +000063 <gwt.ant dir="dev" target="${build.host.platform}"/>
64 <gwt.ant dir="dev" target="oophm"/>
65 </target>
66
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000067 <target name="user" description="[subdir] Builds (or runs ${target} if set) only the user library">
68 <call-subproject subproject="dev-one" subtarget="build"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000069 <gwt.ant dir="user" />
70 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000071
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000072 <target name="tools" description="[subdir] Builds (or runs ${target} if set) only the tools">
73 <call-subproject subproject="user" subtarget="build"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000074 <gwt.ant dir="tools" />
75 </target>
gwt.team.mmendez4449b342007-04-10 19:41:44 +000076
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000077 <target name="servlet" description="[subdir] Builds (or runs ${target} if set) only the servlet jar">
78 <call-subproject subproject="user" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000079 <gwt.ant dir="servlet" />
80 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000081
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000082 <target name="jni" description="[subdir] Builds (or runs ${target} if set) jni for all platforms">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000083 <gwt.ant dir="jni" />
84 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000085
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000086 <target name="jni-one" description="[subdir] Builds jni for only this platform">
fabbott@google.com71e72af2009-06-13 02:28:21 +000087 <gwt.ant dir="jni" target="${build.host.platform}" />
88 </target>
89
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000090 <target name="doc" description="[subdir] Builds (or runs ${target} if set) the doc">
91 <call-subproject subproject="user" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000092 <gwt.ant dir="doc" />
93 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000094
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000095 <target name="samples" description="[subdir] Builds (or runs ${target} if set) the samples">
96 <call-subproject subproject="user" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000097 <gwt.ant dir="samples" />
98 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000099
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000100 <target name="buildtools" description="[subdir] Build (or runs ${target} if set) the build tools">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000101 <gwt.ant dir="build-tools" />
102 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000103
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000104 <target name="build" description="[action] Builds GWT, including samples, but without distro packaging">
105 <call-subproject subproject="dev" subtarget="build"/>
106 <call-subproject subproject="user" subtarget="build"/>
107 <call-subproject subproject="servlet" subtarget="build"/>
108 <call-subproject subproject="tools" subtarget="build"/>
109 <call-subproject subproject="jni" subtarget="build"/>
110 <call-subproject subproject="samples" subtarget="build"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000111 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000112
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000113 <target name="checkstyle" description="[action] Does static analysis of GWT source">
fabbott@google.com71e72af2009-06-13 02:28:21 +0000114 <call-subproject subproject="buildtools" subtarget="checkstyle" />
115 <call-subproject subproject="dev" subtarget="checkstyle" />
116 <call-subproject subproject="user" subtarget="checkstyle" />
117 <call-subproject subproject="servlet" subtarget="checkstyle" />
118 <call-subproject subproject="tools" subtarget="checkstyle" />
119 <call-subproject subproject="samples" subtarget="checkstyle" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000120 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000121
fabbott@google.com61094352009-07-11 02:18:10 +0000122 <target name="test" depends="dist-dev,apicheck,checkstyle"
123 description="[action] Runs all the GWT tests, including checkstyle and apicheck">
fabbott@google.com71e72af2009-06-13 02:28:21 +0000124 <call-subproject subproject="buildtools" subtarget="test" />
125 <call-subproject subproject="dev" subtarget="test" />
126 <call-subproject subproject="user" subtarget="test" />
127 <call-subproject subproject="servlet" subtarget="test" />
128 <call-subproject subproject="tools" subtarget="test" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000129 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000130
jlabanca@google.com47db6912009-07-26 21:05:25 +0000131 <path id="emma.classpath.src">
132 <pathelement location="${gwt.root}/user/src" />
133 <pathelement location="${gwt.root}/dev/**/src/com/google" />
134 <pathelement location="${gwt.root}/build-tools/**/src/com/google" />
135 <pathelement location="${gwt.root}/tools/**/src/com/google" />
136 </path>
137
138 <target name="emma.merge" description="Merges coverage data for all projects" if="emma.enabled">
139 <delete dir="${emma.merged.out}" />
140 <mkdir dir="${emma.merged.out}" />
141 <emma>
142 <merge outfile="${emma.merged.out}/merged.emma" >
143 <fileset dir="${project.build}" >
144 <include name="**/*.emma" />
145 <exclude name="**/merged.emma" />
146 </fileset>
147 </merge>
148 </emma>
149 <emma enabled="${emma.enabled}">
150 <report sourcepath="${emma.classpath.src}">
151 <fileset dir="${project.build}">
152 <patternset>
153 <include name="**/metadata.emma"/>
154 </patternset>
155 </fileset>
156 <fileset file="${emma.merged.out}/merged.emma" />
157 <txt outfile="${emma.merged.out}/coverage.txt" />
158 <html outfile="${emma.merged.out}/coverage.html" />
159 <xml outfile="${emma.merged.out}/coverage.xml" />
160 </report>
161 </emma>
162 </target>
163
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000164 <target name="clean" description="[action] Cleans the entire GWT build">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000165 <delete dir="${gwt.build}" />
166 </target>
fabbott@google.com831b44c2008-04-28 15:22:02 +0000167
fabbott@google.com61094352009-07-11 02:18:10 +0000168 <target name ="presubmit" description="[action] Deprecated for test, which now does checkstyle and apicheck"
169 depends="test">
fabbott@google.com71e72af2009-06-13 02:28:21 +0000170 </target>
ecc@google.comed46bf82009-01-29 17:07:24 +0000171
172 <target name="apicheck-nobuild"
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000173 description="[action] Checks API compatibility to prior GWT revision">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000174 <copy tofile="${gwt.build.out}/userApi.conf" filtering="false"
175 file="${gwt.apicheck.config}"
176 overwrite="true">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000177 </copy>
178 <java failonerror="true" fork="true"
179 classname="com.google.gwt.tools.apichecker.ApiCompatibilityChecker">
jat@google.come7f61a72008-12-24 00:45:21 +0000180 <jvmarg line="-Xmx512m" />
181 <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000182 <classpath>
183 <pathelement location="${gwt.build.out}/tools/api-checker/bin"/>
scottb@google.com22e24742009-04-02 23:43:08 +0000184 <fileset dir="${gwt.build.lib}" includes="gwt-user.jar,gwt-dev-*.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000185 <pathelement path="${java.class.path}"/>
amitmanjhi@google.comfe888202009-05-19 01:02:22 +0000186 <pathelement location="${gwt.tools.lib}/apache/ant-1.6.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000187 </classpath>
amitmanjhi@google.comfe888202009-05-19 01:02:22 +0000188 <arg value="-refJar"/>
fabbott@google.com35e6cb12009-07-13 12:30:55 +0000189 <arg path="${gwt.root}/tools/api-checker/reference/gwt-dev-modified.jar:${gwt.root}/tools/api-checker/reference/gwt-user-modified.jar"/>
jat@google.come7f61a72008-12-24 00:45:21 +0000190 <arg value="-configFile"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000191 <arg file="${gwt.build.out}/userApi.conf"/>
amitmanjhi@google.comfe888202009-05-19 01:02:22 +0000192 <arg value="-logLevel"/>
193 <arg value="ERROR"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000194 </java>
195 </target>
ecc@google.comed46bf82009-01-29 17:07:24 +0000196
fabbott@google.com61094352009-07-11 02:18:10 +0000197 <target name="apicheck" depends="buildonly,tools,apicheck-nobuild"
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000198 description="[action] Builds GWT and checks API compatiblity to prior release"/>
ecc@google.comed46bf82009-01-29 17:07:24 +0000199
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000200</project>