[gwt-mobile-webkit] r354 committed - (why did SVN delete the files?? 2nd try...)...

3 views
Skip to first unread message

gwt-mobi...@googlecode.com

unread,
Jun 25, 2011, 11:17:33 AM6/25/11
to gwt-mobi...@googlegroups.com
Revision: 354
Author: bguijt
Date: Sat Jun 25 08:09:38 2011
Log: (why did SVN delete the files?? 2nd try...)

Fixes issue #34.

Added validation jar (distributed with GWT 2.3) to the compile and build
steps. Backwards compatible with older GWT versions.
http://code.google.com/p/gwt-mobile-webkit/source/detail?r=354

Added:
/trunk/gwt-mobile-webkit/applicationcache/common.ant.xml
/trunk/gwt-mobile-webkit/applicationcache/samples/common.ant.xml
/trunk/gwt-mobile-webkit/geolocation/common.ant.xml
/trunk/gwt-mobile-webkit/geolocation/samples/common.ant.xml
/trunk/gwt-mobile-webkit/iui/common.ant.xml
/trunk/gwt-mobile-webkit/iui/samples/common.ant.xml
/trunk/gwt-mobile-webkit/storage/common.ant.xml
/trunk/gwt-mobile-webkit/storage/samples/common.ant.xml
/trunk/gwt-mobile-webkit/template/common.ant.xml
/trunk/gwt-mobile-webkit/template/samples/common.ant.xml

