blob: 8a3f45c02e7faa51868e980306b5d669aea21f73 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009, 2010 Mountainminds GmbH & Co. KG and Contributors
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:
Marc R. Hoffmann - initial API and implementation
$Id: $
-->
<project name="org.jacoco.build.all" default="rebuild" basedir=".">
<description>
This is the main build file for the JaCoCo build.
</description>
<property name="target.name" value="default"/>
<import file="target_${target.name}.xml"/>
<property name="workspace.dir" location=".."/>
<property name="result.dir" location="./result"/>
<property name="result.dist.dir" location="${result.dir}/dist"/>
<property name="result.dist.lib.dir" location="${result.dist.dir}/lib"/>
<property name="result.dist.doc.dir" location="${result.dist.dir}/doc"/>
<property name="result.dist.test.dir" location="${result.dist.dir}/test"/>
<property name="result.dist.coverage.dir" location="${result.dist.dir}/coverage"/>
<property name="result.tmp.dir" location="${result.dir}/tmp"/>
<property name="jacoco.home.url" value="http://www.eclemma.org/jacoco"/>
<property name="copyright.years" value="2009, 2010"/>
<property name="sign.keystore.alias" value="mtnminds"/>
<property name="sign.tsa.url" value="https://timestamp.geotrust.com/tsa"/>
<property name="sign.tsa.cert" value="mtnminds"/>
<tstamp>
<format property="build.date" pattern="yyyy/MM/dd" timezone="GMT+0"/>
<format property="build.qualifier" pattern="yyyyMMddHHmmss" timezone="GMT+0"/>
</tstamp>
<macrodef name="runbundlebuild">
<attribute name="bundleid"/>
<attribute name="target"/>
<sequential>
<echo level="info">Building @{bundleid} (@{target})</echo>
<ant antfile="buildbundle.xml" target="@{target}" inheritall="true" inheritrefs="true">
<property name="source.bundle.dir" location="${workspace.dir}/@{bundleid}"/>
<property name="result.tmp.bundle.dir" location="${result.tmp.dir}/@{bundleid}"/>
<property name="result.dist.doc.bundle.dir" location="${result.dist.doc.dir}/@{bundleid}"/>
<property name="jacoco.home.url" value="${jacoco.home.url}"/>
</ant>
<path id="bundle-@{bundleid}" location="${result.tmp.dir}/@{bundleid}/classes"/>
<property name="source.@{bundleid}.dir" location="${workspace.dir}/@{bundleid}"/>
<property name="result.tmp.@{bundleid}.dir" location="${result.tmp.dir}/@{bundleid}"/>
</sequential>
</macrodef>
<macrodef name="runallbundlebuilds">
<attribute name="target"/>
<sequential>
<!-- Build tools -->
<runbundlebuild bundleid="org.jacoco.build" target="@{target}"/>
<!-- Implementation -->
<runbundlebuild bundleid="org.jacoco.core" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.agent.rt" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.agent" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.report" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.ant" target="@{target}"/>
<!-- Examples -->
<runbundlebuild bundleid="org.jacoco.examples" target="@{target}"/>
<!-- Tests -->
<runbundlebuild bundleid="org.jacoco.core.test" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.agent.rt.test" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.agent.test" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.report.test" target="@{target}"/>
<runbundlebuild bundleid="org.jacoco.ant.test" target="@{target}"/>
<!-- Documentation -->
<runbundlebuild bundleid="org.jacoco.doc" target="@{target}"/>
</sequential>
</macrodef>
<target name="clean">
<delete dir="${result.dir}" quiet="false" failonerror="true"/>
</target>
<target name="compile">
<runallbundlebuilds target="compile"/>
</target>
<target name="package">
<runallbundlebuilds target="package"/>
</target>
<target name="verify">
<runallbundlebuilds target="verify"/>
</target>
<target name="doc">
<runallbundlebuilds target="doc"/>
</target>
<target name="legal">
<runallbundlebuilds target="legal"/>
</target>
<target name="build">
<runallbundlebuilds target="build"/>
</target>
<target name="rebuild" depends="clean,build"/>
<target name="deliver" depends="clean">
<fail message="JaCoCo delivery only allowed with default target.">
<condition>
<not>
<equals arg1="${target.name}" arg2="default"/>
</not>
</condition>
</fail>
<fail message="Please specify property 'sign.keystore.file'" unless="sign.keystore.file"/>
<input addproperty="sign.keystore.password">Keystore password:</input>
<runallbundlebuilds target="deliver"/>
<property prefix="core.manifest." file="${result.tmp.dir}/org.jacoco.core/MANIFEST.MF"/>
<property name="result.zip.file" location="${result.dir}/jacoco-${core.manifest.Bundle-Version}.zip"/>
<zip destfile="${result.zip.file}" level="9">
<fileset dir="${result.dist.dir}" includes="**/*"/>
</zip>
<checksum file="${result.zip.file}" format="MD5SUM"/>
</target>
</project>