aboutsummaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-07-20 16:24:07 -0700
committerTor Norbye <tnorbye@google.com>2012-07-23 15:36:02 -0700
commita55067435f57c7a25f416ecde509d790a5e0799e (patch)
treed321798bed2dda4a85f31789aa680c47dddebac5 /files
parent08eecafc50dceff0e7eb6960763c2b6ca5601524 (diff)
downloadsdk-a55067435f57c7a25f416ecde509d790a5e0799e.zip
sdk-a55067435f57c7a25f416ecde509d790a5e0799e.tar.gz
sdk-a55067435f57c7a25f416ecde509d790a5e0799e.tar.bz2
Add lint target for ant
Running "ant lint" will now run lint on the project, and dump out the errors to the console as well as also export the errors to lint.xml and lint.html int the bin/ directory. This changeset also modifies the lint CLI to allow multiple simultaneous result reporters - so you don't have to run lint twice in order to get both an .xml and an .html report for example (which is useful when you're running lint on a continuous integration server, and you want the .xml file for the lint plugin trend graph and the html file as a user readable report to click through to from the build page.) Change-Id: Idf8f3f5de0857eb9e7180267a066ae933640682d
Diffstat (limited to 'files')
-rw-r--r--files/ant/build.xml22
1 files changed, 22 insertions, 0 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml
index 1ec0632..769889c 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -77,6 +77,17 @@
<!-- Verbosity -->
<property name="verbose" value="false" />
+ <!-- Output location of the HTML report for the "lint" target.
+ Ideally this would be specified as
+ value="${out.dir}/lint.html"
+ but we can't make a forward reference to the definition for
+ ${out.dir}, and it is not a configurable property (yet).
+ -->
+ <property name="lint.out.html" value="bin/lint.html" />
+
+ <!-- Output location of the XML report for the "lint" target -->
+ <property name="lint.out.xml" value="bin/lint.xml" />
+
<!-- ******************************************************* -->
<!-- ********************* Custom Tasks ******************** -->
<!-- ******************************************************* -->
@@ -138,6 +149,7 @@
<property name="aapt" location="${android.platform.tools.dir}/aapt${exe}" />
<property name="dx" location="${android.platform.tools.dir}/dx${bat}" />
<property name="renderscript" location="${android.platform.tools.dir}/llvm-rs-cc${exe}"/>
+ <property name="lint" location="${android.tools.dir}/lint${bat}" />
<!-- Renderscript include Path -->
<path id="android.renderscript.include.path">
@@ -1275,6 +1287,16 @@
</if>
</target>
+ <!-- ******************************************************* -->
+ <!-- ********** Run Lint on the project ********* -->
+ <!-- ******************************************************* -->
+
+ <target name="lint"
+ description="Runs lint on the project to look for potential bugs" >
+ <lint executable="${lint}"
+ html="${lint.out.html}"
+ xml="${lint.out.xml}" />
+ </target>
<!-- ******************************************************* -->
<!-- ********** Install/uninstall specific targets ********* -->