Skip to content

Instantly share code, notes, and snippets.

@maplesteve
Created March 10, 2013 18:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maplesteve/5129782 to your computer and use it in GitHub Desktop.
Save maplesteve/5129782 to your computer and use it in GitHub Desktop.
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
Copy link
Author

Details: blog post

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