Skip to main content
summaryrefslogtreecommitdiffstats
blob: 0f274224e71cbf8da7800ce63141a9af1fe19666 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="UTF-8"?>
<!--
       Copyright (c) 2011 Obeo.
  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:
      Obeo - initial API and implementation
      Marc Khouzam (Ericsson) - Copied from Linux Tools and adapted for CDT
-->
<project name="antArtifactsUpdater" default="main">
	<!--
        This script is used to mofidy the artifacts.jar file to enable p2 mirroring and statistics.
        It also adds the p2.index file.

	Be sure to use at least ant 1.8.2 to launch this script.

	Ant 1.8.2 is located here : /shared/common/apache-ant-1.8.2/
	on build.eclipse.org, do a
	$> export ANT_HOME=/shared/common/apache-ant-1.8.2/
	-->

	<property name="build.root" value="${project.build.directory}/repository" />
	<antversion property="antversion" />

	<target name="main">
		<!-- adding p2.mirrorsURL and p2.statsURI to the repository -->
		<unzip dest="${build.root}">
			<fileset file="${build.root}/artifacts.jar" />
		</unzip>
 		<!-- Delete the archive, it will be re-generated -->
 		<delete file="${build.root}/artifacts.jar" />
		<move file="${build.root}/artifacts.xml" tofile="${build.root}/artifacts.original.xml" />
		<xslt style="p2.xsl" in="${build.root}/artifacts.original.xml" out="${build.root}/artifacts.xml">
			<param name="mirrorsURL" expression="http://www.eclipse.org/downloads/download.php?file=/${repo-path}&amp;format=xml" />
		</xslt>
		<zip destfile="${build.root}/artifacts.jar" basedir="${build.root}" includes="artifacts.xml" />
 		<delete file="${build.root}/artifacts.xml" />
 		<delete file="${build.root}/artifacts.original.xml" />

		<!-- adding p2.index -->
		<echo file="${build.root}/p2.index" message="version = 1${line.separator}metadata.repository.factory.order = content.xml,\!${line.separator}artifact.repository.factory.order = artifacts.xml,\!" />
	</target>
</project>

Back to the top