Added build tools compilation to the dependency chain and added checkstyle targets that include our custom checks (e.g. sort order)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@59 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/build-tools/customchecks/build.xml b/build-tools/customchecks/build.xml
index 89c2017..9452789 100644
--- a/build-tools/customchecks/build.xml
+++ b/build-tools/customchecks/build.xml
@@ -3,7 +3,7 @@
<property name="project.tail" value="build-tools/customchecks" />
<import file="${gwt.root}/common.ant.xml" />
- <target name="build" description="Compiles this project">
+ <target name="compile" description="Compiles this project">
<mkdir dir="${javac.out}" />
<gwt.javac>
<classpath>
@@ -12,7 +12,7 @@
</gwt.javac>
</target>
- <target name="package" depends="build" description="Packages this project into a jar">
+ <target name="build" depends="compile" description="Packages this project into a jar">
<mkdir dir="${gwt.build.lib}" />
<gwt.jar>
<fileset dir="src" />
@@ -20,8 +20,8 @@
</gwt.jar>
</target>
- <target name="checkstyle" description="Static analysis of source">
- <gwt.checkstyle />
+ <target name="checkstyle">
+ <!-- NOTE: This project doesn't have the checkstyle rule since it participates in bootstrapping. -->
</target>
<target name="clean" description="Cleans this project's intermediate and output files">
diff --git a/build-tools/doctool/build.xml b/build-tools/doctool/build.xml
index 888e97c..53addd6 100644
--- a/build-tools/doctool/build.xml
+++ b/build-tools/doctool/build.xml
@@ -3,7 +3,7 @@
<property name="project.tail" value="build-tools/doctool" />
<import file="${gwt.root}/common.ant.xml" />
- <target name="build" description="Compiles this project">
+ <target name="compile" description="Compiles this project">
<mkdir dir="${javac.out}" />
<gwt.javac>
<classpath>
@@ -12,7 +12,7 @@
</gwt.javac>
</target>
- <target name="package" depends="build" description="Packages this project into a jar">
+ <target name="build" depends="compile" description="Packages this project into a jar">
<mkdir dir="${gwt.build.lib}" />
<gwt.jar>
<fileset dir="src" />
@@ -21,7 +21,9 @@
</target>
<target name="checkstyle" description="Static analysis of source">
- <gwt.checkstyle />
+ <gwt.checkstyle>
+ <fileset dir="src" />
+ </gwt.checkstyle>
</target>
<target name="clean" description="Cleans this project's intermediate and output files">
diff --git a/build.xml b/build.xml
index fc48e3b..068eb0a 100755
--- a/build.xml
+++ b/build.xml
@@ -10,15 +10,15 @@
<ant dir="distro-source" inheritall="false" target="${target}" />
</target>
- <target name="dev" description="Run dev">
+ <target name="dev" depends="buildtools" description="Run dev">
<ant dir="dev" inheritall="false" target="${target}" />
</target>
- <target name="user" depends="dev" description="Run user">
+ <target name="user" depends="buildtools, dev" description="Run user">
<ant dir="user" inheritall="false" target="${target}" />
</target>
- <target name="servlet" depends="user" description="Run servlet">
+ <target name="servlet" depends="buildtools, user" description="Run servlet">
<ant dir="servlet" inheritall="false" target="${target}" />
</target>
@@ -26,6 +26,10 @@
<ant dir="jni" inheritall="false" target="${target}" />
</target>
+ <target name="buildtools" description="Build the build tools">
+ <ant dir="build-tools" inheritall="false" target="${target}" />
+ </target>
+
<target name="-do" depends="dist" description="Run all subprojects"/>
<target name="build" description="Builds GWT">
diff --git a/common.ant.xml b/common.ant.xml
index b4a5dfb..795a29b 100755
--- a/common.ant.xml
+++ b/common.ant.xml
@@ -32,9 +32,6 @@
<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" />
- <!-- Plug-in Tasks -->
- <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar" />
-
<!-- Global Custom Tasks -->
<presetdef name="gwt.javac">
<javac srcdir="src" destdir="${javac.out}" classpath="${unjar.out}" debug="${javac.debug}" debuglevel="${javac.debuglevel}" source="${javac.source}" nowarn="${javac.nowarn}" />
@@ -91,17 +88,16 @@
</sequential>
</macrodef>
- <presetdef name="gwt.checkstyle">
- <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwtCheckStyle.xml" maxWarnings="0">
- <fileset dir="src" />
- <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" />
-
- <!-- Location of cache-file if we decide to try turning it on -->
- <!--
- <property key="checkstyle.cache.file" file="target/cachefile" />
- -->
- </checkstyle>
- </presetdef>
+ <macrodef name="gwt.checkstyle">
+ <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" />
+ <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwtCheckStyle.xml" maxWarnings="0">
+ <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" />
+ <sourcepath />
+ </checkstyle>
+ </sequential>
+ </macrodef>
<!-- Default implementations of the required targets; projects should
override the ones that matter -->
diff --git a/dev/core/build.xml b/dev/core/build.xml
index 6e13110..f1e1186 100755
--- a/dev/core/build.xml
+++ b/dev/core/build.xml
@@ -61,8 +61,23 @@
<target name="checkstyle" description="Static analysis of source">
<gwt.checkstyle>
- <fileset dir="super/com/google/gwt/dev/jjs/intrinsic"/>
+ <fileset dir="src">
+ <filename name="com/google/gwt/dev/js/rhino/**/*.java" negate="yes" />
+ <filename name="org/eclipse/**/*.java" negate="yes" />
+ <filename name="org/apache/**/*.java" negate="yes" />
+
+ <!-- TODO: fix styles on these files -->
+ <filename name="com/google/gwt/dev/**/*.java" negate="yes" />
+ <filename name="com/google/gwt/core/ext/**/*.java" negate="yes" />
+ </fileset>
</gwt.checkstyle>
+
+ <!-- TODO: fix styles on these files -->
+ <!--
+ <gwt.checkstyle>
+ <fileset dir="super/com/google/gwt/dev/jjs/intrinsic" />
+ </gwt.checkstyle>
+ -->
</target>
<target name="clean" description="Cleans this project's intermediate and output files">