=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/applicationcache/common.ant.xml Sat Jun 25
08:09:38 2011
@@ -0,0 +1,474 @@
+<project name="common">
+ <!-- it's okay for this not to exist, but it gives a place to store
+ "your" property settings, if any, persistently. For example, you
+ might use it to set gwt.junit.testcase.includes to a narrower subset
+ of test cases to exercise. -->
+ <property file="local.ant.properties" />
+ <property file="build.properties" />
+
+ <!-- gwt.build.iscasesensitivefs is true if the filesystem of the
+ build machine is case-sensitive, false otherwise. Update with
+ new lines for any supported platforms with case-insensitive
+ filesystems
+ -->
+ <condition property="gwt.build.iscasesensitivefs" else="false">
+ <not>
+ <or>
+ <os family="windows"/>
+ </or>
+ </not>
+ </condition>
+
+ <property name="test.ant.file"
location="${gwt.root}/${project.tail}/build.xml" />
+ <condition property="project.valid">
+ <equals arg1="${ant.file}" arg2="${test.ant.file}"
+ casesensitive="${gwt.build.iscasesensitivefs}"/>
+ </condition>
+ <fail unless="project.valid" message="This build file is in an
inconsistent state (${ant.file} != ${test.ant.file})." />
+
+ <!-- Global Properties -->
+ <property environment="env" />
+ <condition property="gwt.version" value="${env.GWT_VERSION}"
else="0.0.0">
+ <isset property="env.GWT_VERSION" />
+ </condition>
+ <condition property="gwt.tools.check" value="${env.GWT_TOOLS}"
else="${gwt.root}/../tools">
+ <isset property="env.GWT_TOOLS" />
+ </condition>
+ <condition property="gwt.home" value="${env.GWT_HOME}"
+
else="${gwt.root}/../gwt-trunk/build/staging/gwt-${build.host.platform}-0.0.0">
+ <isset property="env.GWT_HOME" />
+ </condition>
+
+ <property name="gwt.tools" location="${gwt.tools.check}" />
+ <property name="gwt.tools.lib" location="${gwt.tools}/lib" />
+ <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" />
+ <property name="gwt.tools.redist" location="${gwt.tools}/redist" />
+ <property name="gwt.build" location="${gwt.root}/build" />
+ <property name="gwt.build.out" location="${gwt.build}/out" />
+ <property name="gwt.build.lib" location="${gwt.build}/lib" />
+ <property name="gwt.build.jni" location="${gwt.build}/jni" />
+ <property name="gwt.build.staging" location="${gwt.build}/staging" />
+ <property name="gwt.build.dist" location="${gwt.build}/dist" />
+ <property name="gwt.threadsPerProcessor" value="1" />
+ <property name="project.build"
location="${gwt.build.out}/${project.tail}" />
+ <property name="project.lib"
location="${gwt.build.lib}/gwt-${ant.project.name}.jar" />
+ <property name="project.jni" location="${gwt.build}/${project.tail}" />
+ <property name="javac.out" location="${project.build}/bin" />
+ <property name="javac.junit.out" location="${project.build}/bin-test" />
+ <property name="javac.emma.out" location="${project.build}/bin-emma" />
+ <property name="javac.debug" value="true" />
+ <property name="javac.debuglevel" value="lines,vars,source" />
+ <property name="javac.encoding" value="utf-8" />
+ <property name="javac.source" value="1.5" />
+ <property name="javac.target" value="1.5" />
+ <property name="javac.nowarn" value="true" />
+ <property name="junit.out" location="${project.build}/test" />
+ <property name="emma.dir" value="${gwt.tools.redist}/emma" />
+ <property name="emma.filter.exclude" value="" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}'
tools directory; perhaps you should define the GWT_TOOLS environment
variable" />
+
+ <!-- Platform identification -->
+ <condition property="build.host.islinux">
+ <and>
+ <os family="unix" />
+ <not>
+ <contains string="${os.name}" substring="mac"
casesensitive="false" />
+ </not>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="linux">
+ <isset property="build.host.islinux" />
+ </condition>
+
+ <condition property="build.host.ismac">
+ <and>
+ <os family="unix" />
+ <contains string="${os.name}" substring="mac" casesensitive="false"
/>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="mac">
+ <isset property="build.host.ismac" />
+ </condition>
+
+ <condition property="build.host.iswindows">
+ <os family="windows" />
+ </condition>
+ <condition property="build.host.platform" value="windows">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <fail unless="build.host.platform" message="Building on ${os.name} is
not supported" />
+
+ <!-- References to files from the GWT_HOME directory -->
+ <condition property="is.gwt2">
+ <available file="${gwt.home}/gwt-dev.jar" />
+ </condition>
+ <condition property="dev.jar" value="${gwt.home}/gwt-dev.jar"
+ else="${gwt.home}/gwt-dev-${build.host.platform}.jar">
+ <isset property="is.gwt2" />
+ </condition>
+ <property name="gwt.dev.jar" location="${dev.jar}" />
+ <property name="gwt.user.jar" location="${gwt.home}/gwt-user.jar"
/>
+ <property name="gwt.servlet.jar"
location="${gwt.home}/gwt-servlet.jar" />
+ <property name="gwt.validation.jar"
location="${gwt.home}/validation-api-1.0.0.GA.jar" />
+ <property name="gwt.validation.sources.jar"
location="${gwt.home}/validation-api-1.0.0.GA-sources.jar" />
+
+ <!-- Reference to jars produced by this build -->
+ <property name="ant.gwt.jar" location="${gwt.home}/ant-gwt.jar" />
+ <property name="mobile.webkit.api.jar"
location="${gwt.build.lib}/gwt-${api.prefix}-${api.name}.jar" />
+ <property name="gwt.doctool.jar"
location="${gwt.build.lib}/gwt-doctool.jar" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir"
property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot
find '${gwt.tools}' tools directory; perhaps you should define the
GWT_TOOLS environment variable" />
+
+ <available file="${gwt.dev.jar}" property="gwt.dev.jar.exists" />
+ <fail unless="gwt.dev.jar.exists" message="Cannot
find '${gwt.dev.jar}'; perhaps you should define the GWT_HOME environment
variable" />
+
+
+ <condition property="hostedmode.platform.args" value="-d32
-XstartOnFirstThread" else="">
+ <and>
+ <isset property="build.host.ismac" />
+ <not>
+ <isset property="is.gwt2" />
+ </not>
+ </and>
+ </condition>
+
+ <!-- JUnit support -->
+ <property name="gwt.junit.port" value="8888" />
+ <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/>
+
+ <!-- Headless mode keeps the hosted mode browser and log window
+ from popping up during a unit test run. This is usually desirable,
+ but the WebKit layout engine performs some optimizations in
+ headless mode that causes some GWT unit tests to break. The
+ solution for the time being is to turn off headless mode on
+ the mac.
+ -->
+ <condition property="junit.headless">
+ <not>
+ <isset property="build.host.ismac" />
+ </not>
+ </condition>
+ <condition property="junit.notheadless.arg" value="-notHeadless" else="">
+ <not>
+ <isset property="junit.headless" />
+ </not>
+ </condition>
+
+ <!-- Shared class paths -->
+ <path id="project.classpath.class">
+ <pathelement location="${javac.out}" />
+ </path>
+ <path id="project.classpath.src">
+ <pathelement location="${gwt.root}/${project.tail}/src" />
+ </path>
+
+ <!-- Pulls in tasks defined in ant-contrib, i.e. foreach -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" />
+ </classpath>
+ </taskdef>
+
+ <!-- Global Custom Tasks -->
+ <presetdef name="gwt.ant">
+ <ant inheritall="false" target="${target}">
+ <propertyset>
+ <propertyref name="gwt.version" />
+ <propertyref name="gwt.junit.port" />
+ <propertyref name="gwt.remote.browsers" />
+ <propertyref name="emma.enabled" />
+ <propertyref name="emma.compiled" />
+ </propertyset>
+ </ant>
+ </presetdef>
+
+ <presetdef name="gwt.javac">
+ <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}"
debuglevel="${javac.debuglevel}" source="${javac.source}"
target="${javac.target}" nowarn="${javac.nowarn}"
encoding="${javac.encoding}" />
+ </presetdef>
+
+ <macrodef name="gwt.jar">
+ <attribute name="destfile" default="${project.lib}"/>
+ <attribute name="duplicate" default="fail"/>
+ <attribute name="update" default="true"/>
+ <element name="jarcontents" implicit="true"/>
+ <sequential>
+ <taskdef name="jar.bydate"
+ classname="com.google.gwt.ant.taskdefs.LatestTimeJar"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+
+ <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}"
filesonly="false"
+ index="true" update="@{update}">
+ <jarcontents/>
+ </jar.bydate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.junit">
+ <!-- TODO: Because dev has core, oophm splits, the "common pattern"
here doesn't work
+ for it (and we use extraclasspaths entries instead). Once we
lose SWT, we can
+ consolidate dev/core and dev/oophm, and that can instead more to
the normal
+ pattern. Note also special casing regarding (dev/) core/test. -->
+ <attribute name="test.args" default="" />
+ <attribute name="test.out" default="" />
+ <attribute name="test.reports" default="@{test.out}/reports" />
+ <attribute name="test.emma.coverage"
default="@{test.out}/emma-coverage" />
+ <attribute name="test.cases" default="" />
+ <attribute name="test.name" default="" />
+ <attribute name="haltonfailure" default="true" />
+ <element name="extraclasspaths" optional="true" />
+ <sequential>
+ <taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar"
/>
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ </classpath>
+ </taskdef>
+
+ <echo message="Writing test results to @{test.reports} for
@{test.cases}" />
+ <mkdir dir="@{test.reports}" />
+
+ <antcall target="-create.emma.coverage.if.enabled">
+ <param name="test.emma.coverage" value="@{test.emma.coverage}"/>
+ </antcall>
+ <condition property="emma.lib"
value="${emma.dir}/emma-2.0.5312-patched.jar"
+ else="${emma.dir}/no-emma-requested">
+ <isset property="emma.enabled" />
+ </condition>
+
+ <junit dir="@{test.out}" fork="yes" printsummary="yes"
+ failureproperty="junit.failure" tempdir="@{test.out}">
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg line="-Xmx768m" />
+ <jvmarg
value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=true" />
+ <sysproperty key="gwt.args" value="${junit.notheadless.arg}
@{test.args}" />
+ <sysproperty key="java.awt.headless" value="${junit.headless}" />
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
+ <classpath>
+ <path refid="project.classpath.src" />
+ <pathelement location="${gwt.root}/${project.tail}/super" />
+ <pathelement location="${gwt.root}/${project.tail}/test" />
+ <!-- TODO: this is here because e.g. ClassPathEntryTest
otherwise fails,
+ expecting the src entry (core/test) to be earlier than the
bin entry
+ (${javac.junit.out}). -->
+ <pathelement location="${gwt.root}/${project.tail}/core/test" />
+ <pathelement location="${javac.junit.out}" />
+ <!-- javac.emma.out is empty unless emma is enabled. -->
+ <pathelement location="${javac.emma.out}" />
+ <path refid="project.classpath.class" />
+ <pathelement location="${emma.lib}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar"
/>
+ <extraclasspaths />
+ </classpath>
+
+ <formatter type="plain" />
+ <formatter type="xml" />
+
+ <batchtest todir="@{test.reports}">
+ <fileset refid="@{test.cases}" />
+ </batchtest>
+ </junit>
+
+ <emma enabled="${emma.enabled}">
+ <report sourcepath="${project.classpath.src}">
+ <fileset file="${javac.emma.out}/metadata.emma" />
+ <fileset dir="@{test.emma.coverage}">
+ <include name="*.emma" />
+ </fileset>
+ <txt outfile="@{test.emma.coverage}/coverage.txt" />
+ <html outfile="@{test.emma.coverage}/coverage.html" />
+ <xml outfile="@{test.emma.coverage}/coverage.xml" />
+ </report>
+ </emma>
+
+ <condition property="junit.stop.build" value="true">
+ <and>
+ <istrue value="@{haltonfailure}"/>
+ <isset property="junit.failure"/>
+ </and>
+ </condition>
+ <fail
+ message="One or more junit tests failed for target: @{test.name}
@{test.args}"
+ if="junit.stop.build" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.tgz.cat">
+ <attribute name="destfile" />
+ <attribute name="compression" default="gzip" />
+ <element name="tar.elements" implicit="true" optional="true" />
+ <sequential>
+ <taskdef name="tar.cat"
classname="com.google.gwt.ant.taskdefs.TarCat"
classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <tar.cat destfile="@{destfile}" compression="@{compression}"
longfile="gnu">
+ <tar.elements />
+ </tar.cat>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of
a workspace">
+ <sequential>
+ <taskdef name="svninfo"
+ classname="com.google.gwt.ant.taskdefs.SvnInfo"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev"
+ outputfileproperty="gwt.svnrev.filename" />
+ <!-- Generally, filtering requires a sentinel file so that changes
to svn rev will
+ be noticed as invalidating the previously-generated filter
output. This property
+ names where such a sentinel lives; it is tested with <available/>
and created
+ with <touch/> -->
+ <mkdir dir="${project.build}/sentinels" />
+ <property name="filter.sentinel"
+
location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}"
/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.revfilter" description="Filters files for
versioning">
+ <attribute name="todir" description="Destination for the filtered
copy"/>
+
+ <element name="src.fileset" implicit="true"
+ description="Source for the filtered copy"/>
+ <sequential>
+ <!-- These files must be filtered for versioning -->
+ <echo message="Branding as GWT version ${gwt.version}, SVN rev
${gwt.svnrev}"/>
+ <mkdir dir="@{todir}" />
+ <copy todir="@{todir}" overwrite="true">
+ <src.fileset/>
+ <filterset>
+ <filter token="GWT_VERSION" value="${gwt.version}" />
+ <filter token="GWT_SVNREV" value="${gwt.svnrev}" />
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.timer">
+ <attribute name="name"/>
+ <element name="timer.elements" implicit="true" optional="false"/>
+ <sequential>
+ <taskdef name="timer"
+ classname="com.google.gwt.ant.taskdefs.Timer"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <timer name="@{name}">
+ <timer.elements/>
+ </timer>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.checkstyle">
+ <attribute name="outputdirectory" default="${project.build}"/>
+ <element name="sourcepath" implicit="yes" optional="true" />
+ <sequential>
+ <taskdef resource="checkstyletask.properties"
classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar"
/>
+ <mkdir dir="@{outputdirectory}"/>
+ <checkstyle
config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml"
maxErrors="0" failOnViolation="false"
failureProperty="gwt.checkstyle.failed">
+ <formatter type="xml"
toFile="@{outputdirectory}/checkstyle_log.xml"/>
+ <property key="checkstyle.header.file"
file="${gwt.root}/eclipse/settings/code-style/google.header" />
+ <sourcepath />
+ </checkstyle>
+ <fail message="Checkstyle errors exist, and are reported in
checkstyle_log.xml located at @{outputdirectory}"
if="gwt.checkstyle.failed" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="property.ensure">
+ <attribute name="name" />
+ <attribute name="location" />
+ <attribute name="message" default="Cannot find dependency ${@{name}}"
/>
+ <attribute name="unless" default="__nonexistent_property__" />
+ <sequential>
+ <property name="@{name}" location="@{location}" />
+ <condition property="@{name}.exists">
+ <or>
+ <available file="${@{name}}" />
+ <isset property="@{unless}" />
+ </or>
+ </condition>
+ <fail unless="@{name}.exists" message="@{message}" />
+ </sequential>
+ </macrodef>
+
+ <!-- Targets for emma support. To run tests with emma enabled, use
+ ant <test-target> -Demma.enabled=true -->
+ <path id="emma.taskdef.lib">
+ <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" />
+ <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" />
+ </path>
+
+ <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib"
/>
+
+ <!-- Instruments emma classes -->
+ <target name="compile.emma.if.enabled" unless="emma.compiled">
+ <delete dir="${javac.emma.out}" />
+ <property name="emma.compiled" value="true" />
+ <antcall target="-compile.emma.if.enabled" />
+ </target>
+
+ <!-- Instruments emma classes -->
+ <target name="-compile.emma.if.enabled" if="emma.enabled">
+ <mkdir dir="${javac.emma.out}" />
+ <path id="emma.classpath">
+ <pathelement location="${javac.out}" />
+ </path>
+ <emma enabled="${emma.enabled}" >
+ <instr instrpathref="emma.classpath" destdir="${javac.emma.out}"
metadatafile="${javac.emma.out}/metadata.emma" merge="false">
+ <filter includes="com.google.*" />
+ <filter excludes="${emma.filter.exclude}" />
+ </instr>
+ </emma>
+ </target>
+
+ <!-- Create the emma coverage directory -->
+ <target name="-create.emma.coverage.if.enabled" if="emma.enabled">
+ <delete dir="${test.emma.coverage}" />
+ <mkdir dir="${test.emma.coverage}" />
+ </target>
+
+ <!-- Default implementations of the required targets; projects should
+ override the ones that matter -->
+ <target name="all" depends="verify" />
+ <target name="verify" depends="checkstyle, test"
+ description="Runs tests and checkstyle static analysis" />
+ <target name="checkstyle" />
+ <target name="test" depends="build" />
+ <target name="build" />
+
+ <target name="clean">
+ <delete dir="${project.build}" />
+ </target>
+
+ <target name="maven-install">
+ <available file="${mobile.webkit.api.jar}"
property="mobile.webkit.api.jar.exists" />
+ <fail unless="mobile.webkit.api.jar.exists" message="Cannot
find '${mobile.webkit.api.jar}'; perhaps you should run 'ant dist' first!"
/>
+
+ <property name="mobile.webkit.api.pom"
value="${gwt.build.out}/distro-source/pom.xml" />
+ <available file="${mobile.webkit.api.pom}"
property="mobile.webkit.api.pom.exists" />
+ <fail unless="mobile.webkit.api.pom.exists" message="Cannot
find '${mobile.webkit.api.pom}'; perhaps you should run 'ant dist' first!"
/>
+
+ <condition property="exec.cmd" value="cmd.exe"
+ else="/bin/sh">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <condition property="exec.arg" value="/c"
+ else="-c">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <property name="mvn.file" value="-Dfile=${mobile.webkit.api.jar}" />
+ <property name="mvn.pomFile"
value="-DpomFile=${mobile.webkit.api.pom}" />
+ <exec executable="${exec.cmd}">
+ <arg value="${exec.arg}" />
+ <arg value="mvn install:install-file ${mvn.file} ${mvn.pomFile}
-DcreateChecksum=true" />
+ </exec>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/applicationcache/samples/common.ant.xml Sat
Jun 25 08:09:38 2011
@@ -0,0 +1,161 @@
+<project name="samples-common">
+ <property name="gwt.root" location="../.." />
+ <property name="project.tail" value="samples/${sample.root}" />
+ <import file="${gwt.root}/common.ant.xml" />
+
+ <!--
+ Number of localworkers for sample compilation. This depends on your
+ hardware, so it's a good candidate to specify in local.ant.properties
+ if this default isn't good for you. Ideally, it should approximate
+ the number of CPU cores in your machine.
+ -->
+ <property name="gwt.samples.localworkers" value="2" />
+
+ <property name="sample.lower" value="${sample.root}" />
+ <property name="sample.upper" value="${sample.module}" />
+
+ <!-- Mirror directory for scripts; makes building distro easier -->
+ <property name="samples.scripts"
value="${gwt.build.out}/samples-scripts" />
+ <!-- Use the uppercase name rather than the lowercase name -->
+ <property name="sample.build"
value="${gwt.build.out}/samples/${sample.upper}" />
+
+ <target name="source" description="Copy source to the output folder">
+ <mkdir dir="${sample.build}/src" />
+ <copy todir="${sample.build}/src">
+ <fileset dir="src" />
+ </copy>
+ <mkdir dir="${sample.build}/war" />
+ <copy todir="${sample.build}/war">
+ <fileset dir="war" excludes="WEB-INF/classes/**"/>
+ </copy>
+ </target>
+
+ <target name="compile" description="Compile all java files">
+ <mkdir dir="${sample.build}/war/WEB-INF/classes" />
+ <gwt.javac destdir="${sample.build}/war/WEB-INF/classes">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ </gwt.javac>
+ </target>
+
+ <target name="gwtc" description="Compile to JavaScript">
+ <condition property="gwt.compile.report" value="-compileReport"
else="">
+ <isset property="is.gwt2" />
+ </condition>
+ <outofdate>
+ <sourcefiles>
+ <fileset dir="src" />
+ <fileset dir="${sample.build}/war/WEB-INF/classes" />
+ <fileset file="${mobile.webkit.api.jar}" />
+ <fileset file="${gwt.user.jar}" />
+ <fileset file="${gwt.dev.jar}" />
+ <fileset file="${gwt.validation.jar}" />
+ <fileset file="${gwt.validation.sources.jar}" />
+ </sourcefiles>
+ <targetfiles
path="${sample.build}/war/${sample.lower}/${sample.lower}.nocache.js" />
+ <sequential>
+ <mkdir dir="${sample.build}/war" />
+ <gwt.timer name="${sample.upper} with ${gwt.samples.localworkers}
localWorkers">
+ <java dir="${sample.build}"
classname="com.google.gwt.dev.Compiler"
classpath="src:${sample.build}/war/WEB-INF/classes:${mobile.webkit.api.jar}:${gwt.user.jar}:${gwt.dev.jar}:${gwt.validation.jar}:${gwt.validation.sources.jar}"
fork="yes" failonerror="true">
+ <jvmarg value="-Xmx256M" />
+ <!--jvmarg
value="-agentlib:jdwp=transport=dt_socket,server=y,address=8000" /-->
+ <arg value="-localWorkers" />
+ <arg value="${gwt.samples.localworkers}" />
+ <arg value="-war" />
+ <arg file="${sample.build}/war" />
+ <arg line="${gwt.compile.report}" />
+ <arg value="-gen" />
+ <arg value=".gwt-gen" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </gwt.timer>
+ <length property="sample.size">
+ <fileset dir="${sample.build}/war/${sample.lower}"
includes="*.cache.html,*.cache.js" />
+ </length>
+ <echo message="output size for ${sample.upper} is ${sample.size}
bytes" />
+ </sequential>
+ </outofdate>
+ </target>
+
+ <target name="scripts" description="Create launch scripts">
+ <mkdir dir="${sample.build}/launch-scripts" />
+ <copy todir="${sample.build}/launch-scripts">
+ <filterset id="scriptfilter">
+ <filter token="ENTRY_MODULE"
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ <filter token="JARNAME" value="gwt-${api.prefix}-${api.name}.jar"
/>
+ <filter token="INDEX_HTML" value="${sample.module}.html" />
+ </filterset>
+ <mapper type="regexp" from="(.*)HelloTemplate(.*)"
to="\1${sample.module}\2" />
+ <fileset dir="${gwt.root}/../shared/templates/shell" />
+ </copy>
+ </target>
+
+ <target name="build" depends="source, compile, gwtc, scripts"
description="Build and package this project" />
+
+ <target name="prepare.hosted" depends="source, compile"
description="Prepares this project for running hosted mode" />
+
+ <target name="checkstyle" description="Static analysis of source">
+ <gwt.checkstyle outputdirectory="${sample.build}">
+ <fileset dir="src" />
+ </gwt.checkstyle>
+ </target>
+
+ <target name="clean" description="Cleans this project's intermediate and
output files">
+ <delete dir="${sample.build}" />
+ <delete includeemptydirs="true">
+ <fileset dir="${samples.scripts}">
+ <include name="*/${sample.upper}/**" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="hosted" description="Run hosted mode">
+ <condition property="hostedmode.class"
value="com.google.gwt.dev.DevMode" else="com.google.gwt.dev.HostedMode">
+ <isset property="is.gwt2" />
+ </condition>
+ <java failonerror="true" fork="true" classname="${hostedmode.class}">
+ <classpath>
+ <pathelement location="src" />
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ </classpath>
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg value="-Xmx256M" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg value="-war" />
+ <arg value="${sample.build}/war" />
+ <arg value="-startupUrl" />
+ <arg value="${sample.module}.html" />
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </target>
+
+ <target name="run" description="Run compiled">
+ <java failonerror="true" fork="true"
classname="org.mortbay.jetty.Main">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.servlet.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ <jvmarg value="-Xmx256M" />
+ <arg value="8080" />
+ <arg value="-webapp" />
+ <arg value="${sample.build}/war" />
+ </java>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/geolocation/common.ant.xml Sat Jun 25 08:09:38
2011
@@ -0,0 +1,474 @@
+<project name="common">
+ <!-- it's okay for this not to exist, but it gives a place to store
+ "your" property settings, if any, persistently. For example, you
+ might use it to set gwt.junit.testcase.includes to a narrower subset
+ of test cases to exercise. -->
+ <property file="local.ant.properties" />
+ <property file="build.properties" />
+
+ <!-- gwt.build.iscasesensitivefs is true if the filesystem of the
+ build machine is case-sensitive, false otherwise. Update with
+ new lines for any supported platforms with case-insensitive
+ filesystems
+ -->
+ <condition property="gwt.build.iscasesensitivefs" else="false">
+ <not>
+ <or>
+ <os family="windows"/>
+ </or>
+ </not>
+ </condition>
+
+ <property name="test.ant.file"
location="${gwt.root}/${project.tail}/build.xml" />
+ <condition property="project.valid">
+ <equals arg1="${ant.file}" arg2="${test.ant.file}"
+ casesensitive="${gwt.build.iscasesensitivefs}"/>
+ </condition>
+ <fail unless="project.valid" message="This build file is in an
inconsistent state (${ant.file} != ${test.ant.file})." />
+
+ <!-- Global Properties -->
+ <property environment="env" />
+ <condition property="gwt.version" value="${env.GWT_VERSION}"
else="0.0.0">
+ <isset property="env.GWT_VERSION" />
+ </condition>
+ <condition property="gwt.tools.check" value="${env.GWT_TOOLS}"
else="${gwt.root}/../tools">
+ <isset property="env.GWT_TOOLS" />
+ </condition>
+ <condition property="gwt.home" value="${env.GWT_HOME}"
+
else="${gwt.root}/../gwt-trunk/build/staging/gwt-${build.host.platform}-0.0.0">
+ <isset property="env.GWT_HOME" />
+ </condition>
+
+ <property name="gwt.tools" location="${gwt.tools.check}" />
+ <property name="gwt.tools.lib" location="${gwt.tools}/lib" />
+ <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" />
+ <property name="gwt.tools.redist" location="${gwt.tools}/redist" />
+ <property name="gwt.build" location="${gwt.root}/build" />
+ <property name="gwt.build.out" location="${gwt.build}/out" />
+ <property name="gwt.build.lib" location="${gwt.build}/lib" />
+ <property name="gwt.build.jni" location="${gwt.build}/jni" />
+ <property name="gwt.build.staging" location="${gwt.build}/staging" />
+ <property name="gwt.build.dist" location="${gwt.build}/dist" />
+ <property name="gwt.threadsPerProcessor" value="1" />
+ <property name="project.build"
location="${gwt.build.out}/${project.tail}" />
+ <property name="project.lib"
location="${gwt.build.lib}/gwt-${ant.project.name}.jar" />
+ <property name="project.jni" location="${gwt.build}/${project.tail}" />
+ <property name="javac.out" location="${project.build}/bin" />
+ <property name="javac.junit.out" location="${project.build}/bin-test" />
+ <property name="javac.emma.out" location="${project.build}/bin-emma" />
+ <property name="javac.debug" value="true" />
+ <property name="javac.debuglevel" value="lines,vars,source" />
+ <property name="javac.encoding" value="utf-8" />
+ <property name="javac.source" value="1.5" />
+ <property name="javac.target" value="1.5" />
+ <property name="javac.nowarn" value="true" />
+ <property name="junit.out" location="${project.build}/test" />
+ <property name="emma.dir" value="${gwt.tools.redist}/emma" />
+ <property name="emma.filter.exclude" value="" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}'
tools directory; perhaps you should define the GWT_TOOLS environment
variable" />
+
+ <!-- Platform identification -->
+ <condition property="build.host.islinux">
+ <and>
+ <os family="unix" />
+ <not>
+ <contains string="${os.name}" substring="mac"
casesensitive="false" />
+ </not>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="linux">
+ <isset property="build.host.islinux" />
+ </condition>
+
+ <condition property="build.host.ismac">
+ <and>
+ <os family="unix" />
+ <contains string="${os.name}" substring="mac" casesensitive="false"
/>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="mac">
+ <isset property="build.host.ismac" />
+ </condition>
+
+ <condition property="build.host.iswindows">
+ <os family="windows" />
+ </condition>
+ <condition property="build.host.platform" value="windows">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <fail unless="build.host.platform" message="Building on ${os.name} is
not supported" />
+
+ <!-- References to files from the GWT_HOME directory -->
+ <condition property="is.gwt2">
+ <available file="${gwt.home}/gwt-dev.jar" />
+ </condition>
+ <condition property="dev.jar" value="${gwt.home}/gwt-dev.jar"
+ else="${gwt.home}/gwt-dev-${build.host.platform}.jar">
+ <isset property="is.gwt2" />
+ </condition>
+ <property name="gwt.dev.jar" location="${dev.jar}" />
+ <property name="gwt.user.jar" location="${gwt.home}/gwt-user.jar"
/>
+ <property name="gwt.servlet.jar"
location="${gwt.home}/gwt-servlet.jar" />
+ <property name="gwt.validation.jar"
location="${gwt.home}/validation-api-1.0.0.GA.jar" />
+ <property name="gwt.validation.sources.jar"
location="${gwt.home}/validation-api-1.0.0.GA-sources.jar" />
+
+ <!-- Reference to jars produced by this build -->
+ <property name="ant.gwt.jar" location="${gwt.home}/ant-gwt.jar" />
+ <property name="mobile.webkit.api.jar"
location="${gwt.build.lib}/gwt-${api.prefix}-${api.name}.jar" />
+ <property name="gwt.doctool.jar"
location="${gwt.build.lib}/gwt-doctool.jar" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir"
property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot
find '${gwt.tools}' tools directory; perhaps you should define the
GWT_TOOLS environment variable" />
+
+ <available file="${gwt.dev.jar}" property="gwt.dev.jar.exists" />
+ <fail unless="gwt.dev.jar.exists" message="Cannot
find '${gwt.dev.jar}'; perhaps you should define the GWT_HOME environment
variable" />
+
+
+ <condition property="hostedmode.platform.args" value="-d32
-XstartOnFirstThread" else="">
+ <and>
+ <isset property="build.host.ismac" />
+ <not>
+ <isset property="is.gwt2" />
+ </not>
+ </and>
+ </condition>
+
+ <!-- JUnit support -->
+ <property name="gwt.junit.port" value="8888" />
+ <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/>
+
+ <!-- Headless mode keeps the hosted mode browser and log window
+ from popping up during a unit test run. This is usually desirable,
+ but the WebKit layout engine performs some optimizations in
+ headless mode that causes some GWT unit tests to break. The
+ solution for the time being is to turn off headless mode on
+ the mac.
+ -->
+ <condition property="junit.headless">
+ <not>
+ <isset property="build.host.ismac" />
+ </not>
+ </condition>
+ <condition property="junit.notheadless.arg" value="-notHeadless" else="">
+ <not>
+ <isset property="junit.headless" />
+ </not>
+ </condition>
+
+ <!-- Shared class paths -->
+ <path id="project.classpath.class">
+ <pathelement location="${javac.out}" />
+ </path>
+ <path id="project.classpath.src">
+ <pathelement location="${gwt.root}/${project.tail}/src" />
+ </path>
+
+ <!-- Pulls in tasks defined in ant-contrib, i.e. foreach -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" />
+ </classpath>
+ </taskdef>
+
+ <!-- Global Custom Tasks -->
+ <presetdef name="gwt.ant">
+ <ant inheritall="false" target="${target}">
+ <propertyset>
+ <propertyref name="gwt.version" />
+ <propertyref name="gwt.junit.port" />
+ <propertyref name="gwt.remote.browsers" />
+ <propertyref name="emma.enabled" />
+ <propertyref name="emma.compiled" />
+ </propertyset>
+ </ant>
+ </presetdef>
+
+ <presetdef name="gwt.javac">
+ <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}"
debuglevel="${javac.debuglevel}" source="${javac.source}"
target="${javac.target}" nowarn="${javac.nowarn}"
encoding="${javac.encoding}" />
+ </presetdef>
+
+ <macrodef name="gwt.jar">
+ <attribute name="destfile" default="${project.lib}"/>
+ <attribute name="duplicate" default="fail"/>
+ <attribute name="update" default="true"/>
+ <element name="jarcontents" implicit="true"/>
+ <sequential>
+ <taskdef name="jar.bydate"
+ classname="com.google.gwt.ant.taskdefs.LatestTimeJar"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+
+ <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}"
filesonly="false"
+ index="true" update="@{update}">
+ <jarcontents/>
+ </jar.bydate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.junit">
+ <!-- TODO: Because dev has core, oophm splits, the "common pattern"
here doesn't work
+ for it (and we use extraclasspaths entries instead). Once we
lose SWT, we can
+ consolidate dev/core and dev/oophm, and that can instead more to
the normal
+ pattern. Note also special casing regarding (dev/) core/test. -->
+ <attribute name="test.args" default="" />
+ <attribute name="test.out" default="" />
+ <attribute name="test.reports" default="@{test.out}/reports" />
+ <attribute name="test.emma.coverage"
default="@{test.out}/emma-coverage" />
+ <attribute name="test.cases" default="" />
+ <attribute name="test.name" default="" />
+ <attribute name="haltonfailure" default="true" />
+ <element name="extraclasspaths" optional="true" />
+ <sequential>
+ <taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar"
/>
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ </classpath>
+ </taskdef>
+
+ <echo message="Writing test results to @{test.reports} for
@{test.cases}" />
+ <mkdir dir="@{test.reports}" />
+
+ <antcall target="-create.emma.coverage.if.enabled">
+ <param name="test.emma.coverage" value="@{test.emma.coverage}"/>
+ </antcall>
+ <condition property="emma.lib"
value="${emma.dir}/emma-2.0.5312-patched.jar"
+ else="${emma.dir}/no-emma-requested">
+ <isset property="emma.enabled" />
+ </condition>
+
+ <junit dir="@{test.out}" fork="yes" printsummary="yes"
+ failureproperty="junit.failure" tempdir="@{test.out}">
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg line="-Xmx768m" />
+ <jvmarg
value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=true" />
+ <sysproperty key="gwt.args" value="${junit.notheadless.arg}
@{test.args}" />
+ <sysproperty key="java.awt.headless" value="${junit.headless}" />
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
+ <classpath>
+ <path refid="project.classpath.src" />
+ <pathelement location="${gwt.root}/${project.tail}/super" />
+ <pathelement location="${gwt.root}/${project.tail}/test" />
+ <!-- TODO: this is here because e.g. ClassPathEntryTest
otherwise fails,
+ expecting the src entry (core/test) to be earlier than the
bin entry
+ (${javac.junit.out}). -->
+ <pathelement location="${gwt.root}/${project.tail}/core/test" />
+ <pathelement location="${javac.junit.out}" />
+ <!-- javac.emma.out is empty unless emma is enabled. -->
+ <pathelement location="${javac.emma.out}" />
+ <path refid="project.classpath.class" />
+ <pathelement location="${emma.lib}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar"
/>
+ <extraclasspaths />
+ </classpath>
+
+ <formatter type="plain" />
+ <formatter type="xml" />
+
+ <batchtest todir="@{test.reports}">
+ <fileset refid="@{test.cases}" />
+ </batchtest>
+ </junit>
+
+ <emma enabled="${emma.enabled}">
+ <report sourcepath="${project.classpath.src}">
+ <fileset file="${javac.emma.out}/metadata.emma" />
+ <fileset dir="@{test.emma.coverage}">
+ <include name="*.emma" />
+ </fileset>
+ <txt outfile="@{test.emma.coverage}/coverage.txt" />
+ <html outfile="@{test.emma.coverage}/coverage.html" />
+ <xml outfile="@{test.emma.coverage}/coverage.xml" />
+ </report>
+ </emma>
+
+ <condition property="junit.stop.build" value="true">
+ <and>
+ <istrue value="@{haltonfailure}"/>
+ <isset property="junit.failure"/>
+ </and>
+ </condition>
+ <fail
+ message="One or more junit tests failed for target: @{test.name}
@{test.args}"
+ if="junit.stop.build" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.tgz.cat">
+ <attribute name="destfile" />
+ <attribute name="compression" default="gzip" />
+ <element name="tar.elements" implicit="true" optional="true" />
+ <sequential>
+ <taskdef name="tar.cat"
classname="com.google.gwt.ant.taskdefs.TarCat"
classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <tar.cat destfile="@{destfile}" compression="@{compression}"
longfile="gnu">
+ <tar.elements />
+ </tar.cat>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of
a workspace">
+ <sequential>
+ <taskdef name="svninfo"
+ classname="com.google.gwt.ant.taskdefs.SvnInfo"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev"
+ outputfileproperty="gwt.svnrev.filename" />
+ <!-- Generally, filtering requires a sentinel file so that changes
to svn rev will
+ be noticed as invalidating the previously-generated filter
output. This property
+ names where such a sentinel lives; it is tested with <available/>
and created
+ with <touch/> -->
+ <mkdir dir="${project.build}/sentinels" />
+ <property name="filter.sentinel"
+
location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}"
/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.revfilter" description="Filters files for
versioning">
+ <attribute name="todir" description="Destination for the filtered
copy"/>
+
+ <element name="src.fileset" implicit="true"
+ description="Source for the filtered copy"/>
+ <sequential>
+ <!-- These files must be filtered for versioning -->
+ <echo message="Branding as GWT version ${gwt.version}, SVN rev
${gwt.svnrev}"/>
+ <mkdir dir="@{todir}" />
+ <copy todir="@{todir}" overwrite="true">
+ <src.fileset/>
+ <filterset>
+ <filter token="GWT_VERSION" value="${gwt.version}" />
+ <filter token="GWT_SVNREV" value="${gwt.svnrev}" />
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.timer">
+ <attribute name="name"/>
+ <element name="timer.elements" implicit="true" optional="false"/>
+ <sequential>
+ <taskdef name="timer"
+ classname="com.google.gwt.ant.taskdefs.Timer"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <timer name="@{name}">
+ <timer.elements/>
+ </timer>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.checkstyle">
+ <attribute name="outputdirectory" default="${project.build}"/>
+ <element name="sourcepath" implicit="yes" optional="true" />
+ <sequential>
+ <taskdef resource="checkstyletask.properties"
classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar"
/>
+ <mkdir dir="@{outputdirectory}"/>
+ <checkstyle
config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml"
maxErrors="0" failOnViolation="false"
failureProperty="gwt.checkstyle.failed">
+ <formatter type="xml"
toFile="@{outputdirectory}/checkstyle_log.xml"/>
+ <property key="checkstyle.header.file"
file="${gwt.root}/eclipse/settings/code-style/google.header" />
+ <sourcepath />
+ </checkstyle>
+ <fail message="Checkstyle errors exist, and are reported in
checkstyle_log.xml located at @{outputdirectory}"
if="gwt.checkstyle.failed" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="property.ensure">
+ <attribute name="name" />
+ <attribute name="location" />
+ <attribute name="message" default="Cannot find dependency ${@{name}}"
/>
+ <attribute name="unless" default="__nonexistent_property__" />
+ <sequential>
+ <property name="@{name}" location="@{location}" />
+ <condition property="@{name}.exists">
+ <or>
+ <available file="${@{name}}" />
+ <isset property="@{unless}" />
+ </or>
+ </condition>
+ <fail unless="@{name}.exists" message="@{message}" />
+ </sequential>
+ </macrodef>
+
+ <!-- Targets for emma support. To run tests with emma enabled, use
+ ant <test-target> -Demma.enabled=true -->
+ <path id="emma.taskdef.lib">
+ <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" />
+ <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" />
+ </path>
+
+ <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib"
/>
+
+ <!-- Instruments emma classes -->
+ <target name="compile.emma.if.enabled" unless="emma.compiled">
+ <delete dir="${javac.emma.out}" />
+ <property name="emma.compiled" value="true" />
+ <antcall target="-compile.emma.if.enabled" />
+ </target>
+
+ <!-- Instruments emma classes -->
+ <target name="-compile.emma.if.enabled" if="emma.enabled">
+ <mkdir dir="${javac.emma.out}" />
+ <path id="emma.classpath">
+ <pathelement location="${javac.out}" />
+ </path>
+ <emma enabled="${emma.enabled}" >
+ <instr instrpathref="emma.classpath" destdir="${javac.emma.out}"
metadatafile="${javac.emma.out}/metadata.emma" merge="false">
+ <filter includes="com.google.*" />
+ <filter excludes="${emma.filter.exclude}" />
+ </instr>
+ </emma>
+ </target>
+
+ <!-- Create the emma coverage directory -->
+ <target name="-create.emma.coverage.if.enabled" if="emma.enabled">
+ <delete dir="${test.emma.coverage}" />
+ <mkdir dir="${test.emma.coverage}" />
+ </target>
+
+ <!-- Default implementations of the required targets; projects should
+ override the ones that matter -->
+ <target name="all" depends="verify" />
+ <target name="verify" depends="checkstyle, test"
+ description="Runs tests and checkstyle static analysis" />
+ <target name="checkstyle" />
+ <target name="test" depends="build" />
+ <target name="build" />
+
+ <target name="clean">
+ <delete dir="${project.build}" />
+ </target>
+
+ <target name="maven-install">
+ <available file="${mobile.webkit.api.jar}"
property="mobile.webkit.api.jar.exists" />
+ <fail unless="mobile.webkit.api.jar.exists" message="Cannot
find '${mobile.webkit.api.jar}'; perhaps you should run 'ant dist' first!"
/>
+
+ <property name="mobile.webkit.api.pom"
value="${gwt.build.out}/distro-source/pom.xml" />
+ <available file="${mobile.webkit.api.pom}"
property="mobile.webkit.api.pom.exists" />
+ <fail unless="mobile.webkit.api.pom.exists" message="Cannot
find '${mobile.webkit.api.pom}'; perhaps you should run 'ant dist' first!"
/>
+
+ <condition property="exec.cmd" value="cmd.exe"
+ else="/bin/sh">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <condition property="exec.arg" value="/c"
+ else="-c">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <property name="mvn.file" value="-Dfile=${mobile.webkit.api.jar}" />
+ <property name="mvn.pomFile"
value="-DpomFile=${mobile.webkit.api.pom}" />
+ <exec executable="${exec.cmd}">
+ <arg value="${exec.arg}" />
+ <arg value="mvn install:install-file ${mvn.file} ${mvn.pomFile}
-DcreateChecksum=true" />
+ </exec>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/geolocation/samples/common.ant.xml Sat Jun 25
08:09:38 2011
@@ -0,0 +1,161 @@
+<project name="samples-common">
+ <property name="gwt.root" location="../.." />
+ <property name="project.tail" value="samples/${sample.root}" />
+ <import file="${gwt.root}/common.ant.xml" />
+
+ <!--
+ Number of localworkers for sample compilation. This depends on your
+ hardware, so it's a good candidate to specify in local.ant.properties
+ if this default isn't good for you. Ideally, it should approximate
+ the number of CPU cores in your machine.
+ -->
+ <property name="gwt.samples.localworkers" value="2" />
+
+ <property name="sample.lower" value="${sample.root}" />
+ <property name="sample.upper" value="${sample.module}" />
+
+ <!-- Mirror directory for scripts; makes building distro easier -->
+ <property name="samples.scripts"
value="${gwt.build.out}/samples-scripts" />
+ <!-- Use the uppercase name rather than the lowercase name -->
+ <property name="sample.build"
value="${gwt.build.out}/samples/${sample.upper}" />
+
+ <target name="source" description="Copy source to the output folder">
+ <mkdir dir="${sample.build}/src" />
+ <copy todir="${sample.build}/src">
+ <fileset dir="src" />
+ </copy>
+ <mkdir dir="${sample.build}/war" />
+ <copy todir="${sample.build}/war">
+ <fileset dir="war" excludes="WEB-INF/classes/**"/>
+ </copy>
+ </target>
+
+ <target name="compile" description="Compile all java files">
+ <mkdir dir="${sample.build}/war/WEB-INF/classes" />
+ <gwt.javac destdir="${sample.build}/war/WEB-INF/classes">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ </gwt.javac>
+ </target>
+
+ <target name="gwtc" description="Compile to JavaScript">
+ <condition property="gwt.compile.report" value="-compileReport"
else="">
+ <isset property="is.gwt2" />
+ </condition>
+ <outofdate>
+ <sourcefiles>
+ <fileset dir="src" />
+ <fileset dir="${sample.build}/war/WEB-INF/classes" />
+ <fileset file="${mobile.webkit.api.jar}" />
+ <fileset file="${gwt.user.jar}" />
+ <fileset file="${gwt.dev.jar}" />
+ <fileset file="${gwt.validation.jar}" />
+ <fileset file="${gwt.validation.sources.jar}" />
+ </sourcefiles>
+ <targetfiles
path="${sample.build}/war/${sample.lower}/${sample.lower}.nocache.js" />
+ <sequential>
+ <mkdir dir="${sample.build}/war" />
+ <gwt.timer name="${sample.upper} with ${gwt.samples.localworkers}
localWorkers">
+ <java dir="${sample.build}"
classname="com.google.gwt.dev.Compiler"
classpath="src:${sample.build}/war/WEB-INF/classes:${mobile.webkit.api.jar}:${gwt.user.jar}:${gwt.dev.jar}:${gwt.validation.jar}:${gwt.validation.sources.jar}"
fork="yes" failonerror="true">
+ <jvmarg value="-Xmx256M" />
+ <!--jvmarg
value="-agentlib:jdwp=transport=dt_socket,server=y,address=8000" /-->
+ <arg value="-localWorkers" />
+ <arg value="${gwt.samples.localworkers}" />
+ <arg value="-war" />
+ <arg file="${sample.build}/war" />
+ <arg line="${gwt.compile.report}" />
+ <arg value="-gen" />
+ <arg value=".gwt-gen" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </gwt.timer>
+ <length property="sample.size">
+ <fileset dir="${sample.build}/war/${sample.lower}"
includes="*.cache.html,*.cache.js" />
+ </length>
+ <echo message="output size for ${sample.upper} is ${sample.size}
bytes" />
+ </sequential>
+ </outofdate>
+ </target>
+
+ <target name="scripts" description="Create launch scripts">
+ <mkdir dir="${sample.build}/launch-scripts" />
+ <copy todir="${sample.build}/launch-scripts">
+ <filterset id="scriptfilter">
+ <filter token="ENTRY_MODULE"
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ <filter token="JARNAME" value="gwt-${api.prefix}-${api.name}.jar"
/>
+ <filter token="INDEX_HTML" value="${sample.module}.html" />
+ </filterset>
+ <mapper type="regexp" from="(.*)HelloTemplate(.*)"
to="\1${sample.module}\2" />
+ <fileset dir="${gwt.root}/../shared/templates/shell" />
+ </copy>
+ </target>
+
+ <target name="build" depends="source, compile, gwtc, scripts"
description="Build and package this project" />
+
+ <target name="prepare.hosted" depends="source, compile"
description="Prepares this project for running hosted mode" />
+
+ <target name="checkstyle" description="Static analysis of source">
+ <gwt.checkstyle outputdirectory="${sample.build}">
+ <fileset dir="src" />
+ </gwt.checkstyle>
+ </target>
+
+ <target name="clean" description="Cleans this project's intermediate and
output files">
+ <delete dir="${sample.build}" />
+ <delete includeemptydirs="true">
+ <fileset dir="${samples.scripts}">
+ <include name="*/${sample.upper}/**" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="hosted" description="Run hosted mode">
+ <condition property="hostedmode.class"
value="com.google.gwt.dev.DevMode" else="com.google.gwt.dev.HostedMode">
+ <isset property="is.gwt2" />
+ </condition>
+ <java failonerror="true" fork="true" classname="${hostedmode.class}">
+ <classpath>
+ <pathelement location="src" />
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ </classpath>
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg value="-Xmx256M" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg value="-war" />
+ <arg value="${sample.build}/war" />
+ <arg value="-startupUrl" />
+ <arg value="${sample.module}.html" />
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </target>
+
+ <target name="run" description="Run compiled">
+ <java failonerror="true" fork="true"
classname="org.mortbay.jetty.Main">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.servlet.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ <jvmarg value="-Xmx256M" />
+ <arg value="8080" />
+ <arg value="-webapp" />
+ <arg value="${sample.build}/war" />
+ </java>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/iui/common.ant.xml Sat Jun 25 08:09:38 2011
@@ -0,0 +1,474 @@
+<project name="common">
+ <!-- it's okay for this not to exist, but it gives a place to store
+ "your" property settings, if any, persistently. For example, you
+ might use it to set gwt.junit.testcase.includes to a narrower subset
+ of test cases to exercise. -->
+ <property file="local.ant.properties" />
+ <property file="build.properties" />
+
+ <!-- gwt.build.iscasesensitivefs is true if the filesystem of the
+ build machine is case-sensitive, false otherwise. Update with
+ new lines for any supported platforms with case-insensitive
+ filesystems
+ -->
+ <condition property="gwt.build.iscasesensitivefs" else="false">
+ <not>
+ <or>
+ <os family="windows"/>
+ </or>
+ </not>
+ </condition>
+
+ <property name="test.ant.file"
location="${gwt.root}/${project.tail}/build.xml" />
+ <condition property="project.valid">
+ <equals arg1="${ant.file}" arg2="${test.ant.file}"
+ casesensitive="${gwt.build.iscasesensitivefs}"/>
+ </condition>
+ <fail unless="project.valid" message="This build file is in an
inconsistent state (${ant.file} != ${test.ant.file})." />
+
+ <!-- Global Properties -->
+ <property environment="env" />
+ <condition property="gwt.version" value="${env.GWT_VERSION}"
else="0.0.0">
+ <isset property="env.GWT_VERSION" />
+ </condition>
+ <condition property="gwt.tools.check" value="${env.GWT_TOOLS}"
else="${gwt.root}/../tools">
+ <isset property="env.GWT_TOOLS" />
+ </condition>
+ <condition property="gwt.home" value="${env.GWT_HOME}"
+
else="${gwt.root}/../gwt-trunk/build/staging/gwt-${build.host.platform}-0.0.0">
+ <isset property="env.GWT_HOME" />
+ </condition>
+
+ <property name="gwt.tools" location="${gwt.tools.check}" />
+ <property name="gwt.tools.lib" location="${gwt.tools}/lib" />
+ <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" />
+ <property name="gwt.tools.redist" location="${gwt.tools}/redist" />
+ <property name="gwt.build" location="${gwt.root}/build" />
+ <property name="gwt.build.out" location="${gwt.build}/out" />
+ <property name="gwt.build.lib" location="${gwt.build}/lib" />
+ <property name="gwt.build.jni" location="${gwt.build}/jni" />
+ <property name="gwt.build.staging" location="${gwt.build}/staging" />
+ <property name="gwt.build.dist" location="${gwt.build}/dist" />
+ <property name="gwt.threadsPerProcessor" value="1" />
+ <property name="project.build"
location="${gwt.build.out}/${project.tail}" />
+ <property name="project.lib"
location="${gwt.build.lib}/gwt-${ant.project.name}.jar" />
+ <property name="project.jni" location="${gwt.build}/${project.tail}" />
+ <property name="javac.out" location="${project.build}/bin" />
+ <property name="javac.junit.out" location="${project.build}/bin-test" />
+ <property name="javac.emma.out" location="${project.build}/bin-emma" />
+ <property name="javac.debug" value="true" />
+ <property name="javac.debuglevel" value="lines,vars,source" />
+ <property name="javac.encoding" value="utf-8" />
+ <property name="javac.source" value="1.5" />
+ <property name="javac.target" value="1.5" />
+ <property name="javac.nowarn" value="true" />
+ <property name="junit.out" location="${project.build}/test" />
+ <property name="emma.dir" value="${gwt.tools.redist}/emma" />
+ <property name="emma.filter.exclude" value="" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}'
tools directory; perhaps you should define the GWT_TOOLS environment
variable" />
+
+ <!-- Platform identification -->
+ <condition property="build.host.islinux">
+ <and>
+ <os family="unix" />
+ <not>
+ <contains string="${os.name}" substring="mac"
casesensitive="false" />
+ </not>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="linux">
+ <isset property="build.host.islinux" />
+ </condition>
+
+ <condition property="build.host.ismac">
+ <and>
+ <os family="unix" />
+ <contains string="${os.name}" substring="mac" casesensitive="false"
/>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="mac">
+ <isset property="build.host.ismac" />
+ </condition>
+
+ <condition property="build.host.iswindows">
+ <os family="windows" />
+ </condition>
+ <condition property="build.host.platform" value="windows">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <fail unless="build.host.platform" message="Building on ${os.name} is
not supported" />
+
+ <!-- References to files from the GWT_HOME directory -->
+ <condition property="is.gwt2">
+ <available file="${gwt.home}/gwt-dev.jar" />
+ </condition>
+ <condition property="dev.jar" value="${gwt.home}/gwt-dev.jar"
+ else="${gwt.home}/gwt-dev-${build.host.platform}.jar">
+ <isset property="is.gwt2" />
+ </condition>
+ <property name="gwt.dev.jar" location="${dev.jar}" />
+ <property name="gwt.user.jar" location="${gwt.home}/gwt-user.jar"
/>
+ <property name="gwt.servlet.jar"
location="${gwt.home}/gwt-servlet.jar" />
+ <property name="gwt.validation.jar"
location="${gwt.home}/validation-api-1.0.0.GA.jar" />
+ <property name="gwt.validation.sources.jar"
location="${gwt.home}/validation-api-1.0.0.GA-sources.jar" />
+
+ <!-- Reference to jars produced by this build -->
+ <property name="ant.gwt.jar" location="${gwt.home}/ant-gwt.jar" />
+ <property name="mobile.webkit.api.jar"
location="${gwt.build.lib}/gwt-${api.prefix}-${api.name}.jar" />
+ <property name="gwt.doctool.jar"
location="${gwt.build.lib}/gwt-doctool.jar" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir"
property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot
find '${gwt.tools}' tools directory; perhaps you should define the
GWT_TOOLS environment variable" />
+
+ <available file="${gwt.dev.jar}" property="gwt.dev.jar.exists" />
+ <fail unless="gwt.dev.jar.exists" message="Cannot
find '${gwt.dev.jar}'; perhaps you should define the GWT_HOME environment
variable" />
+
+
+ <condition property="hostedmode.platform.args" value="-d32
-XstartOnFirstThread" else="">
+ <and>
+ <isset property="build.host.ismac" />
+ <not>
+ <isset property="is.gwt2" />
+ </not>
+ </and>
+ </condition>
+
+ <!-- JUnit support -->
+ <property name="gwt.junit.port" value="8888" />
+ <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/>
+
+ <!-- Headless mode keeps the hosted mode browser and log window
+ from popping up during a unit test run. This is usually desirable,
+ but the WebKit layout engine performs some optimizations in
+ headless mode that causes some GWT unit tests to break. The
+ solution for the time being is to turn off headless mode on
+ the mac.
+ -->
+ <condition property="junit.headless">
+ <not>
+ <isset property="build.host.ismac" />
+ </not>
+ </condition>
+ <condition property="junit.notheadless.arg" value="-notHeadless" else="">
+ <not>
+ <isset property="junit.headless" />
+ </not>
+ </condition>
+
+ <!-- Shared class paths -->
+ <path id="project.classpath.class">
+ <pathelement location="${javac.out}" />
+ </path>
+ <path id="project.classpath.src">
+ <pathelement location="${gwt.root}/${project.tail}/src" />
+ </path>
+
+ <!-- Pulls in tasks defined in ant-contrib, i.e. foreach -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" />
+ </classpath>
+ </taskdef>
+
+ <!-- Global Custom Tasks -->
+ <presetdef name="gwt.ant">
+ <ant inheritall="false" target="${target}">
+ <propertyset>
+ <propertyref name="gwt.version" />
+ <propertyref name="gwt.junit.port" />
+ <propertyref name="gwt.remote.browsers" />
+ <propertyref name="emma.enabled" />
+ <propertyref name="emma.compiled" />
+ </propertyset>
+ </ant>
+ </presetdef>
+
+ <presetdef name="gwt.javac">
+ <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}"
debuglevel="${javac.debuglevel}" source="${javac.source}"
target="${javac.target}" nowarn="${javac.nowarn}"
encoding="${javac.encoding}" />
+ </presetdef>
+
+ <macrodef name="gwt.jar">
+ <attribute name="destfile" default="${project.lib}"/>
+ <attribute name="duplicate" default="fail"/>
+ <attribute name="update" default="true"/>
+ <element name="jarcontents" implicit="true"/>
+ <sequential>
+ <taskdef name="jar.bydate"
+ classname="com.google.gwt.ant.taskdefs.LatestTimeJar"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+
+ <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}"
filesonly="false"
+ index="true" update="@{update}">
+ <jarcontents/>
+ </jar.bydate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.junit">
+ <!-- TODO: Because dev has core, oophm splits, the "common pattern"
here doesn't work
+ for it (and we use extraclasspaths entries instead). Once we
lose SWT, we can
+ consolidate dev/core and dev/oophm, and that can instead more to
the normal
+ pattern. Note also special casing regarding (dev/) core/test. -->
+ <attribute name="test.args" default="" />
+ <attribute name="test.out" default="" />
+ <attribute name="test.reports" default="@{test.out}/reports" />
+ <attribute name="test.emma.coverage"
default="@{test.out}/emma-coverage" />
+ <attribute name="test.cases" default="" />
+ <attribute name="test.name" default="" />
+ <attribute name="haltonfailure" default="true" />
+ <element name="extraclasspaths" optional="true" />
+ <sequential>
+ <taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar"
/>
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ </classpath>
+ </taskdef>
+
+ <echo message="Writing test results to @{test.reports} for
@{test.cases}" />
+ <mkdir dir="@{test.reports}" />
+
+ <antcall target="-create.emma.coverage.if.enabled">
+ <param name="test.emma.coverage" value="@{test.emma.coverage}"/>
+ </antcall>
+ <condition property="emma.lib"
value="${emma.dir}/emma-2.0.5312-patched.jar"
+ else="${emma.dir}/no-emma-requested">
+ <isset property="emma.enabled" />
+ </condition>
+
+ <junit dir="@{test.out}" fork="yes" printsummary="yes"
+ failureproperty="junit.failure" tempdir="@{test.out}">
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg line="-Xmx768m" />
+ <jvmarg
value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=true" />
+ <sysproperty key="gwt.args" value="${junit.notheadless.arg}
@{test.args}" />
+ <sysproperty key="java.awt.headless" value="${junit.headless}" />
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
+ <classpath>
+ <path refid="project.classpath.src" />
+ <pathelement location="${gwt.root}/${project.tail}/super" />
+ <pathelement location="${gwt.root}/${project.tail}/test" />
+ <!-- TODO: this is here because e.g. ClassPathEntryTest
otherwise fails,
+ expecting the src entry (core/test) to be earlier than the
bin entry
+ (${javac.junit.out}). -->
+ <pathelement location="${gwt.root}/${project.tail}/core/test" />
+ <pathelement location="${javac.junit.out}" />
+ <!-- javac.emma.out is empty unless emma is enabled. -->
+ <pathelement location="${javac.emma.out}" />
+ <path refid="project.classpath.class" />
+ <pathelement location="${emma.lib}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar"
/>
+ <extraclasspaths />
+ </classpath>
+
+ <formatter type="plain" />
+ <formatter type="xml" />
+
+ <batchtest todir="@{test.reports}">
+ <fileset refid="@{test.cases}" />
+ </batchtest>
+ </junit>
+
+ <emma enabled="${emma.enabled}">
+ <report sourcepath="${project.classpath.src}">
+ <fileset file="${javac.emma.out}/metadata.emma" />
+ <fileset dir="@{test.emma.coverage}">
+ <include name="*.emma" />
+ </fileset>
+ <txt outfile="@{test.emma.coverage}/coverage.txt" />
+ <html outfile="@{test.emma.coverage}/coverage.html" />
+ <xml outfile="@{test.emma.coverage}/coverage.xml" />
+ </report>
+ </emma>
+
+ <condition property="junit.stop.build" value="true">
+ <and>
+ <istrue value="@{haltonfailure}"/>
+ <isset property="junit.failure"/>
+ </and>
+ </condition>
+ <fail
+ message="One or more junit tests failed for target: @{test.name}
@{test.args}"
+ if="junit.stop.build" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.tgz.cat">
+ <attribute name="destfile" />
+ <attribute name="compression" default="gzip" />
+ <element name="tar.elements" implicit="true" optional="true" />
+ <sequential>
+ <taskdef name="tar.cat"
classname="com.google.gwt.ant.taskdefs.TarCat"
classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <tar.cat destfile="@{destfile}" compression="@{compression}"
longfile="gnu">
+ <tar.elements />
+ </tar.cat>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of
a workspace">
+ <sequential>
+ <taskdef name="svninfo"
+ classname="com.google.gwt.ant.taskdefs.SvnInfo"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev"
+ outputfileproperty="gwt.svnrev.filename" />
+ <!-- Generally, filtering requires a sentinel file so that changes
to svn rev will
+ be noticed as invalidating the previously-generated filter
output. This property
+ names where such a sentinel lives; it is tested with <available/>
and created
+ with <touch/> -->
+ <mkdir dir="${project.build}/sentinels" />
+ <property name="filter.sentinel"
+
location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}"
/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.revfilter" description="Filters files for
versioning">
+ <attribute name="todir" description="Destination for the filtered
copy"/>
+
+ <element name="src.fileset" implicit="true"
+ description="Source for the filtered copy"/>
+ <sequential>
+ <!-- These files must be filtered for versioning -->
+ <echo message="Branding as GWT version ${gwt.version}, SVN rev
${gwt.svnrev}"/>
+ <mkdir dir="@{todir}" />
+ <copy todir="@{todir}" overwrite="true">
+ <src.fileset/>
+ <filterset>
+ <filter token="GWT_VERSION" value="${gwt.version}" />
+ <filter token="GWT_SVNREV" value="${gwt.svnrev}" />
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.timer">
+ <attribute name="name"/>
+ <element name="timer.elements" implicit="true" optional="false"/>
+ <sequential>
+ <taskdef name="timer"
+ classname="com.google.gwt.ant.taskdefs.Timer"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <timer name="@{name}">
+ <timer.elements/>
+ </timer>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.checkstyle">
+ <attribute name="outputdirectory" default="${project.build}"/>
+ <element name="sourcepath" implicit="yes" optional="true" />
+ <sequential>
+ <taskdef resource="checkstyletask.properties"
classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar"
/>
+ <mkdir dir="@{outputdirectory}"/>
+ <checkstyle
config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml"
maxErrors="0" failOnViolation="false"
failureProperty="gwt.checkstyle.failed">
+ <formatter type="xml"
toFile="@{outputdirectory}/checkstyle_log.xml"/>
+ <property key="checkstyle.header.file"
file="${gwt.root}/eclipse/settings/code-style/google.header" />
+ <sourcepath />
+ </checkstyle>
+ <fail message="Checkstyle errors exist, and are reported in
checkstyle_log.xml located at @{outputdirectory}"
if="gwt.checkstyle.failed" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="property.ensure">
+ <attribute name="name" />
+ <attribute name="location" />
+ <attribute name="message" default="Cannot find dependency ${@{name}}"
/>
+ <attribute name="unless" default="__nonexistent_property__" />
+ <sequential>
+ <property name="@{name}" location="@{location}" />
+ <condition property="@{name}.exists">
+ <or>
+ <available file="${@{name}}" />
+ <isset property="@{unless}" />
+ </or>
+ </condition>
+ <fail unless="@{name}.exists" message="@{message}" />
+ </sequential>
+ </macrodef>
+
+ <!-- Targets for emma support. To run tests with emma enabled, use
+ ant <test-target> -Demma.enabled=true -->
+ <path id="emma.taskdef.lib">
+ <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" />
+ <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" />
+ </path>
+
+ <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib"
/>
+
+ <!-- Instruments emma classes -->
+ <target name="compile.emma.if.enabled" unless="emma.compiled">
+ <delete dir="${javac.emma.out}" />
+ <property name="emma.compiled" value="true" />
+ <antcall target="-compile.emma.if.enabled" />
+ </target>
+
+ <!-- Instruments emma classes -->
+ <target name="-compile.emma.if.enabled" if="emma.enabled">
+ <mkdir dir="${javac.emma.out}" />
+ <path id="emma.classpath">
+ <pathelement location="${javac.out}" />
+ </path>
+ <emma enabled="${emma.enabled}" >
+ <instr instrpathref="emma.classpath" destdir="${javac.emma.out}"
metadatafile="${javac.emma.out}/metadata.emma" merge="false">
+ <filter includes="com.google.*" />
+ <filter excludes="${emma.filter.exclude}" />
+ </instr>
+ </emma>
+ </target>
+
+ <!-- Create the emma coverage directory -->
+ <target name="-create.emma.coverage.if.enabled" if="emma.enabled">
+ <delete dir="${test.emma.coverage}" />
+ <mkdir dir="${test.emma.coverage}" />
+ </target>
+
+ <!-- Default implementations of the required targets; projects should
+ override the ones that matter -->
+ <target name="all" depends="verify" />
+ <target name="verify" depends="checkstyle, test"
+ description="Runs tests and checkstyle static analysis" />
+ <target name="checkstyle" />
+ <target name="test" depends="build" />
+ <target name="build" />
+
+ <target name="clean">
+ <delete dir="${project.build}" />
+ </target>
+
+ <target name="maven-install">
+ <available file="${mobile.webkit.api.jar}"
property="mobile.webkit.api.jar.exists" />
+ <fail unless="mobile.webkit.api.jar.exists" message="Cannot
find '${mobile.webkit.api.jar}'; perhaps you should run 'ant dist' first!"
/>
+
+ <property name="mobile.webkit.api.pom"
value="${gwt.build.out}/distro-source/pom.xml" />
+ <available file="${mobile.webkit.api.pom}"
property="mobile.webkit.api.pom.exists" />
+ <fail unless="mobile.webkit.api.pom.exists" message="Cannot
find '${mobile.webkit.api.pom}'; perhaps you should run 'ant dist' first!"
/>
+
+ <condition property="exec.cmd" value="cmd.exe"
+ else="/bin/sh">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <condition property="exec.arg" value="/c"
+ else="-c">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <property name="mvn.file" value="-Dfile=${mobile.webkit.api.jar}" />
+ <property name="mvn.pomFile"
value="-DpomFile=${mobile.webkit.api.pom}" />
+ <exec executable="${exec.cmd}">
+ <arg value="${exec.arg}" />
+ <arg value="mvn install:install-file ${mvn.file} ${mvn.pomFile}
-DcreateChecksum=true" />
+ </exec>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/iui/samples/common.ant.xml Sat Jun 25 08:09:38
2011
@@ -0,0 +1,161 @@
+<project name="samples-common">
+ <property name="gwt.root" location="../.." />
+ <property name="project.tail" value="samples/${sample.root}" />
+ <import file="${gwt.root}/common.ant.xml" />
+
+ <!--
+ Number of localworkers for sample compilation. This depends on your
+ hardware, so it's a good candidate to specify in local.ant.properties
+ if this default isn't good for you. Ideally, it should approximate
+ the number of CPU cores in your machine.
+ -->
+ <property name="gwt.samples.localworkers" value="2" />
+
+ <property name="sample.lower" value="${sample.root}" />
+ <property name="sample.upper" value="${sample.module}" />
+
+ <!-- Mirror directory for scripts; makes building distro easier -->
+ <property name="samples.scripts"
value="${gwt.build.out}/samples-scripts" />
+ <!-- Use the uppercase name rather than the lowercase name -->
+ <property name="sample.build"
value="${gwt.build.out}/samples/${sample.upper}" />
+
+ <target name="source" description="Copy source to the output folder">
+ <mkdir dir="${sample.build}/src" />
+ <copy todir="${sample.build}/src">
+ <fileset dir="src" />
+ </copy>
+ <mkdir dir="${sample.build}/war" />
+ <copy todir="${sample.build}/war">
+ <fileset dir="war" excludes="WEB-INF/classes/**"/>
+ </copy>
+ </target>
+
+ <target name="compile" description="Compile all java files">
+ <mkdir dir="${sample.build}/war/WEB-INF/classes" />
+ <gwt.javac destdir="${sample.build}/war/WEB-INF/classes">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ </gwt.javac>
+ </target>
+
+ <target name="gwtc" description="Compile to JavaScript">
+ <condition property="gwt.compile.report" value="-compileReport"
else="">
+ <isset property="is.gwt2" />
+ </condition>
+ <outofdate>
+ <sourcefiles>
+ <fileset dir="src" />
+ <fileset dir="${sample.build}/war/WEB-INF/classes" />
+ <fileset file="${mobile.webkit.api.jar}" />
+ <fileset file="${gwt.user.jar}" />
+ <fileset file="${gwt.dev.jar}" />
+ <fileset file="${gwt.validation.jar}" />
+ <fileset file="${gwt.validation.sources.jar}" />
+ </sourcefiles>
+ <targetfiles
path="${sample.build}/war/${sample.lower}/${sample.lower}.nocache.js" />
+ <sequential>
+ <mkdir dir="${sample.build}/war" />
+ <gwt.timer name="${sample.upper} with ${gwt.samples.localworkers}
localWorkers">
+ <java dir="${sample.build}"
classname="com.google.gwt.dev.Compiler"
classpath="src:${sample.build}/war/WEB-INF/classes:${mobile.webkit.api.jar}:${gwt.user.jar}:${gwt.dev.jar}:${gwt.validation.jar}:${gwt.validation.sources.jar}"
fork="yes" failonerror="true">
+ <jvmarg value="-Xmx256M" />
+ <!--jvmarg
value="-agentlib:jdwp=transport=dt_socket,server=y,address=8000" /-->
+ <arg value="-localWorkers" />
+ <arg value="${gwt.samples.localworkers}" />
+ <arg value="-war" />
+ <arg file="${sample.build}/war" />
+ <arg line="${gwt.compile.report}" />
+ <arg value="-gen" />
+ <arg value=".gwt-gen" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </gwt.timer>
+ <length property="sample.size">
+ <fileset dir="${sample.build}/war/${sample.lower}"
includes="*.cache.html,*.cache.js" />
+ </length>
+ <echo message="output size for ${sample.upper} is ${sample.size}
bytes" />
+ </sequential>
+ </outofdate>
+ </target>
+
+ <target name="scripts" description="Create launch scripts">
+ <mkdir dir="${sample.build}/launch-scripts" />
+ <copy todir="${sample.build}/launch-scripts">
+ <filterset id="scriptfilter">
+ <filter token="ENTRY_MODULE"
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ <filter token="JARNAME" value="gwt-${api.prefix}-${api.name}.jar"
/>
+ <filter token="INDEX_HTML" value="${sample.module}.html" />
+ </filterset>
+ <mapper type="regexp" from="(.*)HelloTemplate(.*)"
to="\1${sample.module}\2" />
+ <fileset dir="${gwt.root}/../shared/templates/shell" />
+ </copy>
+ </target>
+
+ <target name="build" depends="source, compile, gwtc, scripts"
description="Build and package this project" />
+
+ <target name="prepare.hosted" depends="source, compile"
description="Prepares this project for running hosted mode" />
+
+ <target name="checkstyle" description="Static analysis of source">
+ <gwt.checkstyle outputdirectory="${sample.build}">
+ <fileset dir="src" />
+ </gwt.checkstyle>
+ </target>
+
+ <target name="clean" description="Cleans this project's intermediate and
output files">
+ <delete dir="${sample.build}" />
+ <delete includeemptydirs="true">
+ <fileset dir="${samples.scripts}">
+ <include name="*/${sample.upper}/**" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="hosted" description="Run hosted mode">
+ <condition property="hostedmode.class"
value="com.google.gwt.dev.DevMode" else="com.google.gwt.dev.HostedMode">
+ <isset property="is.gwt2" />
+ </condition>
+ <java failonerror="true" fork="true" classname="${hostedmode.class}">
+ <classpath>
+ <pathelement location="src" />
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ </classpath>
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg value="-Xmx256M" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg value="-war" />
+ <arg value="${sample.build}/war" />
+ <arg value="-startupUrl" />
+ <arg value="${sample.module}.html" />
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </target>
+
+ <target name="run" description="Run compiled">
+ <java failonerror="true" fork="true"
classname="org.mortbay.jetty.Main">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.servlet.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ <jvmarg value="-Xmx256M" />
+ <arg value="8080" />
+ <arg value="-webapp" />
+ <arg value="${sample.build}/war" />
+ </java>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/storage/common.ant.xml Sat Jun 25 08:09:38 2011
@@ -0,0 +1,474 @@
+<project name="common">
+ <!-- it's okay for this not to exist, but it gives a place to store
+ "your" property settings, if any, persistently. For example, you
+ might use it to set gwt.junit.testcase.includes to a narrower subset
+ of test cases to exercise. -->
+ <property file="local.ant.properties" />
+ <property file="build.properties" />
+
+ <!-- gwt.build.iscasesensitivefs is true if the filesystem of the
+ build machine is case-sensitive, false otherwise. Update with
+ new lines for any supported platforms with case-insensitive
+ filesystems
+ -->
+ <condition property="gwt.build.iscasesensitivefs" else="false">
+ <not>
+ <or>
+ <os family="windows"/>
+ </or>
+ </not>
+ </condition>
+
+ <property name="test.ant.file"
location="${gwt.root}/${project.tail}/build.xml" />
+ <condition property="project.valid">
+ <equals arg1="${ant.file}" arg2="${test.ant.file}"
+ casesensitive="${gwt.build.iscasesensitivefs}"/>
+ </condition>
+ <fail unless="project.valid" message="This build file is in an
inconsistent state (${ant.file} != ${test.ant.file})." />
+
+ <!-- Global Properties -->
+ <property environment="env" />
+ <condition property="gwt.version" value="${env.GWT_VERSION}"
else="0.0.0">
+ <isset property="env.GWT_VERSION" />
+ </condition>
+ <condition property="gwt.tools.check" value="${env.GWT_TOOLS}"
else="${gwt.root}/../tools">
+ <isset property="env.GWT_TOOLS" />
+ </condition>
+ <condition property="gwt.home" value="${env.GWT_HOME}"
+
else="${gwt.root}/../gwt-trunk/build/staging/gwt-${build.host.platform}-0.0.0">
+ <isset property="env.GWT_HOME" />
+ </condition>
+
+ <property name="gwt.tools" location="${gwt.tools.check}" />
+ <property name="gwt.tools.lib" location="${gwt.tools}/lib" />
+ <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" />
+ <property name="gwt.tools.redist" location="${gwt.tools}/redist" />
+ <property name="gwt.build" location="${gwt.root}/build" />
+ <property name="gwt.build.out" location="${gwt.build}/out" />
+ <property name="gwt.build.lib" location="${gwt.build}/lib" />
+ <property name="gwt.build.jni" location="${gwt.build}/jni" />
+ <property name="gwt.build.staging" location="${gwt.build}/staging" />
+ <property name="gwt.build.dist" location="${gwt.build}/dist" />
+ <property name="gwt.threadsPerProcessor" value="1" />
+ <property name="project.build"
location="${gwt.build.out}/${project.tail}" />
+ <property name="project.lib"
location="${gwt.build.lib}/gwt-${ant.project.name}.jar" />
+ <property name="project.jni" location="${gwt.build}/${project.tail}" />
+ <property name="javac.out" location="${project.build}/bin" />
+ <property name="javac.junit.out" location="${project.build}/bin-test" />
+ <property name="javac.emma.out" location="${project.build}/bin-emma" />
+ <property name="javac.debug" value="true" />
+ <property name="javac.debuglevel" value="lines,vars,source" />
+ <property name="javac.encoding" value="utf-8" />
+ <property name="javac.source" value="1.5" />
+ <property name="javac.target" value="1.5" />
+ <property name="javac.nowarn" value="true" />
+ <property name="junit.out" location="${project.build}/test" />
+ <property name="emma.dir" value="${gwt.tools.redist}/emma" />
+ <property name="emma.filter.exclude" value="" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}'
tools directory; perhaps you should define the GWT_TOOLS environment
variable" />
+
+ <!-- Platform identification -->
+ <condition property="build.host.islinux">
+ <and>
+ <os family="unix" />
+ <not>
+ <contains string="${os.name}" substring="mac"
casesensitive="false" />
+ </not>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="linux">
+ <isset property="build.host.islinux" />
+ </condition>
+
+ <condition property="build.host.ismac">
+ <and>
+ <os family="unix" />
+ <contains string="${os.name}" substring="mac" casesensitive="false"
/>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="mac">
+ <isset property="build.host.ismac" />
+ </condition>
+
+ <condition property="build.host.iswindows">
+ <os family="windows" />
+ </condition>
+ <condition property="build.host.platform" value="windows">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <fail unless="build.host.platform" message="Building on ${os.name} is
not supported" />
+
+ <!-- References to files from the GWT_HOME directory -->
+ <condition property="is.gwt2">
+ <available file="${gwt.home}/gwt-dev.jar" />
+ </condition>
+ <condition property="dev.jar" value="${gwt.home}/gwt-dev.jar"
+ else="${gwt.home}/gwt-dev-${build.host.platform}.jar">
+ <isset property="is.gwt2" />
+ </condition>
+ <property name="gwt.dev.jar" location="${dev.jar}" />
+ <property name="gwt.user.jar" location="${gwt.home}/gwt-user.jar"
/>
+ <property name="gwt.servlet.jar"
location="${gwt.home}/gwt-servlet.jar" />
+ <property name="gwt.validation.jar"
location="${gwt.home}/validation-api-1.0.0.GA.jar" />
+ <property name="gwt.validation.sources.jar"
location="${gwt.home}/validation-api-1.0.0.GA-sources.jar" />
+
+ <!-- Reference to jars produced by this build -->
+ <property name="ant.gwt.jar" location="${gwt.home}/ant-gwt.jar" />
+ <property name="mobile.webkit.api.jar"
location="${gwt.build.lib}/gwt-${api.prefix}-${api.name}.jar" />
+ <property name="gwt.doctool.jar"
location="${gwt.build.lib}/gwt-doctool.jar" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir"
property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot
find '${gwt.tools}' tools directory; perhaps you should define the
GWT_TOOLS environment variable" />
+
+ <available file="${gwt.dev.jar}" property="gwt.dev.jar.exists" />
+ <fail unless="gwt.dev.jar.exists" message="Cannot
find '${gwt.dev.jar}'; perhaps you should define the GWT_HOME environment
variable" />
+
+
+ <condition property="hostedmode.platform.args" value="-d32
-XstartOnFirstThread" else="">
+ <and>
+ <isset property="build.host.ismac" />
+ <not>
+ <isset property="is.gwt2" />
+ </not>
+ </and>
+ </condition>
+
+ <!-- JUnit support -->
+ <property name="gwt.junit.port" value="8888" />
+ <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/>
+
+ <!-- Headless mode keeps the hosted mode browser and log window
+ from popping up during a unit test run. This is usually desirable,
+ but the WebKit layout engine performs some optimizations in
+ headless mode that causes some GWT unit tests to break. The
+ solution for the time being is to turn off headless mode on
+ the mac.
+ -->
+ <condition property="junit.headless">
+ <not>
+ <isset property="build.host.ismac" />
+ </not>
+ </condition>
+ <condition property="junit.notheadless.arg" value="-notHeadless" else="">
+ <not>
+ <isset property="junit.headless" />
+ </not>
+ </condition>
+
+ <!-- Shared class paths -->
+ <path id="project.classpath.class">
+ <pathelement location="${javac.out}" />
+ </path>
+ <path id="project.classpath.src">
+ <pathelement location="${gwt.root}/${project.tail}/src" />
+ </path>
+
+ <!-- Pulls in tasks defined in ant-contrib, i.e. foreach -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" />
+ </classpath>
+ </taskdef>
+
+ <!-- Global Custom Tasks -->
+ <presetdef name="gwt.ant">
+ <ant inheritall="false" target="${target}">
+ <propertyset>
+ <propertyref name="gwt.version" />
+ <propertyref name="gwt.junit.port" />
+ <propertyref name="gwt.remote.browsers" />
+ <propertyref name="emma.enabled" />
+ <propertyref name="emma.compiled" />
+ </propertyset>
+ </ant>
+ </presetdef>
+
+ <presetdef name="gwt.javac">
+ <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}"
debuglevel="${javac.debuglevel}" source="${javac.source}"
target="${javac.target}" nowarn="${javac.nowarn}"
encoding="${javac.encoding}" />
+ </presetdef>
+
+ <macrodef name="gwt.jar">
+ <attribute name="destfile" default="${project.lib}"/>
+ <attribute name="duplicate" default="fail"/>
+ <attribute name="update" default="true"/>
+ <element name="jarcontents" implicit="true"/>
+ <sequential>
+ <taskdef name="jar.bydate"
+ classname="com.google.gwt.ant.taskdefs.LatestTimeJar"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+
+ <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}"
filesonly="false"
+ index="true" update="@{update}">
+ <jarcontents/>
+ </jar.bydate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.junit">
+ <!-- TODO: Because dev has core, oophm splits, the "common pattern"
here doesn't work
+ for it (and we use extraclasspaths entries instead). Once we
lose SWT, we can
+ consolidate dev/core and dev/oophm, and that can instead more to
the normal
+ pattern. Note also special casing regarding (dev/) core/test. -->
+ <attribute name="test.args" default="" />
+ <attribute name="test.out" default="" />
+ <attribute name="test.reports" default="@{test.out}/reports" />
+ <attribute name="test.emma.coverage"
default="@{test.out}/emma-coverage" />
+ <attribute name="test.cases" default="" />
+ <attribute name="test.name" default="" />
+ <attribute name="haltonfailure" default="true" />
+ <element name="extraclasspaths" optional="true" />
+ <sequential>
+ <taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar"
/>
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ </classpath>
+ </taskdef>
+
+ <echo message="Writing test results to @{test.reports} for
@{test.cases}" />
+ <mkdir dir="@{test.reports}" />
+
+ <antcall target="-create.emma.coverage.if.enabled">
+ <param name="test.emma.coverage" value="@{test.emma.coverage}"/>
+ </antcall>
+ <condition property="emma.lib"
value="${emma.dir}/emma-2.0.5312-patched.jar"
+ else="${emma.dir}/no-emma-requested">
+ <isset property="emma.enabled" />
+ </condition>
+
+ <junit dir="@{test.out}" fork="yes" printsummary="yes"
+ failureproperty="junit.failure" tempdir="@{test.out}">
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg line="-Xmx768m" />
+ <jvmarg
value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=true" />
+ <sysproperty key="gwt.args" value="${junit.notheadless.arg}
@{test.args}" />
+ <sysproperty key="java.awt.headless" value="${junit.headless}" />
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
+ <classpath>
+ <path refid="project.classpath.src" />
+ <pathelement location="${gwt.root}/${project.tail}/super" />
+ <pathelement location="${gwt.root}/${project.tail}/test" />
+ <!-- TODO: this is here because e.g. ClassPathEntryTest
otherwise fails,
+ expecting the src entry (core/test) to be earlier than the
bin entry
+ (${javac.junit.out}). -->
+ <pathelement location="${gwt.root}/${project.tail}/core/test" />
+ <pathelement location="${javac.junit.out}" />
+ <!-- javac.emma.out is empty unless emma is enabled. -->
+ <pathelement location="${javac.emma.out}" />
+ <path refid="project.classpath.class" />
+ <pathelement location="${emma.lib}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar"
/>
+ <extraclasspaths />
+ </classpath>
+
+ <formatter type="plain" />
+ <formatter type="xml" />
+
+ <batchtest todir="@{test.reports}">
+ <fileset refid="@{test.cases}" />
+ </batchtest>
+ </junit>
+
+ <emma enabled="${emma.enabled}">
+ <report sourcepath="${project.classpath.src}">
+ <fileset file="${javac.emma.out}/metadata.emma" />
+ <fileset dir="@{test.emma.coverage}">
+ <include name="*.emma" />
+ </fileset>
+ <txt outfile="@{test.emma.coverage}/coverage.txt" />
+ <html outfile="@{test.emma.coverage}/coverage.html" />
+ <xml outfile="@{test.emma.coverage}/coverage.xml" />
+ </report>
+ </emma>
+
+ <condition property="junit.stop.build" value="true">
+ <and>
+ <istrue value="@{haltonfailure}"/>
+ <isset property="junit.failure"/>
+ </and>
+ </condition>
+ <fail
+ message="One or more junit tests failed for target: @{test.name}
@{test.args}"
+ if="junit.stop.build" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.tgz.cat">
+ <attribute name="destfile" />
+ <attribute name="compression" default="gzip" />
+ <element name="tar.elements" implicit="true" optional="true" />
+ <sequential>
+ <taskdef name="tar.cat"
classname="com.google.gwt.ant.taskdefs.TarCat"
classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <tar.cat destfile="@{destfile}" compression="@{compression}"
longfile="gnu">
+ <tar.elements />
+ </tar.cat>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of
a workspace">
+ <sequential>
+ <taskdef name="svninfo"
+ classname="com.google.gwt.ant.taskdefs.SvnInfo"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev"
+ outputfileproperty="gwt.svnrev.filename" />
+ <!-- Generally, filtering requires a sentinel file so that changes
to svn rev will
+ be noticed as invalidating the previously-generated filter
output. This property
+ names where such a sentinel lives; it is tested with <available/>
and created
+ with <touch/> -->
+ <mkdir dir="${project.build}/sentinels" />
+ <property name="filter.sentinel"
+
location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}"
/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.revfilter" description="Filters files for
versioning">
+ <attribute name="todir" description="Destination for the filtered
copy"/>
+
+ <element name="src.fileset" implicit="true"
+ description="Source for the filtered copy"/>
+ <sequential>
+ <!-- These files must be filtered for versioning -->
+ <echo message="Branding as GWT version ${gwt.version}, SVN rev
${gwt.svnrev}"/>
+ <mkdir dir="@{todir}" />
+ <copy todir="@{todir}" overwrite="true">
+ <src.fileset/>
+ <filterset>
+ <filter token="GWT_VERSION" value="${gwt.version}" />
+ <filter token="GWT_SVNREV" value="${gwt.svnrev}" />
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.timer">
+ <attribute name="name"/>
+ <element name="timer.elements" implicit="true" optional="false"/>
+ <sequential>
+ <taskdef name="timer"
+ classname="com.google.gwt.ant.taskdefs.Timer"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <timer name="@{name}">
+ <timer.elements/>
+ </timer>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.checkstyle">
+ <attribute name="outputdirectory" default="${project.build}"/>
+ <element name="sourcepath" implicit="yes" optional="true" />
+ <sequential>
+ <taskdef resource="checkstyletask.properties"
classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar"
/>
+ <mkdir dir="@{outputdirectory}"/>
+ <checkstyle
config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml"
maxErrors="0" failOnViolation="false"
failureProperty="gwt.checkstyle.failed">
+ <formatter type="xml"
toFile="@{outputdirectory}/checkstyle_log.xml"/>
+ <property key="checkstyle.header.file"
file="${gwt.root}/eclipse/settings/code-style/google.header" />
+ <sourcepath />
+ </checkstyle>
+ <fail message="Checkstyle errors exist, and are reported in
checkstyle_log.xml located at @{outputdirectory}"
if="gwt.checkstyle.failed" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="property.ensure">
+ <attribute name="name" />
+ <attribute name="location" />
+ <attribute name="message" default="Cannot find dependency ${@{name}}"
/>
+ <attribute name="unless" default="__nonexistent_property__" />
+ <sequential>
+ <property name="@{name}" location="@{location}" />
+ <condition property="@{name}.exists">
+ <or>
+ <available file="${@{name}}" />
+ <isset property="@{unless}" />
+ </or>
+ </condition>
+ <fail unless="@{name}.exists" message="@{message}" />
+ </sequential>
+ </macrodef>
+
+ <!-- Targets for emma support. To run tests with emma enabled, use
+ ant <test-target> -Demma.enabled=true -->
+ <path id="emma.taskdef.lib">
+ <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" />
+ <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" />
+ </path>
+
+ <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib"
/>
+
+ <!-- Instruments emma classes -->
+ <target name="compile.emma.if.enabled" unless="emma.compiled">
+ <delete dir="${javac.emma.out}" />
+ <property name="emma.compiled" value="true" />
+ <antcall target="-compile.emma.if.enabled" />
+ </target>
+
+ <!-- Instruments emma classes -->
+ <target name="-compile.emma.if.enabled" if="emma.enabled">
+ <mkdir dir="${javac.emma.out}" />
+ <path id="emma.classpath">
+ <pathelement location="${javac.out}" />
+ </path>
+ <emma enabled="${emma.enabled}" >
+ <instr instrpathref="emma.classpath" destdir="${javac.emma.out}"
metadatafile="${javac.emma.out}/metadata.emma" merge="false">
+ <filter includes="com.google.*" />
+ <filter excludes="${emma.filter.exclude}" />
+ </instr>
+ </emma>
+ </target>
+
+ <!-- Create the emma coverage directory -->
+ <target name="-create.emma.coverage.if.enabled" if="emma.enabled">
+ <delete dir="${test.emma.coverage}" />
+ <mkdir dir="${test.emma.coverage}" />
+ </target>
+
+ <!-- Default implementations of the required targets; projects should
+ override the ones that matter -->
+ <target name="all" depends="verify" />
+ <target name="verify" depends="checkstyle, test"
+ description="Runs tests and checkstyle static analysis" />
+ <target name="checkstyle" />
+ <target name="test" depends="build" />
+ <target name="build" />
+
+ <target name="clean">
+ <delete dir="${project.build}" />
+ </target>
+
+ <target name="maven-install">
+ <available file="${mobile.webkit.api.jar}"
property="mobile.webkit.api.jar.exists" />
+ <fail unless="mobile.webkit.api.jar.exists" message="Cannot
find '${mobile.webkit.api.jar}'; perhaps you should run 'ant dist' first!"
/>
+
+ <property name="mobile.webkit.api.pom"
value="${gwt.build.out}/distro-source/pom.xml" />
+ <available file="${mobile.webkit.api.pom}"
property="mobile.webkit.api.pom.exists" />
+ <fail unless="mobile.webkit.api.pom.exists" message="Cannot
find '${mobile.webkit.api.pom}'; perhaps you should run 'ant dist' first!"
/>
+
+ <condition property="exec.cmd" value="cmd.exe"
+ else="/bin/sh">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <condition property="exec.arg" value="/c"
+ else="-c">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <property name="mvn.file" value="-Dfile=${mobile.webkit.api.jar}" />
+ <property name="mvn.pomFile"
value="-DpomFile=${mobile.webkit.api.pom}" />
+ <exec executable="${exec.cmd}">
+ <arg value="${exec.arg}" />
+ <arg value="mvn install:install-file ${mvn.file} ${mvn.pomFile}
-DcreateChecksum=true" />
+ </exec>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/storage/samples/common.ant.xml Sat Jun 25
08:09:38 2011
@@ -0,0 +1,161 @@
+<project name="samples-common">
+ <property name="gwt.root" location="../.." />
+ <property name="project.tail" value="samples/${sample.root}" />
+ <import file="${gwt.root}/common.ant.xml" />
+
+ <!--
+ Number of localworkers for sample compilation. This depends on your
+ hardware, so it's a good candidate to specify in local.ant.properties
+ if this default isn't good for you. Ideally, it should approximate
+ the number of CPU cores in your machine.
+ -->
+ <property name="gwt.samples.localworkers" value="2" />
+
+ <property name="sample.lower" value="${sample.root}" />
+ <property name="sample.upper" value="${sample.module}" />
+
+ <!-- Mirror directory for scripts; makes building distro easier -->
+ <property name="samples.scripts"
value="${gwt.build.out}/samples-scripts" />
+ <!-- Use the uppercase name rather than the lowercase name -->
+ <property name="sample.build"
value="${gwt.build.out}/samples/${sample.upper}" />
+
+ <target name="source" description="Copy source to the output folder">
+ <mkdir dir="${sample.build}/src" />
+ <copy todir="${sample.build}/src">
+ <fileset dir="src" />
+ </copy>
+ <mkdir dir="${sample.build}/war" />
+ <copy todir="${sample.build}/war">
+ <fileset dir="war" excludes="WEB-INF/classes/**"/>
+ </copy>
+ </target>
+
+ <target name="compile" description="Compile all java files">
+ <mkdir dir="${sample.build}/war/WEB-INF/classes" />
+ <gwt.javac destdir="${sample.build}/war/WEB-INF/classes">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ </gwt.javac>
+ </target>
+
+ <target name="gwtc" description="Compile to JavaScript">
+ <condition property="gwt.compile.report" value="-compileReport"
else="">
+ <isset property="is.gwt2" />
+ </condition>
+ <outofdate>
+ <sourcefiles>
+ <fileset dir="src" />
+ <fileset dir="${sample.build}/war/WEB-INF/classes" />
+ <fileset file="${mobile.webkit.api.jar}" />
+ <fileset file="${gwt.user.jar}" />
+ <fileset file="${gwt.dev.jar}" />
+ <fileset file="${gwt.validation.jar}" />
+ <fileset file="${gwt.validation.sources.jar}" />
+ </sourcefiles>
+ <targetfiles
path="${sample.build}/war/${sample.lower}/${sample.lower}.nocache.js" />
+ <sequential>
+ <mkdir dir="${sample.build}/war" />
+ <gwt.timer name="${sample.upper} with ${gwt.samples.localworkers}
localWorkers">
+ <java dir="${sample.build}"
classname="com.google.gwt.dev.Compiler"
classpath="src:${sample.build}/war/WEB-INF/classes:${mobile.webkit.api.jar}:${gwt.user.jar}:${gwt.dev.jar}:${gwt.validation.jar}:${gwt.validation.sources.jar}"
fork="yes" failonerror="true">
+ <jvmarg value="-Xmx256M" />
+ <!--jvmarg
value="-agentlib:jdwp=transport=dt_socket,server=y,address=8000" /-->
+ <arg value="-localWorkers" />
+ <arg value="${gwt.samples.localworkers}" />
+ <arg value="-war" />
+ <arg file="${sample.build}/war" />
+ <arg line="${gwt.compile.report}" />
+ <arg value="-gen" />
+ <arg value=".gwt-gen" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </gwt.timer>
+ <length property="sample.size">
+ <fileset dir="${sample.build}/war/${sample.lower}"
includes="*.cache.html,*.cache.js" />
+ </length>
+ <echo message="output size for ${sample.upper} is ${sample.size}
bytes" />
+ </sequential>
+ </outofdate>
+ </target>
+
+ <target name="scripts" description="Create launch scripts">
+ <mkdir dir="${sample.build}/launch-scripts" />
+ <copy todir="${sample.build}/launch-scripts">
+ <filterset id="scriptfilter">
+ <filter token="ENTRY_MODULE"
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ <filter token="JARNAME" value="gwt-${api.prefix}-${api.name}.jar"
/>
+ <filter token="INDEX_HTML" value="${sample.module}.html" />
+ </filterset>
+ <mapper type="regexp" from="(.*)HelloTemplate(.*)"
to="\1${sample.module}\2" />
+ <fileset dir="${gwt.root}/../shared/templates/shell" />
+ </copy>
+ </target>
+
+ <target name="build" depends="source, compile, gwtc, scripts"
description="Build and package this project" />
+
+ <target name="prepare.hosted" depends="source, compile"
description="Prepares this project for running hosted mode" />
+
+ <target name="checkstyle" description="Static analysis of source">
+ <gwt.checkstyle outputdirectory="${sample.build}">
+ <fileset dir="src" />
+ </gwt.checkstyle>
+ </target>
+
+ <target name="clean" description="Cleans this project's intermediate and
output files">
+ <delete dir="${sample.build}" />
+ <delete includeemptydirs="true">
+ <fileset dir="${samples.scripts}">
+ <include name="*/${sample.upper}/**" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="hosted" description="Run hosted mode">
+ <condition property="hostedmode.class"
value="com.google.gwt.dev.DevMode" else="com.google.gwt.dev.HostedMode">
+ <isset property="is.gwt2" />
+ </condition>
+ <java failonerror="true" fork="true" classname="${hostedmode.class}">
+ <classpath>
+ <pathelement location="src" />
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ </classpath>
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg value="-Xmx256M" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg value="-war" />
+ <arg value="${sample.build}/war" />
+ <arg value="-startupUrl" />
+ <arg value="${sample.module}.html" />
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </target>
+
+ <target name="run" description="Run compiled">
+ <java failonerror="true" fork="true"
classname="org.mortbay.jetty.Main">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.servlet.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ <jvmarg value="-Xmx256M" />
+ <arg value="8080" />
+ <arg value="-webapp" />
+ <arg value="${sample.build}/war" />
+ </java>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/template/common.ant.xml Sat Jun 25 08:09:38
2011
@@ -0,0 +1,474 @@
+<project name="common">
+ <!-- it's okay for this not to exist, but it gives a place to store
+ "your" property settings, if any, persistently. For example, you
+ might use it to set gwt.junit.testcase.includes to a narrower subset
+ of test cases to exercise. -->
+ <property file="local.ant.properties" />
+ <property file="build.properties" />
+
+ <!-- gwt.build.iscasesensitivefs is true if the filesystem of the
+ build machine is case-sensitive, false otherwise. Update with
+ new lines for any supported platforms with case-insensitive
+ filesystems
+ -->
+ <condition property="gwt.build.iscasesensitivefs" else="false">
+ <not>
+ <or>
+ <os family="windows"/>
+ </or>
+ </not>
+ </condition>
+
+ <property name="test.ant.file"
location="${gwt.root}/${project.tail}/build.xml" />
+ <condition property="project.valid">
+ <equals arg1="${ant.file}" arg2="${test.ant.file}"
+ casesensitive="${gwt.build.iscasesensitivefs}"/>
+ </condition>
+ <fail unless="project.valid" message="This build file is in an
inconsistent state (${ant.file} != ${test.ant.file})." />
+
+ <!-- Global Properties -->
+ <property environment="env" />
+ <condition property="gwt.version" value="${env.GWT_VERSION}"
else="0.0.0">
+ <isset property="env.GWT_VERSION" />
+ </condition>
+ <condition property="gwt.tools.check" value="${env.GWT_TOOLS}"
else="${gwt.root}/../tools">
+ <isset property="env.GWT_TOOLS" />
+ </condition>
+ <condition property="gwt.home" value="${env.GWT_HOME}"
+
else="${gwt.root}/../gwt-trunk/build/staging/gwt-${build.host.platform}-0.0.0">
+ <isset property="env.GWT_HOME" />
+ </condition>
+
+ <property name="gwt.tools" location="${gwt.tools.check}" />
+ <property name="gwt.tools.lib" location="${gwt.tools}/lib" />
+ <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" />
+ <property name="gwt.tools.redist" location="${gwt.tools}/redist" />
+ <property name="gwt.build" location="${gwt.root}/build" />
+ <property name="gwt.build.out" location="${gwt.build}/out" />
+ <property name="gwt.build.lib" location="${gwt.build}/lib" />
+ <property name="gwt.build.jni" location="${gwt.build}/jni" />
+ <property name="gwt.build.staging" location="${gwt.build}/staging" />
+ <property name="gwt.build.dist" location="${gwt.build}/dist" />
+ <property name="gwt.threadsPerProcessor" value="1" />
+ <property name="project.build"
location="${gwt.build.out}/${project.tail}" />
+ <property name="project.lib"
location="${gwt.build.lib}/gwt-${ant.project.name}.jar" />
+ <property name="project.jni" location="${gwt.build}/${project.tail}" />
+ <property name="javac.out" location="${project.build}/bin" />
+ <property name="javac.junit.out" location="${project.build}/bin-test" />
+ <property name="javac.emma.out" location="${project.build}/bin-emma" />
+ <property name="javac.debug" value="true" />
+ <property name="javac.debuglevel" value="lines,vars,source" />
+ <property name="javac.encoding" value="utf-8" />
+ <property name="javac.source" value="1.5" />
+ <property name="javac.target" value="1.5" />
+ <property name="javac.nowarn" value="true" />
+ <property name="junit.out" location="${project.build}/test" />
+ <property name="emma.dir" value="${gwt.tools.redist}/emma" />
+ <property name="emma.filter.exclude" value="" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}'
tools directory; perhaps you should define the GWT_TOOLS environment
variable" />
+
+ <!-- Platform identification -->
+ <condition property="build.host.islinux">
+ <and>
+ <os family="unix" />
+ <not>
+ <contains string="${os.name}" substring="mac"
casesensitive="false" />
+ </not>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="linux">
+ <isset property="build.host.islinux" />
+ </condition>
+
+ <condition property="build.host.ismac">
+ <and>
+ <os family="unix" />
+ <contains string="${os.name}" substring="mac" casesensitive="false"
/>
+ </and>
+ </condition>
+ <condition property="build.host.platform" value="mac">
+ <isset property="build.host.ismac" />
+ </condition>
+
+ <condition property="build.host.iswindows">
+ <os family="windows" />
+ </condition>
+ <condition property="build.host.platform" value="windows">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <fail unless="build.host.platform" message="Building on ${os.name} is
not supported" />
+
+ <!-- References to files from the GWT_HOME directory -->
+ <condition property="is.gwt2">
+ <available file="${gwt.home}/gwt-dev.jar" />
+ </condition>
+ <condition property="dev.jar" value="${gwt.home}/gwt-dev.jar"
+ else="${gwt.home}/gwt-dev-${build.host.platform}.jar">
+ <isset property="is.gwt2" />
+ </condition>
+ <property name="gwt.dev.jar" location="${dev.jar}" />
+ <property name="gwt.user.jar" location="${gwt.home}/gwt-user.jar"
/>
+ <property name="gwt.servlet.jar"
location="${gwt.home}/gwt-servlet.jar" />
+ <property name="gwt.validation.jar"
location="${gwt.home}/validation-api-1.0.0.GA.jar" />
+ <property name="gwt.validation.sources.jar"
location="${gwt.home}/validation-api-1.0.0.GA-sources.jar" />
+
+ <!-- Reference to jars produced by this build -->
+ <property name="ant.gwt.jar" location="${gwt.home}/ant-gwt.jar" />
+ <property name="mobile.webkit.api.jar"
location="${gwt.build.lib}/gwt-${api.prefix}-${api.name}.jar" />
+ <property name="gwt.doctool.jar"
location="${gwt.build.lib}/gwt-doctool.jar" />
+
+ <!-- Sanity check -->
+ <available file="${gwt.tools}" type="dir"
property="gwt.tools.exists" />
+ <fail unless="gwt.tools.exists" message="Cannot
find '${gwt.tools}' tools directory; perhaps you should define the
GWT_TOOLS environment variable" />
+
+ <available file="${gwt.dev.jar}" property="gwt.dev.jar.exists" />
+ <fail unless="gwt.dev.jar.exists" message="Cannot
find '${gwt.dev.jar}'; perhaps you should define the GWT_HOME environment
variable" />
+
+
+ <condition property="hostedmode.platform.args" value="-d32
-XstartOnFirstThread" else="">
+ <and>
+ <isset property="build.host.ismac" />
+ <not>
+ <isset property="is.gwt2" />
+ </not>
+ </and>
+ </condition>
+
+ <!-- JUnit support -->
+ <property name="gwt.junit.port" value="8888" />
+ <property name="gwt.junit.testcase.includes" value="**/*Suite.class"/>
+
+ <!-- Headless mode keeps the hosted mode browser and log window
+ from popping up during a unit test run. This is usually desirable,
+ but the WebKit layout engine performs some optimizations in
+ headless mode that causes some GWT unit tests to break. The
+ solution for the time being is to turn off headless mode on
+ the mac.
+ -->
+ <condition property="junit.headless">
+ <not>
+ <isset property="build.host.ismac" />
+ </not>
+ </condition>
+ <condition property="junit.notheadless.arg" value="-notHeadless" else="">
+ <not>
+ <isset property="junit.headless" />
+ </not>
+ </condition>
+
+ <!-- Shared class paths -->
+ <path id="project.classpath.class">
+ <pathelement location="${javac.out}" />
+ </path>
+ <path id="project.classpath.src">
+ <pathelement location="${gwt.root}/${project.tail}/src" />
+ </path>
+
+ <!-- Pulls in tasks defined in ant-contrib, i.e. foreach -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${gwt.tools.antlib}/ant-contrib-1.0b3.jar" />
+ </classpath>
+ </taskdef>
+
+ <!-- Global Custom Tasks -->
+ <presetdef name="gwt.ant">
+ <ant inheritall="false" target="${target}">
+ <propertyset>
+ <propertyref name="gwt.version" />
+ <propertyref name="gwt.junit.port" />
+ <propertyref name="gwt.remote.browsers" />
+ <propertyref name="emma.enabled" />
+ <propertyref name="emma.compiled" />
+ </propertyset>
+ </ant>
+ </presetdef>
+
+ <presetdef name="gwt.javac">
+ <javac srcdir="src" destdir="${javac.out}" debug="${javac.debug}"
debuglevel="${javac.debuglevel}" source="${javac.source}"
target="${javac.target}" nowarn="${javac.nowarn}"
encoding="${javac.encoding}" />
+ </presetdef>
+
+ <macrodef name="gwt.jar">
+ <attribute name="destfile" default="${project.lib}"/>
+ <attribute name="duplicate" default="fail"/>
+ <attribute name="update" default="true"/>
+ <element name="jarcontents" implicit="true"/>
+ <sequential>
+ <taskdef name="jar.bydate"
+ classname="com.google.gwt.ant.taskdefs.LatestTimeJar"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+
+ <jar.bydate destfile="@{destfile}" duplicate="@{duplicate}"
filesonly="false"
+ index="true" update="@{update}">
+ <jarcontents/>
+ </jar.bydate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.junit">
+ <!-- TODO: Because dev has core, oophm splits, the "common pattern"
here doesn't work
+ for it (and we use extraclasspaths entries instead). Once we
lose SWT, we can
+ consolidate dev/core and dev/oophm, and that can instead more to
the normal
+ pattern. Note also special casing regarding (dev/) core/test. -->
+ <attribute name="test.args" default="" />
+ <attribute name="test.out" default="" />
+ <attribute name="test.reports" default="@{test.out}/reports" />
+ <attribute name="test.emma.coverage"
default="@{test.out}/emma-coverage" />
+ <attribute name="test.cases" default="" />
+ <attribute name="test.name" default="" />
+ <attribute name="haltonfailure" default="true" />
+ <element name="extraclasspaths" optional="true" />
+ <sequential>
+ <taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+ <classpath>
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar"
/>
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ </classpath>
+ </taskdef>
+
+ <echo message="Writing test results to @{test.reports} for
@{test.cases}" />
+ <mkdir dir="@{test.reports}" />
+
+ <antcall target="-create.emma.coverage.if.enabled">
+ <param name="test.emma.coverage" value="@{test.emma.coverage}"/>
+ </antcall>
+ <condition property="emma.lib"
value="${emma.dir}/emma-2.0.5312-patched.jar"
+ else="${emma.dir}/no-emma-requested">
+ <isset property="emma.enabled" />
+ </condition>
+
+ <junit dir="@{test.out}" fork="yes" printsummary="yes"
+ failureproperty="junit.failure" tempdir="@{test.out}">
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg line="-Xmx768m" />
+ <jvmarg
value="-Demma.coverage.out.file=@{test.emma.coverage}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=true" />
+ <sysproperty key="gwt.args" value="${junit.notheadless.arg}
@{test.args}" />
+ <sysproperty key="java.awt.headless" value="${junit.headless}" />
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
+ <classpath>
+ <path refid="project.classpath.src" />
+ <pathelement location="${gwt.root}/${project.tail}/super" />
+ <pathelement location="${gwt.root}/${project.tail}/test" />
+ <!-- TODO: this is here because e.g. ClassPathEntryTest
otherwise fails,
+ expecting the src entry (core/test) to be earlier than the
bin entry
+ (${javac.junit.out}). -->
+ <pathelement location="${gwt.root}/${project.tail}/core/test" />
+ <pathelement location="${javac.junit.out}" />
+ <!-- javac.emma.out is empty unless emma is enabled. -->
+ <pathelement location="${javac.emma.out}" />
+ <path refid="project.classpath.class" />
+ <pathelement location="${emma.lib}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+ <pathelement
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar"
/>
+ <extraclasspaths />
+ </classpath>
+
+ <formatter type="plain" />
+ <formatter type="xml" />
+
+ <batchtest todir="@{test.reports}">
+ <fileset refid="@{test.cases}" />
+ </batchtest>
+ </junit>
+
+ <emma enabled="${emma.enabled}">
+ <report sourcepath="${project.classpath.src}">
+ <fileset file="${javac.emma.out}/metadata.emma" />
+ <fileset dir="@{test.emma.coverage}">
+ <include name="*.emma" />
+ </fileset>
+ <txt outfile="@{test.emma.coverage}/coverage.txt" />
+ <html outfile="@{test.emma.coverage}/coverage.html" />
+ <xml outfile="@{test.emma.coverage}/coverage.xml" />
+ </report>
+ </emma>
+
+ <condition property="junit.stop.build" value="true">
+ <and>
+ <istrue value="@{haltonfailure}"/>
+ <isset property="junit.failure"/>
+ </and>
+ </condition>
+ <fail
+ message="One or more junit tests failed for target: @{test.name}
@{test.args}"
+ if="junit.stop.build" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.tgz.cat">
+ <attribute name="destfile" />
+ <attribute name="compression" default="gzip" />
+ <element name="tar.elements" implicit="true" optional="true" />
+ <sequential>
+ <taskdef name="tar.cat"
classname="com.google.gwt.ant.taskdefs.TarCat"
classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <tar.cat destfile="@{destfile}" compression="@{compression}"
longfile="gnu">
+ <tar.elements />
+ </tar.cat>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.getsvninfo" description="Identifies the SVN info of
a workspace">
+ <sequential>
+ <taskdef name="svninfo"
+ classname="com.google.gwt.ant.taskdefs.SvnInfo"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <svninfo directory="${gwt.root}" outputproperty="gwt.svnrev"
+ outputfileproperty="gwt.svnrev.filename" />
+ <!-- Generally, filtering requires a sentinel file so that changes
to svn rev will
+ be noticed as invalidating the previously-generated filter
output. This property
+ names where such a sentinel lives; it is tested with <available/>
and created
+ with <touch/> -->
+ <mkdir dir="${project.build}/sentinels" />
+ <property name="filter.sentinel"
+
location="${project.build}/sentinels/gwt-${gwt.version}-svn-${gwt.svnrev.filename}"
/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.revfilter" description="Filters files for
versioning">
+ <attribute name="todir" description="Destination for the filtered
copy"/>
+
+ <element name="src.fileset" implicit="true"
+ description="Source for the filtered copy"/>
+ <sequential>
+ <!-- These files must be filtered for versioning -->
+ <echo message="Branding as GWT version ${gwt.version}, SVN rev
${gwt.svnrev}"/>
+ <mkdir dir="@{todir}" />
+ <copy todir="@{todir}" overwrite="true">
+ <src.fileset/>
+ <filterset>
+ <filter token="GWT_VERSION" value="${gwt.version}" />
+ <filter token="GWT_SVNREV" value="${gwt.svnrev}" />
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.timer">
+ <attribute name="name"/>
+ <element name="timer.elements" implicit="true" optional="false"/>
+ <sequential>
+ <taskdef name="timer"
+ classname="com.google.gwt.ant.taskdefs.Timer"
+ classpath="${gwt.build.lib}/ant-gwt.jar" />
+ <timer name="@{name}">
+ <timer.elements/>
+ </timer>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="gwt.checkstyle">
+ <attribute name="outputdirectory" default="${project.build}"/>
+ <element name="sourcepath" implicit="yes" optional="true" />
+ <sequential>
+ <taskdef resource="checkstyletask.properties"
classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar"
/>
+ <mkdir dir="@{outputdirectory}"/>
+ <checkstyle
config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml"
maxErrors="0" failOnViolation="false"
failureProperty="gwt.checkstyle.failed">
+ <formatter type="xml"
toFile="@{outputdirectory}/checkstyle_log.xml"/>
+ <property key="checkstyle.header.file"
file="${gwt.root}/eclipse/settings/code-style/google.header" />
+ <sourcepath />
+ </checkstyle>
+ <fail message="Checkstyle errors exist, and are reported in
checkstyle_log.xml located at @{outputdirectory}"
if="gwt.checkstyle.failed" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="property.ensure">
+ <attribute name="name" />
+ <attribute name="location" />
+ <attribute name="message" default="Cannot find dependency ${@{name}}"
/>
+ <attribute name="unless" default="__nonexistent_property__" />
+ <sequential>
+ <property name="@{name}" location="@{location}" />
+ <condition property="@{name}.exists">
+ <or>
+ <available file="${@{name}}" />
+ <isset property="@{unless}" />
+ </or>
+ </condition>
+ <fail unless="@{name}.exists" message="@{message}" />
+ </sequential>
+ </macrodef>
+
+ <!-- Targets for emma support. To run tests with emma enabled, use
+ ant <test-target> -Demma.enabled=true -->
+ <path id="emma.taskdef.lib">
+ <pathelement location="${emma.dir}/emma-2.0.5312-patched.jar" />
+ <pathelement location="${emma.dir}/emma_ant-2.0.5312.jar" />
+ </path>
+
+ <taskdef resource="emma_ant.properties" classpathref="emma.taskdef.lib"
/>
+
+ <!-- Instruments emma classes -->
+ <target name="compile.emma.if.enabled" unless="emma.compiled">
+ <delete dir="${javac.emma.out}" />
+ <property name="emma.compiled" value="true" />
+ <antcall target="-compile.emma.if.enabled" />
+ </target>
+
+ <!-- Instruments emma classes -->
+ <target name="-compile.emma.if.enabled" if="emma.enabled">
+ <mkdir dir="${javac.emma.out}" />
+ <path id="emma.classpath">
+ <pathelement location="${javac.out}" />
+ </path>
+ <emma enabled="${emma.enabled}" >
+ <instr instrpathref="emma.classpath" destdir="${javac.emma.out}"
metadatafile="${javac.emma.out}/metadata.emma" merge="false">
+ <filter includes="com.google.*" />
+ <filter excludes="${emma.filter.exclude}" />
+ </instr>
+ </emma>
+ </target>
+
+ <!-- Create the emma coverage directory -->
+ <target name="-create.emma.coverage.if.enabled" if="emma.enabled">
+ <delete dir="${test.emma.coverage}" />
+ <mkdir dir="${test.emma.coverage}" />
+ </target>
+
+ <!-- Default implementations of the required targets; projects should
+ override the ones that matter -->
+ <target name="all" depends="verify" />
+ <target name="verify" depends="checkstyle, test"
+ description="Runs tests and checkstyle static analysis" />
+ <target name="checkstyle" />
+ <target name="test" depends="build" />
+ <target name="build" />
+
+ <target name="clean">
+ <delete dir="${project.build}" />
+ </target>
+
+ <target name="maven-install">
+ <available file="${mobile.webkit.api.jar}"
property="mobile.webkit.api.jar.exists" />
+ <fail unless="mobile.webkit.api.jar.exists" message="Cannot
find '${mobile.webkit.api.jar}'; perhaps you should run 'ant dist' first!"
/>
+
+ <property name="mobile.webkit.api.pom"
value="${gwt.build.out}/distro-source/pom.xml" />
+ <available file="${mobile.webkit.api.pom}"
property="mobile.webkit.api.pom.exists" />
+ <fail unless="mobile.webkit.api.pom.exists" message="Cannot
find '${mobile.webkit.api.pom}'; perhaps you should run 'ant dist' first!"
/>
+
+ <condition property="exec.cmd" value="cmd.exe"
+ else="/bin/sh">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <condition property="exec.arg" value="/c"
+ else="-c">
+ <isset property="build.host.iswindows" />
+ </condition>
+ <property name="mvn.file" value="-Dfile=${mobile.webkit.api.jar}" />
+ <property name="mvn.pomFile"
value="-DpomFile=${mobile.webkit.api.pom}" />
+ <exec executable="${exec.cmd}">
+ <arg value="${exec.arg}" />
+ <arg value="mvn install:install-file ${mvn.file} ${mvn.pomFile}
-DcreateChecksum=true" />
+ </exec>
+ </target>
+</project>
=======================================
--- /dev/null
+++ /trunk/gwt-mobile-webkit/template/samples/common.ant.xml Sat Jun 25
08:09:38 2011
@@ -0,0 +1,161 @@
+<project name="samples-common">
+ <property name="gwt.root" location="../.." />
+ <property name="project.tail" value="samples/${sample.root}" />
+ <import file="${gwt.root}/common.ant.xml" />
+
+ <!--
+ Number of localworkers for sample compilation. This depends on your
+ hardware, so it's a good candidate to specify in local.ant.properties
+ if this default isn't good for you. Ideally, it should approximate
+ the number of CPU cores in your machine.
+ -->
+ <property name="gwt.samples.localworkers" value="2" />
+
+ <property name="sample.lower" value="${sample.root}" />
+ <property name="sample.upper" value="${sample.module}" />
+
+ <!-- Mirror directory for scripts; makes building distro easier -->
+ <property name="samples.scripts"
value="${gwt.build.out}/samples-scripts" />
+ <!-- Use the uppercase name rather than the lowercase name -->
+ <property name="sample.build"
value="${gwt.build.out}/samples/${sample.upper}" />
+
+ <target name="source" description="Copy source to the output folder">
+ <mkdir dir="${sample.build}/src" />
+ <copy todir="${sample.build}/src">
+ <fileset dir="src" />
+ </copy>
+ <mkdir dir="${sample.build}/war" />
+ <copy todir="${sample.build}/war">
+ <fileset dir="war" excludes="WEB-INF/classes/**"/>
+ </copy>
+ </target>
+
+ <target name="compile" description="Compile all java files">
+ <mkdir dir="${sample.build}/war/WEB-INF/classes" />
+ <gwt.javac destdir="${sample.build}/war/WEB-INF/classes">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ </gwt.javac>
+ </target>
+
+ <target name="gwtc" description="Compile to JavaScript">
+ <condition property="gwt.compile.report" value="-compileReport"
else="">
+ <isset property="is.gwt2" />
+ </condition>
+ <outofdate>
+ <sourcefiles>
+ <fileset dir="src" />
+ <fileset dir="${sample.build}/war/WEB-INF/classes" />
+ <fileset file="${mobile.webkit.api.jar}" />
+ <fileset file="${gwt.user.jar}" />
+ <fileset file="${gwt.dev.jar}" />
+ <fileset file="${gwt.validation.jar}" />
+ <fileset file="${gwt.validation.sources.jar}" />
+ </sourcefiles>
+ <targetfiles
path="${sample.build}/war/${sample.lower}/${sample.lower}.nocache.js" />
+ <sequential>
+ <mkdir dir="${sample.build}/war" />
+ <gwt.timer name="${sample.upper} with ${gwt.samples.localworkers}
localWorkers">
+ <java dir="${sample.build}"
classname="com.google.gwt.dev.Compiler"
classpath="src:${sample.build}/war/WEB-INF/classes:${mobile.webkit.api.jar}:${gwt.user.jar}:${gwt.dev.jar}:${gwt.validation.jar}:${gwt.validation.sources.jar}"
fork="yes" failonerror="true">
+ <jvmarg value="-Xmx256M" />
+ <!--jvmarg
value="-agentlib:jdwp=transport=dt_socket,server=y,address=8000" /-->
+ <arg value="-localWorkers" />
+ <arg value="${gwt.samples.localworkers}" />
+ <arg value="-war" />
+ <arg file="${sample.build}/war" />
+ <arg line="${gwt.compile.report}" />
+ <arg value="-gen" />
+ <arg value=".gwt-gen" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </gwt.timer>
+ <length property="sample.size">
+ <fileset dir="${sample.build}/war/${sample.lower}"
includes="*.cache.html,*.cache.js" />
+ </length>
+ <echo message="output size for ${sample.upper} is ${sample.size}
bytes" />
+ </sequential>
+ </outofdate>
+ </target>
+
+ <target name="scripts" description="Create launch scripts">
+ <mkdir dir="${sample.build}/launch-scripts" />
+ <copy todir="${sample.build}/launch-scripts">
+ <filterset id="scriptfilter">
+ <filter token="ENTRY_MODULE"
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ <filter token="JARNAME" value="gwt-${api.prefix}-${api.name}.jar"
/>
+ <filter token="INDEX_HTML" value="${sample.module}.html" />
+ </filterset>
+ <mapper type="regexp" from="(.*)HelloTemplate(.*)"
to="\1${sample.module}\2" />
+ <fileset dir="${gwt.root}/../shared/templates/shell" />
+ </copy>
+ </target>
+
+ <target name="build" depends="source, compile, gwtc, scripts"
description="Build and package this project" />
+
+ <target name="prepare.hosted" depends="source, compile"
description="Prepares this project for running hosted mode" />
+
+ <target name="checkstyle" description="Static analysis of source">
+ <gwt.checkstyle outputdirectory="${sample.build}">
+ <fileset dir="src" />
+ </gwt.checkstyle>
+ </target>
+
+ <target name="clean" description="Cleans this project's intermediate and
output files">
+ <delete dir="${sample.build}" />
+ <delete includeemptydirs="true">
+ <fileset dir="${samples.scripts}">
+ <include name="*/${sample.upper}/**" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="hosted" description="Run hosted mode">
+ <condition property="hostedmode.class"
value="com.google.gwt.dev.DevMode" else="com.google.gwt.dev.HostedMode">
+ <isset property="is.gwt2" />
+ </condition>
+ <java failonerror="true" fork="true" classname="${hostedmode.class}">
+ <classpath>
+ <pathelement location="src" />
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.user.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ <pathelement location="${gwt.validation.sources.jar}" />
+ </classpath>
+ <jvmarg line="${hostedmode.platform.args}" />
+ <jvmarg value="-Xmx256M" />
+ <!--arg value="-logLevel" />
+ <arg value="INFO" />
+ <arg value="-style" />
+ <arg value="PRETTY" /-->
+ <arg value="-war" />
+ <arg value="${sample.build}/war" />
+ <arg value="-startupUrl" />
+ <arg value="${sample.module}.html" />
+ <arg
value="com.google.code.gwt.${sample.api}.sample.${sample.lower}.${sample.module}"
/>
+ </java>
+ </target>
+
+ <target name="run" description="Run compiled">
+ <java failonerror="true" fork="true"
classname="org.mortbay.jetty.Main">
+ <classpath>
+ <pathelement location="${mobile.webkit.api.jar}" />
+ <pathelement location="${gwt.dev.jar}" />
+ <pathelement location="${gwt.servlet.jar}" />
+ <pathelement location="${gwt.validation.jar}" />
+ </classpath>
+ <jvmarg value="-Xmx256M" />
+ <arg value="8080" />
+ <arg value="-webapp" />
+ <arg value="${sample.build}/war" />
+ </java>
+ </target>
+</project>

Reply all
Reply to author
Forward
0 new messages