gwt.team.scottb | ab0aa68 | 2006-12-06 23:14:19 +0000 | [diff] [blame] | 1 | <project name="common">
|
| 2 | <property name="test.ant.file" location="${gwt.root}/${project.tail}/build.xml" />
|
| 3 | <condition property="project.valid">
|
| 4 | <equals arg1="${ant.file}" arg2="${test.ant.file}" />
|
| 5 | </condition>
|
| 6 | <fail unless="project.valid" message="This build file is in an inconsistent state." />
|
| 7 |
|
| 8 | <!-- Global Properties -->
|
| 9 | <property environment="env" />
|
| 10 | <property name="gwt.version" value="${env.GWT_VERSION}" />
|
| 11 | <property name="gwt.tools" location="${env.GWT_TOOLS}" />
|
| 12 | <property name="gwt.tools.lib" location="${gwt.tools}/lib" />
|
| 13 | <property name="gwt.tools.antlib" location="${gwt.tools}/antlib" />
|
| 14 | <property name="gwt.tools.redist" location="${gwt.tools}/redist" />
|
| 15 | <property name="gwt.build" location="${gwt.root}/build" />
|
| 16 | <property name="gwt.build.out" location="${gwt.build}/out" />
|
| 17 | <property name="gwt.build.lib" location="${gwt.build}/lib" />
|
| 18 | <property name="gwt.build.jni" location="${gwt.build}/jni" />
|
| 19 | <property name="gwt.build.staging" location="${gwt.build}/staging" />
|
| 20 | <property name="gwt.build.dist" location="${gwt.build}/dist" />
|
| 21 | <property name="project.build" location="${gwt.build.out}/${project.tail}" />
|
| 22 | <property name="project.lib" location="${gwt.build.lib}/gwt-${ant.project.name}.jar" />
|
| 23 | <property name="project.jni" location="${gwt.build}/${project.tail}" />
|
| 24 | <property name="unjar.out" location="${project.build}/unjar" />
|
| 25 | <property name="javac.out" location="${project.build}/bin" />
|
| 26 | <property name="javac.debug" value="true" />
|
| 27 | <property name="javac.debuglevel" value="lines,vars,source" />
|
| 28 | <property name="javac.source" value="1.4" />
|
| 29 | <property name="javac.nowarn" value="true" />
|
| 30 |
|
gwt.team.scottb | 35e9b0e | 2006-12-06 23:38:46 +0000 | [diff] [blame] | 31 | <!-- Sanity check -->
|
| 32 | <available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
|
| 33 | <fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}' tools directory; perhaps you should define the GWT_TOOLS environment variable" />
|
| 34 |
|
gwt.team.scottb | ab0aa68 | 2006-12-06 23:14:19 +0000 | [diff] [blame] | 35 | <!-- Global Custom Tasks -->
|
| 36 | <presetdef name="gwt.javac">
|
| 37 | <javac srcdir="src" destdir="${javac.out}" classpath="${unjar.out}" debug="${javac.debug}" debuglevel="${javac.debuglevel}" source="${javac.source}" nowarn="${javac.nowarn}" />
|
| 38 | </presetdef>
|
| 39 |
|
| 40 | <presetdef name="gwt.jar">
|
| 41 | <jar destfile="${project.lib}" update="true" duplicate="preserve" index="true" />
|
| 42 | </presetdef>
|
| 43 |
|
| 44 | <macrodef name="gwt.untar">
|
| 45 | <attribute name="src" />
|
| 46 | <attribute name="dest" />
|
| 47 | <sequential>
|
| 48 | <!-- GNU tar handles permissions and symlinks correctly -->
|
| 49 | <exec executable="tar" failonerror="true">
|
| 50 | <arg value="-xpzf" />
|
| 51 | <arg file="@{src}" />
|
| 52 | <arg value="-C" />
|
| 53 | <arg file="@{dest}" />
|
| 54 | </exec>
|
| 55 | </sequential>
|
| 56 | </macrodef>
|
| 57 |
|
gwt.team.scottb | 35e9b0e | 2006-12-06 23:38:46 +0000 | [diff] [blame] | 58 | <target name="antcall.unjar.maybe" unless="unjar.upToDate">
|
gwt.team.scottb | ab0aa68 | 2006-12-06 23:14:19 +0000 | [diff] [blame] | 59 | <mkdir dir="${unjar.out}" />
|
| 60 | <unjar src="${unjar.path}" dest="${unjar.out}" overwrite="true" />
|
| 61 | <touch file="${unjar.flagFile}" />
|
| 62 | </target>
|
| 63 |
|
| 64 | <target name="antcall.unjar">
|
| 65 | <basename property="unjar.name" file="${unjar.path}" />
|
| 66 | <property name="unjar.flagFile" value="${project.build}/${unjar.name}.unjar" />
|
| 67 | <uptodate property="unjar.upToDate" srcfile="${unjar.path}" targetfile="${unjar.flagFile}" />
|
| 68 | <antcall target="antcall.unjar.maybe" />
|
| 69 | </target>
|
| 70 |
|
| 71 | <macrodef name="gwt.unjar">
|
| 72 | <attribute name="toollib" default="" />
|
| 73 | <attribute name="path" default="${gwt.tools.lib}/@{toollib}" />
|
| 74 | <sequential>
|
| 75 | <antcall target="antcall.unjar">
|
| 76 | <param name="unjar.path" value="@{path}" />
|
| 77 | </antcall>
|
| 78 | </sequential>
|
| 79 | </macrodef>
|
| 80 |
|
| 81 | <macrodef name="property.ensure">
|
| 82 | <attribute name="name" />
|
| 83 | <attribute name="location" />
|
| 84 | <sequential>
|
| 85 | <property name="@{name}" location="@{location}" />
|
| 86 | <available file="${@{name}}" property="@{name}.exists" />
|
| 87 | <fail unless="@{name}.exists" message="Cannot find dependency ${@{name}}" />
|
| 88 | </sequential>
|
| 89 | </macrodef>
|
| 90 |
|
gwt.team.bruce | 672efb5 | 2006-12-08 15:38:58 +0000 | [diff] [blame^] | 91 | <macrodef name="gwt.checkstyle">
|
| 92 | <element name="sourcepath" implicit="yes" optional="true"/>
|
| 93 | <sequential>
|
| 94 | <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar" />
|
| 95 | <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwtCheckStyle.xml" maxWarnings="0">
|
| 96 | <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" />
|
| 97 | <sourcepath />
|
| 98 | </checkstyle>
|
| 99 | </sequential>
|
| 100 | </macrodef>
|
gwt.team.scottb | 36f322f | 2006-12-07 19:49:22 +0000 | [diff] [blame] | 101 |
|
| 102 | <!-- Default implementations of the required targets; projects should
|
| 103 | override the ones that matter -->
|
| 104 | <target name="all" depends="verify" />
|
| 105 | <target name="verify" depends="checkstyle, test" description="Verify this project" />
|
| 106 | <target name="checkstyle" description="Static analysis of source" />
|
| 107 | <target name="test" depends="build" description="Test this project" />
|
| 108 | <target name="build" description="Build and (maybe) package this project" />
|
| 109 |
|
| 110 | <target name="clean" description="Cleans this project's intermediate and output files">
|
| 111 | <delete dir="${project.build}" />
|
| 112 | </target>
|
| 113 |
|
gwt.team.scottb | ab0aa68 | 2006-12-06 23:14:19 +0000 | [diff] [blame] | 114 | </project>
|