| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ****************************************************************************** |
| * Copyright (c) 2008, 2010 VMware Inc. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * VMware Inc. - initial contribution |
| ****************************************************************************** |
| --> |
| <project name="quality-multi-bundle" xmlns:ivy="antlib:org.apache.ivy.ant"> |
| |
| <import file="common.xml"/> |
| |
| <!-- Main targets --> |
| <target name="test" depends="jar, test.pre, test.do, test.post" |
| description="Executes all tests resulting from a compilation of the test tree returning test success metrics."/> |
| |
| <target name="clover" depends="clover.pre, clover.do, clover.post" |
| description="Executes all tests resulting from a compilation of the test tree returning test coverage metrics."/> |
| |
| <target name="findbugs" depends="findbugs.pre, findbugs.do" |
| description="Checks all code from the source tree for bugs."/> |
| |
| <target name="osgi-validate" |
| description="Checks all code from the source tree for bugs."> |
| <all-bundles target="osgi-validate"/> |
| </target> |
| |
| <target name="report" depends="ivy.init" description="Produce a HTML formatted report about all the dependancies and sub-dependancies of this build"> |
| <all-bundles target="report" > |
| <property name="ivy.report.todir" value="${ivy.report.todir}" /> |
| </all-bundles> |
| </target> |
| |
| <!-- Other targets --> |
| <target name="test.pre"> |
| <delete quiet="true" dir="${test-results.output.dir}"/> |
| <mkdir dir="${test-results.output.dir}/xml"/> |
| </target> |
| |
| <target name="test.do"> |
| <all-bundles-exec target="test.do" exec-ant-args="-Dtest-results.output.dir=${test-results.output.dir}"> |
| <!-- <property name="test-results.output.dir" value="${test-results.output.dir}"/> --> |
| </all-bundles-exec> |
| </target> |
| |
| <target name="test.post"> |
| <mkdir dir="${test-results.output.dir}/html"/> |
| <junitreport> |
| <fileset dir="${test-results.output.dir}/xml" erroronmissingdir="false"/> |
| <report format="frames" todir="${test-results.output.dir}/html"/> |
| </junitreport> |
| <delete file="TESTS-TestSuites.xml"/> |
| </target> |
| |
| <target name="clover.init" depends="ivy.init"> |
| <ivy:cachepath resolveId="clover.classpath" pathid="clover.classpath" organisation="com.atlassian.clover" |
| module="com.springsource.com.cenqua.clover" revision="${com.springsource.com.cenqua.clover.version}" |
| conf="runtime" type="jar" inline="true" log="download-only"/> |
| <taskdef resource="cloverlib.xml" classpathref="clover.classpath"/> |
| </target> |
| |
| <target name="clover.pre" depends="clover.init"> |
| <delete dir="${clover.output.dir}" quiet="true"/> |
| <mkdir dir="${clover.db.dir}"/> |
| </target> |
| |
| <target name="clover.do"> |
| <condition property="has.unit.test.bundles"> |
| <isreference refid="unit.test.bundles" /> |
| </condition> |
| <antcall target="clover.do.unit"/> |
| <antcall target="clover.do.all" /> |
| </target> |
| |
| <target name="clover.do.unit" if="has.unit.test.bundles"> |
| <all-bundles target="clover" buildpathRef="unit.test.bundles"/> |
| </target> |
| |
| <target name="clover.do.all" unless="has.unit.test.bundles"> |
| <all-bundles target="clover" buildpathRef="bundles"/> |
| </target> |
| |
| <target name="clover.post" depends="clover.init"> |
| <clover-merge initString="${clover.db.file}"> |
| <cloverDbSet dir="${basedir}/.." span="30m"> |
| <include name="**/target/clover/db/clover.db"/> |
| </cloverDbSet> |
| </clover-merge> |
| <clover-report initstring="${clover.db.file}"> |
| <current outfile="${clover.output.dir}/clover.xml" span="30m"> |
| <format type="xml"/> |
| <testsources dir=".."> |
| <include name="**/src/test/java/**/*.java"/> |
| <include name="**/src/test/java/*.java"/> |
| </testsources> |
| </current> |
| </clover-report> |
| <clover-report initstring="${clover.db.file}"> |
| <current outfile="${clover.output.dir}/html" span="30m"> |
| <format type="html"/> |
| <testsources dir=".."> |
| <include name="**/src/test/java/**/*.java"/> |
| <include name="**/src/test/java/*.java"/> |
| </testsources> |
| </current> |
| </clover-report> |
| <clover-report initstring="${clover.db.file}"> |
| <current outfile="${clover.output.dir}/clover.pdf" summary="true" span="30m"> |
| <format type="pdf"/> |
| <testsources dir=".."> |
| <include name="**/src/test/java/**/*.java"/> |
| <include name="**/src/test/java/*.java"/> |
| </testsources> |
| </current> |
| </clover-report> |
| <clover-check initstring="${clover.db.file}" target="${clover.coverage}" haltOnFailure="${clover.enforce}" |
| span="30m"> |
| <testsources dir=".."> |
| <include name="**/src/test/java/**/*.java"/> |
| <include name="**/src/test/java/*.java"/> |
| </testsources> |
| </clover-check> |
| </target> |
| |
| <target name="findbugs.pre"> |
| <delete dir="${findbugs.output.dir}" quiet="true"/> |
| <mkdir dir="${findbugs.output.dir}"/> |
| </target> |
| |
| <target name="findbugs.do"> |
| <all-bundles target="findbugs.do"> |
| <property name="findbugs.output.dir" value="${findbugs.output.dir}"/> |
| </all-bundles> |
| </target> |
| |
| </project> |