blob: 6fa62a974dd8e7aa43320b268615f51faba22b08 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2011 Obeo.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
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>