blob: 89ebed20c691dea7f5632e6352f3e221fb07ae47 [file] [log] [blame]
<!--
Copyright (c) 2009, 2010 Tasktop Technologies and others.
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:
Tasktop Technologies - initial API and implementation
Andrew Eisenberg - install-bundle macro
-->
<project name="Download files and provide provisioning for existing eclipse installatins">
<macrodef name="uninstall-bundle" description="Install a bundle into a given Eclipse">
<attribute name="eclipse.loc" />
<attribute name="updatesite.url" />
<attribute name="feature.id" />
<sequential>
<echo message="Uninstalling @{feature.id} into @{eclipse.loc} from @{updatesite.url}" />
<java fork="true" failonerror="true"
classname="org.eclipse.core.launcher.Main">
<arg line= "-application org.eclipse.equinox.p2.director" />
<arg line= "-metadataRepository @{updatesite.url}" />
<arg line= "-artifactRepository @{updatesite.url}" />
<arg line= "-uninstallIU @{feature.id}.feature.group" />
<arg value="-nosplash" />
<classpath>
<fileset dir="@{eclipse.loc}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar"/>
</fileset>
</classpath>
</java>
</sequential>
</macrodef>
<macrodef name="install-bundle-version" description="Install a bundle into a given Eclipse">
<attribute name="eclipse.loc" />
<attribute name="updatesite.url" />
<attribute name="feature.id" />
<attribute name="version" />
<sequential>
<echo message="Installing @{feature.id} version @{version} into @{eclipse.loc} from @{updatesite.url}" />
<java fork="true" failonerror="true"
classname="org.eclipse.core.launcher.Main">
<arg line= "-application org.eclipse.equinox.p2.director" />
<arg line= "-metadataRepository @{updatesite.url}" />
<arg line= "-artifactRepository @{updatesite.url}" />
<arg line= "-installIU @{feature.id}.feature.group/@{version}" />
<arg value="-nosplash" />
<classpath>
<fileset dir="@{eclipse.loc}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar"/>
</fileset>
</classpath>
</java>
</sequential>
</macrodef>
<macrodef name="install-bundle" description="Install a bundle into a given Eclipse">
<attribute name="eclipse.loc" />
<attribute name="updatesite.url" />
<attribute name="feature.id" />
<sequential>
<echo message="Installing @{feature.id} into @{eclipse.loc} from @{updatesite.url}" />
<java fork="true" failonerror="true"
classname="org.eclipse.core.launcher.Main">
<arg line= "-application org.eclipse.equinox.p2.director" />
<arg line= "-metadataRepository @{updatesite.url}" />
<arg line= "-artifactRepository @{updatesite.url}" />
<arg line= "-installIU @{feature.id}.feature.group" />
<arg value="-nosplash" />
<classpath>
<fileset dir="@{eclipse.loc}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar"/>
</fileset>
</classpath>
</java>
</sequential>
</macrodef>
<target name="unpack-archive" description="Unpacks a file that is either .zip or .tar.gz">
<echo message="Unpacking ${theFile} into ${theDir}"/>
<condition property="isAZip">
<contains string="${theFile}" substring=".zip" />
</condition>
<condition property="isATar">
<contains string="${theFile}" substring=".tar.gz" />
</condition>
<antcall target="unzipFile"/>
<antcall target="untarFile"/>
</target>
<target name="unzipFile" if="isAZip">
<unzip src="${theFile}" dest="${theDir}" overwrite="true" />
</target>
<target name="untarFile" if="isATar">
<untar src="${theFile}" dest="${theDir}" overwrite="true" compression="gzip" />
</target>
</project>