gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 1 | <project name="common"> |
fabbott@google.com | 2530547 | 2009-06-10 21:39:00 +0000 | [diff] [blame] | 2 | <!-- it's okay for this not to exist, but it gives a place to store |
| 3 | "your" property settings, if any, persistently. For example, you |
| 4 | might use it to set gwt.junit.testcase.includes to a narrower subset |
| 5 | of test cases to exercise. --> |
| 6 | <property file="local.ant.properties" /> |
| 7 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 8 | <!-- gwt.build.iscasesensitivefs is true if the filesystem of the |
| 9 | build machine is case-sensitive, false otherwise. Update with |
| 10 | new lines for any supported platforms with case-insensitive |
| 11 | filesystems |
| 12 | --> |
| 13 | <condition property="gwt.build.iscasesensitivefs" else="false"> |
| 14 | <not> |
| 15 | <or> |
| 16 | <os family="windows"/> |
| 17 | </or> |
| 18 | </not> |
| 19 | </condition> |
gwt.team.jat | ceab1ec | 2006-12-28 22:48:49 +0000 | [diff] [blame] | 20 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 21 | <property name="test.ant.file" location="${gwt.root}/${project.tail}/build.xml" /> |
| 22 | <condition property="project.valid"> |
| 23 | <equals arg1="${ant.file}" arg2="${test.ant.file}" |
| 24 | casesensitive="${gwt.build.iscasesensitivefs}"/> |
| 25 | </condition> |
| 26 | <fail unless="project.valid" message="This build file is in an inconsistent state (${ant.file} != ${test.ant.file})." /> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 27 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 28 | <!-- Global Properties --> |
| 29 | <property environment="env" /> |
| 30 | <condition property="gwt.version" value="${env.GWT_VERSION}" else="0.0.0"> |
| 31 | <isset property="env.GWT_VERSION" /> |
| 32 | </condition> |
| 33 | <condition property="gwt.tools.check" value="${env.GWT_TOOLS}" else="${gwt.root}/../tools"> |
| 34 | <isset property="env.GWT_TOOLS" /> |
| 35 | </condition> |
| 36 | <property name="gwt.tools" location="${gwt.tools.check}" /> |
| 37 | <property name="gwt.tools.lib" location="${gwt.tools}/lib" /> |
| 38 | <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" /> |
| 39 | <property name="gwt.tools.redist" location="${gwt.tools}/redist" /> |
| 40 | <property name="gwt.build" location="${gwt.root}/build" /> |
| 41 | <property name="gwt.build.out" location="${gwt.build}/out" /> |
| 42 | <property name="gwt.build.lib" location="${gwt.build}/lib" /> |
| 43 | <property name="gwt.build.jni" location="${gwt.build}/jni" /> |
| 44 | <property name="gwt.build.staging" location="${gwt.build}/staging" /> |
| 45 | <property name="gwt.build.dist" location="${gwt.build}/dist" /> |
bobv@google.com | b2bd3f5 | 2009-02-19 23:38:40 +0000 | [diff] [blame] | 46 | <property name="gwt.threadsPerProcessor" value="1" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 47 | <property name="project.build" location="${gwt.build.out}/${project.tail}" /> |
| 48 | <property name="project.lib" location="${gwt.build.lib}/gwt-${ant.project.name}.jar" /> |
| 49 | <property name="project.jni" location="${gwt.build}/${project.tail}" /> |
| 50 | <property name="javac.out" location="${project.build}/bin" /> |
| 51 | <property name="javac.junit.out" location="${project.build}/bin-test" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 52 | <property name="javac.emma.out" location="${project.build}/bin-emma" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 53 | <property name="javac.debug" value="true" /> |
| 54 | <property name="javac.debuglevel" value="lines,vars,source" /> |
| 55 | <property name="javac.encoding" value="utf-8" /> |
| 56 | <property name="javac.source" value="1.5" /> |
| 57 | <property name="javac.target" value="1.5" /> |
| 58 | <property name="javac.nowarn" value="true" /> |
| 59 | <property name="junit.out" location="${project.build}/test" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 60 | <property name="emma.dir" value="${gwt.tools.redist}/emma" /> |
| 61 | <property name="emma.filter.exclude" value="" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 62 | |
| 63 | <!-- Sanity check --> |
| 64 | <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" /> |
| 65 | <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}' tools directory; perhaps you should define the GWT_TOOLS environment variable" /> |
gwt.team.scottb | 193a3b9 | 2006-12-11 22:24:38 +0000 | [diff] [blame] | 66 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 67 | <!-- Platform identification --> |
| 68 | <condition property="build.host.islinux"> |
| 69 | <and> |
| 70 | <os family="unix" /> |
| 71 | <not> |
| 72 | <contains string="${os.name}" substring="mac" casesensitive="false" /> |
| 73 | </not> |
| 74 | </and> |
| 75 | </condition> |
| 76 | <condition property="build.host.platform" value="linux"> |
| 77 | <isset property="build.host.islinux" /> |
| 78 | </condition> |
gwt.team.scottb | 193a3b9 | 2006-12-11 22:24:38 +0000 | [diff] [blame] | 79 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 80 | <condition property="build.host.ismac"> |
| 81 | <and> |
| 82 | <os family="unix" /> |
| 83 | <contains string="${os.name}" substring="mac" casesensitive="false" /> |
| 84 | </and> |
| 85 | </condition> |
| 86 | <condition property="build.host.platform" value="mac"> |
| 87 | <isset property="build.host.ismac" /> |
| 88 | </condition> |
gwt.team.scottb | 193a3b9 | 2006-12-11 22:24:38 +0000 | [diff] [blame] | 89 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 90 | <condition property="build.host.iswindows"> |
| 91 | <os family="windows" /> |
| 92 | </condition> |
| 93 | <condition property="build.host.platform" value="windows"> |
| 94 | <isset property="build.host.iswindows" /> |
| 95 | </condition> |
| 96 | <fail unless="build.host.platform" message="Building on ${os.name} is not supported" /> |
gwt.team.scottb | 193a3b9 | 2006-12-11 22:24:38 +0000 | [diff] [blame] | 97 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 98 | <condition property="junit.platform.args" value="-XstartOnFirstThread" else=""> |
| 99 | <isset property="build.host.ismac" /> |
| 100 | </condition> |
gwt.team.scottb | 193a3b9 | 2006-12-11 22:24:38 +0000 | [diff] [blame] | 101 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 102 | <!-- JUnit support --> |
| 103 | <property name="gwt.dev.staging.jar" location="${gwt.build.staging}/gwt-${build.host.platform}-${gwt.version}/gwt-dev-${build.host.platform}.jar" /> |
| 104 | <property name="gwt.junit.port" value="8888" /> |
| 105 | <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/> |
gwt.team.zundel | 910448e | 2008-04-26 13:56:28 +0000 | [diff] [blame] | 106 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 107 | <!-- Headless mode keeps the hosted mode browser and log window |
| 108 | from popping up during a unit test run. This is usually desirable, |
| 109 | but the WebKit layout engine performs some optimizations in |
| 110 | headless mode that causes some GWT unit tests to break. The |
| 111 | solution for the time being is to turn off headless mode on |
| 112 | the mac. |
| 113 | --> |
| 114 | <condition property="junit.headless"> |
| 115 | <not> |
| 116 | <isset property="build.host.ismac" /> |
| 117 | </not> |
| 118 | </condition> |
| 119 | <condition property="junit.notheadless.arg" value="-notHeadless" else=""> |
| 120 | <not> |
| 121 | <isset property="junit.headless" /> |
| 122 | </not> |
| 123 | </condition> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 124 | |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 125 | <!-- Shared class paths --> |
| 126 | <path id="project.classpath.class"> |
| 127 | <pathelement location="${javac.out}" /> |
| 128 | </path> |
| 129 | <path id="project.classpath.src"> |
| 130 | <pathelement location="${gwt.root}/${project.tail}/src" /> |
| 131 | </path> |
| 132 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 133 | <!-- Pulls in tasks defined in ant-contrib, i.e. foreach --> |
| 134 | <taskdef resource="net/sf/antcontrib/antlib.xml"> |
| 135 | <classpath> |
| 136 | <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" /> |
| 137 | </classpath> |
| 138 | </taskdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 139 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 140 | <!-- Global Custom Tasks --> |
| 141 | <presetdef name="gwt.ant"> |
| 142 | <ant inheritall="false" target="${target}"> |
| 143 | <propertyset> |
| 144 | <propertyref name="gwt.version" /> |
| 145 | <propertyref name="gwt.junit.port" /> |
| 146 | <propertyref name="gwt.remote.browsers" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 147 | <propertyref name="emma.enabled" /> |
jlabanca@google.com | d93fa54 | 2009-08-24 17:44:29 +0000 | [diff] [blame] | 148 | <propertyref name="emma.compiled" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 149 | </propertyset> |
| 150 | </ant> |
| 151 | </presetdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 152 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 153 | <presetdef name="gwt.javac"> |
| 154 | <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}" debuglevel="${javac.debuglevel}" source="${javac.source}" target="${javac.target}" nowarn="${javac.nowarn}" encoding="${javac.encoding}" /> |
| 155 | </presetdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 156 | |
fabbott@google.com | 2530547 | 2009-06-10 21:39:00 +0000 | [diff] [blame] | 157 | <macrodef name="gwt.jar"> |
| 158 | <attribute name="destfile" default="${project.lib}"/> |
| 159 | <attribute name="duplicate" default="fail"/> |
| 160 | <attribute name="update" default="true"/> |
| 161 | <element name="jarcontents" implicit="true"/> |
| 162 | <sequential> |
| 163 | <taskdef name="jar.bydate" |
| 164 | classname="com.google.gwt.ant.taskdefs.LatestTimeJar" |
| 165 | classpath="${gwt.build.lib}/ant-gwt.jar" /> |
| 166 | |
| 167 | <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}" filesonly="false" |
| 168 | index="true" update="@{update}"> |
| 169 | <jarcontents/> |
| 170 | </jar.bydate> |
| 171 | </sequential> |
| 172 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 173 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 174 | <macrodef name="gwt.junit"> |
| 175 | <!-- TODO: make this more generic / refactor so it can be used from dev/core --> |
amitmanjhi@google.com | cc68e23 | 2009-07-22 17:25:37 +0000 | [diff] [blame] | 176 | <attribute name="test.args" default="" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 177 | <attribute name="test.out" default="" /> |
| 178 | <attribute name="test.reports" default="@{test.out}/reports" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 179 | <attribute name="test.emma.coverage" default="@{test.out}/emma-coverage" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 180 | <attribute name="test.cases" default="" /> |
fabbott@google.com | afd5f3a | 2009-09-03 19:14:51 +0000 | [diff] [blame] | 181 | <attribute name="haltonfailure" default="true" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 182 | <element name="extraclasspaths" optional="true" /> |
| 183 | <sequential> |
| 184 | <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"> |
| 185 | <classpath> |
| 186 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 187 | <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar" /> |
| 188 | <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" /> |
| 189 | </classpath> |
| 190 | </taskdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 191 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 192 | <echo message="Writing test results to @{test.reports} for @{test.cases}" /> |
| 193 | <mkdir dir="@{test.reports}" /> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 194 | |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 195 | <antcall target="-create.emma.coverage"> |
| 196 | <param name="test.emma.coverage" value="@{test.emma.coverage}"/> |
| 197 | </antcall> |
| 198 | <condition property="emma.lib" value="${emma.dir}/emma-2.0.5312-patched.jar" else=""> |
| 199 | <isset property="emma.enabled" /> |
| 200 | </condition> |
| 201 | |
fabbott@google.com | f87faf1 | 2009-06-17 15:33:38 +0000 | [diff] [blame] | 202 | <junit dir="@{test.out}" fork="yes" printsummary="yes" |
jlabanca@google.com | 718da3a | 2009-08-07 11:58:23 +0000 | [diff] [blame] | 203 | failureproperty="junit.failure" tempdir="@{test.out}"> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 204 | <jvmarg line="${junit.platform.args}" /> |
jat@google.com | 633cf17 | 2009-03-27 06:08:37 +0000 | [diff] [blame] | 205 | <jvmarg line="-Xmx768m" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 206 | <jvmarg value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" /> |
| 207 | <jvmarg value="-Demma.coverage.out.merge=true" /> |
amitmanjhi@google.com | 6146b0c | 2009-07-25 14:55:48 +0000 | [diff] [blame] | 208 | <sysproperty key="gwt.args" value="${junit.notheadless.arg} @{test.args}" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 209 | <sysproperty key="java.awt.headless" value="${junit.headless}" /> |
| 210 | <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" /> |
| 211 | <classpath> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 212 | <path refid="project.classpath.src" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 213 | <pathelement location="${gwt.root}/${project.tail}/super" /> |
| 214 | <pathelement location="${gwt.root}/${project.tail}/test" /> |
| 215 | <pathelement location="${javac.junit.out}" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 216 | <!-- javac.emma.out is empty unless emma is enabled. --> |
| 217 | <pathelement location="${javac.emma.out}" /> |
| 218 | <path refid="project.classpath.class" /> |
| 219 | <pathelement location="${emma.lib}" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 220 | <pathelement location="${gwt.dev.staging.jar}" /> |
| 221 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 222 | <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" /> |
bobv@google.com | a933c8b | 2009-03-26 02:12:25 +0000 | [diff] [blame] | 223 | <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" /> |
| 224 | <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 225 | <extraclasspaths /> |
| 226 | </classpath> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 227 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 228 | <formatter type="plain" /> |
| 229 | <formatter type="xml" /> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 230 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 231 | <batchtest todir="@{test.reports}"> |
| 232 | <fileset refid="@{test.cases}" /> |
| 233 | </batchtest> |
| 234 | </junit> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 235 | |
| 236 | <emma enabled="${emma.enabled}"> |
| 237 | <report sourcepath="${project.classpath.src}"> |
| 238 | <fileset file="${javac.emma.out}/metadata.emma" /> |
| 239 | <fileset dir="@{test.emma.coverage}"> |
| 240 | <include name="*.emma" /> |
| 241 | </fileset> |
| 242 | <txt outfile="@{test.emma.coverage}/coverage.txt" /> |
| 243 | <html outfile="@{test.emma.coverage}/coverage.html" /> |
| 244 | <xml outfile="@{test.emma.coverage}/coverage.xml" /> |
| 245 | </report> |
| 246 | </emma> |
| 247 | |
fabbott@google.com | afd5f3a | 2009-09-03 19:14:51 +0000 | [diff] [blame] | 248 | <condition property="junit.stop.build" value="true"> |
| 249 | <and> |
| 250 | <istrue value="@{haltonfailure}"/> |
fabbott@google.com | be8c74e | 2009-09-28 19:14:04 +0000 | [diff] [blame^] | 251 | <isset property="junit.failure"/> |
fabbott@google.com | afd5f3a | 2009-09-03 19:14:51 +0000 | [diff] [blame] | 252 | </and> |
| 253 | </condition> |
| 254 | <fail message="One or more junit tests failed" if="junit.stop.build" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 255 | </sequential> |
| 256 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 257 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 258 | <macrodef name="gwt.tgz.cat"> |
| 259 | <attribute name="destfile" /> |
| 260 | <attribute name="compression" default="gzip" /> |
| 261 | <element name="tar.elements" implicit="true" optional="true" /> |
| 262 | <sequential> |
| 263 | <taskdef name="tar.cat" classname="com.google.gwt.ant.taskdefs.TarCat" classpath="${gwt.build.lib}/ant-gwt.jar" /> |
| 264 | <tar.cat destfile="@{destfile}" compression="@{compression}" longfile="gnu"> |
| 265 | <tar.elements /> |
| 266 | </tar.cat> |
| 267 | </sequential> |
| 268 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 269 | |
fabbott@google.com | 3b1edcc | 2008-09-11 03:19:19 +0000 | [diff] [blame] | 270 | <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of a workspace"> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 271 | <sequential> |
fabbott@google.com | 66b7906 | 2008-09-20 05:44:47 +0000 | [diff] [blame] | 272 | <taskdef name="svninfo" |
| 273 | classname="com.google.gwt.ant.taskdefs.SvnInfo" |
| 274 | classpath="${gwt.build.lib}/ant-gwt.jar" /> |
fabbott@google.com | 4e4f363 | 2008-09-23 01:15:55 +0000 | [diff] [blame] | 275 | <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev" |
fabbott@google.com | 66b7906 | 2008-09-20 05:44:47 +0000 | [diff] [blame] | 276 | outputfileproperty="gwt.svnrev.filename" /> |
fabbott@google.com | 3b1edcc | 2008-09-11 03:19:19 +0000 | [diff] [blame] | 277 | <!-- Generally, filtering requires a sentinel file so that changes to svn rev will |
| 278 | be noticed as invalidating the previously-generated filter output. This property |
| 279 | names where such a sentinel lives; it is tested with <available/> and created |
| 280 | with <touch/> --> |
| 281 | <mkdir dir="${project.build}/sentinels" /> |
| 282 | <property name="filter.sentinel" |
| 283 | location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}" /> |
| 284 | </sequential> |
| 285 | </macrodef> |
| 286 | |
| 287 | <macrodef name="gwt.revfilter" description="Filters files for versioning"> |
| 288 | <attribute name="todir" description="Destination for the filtered copy"/> |
| 289 | |
| 290 | <element name="src.fileset" implicit="true" |
| 291 | description="Source for the filtered copy"/> |
| 292 | <sequential> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 293 | <!-- These files must be filtered for versioning --> |
fabbott@google.com | 3b1edcc | 2008-09-11 03:19:19 +0000 | [diff] [blame] | 294 | <echo message="Branding as GWT version ${gwt.version}, SVN rev ${gwt.svnrev}"/> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 295 | <mkdir dir="@{todir}" /> |
| 296 | <copy todir="@{todir}" overwrite="true"> |
| 297 | <src.fileset/> |
| 298 | <filterset> |
| 299 | <filter token="GWT_VERSION" value="${gwt.version}" /> |
| 300 | <filter token="GWT_SVNREV" value="${gwt.svnrev}" /> |
| 301 | </filterset> |
| 302 | </copy> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 303 | </sequential> |
| 304 | </macrodef> |
fabbott@google.com | 4a87ea1 | 2008-08-20 21:02:23 +0000 | [diff] [blame] | 305 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 306 | <macrodef name="gwt.timer"> |
| 307 | <attribute name="name"/> |
| 308 | <element name="timer.elements" implicit="true" optional="false"/> |
| 309 | <sequential> |
| 310 | <taskdef name="timer" |
| 311 | classname="com.google.gwt.ant.taskdefs.Timer" |
| 312 | classpath="${gwt.build.lib}/ant-gwt.jar" /> |
| 313 | <timer name="@{name}"> |
| 314 | <timer.elements/> |
| 315 | </timer> |
| 316 | </sequential> |
| 317 | </macrodef> |
fabbott@google.com | f8284cd | 2008-05-09 20:14:51 +0000 | [diff] [blame] | 318 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 319 | <macrodef name="gwt.checkstyle"> |
fabbott@google.com | 615a29b | 2009-06-23 16:20:54 +0000 | [diff] [blame] | 320 | <attribute name="outputdirectory" default="${project.build}"/> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 321 | <element name="sourcepath" implicit="yes" optional="true" /> |
| 322 | <sequential> |
| 323 | <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar" /> |
fabbott@google.com | 6109435 | 2009-07-11 02:18:10 +0000 | [diff] [blame] | 324 | <mkdir dir="@{outputdirectory}"/> |
fabbott@google.com | 615a29b | 2009-06-23 16:20:54 +0000 | [diff] [blame] | 325 | <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml" maxErrors="0" failOnViolation="false" failureProperty="gwt.checkstyle.failed"> |
| 326 | <formatter type="xml" toFile="@{outputdirectory}/checkstyle_log.xml"/> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 327 | <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" /> |
| 328 | <sourcepath /> |
| 329 | </checkstyle> |
fabbott@google.com | 615a29b | 2009-06-23 16:20:54 +0000 | [diff] [blame] | 330 | <fail message="Checkstyle errors exist, and are reported in checkstyle_log.xml located at @{outputdirectory}" if="gwt.checkstyle.failed" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 331 | </sequential> |
| 332 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 333 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 334 | <macrodef name="property.ensure"> |
| 335 | <attribute name="name" /> |
| 336 | <attribute name="location" /> |
| 337 | <attribute name="message" default="Cannot find dependency ${@{name}}" /> |
| 338 | <attribute name="unless" default="__nonexistent_property__" /> |
| 339 | <sequential> |
| 340 | <property name="@{name}" location="@{location}" /> |
| 341 | <condition property="@{name}.exists"> |
| 342 | <or> |
| 343 | <available file="${@{name}}" /> |
| 344 | <isset property="@{unless}" /> |
| 345 | </or> |
| 346 | </condition> |
| 347 | <fail unless="@{name}.exists" message="@{message}" /> |
| 348 | </sequential> |
| 349 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 350 | |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 351 | <!-- Targets for emma support. To run tests with emma enabled, use |
| 352 | ant <test-target> -Demma.enabled=true --> |
| 353 | <path id="emma.taskdef.lib"> |
| 354 | <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" /> |
| 355 | <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" /> |
| 356 | </path> |
| 357 | |
| 358 | <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib" /> |
| 359 | |
| 360 | <target name="compile.emma" description="Instruments emma classes" unless="emma.compiled"> |
| 361 | <delete dir="${javac.emma.out}" /> |
| 362 | <property name="emma.compiled" value="true" /> |
| 363 | <antcall target="-compile.emma.if.enabled" /> |
| 364 | </target> |
| 365 | |
| 366 | <target name="-compile.emma.if.enabled" description="Instruments emma classes" if="emma.enabled"> |
| 367 | <mkdir dir="${javac.emma.out}" /> |
| 368 | <path id="emma.classpath"> |
| 369 | <pathelement location="${javac.out}" /> |
| 370 | </path> |
| 371 | <emma enabled="${emma.enabled}" > |
| 372 | <instr instrpathref="emma.classpath" destdir="${javac.emma.out}" metadatafile="${javac.emma.out}/metadata.emma" merge="false"> |
| 373 | <filter includes="com.google.*" /> |
| 374 | <filter excludes="${emma.filter.exclude}" /> |
| 375 | </instr> |
| 376 | </emma> |
| 377 | </target> |
| 378 | |
| 379 | <target name="-create.emma.coverage" description="Create the emma coverage directory" if="emma.enabled"> |
| 380 | <delete dir="${test.emma.coverage}" /> |
| 381 | <mkdir dir="${test.emma.coverage}" /> |
| 382 | </target> |
| 383 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 384 | <!-- Default implementations of the required targets; projects should |
| 385 | override the ones that matter --> |
| 386 | <target name="all" depends="verify" /> |
fabbott@google.com | 71e72af | 2009-06-13 02:28:21 +0000 | [diff] [blame] | 387 | <target name="verify" depends="checkstyle, test" description="Runs tests and checkstyle static analysis" /> |
| 388 | <target name="checkstyle" /> |
| 389 | <target name="test" depends="build" /> |
| 390 | <target name="build" /> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 391 | |
fabbott@google.com | 71e72af | 2009-06-13 02:28:21 +0000 | [diff] [blame] | 392 | <target name="clean"> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 393 | <delete dir="${project.build}" /> |
| 394 | </target> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 395 | |
| 396 | </project> |