blob: be88ad1fb2c08f33b47dea150306f54e3c74ceb3 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project name="create-repositories" default="default" basedir="..">
<target name="default" depends="init,downloadEclipse,downloadDeltaPack,downloadTestFramework,downloadDTFJ">
</target>
<target name="init" depends="initProperties,initProxy,initMatTargetDef"/>
<target name="initProperties">
<mkdir dir="p2tool"/>
<makeurl property="target.baseUrl">
<path location="p2tool/."/>
</makeurl>
<!--
FeaturesAndBundlesPublisher get confused by escaped spaces in file names,
so use another way
-->
<pathconvert property="target.baseUrlRaw" targetos="unix">
<path location="p2tool/"/>
<regexpmapper from="^/?(.*)" to="file:/\1/"/>
</pathconvert>
<property environment="env"/>
</target>
<target name="initProxy" if="env.proxyHost">
<echo message="Setting proxy: ${env.proxyHost}:${env.proxyPort}"/>
<setproxy proxyhost="${env.proxyHost}" proxyport="${env.proxyPort}"/>
</target>
<target name="initMatTargetDef">
<makeurl property="workspace.baseUrl">
<path location="."/>
</makeurl>
<replace file="${ant.file}/../org.eclipse.mat.targetdef/mat-site.target" token="%workspaceUrl%" value="${workspace.baseUrl}"/>
</target>
<target name="downloadEclipse" depends="init,downloadEclipseLinuxPPC,downloadEclipseWin32">
<!-- Convert installation to also being a repository, in case we want to use this too -->
<java jar="p2tool/eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" fork="true" maxmemory="512m" failonerror="true">
<arg value="-consoleLog" />
<arg value="-application" />
<arg value="org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher"/>
<arg value="-metadataRepository"/>
<arg value="${target.baseUrlRaw}eclipse/repo"/>
<arg value="-artifactRepository"/>
<arg value="${target.baseUrlRaw}eclipse/repo"/>
<arg value="-source"/>
<arg value="p2tool/eclipse/eclipse"/>
<arg value="-publishArtifacts"/>
</java>
<copy file="p2tool/eclipse/repo/content.xml" todir="p2tool/eclipse/eclipse"/>
<delete dir="p2tool/eclipse/repo"/>
</target>
<target name="downloadEclipseLinuxPPC" depends="check-downloadWin32" unless="win32.present">
<get
src="http://download.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk-ppc.tar.gz"
dest="p2tool/eclipse-SDK-3.6.2-linux-gtk-ppc.tar.gz"
usetimestamp="true"
verbose="true"/>
<delete dir="p2tool/eclipse"/>
<untar src="p2tool/eclipse-SDK-3.6.2-linux-gtk-ppc.tar.gz" dest="p2tool/eclipse" compression="gzip"/>
</target>
<target name="check-downloadWin32">
<available file="p2tool/eclipse-SDK-3.6.2-win32.zip" property="win32.present"/>
</target>
<!-- Uses this target if you happen to have the Windows version around
and in the p2tools directory.
The build only uses the jars, so works with either -->
<target name="downloadEclipseWin32" depends="check-downloadWin32" if="win32.present">
<get
src="http://download.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-win32.zip"
dest="p2tool/eclipse-SDK-3.6.2-win32.zip"
usetimestamp="true"
verbose="true"/>
<delete dir="p2tool/eclipse"/>
<unzip src="p2tool/eclipse-SDK-3.6.2-win32.zip" dest="p2tool/eclipse"/>
</target>
<target name="downloadDeltaPack" description="downloadDeltaPack" depends="downloadEclipse">
<get
src="http://download.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-3.6.2-delta-pack.zip"
dest="p2tool/eclipse-3.6.2-delta-pack.zip"
usetimestamp="true"
verbose="true"/>
<delete dir="p2tool/eclipse-delta-pack"/>
<unzip src="p2tool/eclipse-3.6.2-delta-pack.zip" dest="p2tool/eclipse-delta-pack"/>
<java jar="p2tool/eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" fork="true" maxmemory="512m" failonerror="true">
<arg value="-consoleLog" />
<arg value="-application" />
<arg value="org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher"/>
<arg value="-mr"/>
<arg value="${target.baseUrlRaw}eclipse-delta-pack/repo"/>
<arg value="-ar"/>
<arg value="${target.baseUrlRaw}eclipse-delta-pack/repo"/>
<arg value="-source"/>
<arg value="p2tool/eclipse-delta-pack/eclipse"/>
<arg value="-compress"/>
<arg value="-publishArtifacts"/>
</java>
</target>
<target name="downloadTestFramework" description="description" depends="downloadEclipse">
<get
src="http://download.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-test-framework-3.6.2.zip"
dest="p2tool/eclipse-test-framework.zip"
usetimestamp="true"/>
<delete dir="p2tool/eclipse-test-framework"/>
<unzip src="p2tool/eclipse-test-framework.zip" dest="p2tool/eclipse-test-framework"/>
<java jar="p2tool/eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" fork="true" maxmemory="512m" failonerror="true">
<arg value="-consoleLog" />
<arg value="-application" />
<arg value="org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher"/>
<arg value="-mr"/>
<arg value="${target.baseUrlRaw}eclipse-test-framework/repo"/>
<arg value="-ar"/>
<arg value="${target.baseUrlRaw}eclipse-test-framework/repo"/>
<arg value="-source"/>
<arg value="p2tool/eclipse-test-framework/eclipse"/>
<arg value="-compress"/>
<arg value="-publishArtifacts"/>
</java>
</target>
<target name="downloadDTFJ" description="description" depends="downloadEclipse">
<get
src="ftp://ftp.software.ibm.com/software/java/support/tools/dtfj/dtfj-updatesite.zip"
dest="p2tool/dtfj-updatesite.zip"
usetimestamp="true"/>
<delete dir="p2tool/dtfj-updatesite"/>
<unzip src="p2tool/dtfj-updatesite.zip" dest="p2tool/dtfj-updatesite"/>
<java jar="p2tool/eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" fork="true" maxmemory="512m" failonerror="true">
<arg value="-consoleLog" />
<arg value="-application" />
<arg value="org.eclipse.equinox.p2.publisher.UpdateSitePublisher"/>
<arg value="-mr"/>
<arg value="${target.baseUrlRaw}dtfj-updatesite/repo"/>
<arg value="-ar"/>
<arg value="${target.baseUrlRaw}dtfj-updatesite/repo"/>
<arg value="-source"/>
<arg value="p2tool/dtfj-updatesite"/>
<arg value="-compress"/>
<arg value="-publishArtifacts"/>
</java>
</target>
<target name="cleanup" depends="cleanupTestFramework,cleanupDTFJ">
</target>
<target name="cleanupTestFramework" description="delete TestFramework repository">
<delete dir="p2tool/eclipse-test-framework"/>
<delete file="p2tool/eclipse-test-framework.zip"/>
</target>
<target name="cleanupDTFJ" description="delete DTFJ repository">
<delete dir="p2tool/dtfj-updatesite"/>
<delete file="p2tool/dtfj-updatesite.zip"/>
</target>
</project>