blob: 9c970670e8844c261120bbbe1f279c97d3abbaaf [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.com81244562009-08-05 19:55:36 +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">
jat@google.com0b1619e2009-09-20 19:33:31 +000038 <call-subproject subproject="dev" subtarget="build" />
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000039 <call-subproject subproject="user" subtarget="build" />
40 <call-subproject subproject="servlet" subtarget="build" />
jat@google.com64a55cb2009-10-16 14:16:57 +000041 <call-subproject subproject="jni" 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-dev" depends="buildonly" description="[action] Make this platform's distribution, minus doc and samples">
jat@google.com0b1619e2009-09-20 19:33:31 +000049 <gwt.ant dir="distro-source" target="build" />
fabbott@google.com71e72af2009-06-13 02:28:21 +000050 </target>
51
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000052 <target name="dev" description="[subdir] Builds (or runs ${target} if set) all the dev libraries">
53 <call-subproject subproject="buildtools" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000054 <gwt.ant dir="dev" />
55 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000056
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000057 <target name="user" description="[subdir] Builds (or runs ${target} if set) only the user library">
jat@google.com0b1619e2009-09-20 19:33:31 +000058 <call-subproject subproject="dev" subtarget="build"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000059 <gwt.ant dir="user" />
60 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000061
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000062 <target name="tools" description="[subdir] Builds (or runs ${target} if set) only the tools">
63 <call-subproject subproject="user" subtarget="build"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000064 <gwt.ant dir="tools" />
65 </target>
gwt.team.mmendez4449b342007-04-10 19:41:44 +000066
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000067 <target name="servlet" description="[subdir] Builds (or runs ${target} if set) only the servlet jar">
68 <call-subproject subproject="user" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000069 <gwt.ant dir="servlet" />
70 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000071
jat@google.com64a55cb2009-10-16 14:16:57 +000072 <target name="jni" description="[subdir] Builds (or runs ${target} if set) jni for all platforms">
73 <gwt.ant dir="jni" />
74 </target>
75
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000076 <target name="doc" description="[subdir] Builds (or runs ${target} if set) the doc">
77 <call-subproject subproject="user" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000078 <gwt.ant dir="doc" />
79 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000080
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000081 <target name="samples" description="[subdir] Builds (or runs ${target} if set) the samples">
82 <call-subproject subproject="user" subtarget="build" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000083 <gwt.ant dir="samples" />
84 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000085
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000086 <target name="buildtools" description="[subdir] Build (or runs ${target} if set) the build tools">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000087 <gwt.ant dir="build-tools" />
88 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000089
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000090 <target name="build" description="[action] Builds GWT, including samples, but without distro packaging">
91 <call-subproject subproject="dev" subtarget="build"/>
92 <call-subproject subproject="user" subtarget="build"/>
93 <call-subproject subproject="servlet" subtarget="build"/>
94 <call-subproject subproject="tools" subtarget="build"/>
jat@google.com64a55cb2009-10-16 14:16:57 +000095 <call-subproject subproject="jni" subtarget="build"/>
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000096 <call-subproject subproject="samples" subtarget="build"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +000097 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +000098
fabbott@google.com3d7fbc22009-06-18 05:07:26 +000099 <target name="checkstyle" description="[action] Does static analysis of GWT source">
fabbott@google.com71e72af2009-06-13 02:28:21 +0000100 <call-subproject subproject="buildtools" subtarget="checkstyle" />
101 <call-subproject subproject="dev" subtarget="checkstyle" />
102 <call-subproject subproject="user" subtarget="checkstyle" />
103 <call-subproject subproject="servlet" subtarget="checkstyle" />
104 <call-subproject subproject="tools" subtarget="checkstyle" />
105 <call-subproject subproject="samples" subtarget="checkstyle" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000106 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000107
fabbott@google.com61094352009-07-11 02:18:10 +0000108 <target name="test" depends="dist-dev,apicheck,checkstyle"
109 description="[action] Runs all the GWT tests, including checkstyle and apicheck">
fabbott@google.com71e72af2009-06-13 02:28:21 +0000110 <call-subproject subproject="buildtools" subtarget="test" />
111 <call-subproject subproject="dev" subtarget="test" />
112 <call-subproject subproject="user" subtarget="test" />
113 <call-subproject subproject="servlet" subtarget="test" />
114 <call-subproject subproject="tools" subtarget="test" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000115 </target>
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000116
jlabanca@google.com81244562009-08-05 19:55:36 +0000117 <path id="emma.classpath.src">
118 <pathelement location="${gwt.root}/user/src" />
119 <pathelement location="${gwt.root}/dev/**/src/com/google" />
120 <pathelement location="${gwt.root}/build-tools/**/src/com/google" />
121 <pathelement location="${gwt.root}/tools/**/src/com/google" />
122 </path>
123
124 <target name="emma.merge" description="Merges coverage data for all projects">
125 <delete dir="${emma.merged.out}" />
126 <mkdir dir="${emma.merged.out}" />
127 <emma>
128 <merge outfile="${emma.merged.out}/merged.emma" >
129 <fileset dir="${project.build}">
130 <include name="**/*.emma" />
131 <exclude name="**/merged.emma" />
132 </fileset>
133 </merge>
134 </emma>
135 <emma>
136 <report sourcepath="${emma.classpath.src}">
137 <fileset dir="${project.build}">
138 <patternset>
139 <include name="**/metadata.emma"/>
140 </patternset>
141 </fileset>
142 <fileset file="${emma.merged.out}/merged.emma" />
143 <txt outfile="${emma.merged.out}/coverage.txt" />
144 <html outfile="${emma.merged.out}/coverage.html" />
145 <xml outfile="${emma.merged.out}/coverage.xml" />
146 </report>
147 </emma>
148 </target>
149
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000150 <target name="clean" description="[action] Cleans the entire GWT build">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000151 <delete dir="${gwt.build}" />
152 </target>
fabbott@google.com831b44c2008-04-28 15:22:02 +0000153
fabbott@google.com61094352009-07-11 02:18:10 +0000154 <target name ="presubmit" description="[action] Deprecated for test, which now does checkstyle and apicheck"
jat@google.come0fa5b12009-10-13 23:57:19 +0000155 depends="test">
fabbott@google.com71e72af2009-06-13 02:28:21 +0000156 </target>
jat@google.come0fa5b12009-10-13 23:57:19 +0000157
ecc@google.comed46bf82009-01-29 17:07:24 +0000158 <target name="apicheck-nobuild"
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000159 description="[action] Checks API compatibility to prior GWT revision">
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000160 <java failonerror="true" fork="true"
161 classname="com.google.gwt.tools.apichecker.ApiCompatibilityChecker">
jat@google.come7f61a72008-12-24 00:45:21 +0000162 <jvmarg line="-Xmx512m" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000163 <classpath>
164 <pathelement location="${gwt.build.out}/tools/api-checker/bin"/>
jat@google.com0b1619e2009-09-20 19:33:31 +0000165 <fileset dir="${gwt.build.lib}" includes="gwt-user.jar,gwt-dev.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000166 <pathelement path="${java.class.path}"/>
amitmanjhi@google.comfe888202009-05-19 01:02:22 +0000167 <pathelement location="${gwt.tools.lib}/apache/ant-1.6.5.jar" />
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000168 </classpath>
amitmanjhi@google.comfe888202009-05-19 01:02:22 +0000169 <arg value="-refJar"/>
fabbott@google.com35e6cb12009-07-13 12:30:55 +0000170 <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 +0000171 <arg value="-configFile"/>
fabbott@google.com744d7842009-10-08 01:58:00 +0000172 <arg file="${gwt.apicheck.config}"/>
amitmanjhi@google.comfe888202009-05-19 01:02:22 +0000173 <arg value="-logLevel"/>
174 <arg value="ERROR"/>
fabbott@google.com0e2dc6282008-08-22 16:09:01 +0000175 </java>
176 </target>
jat@google.come0fa5b12009-10-13 23:57:19 +0000177
fabbott@google.com61094352009-07-11 02:18:10 +0000178 <target name="apicheck" depends="buildonly,tools,apicheck-nobuild"
fabbott@google.com3d7fbc22009-06-18 05:07:26 +0000179 description="[action] Builds GWT and checks API compatiblity to prior release"/>
jat@google.come0fa5b12009-10-13 23:57:19 +0000180
gwt.team.scottb14c5b9d2006-12-10 06:06:08 +0000181</project>