Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2010-04-23 10:29:10 -0400
committerGlyn Normington2010-04-23 10:29:10 -0400
commit83c941f667ce076ae273e1b169304bbdc5795212 (patch)
treed8444aefe5c6aa974a6786e18eb8a22bc114b40f /common/quality.xml
downloadorg.eclipse.virgo.virgo-build-83c941f667ce076ae273e1b169304bbdc5795212.tar.gz
org.eclipse.virgo.virgo-build-83c941f667ce076ae273e1b169304bbdc5795212.tar.xz
org.eclipse.virgo.virgo-build-83c941f667ce076ae273e1b169304bbdc5795212.zip
[bug 307629] initial check-in based on dm Server Virgo virgo-build at ecdc38e1579879690c2916569b12ad0ba5a6acc0
Diffstat (limited to 'common/quality.xml')
-rw-r--r--common/quality.xml274
1 files changed, 274 insertions, 0 deletions
diff --git a/common/quality.xml b/common/quality.xml
new file mode 100644
index 0000000..9852041
--- /dev/null
+++ b/common/quality.xml
@@ -0,0 +1,274 @@
+<?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-common" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:osgi="antlib:org.springframework.build.osgi">
+
+<!-- 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" depends="ivy.init, osgi.init" description="Validates that a bundle can resolve against it's dependencies.">
+ <ivy:cachepath resolveId="osgi.optional.classpath" pathid="osgi.optional.classpath"
+ conf="compile,optional,provided,server-provided" type="jar" log="download-only"/>
+ <osgi:validate bundlePath="${jar.output.file}">
+ <equinoxPath refid="equinox.classpath"/>
+ <supportingBundlesPath refid="osgi.optional.classpath"/>
+ </osgi:validate>
+
+ <ivy:cachepath resolveId="osgi.compile.classpath" pathid="osgi.compile.classpath"
+ conf="compile,provided,server-provided" type="jar" log="download-only"/>
+ <osgi:validate bundlePath="${jar.output.file}">
+ <equinoxPath refid="equinox.classpath"/>
+ <supportingBundlesPath refid="osgi.compile.classpath"/>
+ </osgi:validate>
+ </target>
+
+ <target name="report" depends="ivy.init, resolve" description="Produce a HTML formatted report about all the dependencies and sub-dependencies of this build">
+ <mkdir dir="${ivy.report.todir}" />
+ <ivy:report conf="test, runtime, optional, provided, server-provided, aspects, external, additional" graph="false" xml="true"/>
+ </target>
+
+<!-- Other targets -->
+ <target name="test.pre" depends="test.init" if="test.exists">
+ <delete dir="${test-results.output.dir}" quiet="true"/>
+ <mkdir dir="${test-results.output.dir}/xml"/>
+ </target>
+
+ <target name="test.do" depends="ivy.init, resolve.test, compile.init, test.init" if="test.exists">
+ <path id="test.compile.classpath">
+ <pathelement location="${jar.output.file}"/>
+ <path refid="compile.classpath"/>
+ <path refid="test.classpath"/>
+ </path>
+ <test-compile classpath.id="test.compile.classpath" input.dir="${test.java.dir}" output.dir="${test.output.dir}"
+ resources.dir="${test.resources.dir}"/>
+
+ <path id="test.run.classpath">
+ <pathelement location="${jar.output.file}"/>
+ <pathelement location="${test.output.dir}"/>
+ <path refid="compile.classpath"/>
+ <path refid="test.classpath"/>
+ <path refid="runtime.classpath"/>
+ </path>
+ <test-run classpath.id="test.run.classpath"/>
+ </target>
+
+ <target name="test.post" depends="test.init" if="test.exists">
+ <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">
+ <delete dir="${clover.output.dir}" quiet="true"/>
+ <mkdir dir="${clover.output.dir}"/>
+ </target>
+
+ <target name="clover.do" depends="ivy.init, resolve.test, compile.init, clover.instrument, test.init"
+ if="test.exists">
+ <path id="test.compile.classpath">
+ <pathelement location="${main.output.dir}"/>
+ <path refid="compile.classpath" />
+ <path refid="test.classpath"/>
+ </path>
+
+ <path id="clover.run.classpath">
+ <pathelement location="${main.output.dir}"/>
+ <pathelement location="${test.output.dir}"/>
+ <path refid="clover.classpath"/>
+ <path refid="compile.classpath"/>
+ <path refid="test.classpath"/>
+ <path refid="runtime.classpath"/>
+ </path>
+ <test-run classpath.id="clover.run.classpath"/>
+ </target>
+
+ <target name="clover.instrument" depends="ivy.init, resolve.test, compile.init, clover.init">
+ <instrument input.dir="${main.java.dir}" output.dir="${main.clover.dir}"/>
+ <path id="clover.compile.classpath">
+ <path refid="clover.classpath"/>
+ <path refid="compile.classpath"/>
+ </path>
+ <compile classpath.id="clover.compile.classpath" input.dir="${main.clover.dir}" output.dir="${main.output.dir}"
+ resources.dir="${main.resources.dir}"/>
+
+ <instrument input.dir="${test.java.dir}" output.dir="${test.clover.dir}"/>
+ <path id="test.compile.classpath">
+ <pathelement location="${main.output.dir}"/>
+ <path refid="clover.classpath"/>
+ <path refid="compile.classpath"/>
+ <path refid="test.classpath"/>
+ </path>
+ <test-compile classpath.id="test.compile.classpath" input.dir="${test.clover.dir}" output.dir="${test.output.dir}"
+ resources.dir="${test.resources.dir}"/>
+ <delete dir="${clover.staging.dir}" quiet="true"/>
+ </target>
+
+ <target name="clover.post" depends="clover.init">
+ <clover-report initstring="${clover.db.file}">
+ <current outfile="${clover.output.dir}/clover.xml">
+ <format type="xml"/>
+ <testsources dir="${test.java.dir}">
+ <include name="**/*.java"/>
+ <include name="*.java"/>
+ </testsources>
+ </current>
+ </clover-report>
+ <clover-report initstring="${clover.db.file}">
+ <current outfile="${clover.output.dir}/html">
+ <format type="html"/>
+ <testsources dir="${test.java.dir}">
+ <include name="**/*.java"/>
+ <include name="*.java"/>
+ </testsources>
+ </current>
+ </clover-report>
+ <clover-report initstring="${clover.db.file}">
+ <current outfile="${clover.output.dir}/clover.pdf" summary="true">
+ <format type="pdf"/>
+ <testsources dir="${test.java.dir}">
+ <include name="**/*.java"/>
+ <include name="*.java"/>
+ </testsources>
+ </current>
+ </clover-report>
+ <clover-check initstring="${clover.db.file}" target="${clover.coverage}" haltOnFailure="${clover.enforce}">
+ <testsources dir="${test.java.dir}">
+ <include name="**/*.java"/>
+ <include name="*.java"/>
+ </testsources>
+ </clover-check>
+ </target>
+
+ <target name="findbugs.init" depends="ivy.init, findbugs.download">
+ <ivy:cachepath resolveId="findbugs.classpath" pathid="findbugs.classpath" organisation="edu.umd.cs.findbugs"
+ module="com.springsource.edu.umd.cs.findbugs.ant" revision="${edu.umd.cs.findbugs.version}"
+ conf="runtime" type="jar" inline="true" log="download-only"/>
+ <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
+ classpathref="findbugs.classpath"/>
+ </target>
+
+ <target name="findbugs.download" depends="findbugs.download.init" if="findbugs.download.needed">
+ <ivy:cachepath resolveId="findbugs" pathid="findbugs" organisation="edu.umd.cs.findbugs"
+ module="edu.umd.cs.findbugs.dist" revision="${edu.umd.cs.findbugs.version}" conf="runtime" type="zip"
+ inline="true" log="download-only"/>
+ <unzip dest="${findbugs.dir}">
+ <path refid="findbugs"/>
+ <globmapper from="findbugs-${edu.umd.cs.findbugs.version}/*" to="*"/>
+ </unzip>
+ </target>
+
+ <target name="findbugs.download.init">
+ <condition property="findbugs.download.needed">
+ <not>
+ <available file="${findbugs.dir}" type="dir"/>
+ </not>
+ </condition>
+ </target>
+
+ <target name="findbugs.pre" depends="src.init" if="src.exists">
+ <delete dir="${findbugs.output.dir}" quiet="true"/>
+ <mkdir dir="${findbugs.output.dir}"/>
+ </target>
+
+ <target name="findbugs.do" depends="ivy.init, resolve.compile, compile.init, findbugs.init, src.init" if="src.exists">
+ <findbugs home="${findbugs.dir}" output="xml" outputFile="${findbugs.output.file}"
+ excludeFilter="${findbugs.exclude.file}" jvmargs="-Xmx1024M" errorProperty="findbugs.errors" warningsProperty="findbugs.warnings">
+ <class location="${main.output.dir}"/>
+ <auxClasspath>
+ <!-- Require something to always be in this classpath so findbugs on windows runs -->
+ <path location="." />
+ <path refid="compile.classpath"/>
+ </auxClasspath>
+ <sourcepath location="${main.java.dir}"/>
+ </findbugs>
+ <antcall target="findbugs.post"/>
+ </target>
+
+ <target name="findbugs.post" if="findbugs.enforce">
+ <fail if="findbugs.errors" message="FindBugs errors found"/>
+ <fail if="findbugs.warnings" message="FindBugs warnings found"/>
+ </target>
+
+ <target name="osgi.init" depends="ivy.init">
+ <ivy:cachepath resolveId="equinox.classpath" pathid="equinox.classpath" organisation="org.eclipse.osgi"
+ module="org.eclipse.osgi" revision="${org.eclipse.osgi.version}" type="jar" inline="true"
+ log="download-only"/>
+ <ivy:cachepath resolveId="ant.osgi.classpath" pathid="ant.osgi.classpath"
+ organisation="org.springframework.build" module="org.springframework.build.osgi"
+ revision="${org.springframework.build.osgi.version}" conf="runtime" type="jar" inline="true"
+ log="download-only"/>
+ <taskdef resource="org/springframework/build/osgi/antlib.xml" uri="antlib:org.springframework.build.osgi"
+ classpathref="ant.osgi.classpath"/>
+ </target>
+
+<!-- Macros -->
+ <macrodef name="test-run">
+ <attribute name="classpath.id"/>
+ <sequential>
+ <condition property="test.halt" value="false" else="true">
+ <istrue value="${ci.build}"/>
+ </condition>
+ <mkdir dir="${test-results.output.dir}/xml"/>
+ <junit forkmode="${test.forkmode}" dir="${basedir}" haltonerror="${test.halt}" haltonfailure="${test.halt}">
+ <jvmarg line="${test.vm.args}"/>
+ <syspropertyset>
+ <propertyref builtin="commandline"/>
+ </syspropertyset>
+ <classpath refid="@{classpath.id}"/>
+ <test fork="yes" todir="${test-results.output.dir}/xml" name="${testcase}" if="testcase"/>
+ <batchtest fork="yes" todir="${test-results.output.dir}/xml" unless="testcase">
+ <fileset dir="${test.output.dir}" erroronmissingdir="false">
+ <include name="**/*Test.class"/>
+ <include name="**/*Tests.class"/>
+ <exclude name="**/Abstract*.class"/>
+ </fileset>
+ </batchtest>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ </junit>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="instrument">
+ <attribute name="input.dir"/>
+ <attribute name="output.dir"/>
+ <sequential>
+ <clover-instr initstring="${clover.db.file}" destdir="@{output.dir}">
+ <fileset dir="@{input.dir}" erroronmissingdir="false">
+ <include name="**/*.java"/>
+ <include name="*.java"/>
+ </fileset>
+ </clover-instr>
+ <copy todir="@{output.dir}">
+ <fileset dir="@{input.dir}" erroronmissingdir="false">
+ <exclude name="**/*.java"/>
+ <exclude name="*.java"/>
+ </fileset>
+ </copy>
+ </sequential>
+ </macrodef>
+</project>

Back to the top