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 | <!-- JUnit support --> |
jat@google.com | 0b1619e | 2009-09-20 19:33:31 +0000 | [diff] [blame] | 99 | <property name="gwt.dev.staging.jar" location="${gwt.build.staging}/gwt-${gwt.version}/gwt-dev.jar" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 100 | <property name="gwt.junit.port" value="8888" /> |
| 101 | <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/> |
gwt.team.zundel | 910448e | 2008-04-26 13:56:28 +0000 | [diff] [blame] | 102 | |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 103 | <!-- Shared class paths --> |
| 104 | <path id="project.classpath.class"> |
| 105 | <pathelement location="${javac.out}" /> |
| 106 | </path> |
| 107 | <path id="project.classpath.src"> |
| 108 | <pathelement location="${gwt.root}/${project.tail}/src" /> |
| 109 | </path> |
| 110 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 111 | <!-- Pulls in tasks defined in ant-contrib, i.e. foreach --> |
| 112 | <taskdef resource="net/sf/antcontrib/antlib.xml"> |
| 113 | <classpath> |
| 114 | <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" /> |
| 115 | </classpath> |
| 116 | </taskdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 117 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 118 | <!-- Global Custom Tasks --> |
| 119 | <presetdef name="gwt.ant"> |
| 120 | <ant inheritall="false" target="${target}"> |
| 121 | <propertyset> |
| 122 | <propertyref name="gwt.version" /> |
| 123 | <propertyref name="gwt.junit.port" /> |
| 124 | <propertyref name="gwt.remote.browsers" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 125 | <propertyref name="emma.enabled" /> |
jlabanca@google.com | d93fa54 | 2009-08-24 17:44:29 +0000 | [diff] [blame] | 126 | <propertyref name="emma.compiled" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 127 | </propertyset> |
| 128 | </ant> |
| 129 | </presetdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 130 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 131 | <presetdef name="gwt.javac"> |
| 132 | <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}" debuglevel="${javac.debuglevel}" source="${javac.source}" target="${javac.target}" nowarn="${javac.nowarn}" encoding="${javac.encoding}" /> |
| 133 | </presetdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 134 | |
fabbott@google.com | 2530547 | 2009-06-10 21:39:00 +0000 | [diff] [blame] | 135 | <macrodef name="gwt.jar"> |
| 136 | <attribute name="destfile" default="${project.lib}"/> |
| 137 | <attribute name="duplicate" default="fail"/> |
| 138 | <attribute name="update" default="true"/> |
| 139 | <element name="jarcontents" implicit="true"/> |
| 140 | <sequential> |
| 141 | <taskdef name="jar.bydate" |
| 142 | classname="com.google.gwt.ant.taskdefs.LatestTimeJar" |
| 143 | classpath="${gwt.build.lib}/ant-gwt.jar" /> |
| 144 | |
| 145 | <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}" filesonly="false" |
| 146 | index="true" update="@{update}"> |
| 147 | <jarcontents/> |
| 148 | </jar.bydate> |
| 149 | </sequential> |
| 150 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 151 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 152 | <macrodef name="gwt.junit"> |
fabbott@google.com | c0e9c9f | 2009-09-28 15:46:02 +0000 | [diff] [blame] | 153 | <!-- TODO: Because dev has core, oophm splits, the "common pattern" here doesn't work |
| 154 | for it (and we use extraclasspaths entries instead). Once we lose SWT, we can |
| 155 | consolidate dev/core and dev/oophm, and that can instead more to the normal |
fabbott@google.com | 415e5a9 | 2009-09-28 20:22:48 +0000 | [diff] [blame] | 156 | pattern. Note also special casing regarding (dev/) core/test. --> |
amitmanjhi@google.com | cc68e23 | 2009-07-22 17:25:37 +0000 | [diff] [blame] | 157 | <attribute name="test.args" default="" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 158 | <attribute name="test.out" default="" /> |
| 159 | <attribute name="test.reports" default="@{test.out}/reports" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 160 | <attribute name="test.emma.coverage" default="@{test.out}/emma-coverage" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 161 | <attribute name="test.cases" default="" /> |
fabbott@google.com | afd5f3a | 2009-09-03 19:14:51 +0000 | [diff] [blame] | 162 | <attribute name="haltonfailure" default="true" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 163 | <element name="extraclasspaths" optional="true" /> |
| 164 | <sequential> |
| 165 | <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"> |
| 166 | <classpath> |
| 167 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 168 | <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar" /> |
| 169 | <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" /> |
| 170 | </classpath> |
| 171 | </taskdef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 172 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 173 | <echo message="Writing test results to @{test.reports} for @{test.cases}" /> |
| 174 | <mkdir dir="@{test.reports}" /> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 175 | |
jlabanca@google.com | 875439d | 2009-10-02 14:37:34 +0000 | [diff] [blame] | 176 | <antcall target="-create.emma.coverage.if.enabled"> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 177 | <param name="test.emma.coverage" value="@{test.emma.coverage}"/> |
| 178 | </antcall> |
| 179 | <condition property="emma.lib" value="${emma.dir}/emma-2.0.5312-patched.jar" else=""> |
| 180 | <isset property="emma.enabled" /> |
| 181 | </condition> |
| 182 | |
fabbott@google.com | f87faf1 | 2009-06-17 15:33:38 +0000 | [diff] [blame] | 183 | <junit dir="@{test.out}" fork="yes" printsummary="yes" |
jlabanca@google.com | 718da3a | 2009-08-07 11:58:23 +0000 | [diff] [blame] | 184 | failureproperty="junit.failure" tempdir="@{test.out}"> |
jat@google.com | 633cf17 | 2009-03-27 06:08:37 +0000 | [diff] [blame] | 185 | <jvmarg line="-Xmx768m" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 186 | <jvmarg value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" /> |
| 187 | <jvmarg value="-Demma.coverage.out.merge=true" /> |
amitmanjhi@google.com | b62c310 | 2009-09-24 20:55:42 +0000 | [diff] [blame] | 188 | <sysproperty key="gwt.args" value="@{test.args}" /> |
| 189 | <sysproperty key="java.awt.headless" value="true" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 190 | <classpath> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 191 | <path refid="project.classpath.src" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 192 | <pathelement location="${gwt.root}/${project.tail}/super" /> |
| 193 | <pathelement location="${gwt.root}/${project.tail}/test" /> |
fabbott@google.com | 415e5a9 | 2009-09-28 20:22:48 +0000 | [diff] [blame] | 194 | <!-- TODO: this is here because e.g. ClassPathEntryTest otherwise fails, |
| 195 | expecting the src entry (core/test) to be earlier than the bin entry |
| 196 | (${javac.junit.out}). --> |
| 197 | <pathelement location="${gwt.root}/${project.tail}/core/test" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 198 | <pathelement location="${javac.junit.out}" /> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 199 | <!-- javac.emma.out is empty unless emma is enabled. --> |
| 200 | <pathelement location="${javac.emma.out}" /> |
| 201 | <path refid="project.classpath.class" /> |
| 202 | <pathelement location="${emma.lib}" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 203 | <pathelement location="${gwt.dev.staging.jar}" /> |
| 204 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 205 | <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" /> |
bobv@google.com | a933c8b | 2009-03-26 02:12:25 +0000 | [diff] [blame] | 206 | <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" /> |
| 207 | <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" /> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 208 | <extraclasspaths /> |
| 209 | </classpath> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 210 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 211 | <formatter type="plain" /> |
| 212 | <formatter type="xml" /> |
gwt.team.mmendez | 99f280b | 2006-12-08 23:11:29 +0000 | [diff] [blame] | 213 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 214 | <batchtest todir="@{test.reports}"> |
| 215 | <fileset refid="@{test.cases}" /> |
| 216 | </batchtest> |
| 217 | </junit> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 218 | |
| 219 | <emma enabled="${emma.enabled}"> |
| 220 | <report sourcepath="${project.classpath.src}"> |
| 221 | <fileset file="${javac.emma.out}/metadata.emma" /> |
| 222 | <fileset dir="@{test.emma.coverage}"> |
| 223 | <include name="*.emma" /> |
| 224 | </fileset> |
| 225 | <txt outfile="@{test.emma.coverage}/coverage.txt" /> |
| 226 | <html outfile="@{test.emma.coverage}/coverage.html" /> |
| 227 | <xml outfile="@{test.emma.coverage}/coverage.xml" /> |
| 228 | </report> |
| 229 | </emma> |
| 230 | |
fabbott@google.com | afd5f3a | 2009-09-03 19:14:51 +0000 | [diff] [blame] | 231 | <condition property="junit.stop.build" value="true"> |
| 232 | <and> |
| 233 | <istrue value="@{haltonfailure}"/> |
fabbott@google.com | be8c74e | 2009-09-28 19:14:04 +0000 | [diff] [blame] | 234 | <isset property="junit.failure"/> |
fabbott@google.com | afd5f3a | 2009-09-03 19:14:51 +0000 | [diff] [blame] | 235 | </and> |
| 236 | </condition> |
| 237 | <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] | 238 | </sequential> |
| 239 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 240 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 241 | <macrodef name="gwt.tgz.cat"> |
| 242 | <attribute name="destfile" /> |
| 243 | <attribute name="compression" default="gzip" /> |
| 244 | <element name="tar.elements" implicit="true" optional="true" /> |
| 245 | <sequential> |
| 246 | <taskdef name="tar.cat" classname="com.google.gwt.ant.taskdefs.TarCat" classpath="${gwt.build.lib}/ant-gwt.jar" /> |
| 247 | <tar.cat destfile="@{destfile}" compression="@{compression}" longfile="gnu"> |
| 248 | <tar.elements /> |
| 249 | </tar.cat> |
| 250 | </sequential> |
| 251 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 252 | |
fabbott@google.com | 3b1edcc | 2008-09-11 03:19:19 +0000 | [diff] [blame] | 253 | <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] | 254 | <sequential> |
fabbott@google.com | 66b7906 | 2008-09-20 05:44:47 +0000 | [diff] [blame] | 255 | <taskdef name="svninfo" |
| 256 | classname="com.google.gwt.ant.taskdefs.SvnInfo" |
| 257 | classpath="${gwt.build.lib}/ant-gwt.jar" /> |
fabbott@google.com | 4e4f363 | 2008-09-23 01:15:55 +0000 | [diff] [blame] | 258 | <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev" |
fabbott@google.com | 66b7906 | 2008-09-20 05:44:47 +0000 | [diff] [blame] | 259 | outputfileproperty="gwt.svnrev.filename" /> |
fabbott@google.com | 3b1edcc | 2008-09-11 03:19:19 +0000 | [diff] [blame] | 260 | <!-- Generally, filtering requires a sentinel file so that changes to svn rev will |
| 261 | be noticed as invalidating the previously-generated filter output. This property |
| 262 | names where such a sentinel lives; it is tested with <available/> and created |
| 263 | with <touch/> --> |
| 264 | <mkdir dir="${project.build}/sentinels" /> |
| 265 | <property name="filter.sentinel" |
| 266 | location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}" /> |
| 267 | </sequential> |
| 268 | </macrodef> |
| 269 | |
| 270 | <macrodef name="gwt.revfilter" description="Filters files for versioning"> |
| 271 | <attribute name="todir" description="Destination for the filtered copy"/> |
| 272 | |
| 273 | <element name="src.fileset" implicit="true" |
| 274 | description="Source for the filtered copy"/> |
| 275 | <sequential> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 276 | <!-- These files must be filtered for versioning --> |
fabbott@google.com | 3b1edcc | 2008-09-11 03:19:19 +0000 | [diff] [blame] | 277 | <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] | 278 | <mkdir dir="@{todir}" /> |
| 279 | <copy todir="@{todir}" overwrite="true"> |
| 280 | <src.fileset/> |
| 281 | <filterset> |
| 282 | <filter token="GWT_VERSION" value="${gwt.version}" /> |
| 283 | <filter token="GWT_SVNREV" value="${gwt.svnrev}" /> |
| 284 | </filterset> |
| 285 | </copy> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 286 | </sequential> |
| 287 | </macrodef> |
fabbott@google.com | 4a87ea1 | 2008-08-20 21:02:23 +0000 | [diff] [blame] | 288 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 289 | <macrodef name="gwt.timer"> |
| 290 | <attribute name="name"/> |
| 291 | <element name="timer.elements" implicit="true" optional="false"/> |
| 292 | <sequential> |
| 293 | <taskdef name="timer" |
| 294 | classname="com.google.gwt.ant.taskdefs.Timer" |
| 295 | classpath="${gwt.build.lib}/ant-gwt.jar" /> |
| 296 | <timer name="@{name}"> |
| 297 | <timer.elements/> |
| 298 | </timer> |
| 299 | </sequential> |
| 300 | </macrodef> |
fabbott@google.com | f8284cd | 2008-05-09 20:14:51 +0000 | [diff] [blame] | 301 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 302 | <macrodef name="gwt.checkstyle"> |
fabbott@google.com | 615a29b | 2009-06-23 16:20:54 +0000 | [diff] [blame] | 303 | <attribute name="outputdirectory" default="${project.build}"/> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 304 | <element name="sourcepath" implicit="yes" optional="true" /> |
| 305 | <sequential> |
| 306 | <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] | 307 | <mkdir dir="@{outputdirectory}"/> |
fabbott@google.com | 615a29b | 2009-06-23 16:20:54 +0000 | [diff] [blame] | 308 | <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml" maxErrors="0" failOnViolation="false" failureProperty="gwt.checkstyle.failed"> |
| 309 | <formatter type="xml" toFile="@{outputdirectory}/checkstyle_log.xml"/> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 310 | <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" /> |
| 311 | <sourcepath /> |
| 312 | </checkstyle> |
fabbott@google.com | 615a29b | 2009-06-23 16:20:54 +0000 | [diff] [blame] | 313 | <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] | 314 | </sequential> |
| 315 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 316 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 317 | <macrodef name="property.ensure"> |
| 318 | <attribute name="name" /> |
| 319 | <attribute name="location" /> |
| 320 | <attribute name="message" default="Cannot find dependency ${@{name}}" /> |
| 321 | <attribute name="unless" default="__nonexistent_property__" /> |
| 322 | <sequential> |
| 323 | <property name="@{name}" location="@{location}" /> |
| 324 | <condition property="@{name}.exists"> |
| 325 | <or> |
| 326 | <available file="${@{name}}" /> |
| 327 | <isset property="@{unless}" /> |
| 328 | </or> |
| 329 | </condition> |
| 330 | <fail unless="@{name}.exists" message="@{message}" /> |
| 331 | </sequential> |
| 332 | </macrodef> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 333 | |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 334 | <!-- Targets for emma support. To run tests with emma enabled, use |
| 335 | ant <test-target> -Demma.enabled=true --> |
| 336 | <path id="emma.taskdef.lib"> |
| 337 | <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" /> |
| 338 | <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" /> |
| 339 | </path> |
| 340 | |
| 341 | <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib" /> |
| 342 | |
jat@google.com | 57b6940 | 2009-10-14 18:08:29 +0000 | [diff] [blame^] | 343 | <!-- Instruments emma classes --> |
| 344 | <target name="compile.emma.if.enabled" unless="emma.compiled"> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 345 | <delete dir="${javac.emma.out}" /> |
| 346 | <property name="emma.compiled" value="true" /> |
| 347 | <antcall target="-compile.emma.if.enabled" /> |
| 348 | </target> |
| 349 | |
jat@google.com | 57b6940 | 2009-10-14 18:08:29 +0000 | [diff] [blame^] | 350 | <!-- Instruments emma classes --> |
| 351 | <target name="-compile.emma.if.enabled" if="emma.enabled"> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 352 | <mkdir dir="${javac.emma.out}" /> |
| 353 | <path id="emma.classpath"> |
| 354 | <pathelement location="${javac.out}" /> |
| 355 | </path> |
| 356 | <emma enabled="${emma.enabled}" > |
| 357 | <instr instrpathref="emma.classpath" destdir="${javac.emma.out}" metadatafile="${javac.emma.out}/metadata.emma" merge="false"> |
| 358 | <filter includes="com.google.*" /> |
| 359 | <filter excludes="${emma.filter.exclude}" /> |
| 360 | </instr> |
| 361 | </emma> |
| 362 | </target> |
| 363 | |
jat@google.com | 57b6940 | 2009-10-14 18:08:29 +0000 | [diff] [blame^] | 364 | <!-- Create the emma coverage directory --> |
| 365 | <target name="-create.emma.coverage.if.enabled" if="emma.enabled"> |
jlabanca@google.com | 8124456 | 2009-08-05 19:55:36 +0000 | [diff] [blame] | 366 | <delete dir="${test.emma.coverage}" /> |
| 367 | <mkdir dir="${test.emma.coverage}" /> |
| 368 | </target> |
| 369 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 370 | <!-- Default implementations of the required targets; projects should |
| 371 | override the ones that matter --> |
| 372 | <target name="all" depends="verify" /> |
jat@google.com | 57b6940 | 2009-10-14 18:08:29 +0000 | [diff] [blame^] | 373 | <target name="verify" depends="checkstyle, test" |
| 374 | description="Runs tests and checkstyle static analysis" /> |
fabbott@google.com | 71e72af | 2009-06-13 02:28:21 +0000 | [diff] [blame] | 375 | <target name="checkstyle" /> |
| 376 | <target name="test" depends="build" /> |
| 377 | <target name="build" /> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 378 | |
fabbott@google.com | 71e72af | 2009-06-13 02:28:21 +0000 | [diff] [blame] | 379 | <target name="clean"> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 380 | <delete dir="${project.build}" /> |
| 381 | </target> |
gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 382 | |
| 383 | </project> |