blob: 820217edb20d4a650afc5a4aa41d3c0cc432f6b3 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
******************************************************************************
* Copyright (c) 2011 Eclipse Foundation
* 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:
* SAP AG - initial contribution
******************************************************************************
-->
<project name="p2tools-multi-bundle" xmlns:ivy="antlib:org.apache.ivy.ant">
<import file="common.xml"/>
<!-- Main targets -->
<target name="p2.generate-inf" description="Generates p2.inf-s for all feature directories inside a wrapping 'features' directory.">
<fail message="The 'source' property must be set on this target.">
<condition>
<not>
<isset property="source"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2InfGenerator" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.virgo.build.p2tools.instructions.P2InstructionGeneratorApplication"/>
<arg line="-source ${source}"/>
</java>
</target>
<target name="p2.publish-binary" description="Publishes a single zipped artifact with unzip instructions to a p2 repository.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'source' property must be set on this target.">
<condition>
<not>
<isset property="source"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Binaries" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.virgo.build.p2tools.binaries.BinaryPublisherApplication"/>
<arg line="-metadataRepository file:${repository}"/>
<arg line="-artifactRepository file:${repository}"/>
<arg line="-source ${source}"/>
<arg line="-publishArtifacts"/>
<arg line="-append"/>
<arg line="-compress"/>
</java>
</target>
<target name="p2.publish-binary-chmod" description="Publishes a single zipped artifact with proper unzip and permissions instructions to a p2 repository.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'source' property must be set on this target.">
<condition>
<not>
<isset property="source"/>
</not>
</condition>
</fail>
<fail message="The 'chmod.args' property must be set on this target.">
<condition>
<not>
<isset property="chmod.args"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Binaries" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.virgo.build.p2tools.binaries.BinaryPublisherApplication"/>
<arg line="-metadataRepository file:${repository}"/>
<arg line="-artifactRepository file:${repository}"/>
<arg line="-source ${source}"/>
<arg line="-publishArtifacts"/>
<arg line="-append"/>
<arg line="-compress"/>
<arg line="-chmod ${chmod.args}"/>
</java>
</target>
<target name="p2.publish-bundles-features" description="Publishes bundles and features located in separate folders in the source location to a p2 repository.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'source' property must be set on this target.">
<condition>
<not>
<isset property="source"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2FeaturesAndBundles" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher"/>
<arg line="-metadataRepository file:${repository}"/>
<arg line="-artifactRepository file:${repository}"/>
<arg line="-source ${source}"/>
<arg line="-append"/>
<arg line="-compress"/>
<arg line="-publishArtifacts"/>
</java>
</target>
<target name="p2.publish-bundles-features-alt" description="Alternative form. Publishes bundles and features passed as separate sources.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'bundles' property must be set on this target.">
<condition>
<not>
<isset property="bundles"/>
</not>
</condition>
</fail>
<fail message="The 'features' property must be set on this target.">
<condition>
<not>
<isset property="features"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2FeaturesAndBundles" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher"/>
<arg line="-metadataRepository file:${repository}"/>
<arg line="-artifactRepository file:${repository}"/>
<arg line="-bundles ${bundles}"/>
<arg line="-features ${features}"/>
<arg line="-append"/>
<arg line="-compress"/>
<arg line="-publishArtifacts"/>
</java>
</target>
<target name="p2.publish-product" description="Publishes a product to a p2 repository. The publishing uses ANY environment configurations.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'product.file.location' property must be set on this target.">
<condition>
<not>
<isset property="product.file.location"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Product" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.publisher.ProductPublisher"/>
<arg line="-metadataRepository file:${repository}"/>
<arg line="-artifactRepository file:${repository}"/>
<arg line="-productFile ${product.file.location}"/>
<arg line="-configs ANY.ANY.ANY"/>
<arg line="-publishArtifacts"/>
<arg line="-append"/>
<arg line="-compress"/>
<arg line="-flavor tooling"/>
</java>
</target>
<target name="p2.publish-category" description="Categorizes features published in a p2 repository.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'category.file.location' property must be set on this target.">
<condition>
<not>
<isset property="category.file.location"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Category" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.publisher.CategoryPublisher"/>
<arg line="-metadataRepository file:file:${repository}"/>
<arg line="-categoryDefinition file:${category.file.location}"/>
<arg line="-compress"/>
</java>
</target>
<target name="p2.install-virgo-product" description="Installs a Virgo product to a desired destination. Default profile(roaming) is VIRGOProfile, the environment cofigurations are ANY.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'product.iu' property must be set on this target.">
<condition>
<not>
<isset property="product.iu"/>
</not>
</condition>
</fail>
<fail message="The 'destination' property must be set on this target.">
<condition>
<not>
<isset property="destination"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Director" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.director"/>
<arg line="-repository file:${repository}"/>
<arg line="-installIU ${product.iu}"/>
<arg line="-tag InitialState"/>
<arg line="-destination ${destination}"/>
<arg line="-profile VIRGOProfile"/>
<arg line="-roaming"/>
</java>
</target>
<target name="p2.mirror-metadata" description="Mirrors a metadata set of rootIUs from a local or remote p2 repository to a local destination. The metadata mirror app must be ran first.">
<fail message="The 'source' property must be set on this target.">
<condition>
<not>
<isset property="source"/>
</not>
</condition>
</fail>
<fail message="The 'destination' property must be set on this target.">
<condition>
<not>
<isset property="destination"/>
</not>
</condition>
</fail>
<fail message="The 'roots' property must be set on this target.">
<condition>
<not>
<isset property="roots"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2MetadataMirror" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.metadata.repository.mirrorApplication"/>
<arg line="-source ${source}"/>
<arg line="-destination ${destination}"/>
<arg line="-roots ${roots}"/>
</java>
</target>
<target name="p2.mirror-artifacts" description="Mirrors an artifact set of rootIUs from a local or remote p2 repository to a local destination. The artifacts mirror app must be ran after the metadata one.">
<fail message="The 'source' property must be set on this target.">
<condition>
<not>
<isset property="source"/>
</not>
</condition>
</fail>
<fail message="The 'destination' property must be set on this target.">
<condition>
<not>
<isset property="destination"/>
</not>
</condition>
</fail>
<fail message="The 'roots' property must be set on this target.">
<condition>
<not>
<isset property="roots"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2ArtifactMirror" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.virgo.build.p2tools.artifact.mirrorApplication"/>
<arg line="-source ${source}"/>
<arg line="-destination ${destination}"/>
<arg line="-roots ${roots}"/>
</java>
</target>
<target name="p2.install-iu" description="Installs one or more IUs to a target p2 installation's profile.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'iu' property must be set on this target.">
<condition>
<not>
<isset property="iu"/>
</not>
</condition>
</fail>
<fail message="The 'destination' property must be set on this target.">
<condition>
<not>
<isset property="destination"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Director" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.director"/>
<arg line="-repository file:${repository}"/>
<arg line="-installIU ${iu}"/>
<arg line="-destination ${destination}"/>
<arg line="-profile VIRGOProfile"/>
</java>
</target>
<target name="p2.uninstall-iu" description="Uninstalls one or more IUs to a target p2 installation's profile.">
<fail message="The 'repository' property must be set on this target.">
<condition>
<not>
<isset property="repository"/>
</not>
</condition>
</fail>
<fail message="The 'iu' property must be set on this target.">
<condition>
<not>
<isset property="iu"/>
</not>
</condition>
</fail>
<fail message="The 'destination' property must be set on this target.">
<condition>
<not>
<isset property="destination"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2Director" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.equinox.p2.director"/>
<arg line="-repository file:${repository}"/>
<arg line="-uninstallIU ${iu}"/>
<arg line="-destination ${destination}"/>
<arg line="-profile VIRGOProfile"/>
</java>
</target>
<target name="convert-p2-to-ivy" description="Prepares p2 repository artifacts for Ivy publishing">
<fail message="The 'source.plugins.dir' property must be set on this target.">
<condition>
<not>
<isset property="source.plugins.dir"/>
</not>
</condition>
</fail>
<fail message="The 'destination' property must be set on this target.">
<condition>
<not>
<isset property="destination"/>
</not>
</condition>
</fail>
<fail message="The 'offset.to.virgo.build' property must be set on this target.">
<condition>
<not>
<isset property="offset.to.virgo.build"/>
</not>
</condition>
</fail>
<fail message="The 'updated.build.versions.location' property must be set on this target.">
<condition>
<not>
<isset property="updated.build.versions.location"/>
</not>
</condition>
</fail>
<java jar="${tools.dir}/plugins/org.eclipse.equinox.launcher_${tools.org.eclipse.equinox.launcher}.jar" fork="true" taskname="p2ToIvyConvertor" failonerror="true" maxmemory="256m">
<!--jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/-->
<arg line="-application org.eclipse.virgo.build.p2tools.convertor.ConvertorApplication"/>
<arg line="-source.plugins.dir ${source.plugins.dir}"/>
<arg line="-destination ${destination}"/>
<arg line="-offset.to.virgo.build ${offset.to.virgo.build}"/>
<arg line="-build.versions.location ${updated.build.versions.location}"/>
</java>
</target>
<target name="fetch-unzipped-virgo-build-tools">
<fail message="The 'org.eclipse.virgo.build.tools' version property must be set on this target.">
<condition>
<not>
<isset property="org.eclipse.virgo.build.tools"/>
</not>
</condition>
</fail>
<!-- target dir is always initialized by virgo-build, no need to validate if it's set -->
<mkdir dir="${target.dir}"/>
<get src="http://build.eclipse.org/rt/virgo/zips/release/VB/${org.eclipse.virgo.build.tools}/virgo-build-tools-${org.eclipse.virgo.build.tools}.zip"
dest="${tools.dir}.zip"
usetimestamp="true" />
<echo message="Fetched the Virgo Build Tools zip to ${tools.dir}.zip"/>
<unzip src="${tools.dir}.zip" dest="${tools.dir}">
<globmapper from="virgo-build-tools-${org.eclipse.virgo.build.tools}/*" to="*"/>
</unzip>
<delete file="${tools.dir}.zip" quiet="true"/>
<echo message="Unzipped the Virgo Build Tools zip to ${tools.dir}"/>
</target>
</project>