Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2013 18:35
Show Gist options
  • 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 name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/oclint" />
<target name="oclint">
<antcall target="xcodebuild-clean" />
<antcall target="xcodebuild" />
<antcall target="oclint-xcodebuild" />
<antcall target="oclint-parse" />
<target name="xcodebuild-clean">
<exec executable="xcodebuild">
<arg value="-configuration" />
<arg value="Release" />
<arg value="clean" />
<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=" />
<target name="oclint-xcodebuild">
<exec executable="PATH_TO_oclint-release/bin/oclint-xcodebuild" />
<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" />
Copy link

Details: blog post

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