blob: 6803fa96732e85534b425eba9e0e90d79a2fe7f3 [file] [log] [blame]
<?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="common-multi-bundle" xmlns:ivy="antlib:org.apache.ivy.ant">
<tstamp>
<format property="timestamp" pattern="yyyyMMddHHmmss" timezone="GMT"/>
</tstamp>
<!-- Properties -->
<dirname property="virgo.build.dir" file="${ant.file.common-multi-bundle}/.."/>
<property file="${virgo.build.dir}/common/common.properties"/>
<!-- Global targets -->
<condition property="adjusted.release.type" value="snapshot" else="${release.type}">
<equals arg1="integration" arg2="${release.type}"/>
</condition>
<target name="resolve"
description="Resolve the dependencies of all artifacts">
<all-bundles target="resolve"/>
</target>
<target name="set-hudson-proxy" description="Sets the jets3t property file to proxy settings from env variables.">
<fail unless="http.proxyHost">Property 'http.proxyHost' is not set for set-hudson-proxy target.</fail>
<fail unless="http.proxyPort">Property 'http.proxyPort' is not set for set-hudson-proxy target.</fail>
<echo file="../virgo-build/lib/ivy/jets3t.properties"># Hudson Generated Proxy Configuration
httpclient.proxy-autodetect=false
httpclient.proxy-host=${http.proxyHost}
httpclient.proxy-port=${http.proxyPort}
</echo>
</target>
<target name="check-proxy" description="Checks that proxy properties are set before proceeding -- fails with diagnosis otherwise.">
<condition property="check-proxy.hostAndPortBothNotSet">
<and>
<not><isset property="http.proxyHost"/></not>
<not><isset property="http.proxyPort"/></not>
</and>
</condition>
<fail if="check-proxy.hostAndPortBothNotSet">Properties 'http.proxyHost' and 'http.proxyPort' are both not set.</fail>
<condition property="check-proxy.hostSetOnly">
<and>
<isset property="http.proxyHost"/>
<not><isset property="http.proxyPort"/></not>
</and>
</condition>
<fail if="check-proxy.hostSetOnly">Property 'http.proxyHost' set to '${http.proxyHost}' but 'http.proxyPort' not set.</fail>
<condition property="check-proxy.portSetOnly">
<and>
<isset property="http.proxyPort"/>
<not><isset property="http.proxyHost"/></not>
</and>
</condition>
<fail if="check-proxy.portSetOnly">Property 'http.proxyPort' set to '${http.proxyPort}' but 'http.proxyHost' not set.</fail>
<echo>Property 'http.proxyHost' is set to '${http.proxyHost}' and property 'http.proxyPort' is set to '${http.proxyPort}'.</echo>
</target>
<target name="diagnostics" description="diagnostics">
<sequential>
<echo>The diagnostics target was explicitly requested...</echo>
<echo>----Ant diagnostics-------------------------------</echo>
<diagnostics/>
<echo>----Properties--Ant-------------------------------</echo>
<echoproperties>
<propertyset>
<propertyref builtin="all"/>
</propertyset>
</echoproperties>
<echo>----Environment-----------------------------------</echo>
<property environment="env"/>
<echoproperties>
<propertyset>
<propertyref prefix="env."/>
</propertyset>
</echoproperties>
<echo>--------------------------------------------------</echo>
<fail message="Diagnostics output -- build aborted."/>
</sequential>
</target>
<!-- Main targets -->
<target name="clean"
description="Removes the target directory.">
<delete quiet="true" dir="${target.dir}"/>
<all-bundles target="clean"/>
</target>
<target name="clean-integration"
description="Removes the integration repository directory.">
<fail message="The 'integration.repo.dir' property must be set on this project.">
<condition>
<not>
<isset property="integration.repo.dir"/>
</not>
</condition>
</fail>
<delete quiet="true" dir="${integration.repo.dir}"/>
</target>
<target name="clean-ivy" depends="ivy.init"
description="Removes the ivy cache directory.">
<fail message="The 'ivy.cache.dir' property must be set on this project.">
<condition>
<not>
<isset property="ivy.cache.dir"/>
</not>
</condition>
</fail>
<delete quiet="true" dir="${ivy.cache.dir}"/>
</target>
<!-- Other targets -->
<target name="ivy.init" unless="ivy.initialized">
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant">
<classpath>
<path location="${ivy.lib.dir}/ivy.jar"/>
<path location="${ivy.lib.dir}/org.springframework.build.aws.ivy.jar"/>
<path location="${ivy.lib.dir}/commons-codec.jar"/>
<path location="${ivy.lib.dir}/commons-httpclient.jar"/>
<path location="${ivy.lib.dir}/commons-logging.jar"/>
<path location="${ivy.lib.dir}/jets3t.jar"/>
<path location="${ivy.lib.dir}/jsch-0.1.42.jar"/>
<path location="${ivy.lib.dir}"/>
</classpath>
</taskdef>
<ivy:settings file="${ivy.settings.file}"/>
<property name="ivy.initialized" value="true"/>
</target>
<!-- Macros -->
<macrodef name="all-bundles">
<attribute name="target"/>
<attribute name="buildpathRef" default="bundles"/>
<element name="inherited-properties" optional="true" implicit="true"/>
<sequential>
<subant target="@{target}" verbose="true" buildpathRef="@{buildpathRef}">
<inherited-properties/>
<propertyset>
<propertyref builtin="commandline"/>
</propertyset>
<property name="timestamp" value="${timestamp}"/>
</subant>
</sequential>
</macrodef>
<macrodef name="all-bundles-exec">
<attribute name="target"/>
<attribute name="buildpathRef" default="bundles"/>
<attribute name="exec-ant-args" default=""/>
<element name="inherited-properties" optional="true" implicit="true"/>
<sequential>
<subant target="exec-ant" verbose="true" buildpathRef="@{buildpathRef}">
<inherited-properties/>
<propertyset>
<propertyref builtin="commandline"/>
</propertyset>
<property name="timestamp" value="${timestamp}"/>
<property name="exec-ant-target" value="@{target}"/>
<property name="exec-args" value="@{exec-ant-args}"/>
</subant>
</sequential>
</macrodef>
<macrodef name="java-doc">
<attribute name="input.dir"/>
<attribute name="output.dir"/>
<attribute name="classpath.id"/>
<attribute name="access"/>
<attribute name="exclude.package.names" default=""/>
<sequential>
<delete quiet="true" dir="@{output.dir}"/>
<mkdir dir="@{output.dir}"/>
<javadoc.links sourcepath="@{input.dir}" destdir="@{output.dir}" classpathref="@{classpath.id}"
access="@{access}" excludepackagenames="@{exclude.package.names}" maxmemory="${javadoc.max.memory}"
stylesheetfile="${javadoc.stylesheet.file}" splitindex="true" useexternalfile="true">
<header><![CDATA[<!-- Begin Google Analytics code --> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-2728886-3"); pageTracker._setDomainName("none"); pageTracker._setAllowLinker(true); pageTracker._trackPageview(); </script> <!-- End Google Analytics code -->]]></header>
<bottom><![CDATA[<!-- Begin LoopFuse code --> <script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"> </script> <script type="text/javascript"> _lf_cid = "LF_48be82fa"; _lf_remora(); </script> <!-- End LoopFuse code -->]]></bottom>
</javadoc.links>
<copy toDir="@{output.dir}/resources">
<fileset dir="${javadoc.resources.dir}" erroronmissingdir="false"/>
</copy>
</sequential>
</macrodef>
<presetdef name="javadoc.links">
<javadoc/>
</presetdef>
</project>