Create a gist now

Instantly share code, notes, and snippets.

Embed
Sample build.xml to use oclint for PMD analysis in Jenkins. See the post mentioned in the first comment for details.
<?xml version="1.0" encoding="UTF-8"?>
<project name="fooProject" default="build-fooProject">
<property environment="env"/>
<target name="build-fooProject" depends="prepare,oclint" />
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/oclint" />
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/oclint" />
</target>
<target name="oclint">
<antcall target="xcodebuild-clean" />
<antcall target="xcodebuild" />
<antcall target="oclint-xcodebuild" />
<antcall target="oclint-parse" />
</target>
<target name="xcodebuild-clean">
<exec executable="xcodebuild">
<arg value="-configuration" />
<arg value="Release" />
<arg value="clean" />
</exec>
</target>
<target name="xcodebuild">
<exec executable="xcodebuild" output="xcodebuild.log">
<arg value="-configuration" />
<arg value="Release" />
<arg value="-arch" />
<arg value="armv7" />
<arg value="CODE_SIGN_IDENTITY=" />
<arg value="CODE_SIGNING_REQUIRED=NO" />
</exec>
</target>
<target name="oclint-xcodebuild">
<exec executable="PATH_TO_oclint-release/bin/oclint-xcodebuild" />
</target>
<target name="oclint-parse">
<exec executable="PATH_TO_oclint-release/bin/oclint-json-compilation-database">
<env key="PATH" value="${env.PATH}:PATH_TO_oclint-release/bin/"/>
<arg value="--" />
<arg value="-o=${basedir}/build/oclint/lint.xml" />
<arg value="-report-type=pmd" />
<arg value="-stats" />
</exec>
</target>
</project>
@maplesteve

This comment has been minimized.

Show comment
Hide comment
@maplesteve

maplesteve Mar 10, 2013

Details: blog post

Owner

maplesteve commented Mar 10, 2013

Details: blog post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment