Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2014-09-25 21:34:05 +0000
committerMarc Khouzam2015-01-13 20:04:13 +0000
commit16886a1f2a6c47c25cbc42f7495a27fa0411c9ae (patch)
tree9994acc83d483382244552352bdf18c028f29d15
parent49997a17b32d3165deb33831ca8009f0f02e7ddf (diff)
downloadorg.eclipse.cdt-16886a1f2a6c47c25cbc42f7495a27fa0411c9ae.tar.gz
org.eclipse.cdt-16886a1f2a6c47c25cbc42f7495a27fa0411c9ae.tar.xz
org.eclipse.cdt-16886a1f2a6c47c25cbc42f7495a27fa0411c9ae.zip
Bug 445128 - Enable the use of p2 mirrors for CDT releases
Note that <repo-path> will need to be changed at release time to point to the release location, which will probably be "tools/cdt/releases/8.6" Change-Id: I0a89c8807a435ac348f4f28f2442d27668248cfc Reviewed-on: https://git.eclipse.org/r/33992 Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--pom.xml1
-rw-r--r--releng/org.eclipse.cdt.repo/antArtifactsUpdater.xml46
-rw-r--r--releng/org.eclipse.cdt.repo/p2.xsl35
-rw-r--r--releng/org.eclipse.cdt.repo/pom.xml46
4 files changed, 110 insertions, 18 deletions
diff --git a/pom.xml b/pom.xml
index 28972cd05b3..36960480031 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,6 +19,7 @@
<tycho-extras-version>0.22.0</tycho-extras-version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<cdt-site>http://hudson.eclipse.org/cdt/job/cdt-master/lastSuccessfulBuild/artifact/releng/org.eclipse.cdt.repo/target/repository</cdt-site>
+ <repo-path>tools/cdt/builds/master/nightly</repo-path>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../../target/jacoco.exec</sonar.jacoco.reportPath>
<target-platform>cdt-e4.4</target-platform>
diff --git a/releng/org.eclipse.cdt.repo/antArtifactsUpdater.xml b/releng/org.eclipse.cdt.repo/antArtifactsUpdater.xml
new file mode 100644
index 00000000000..0f274224e71
--- /dev/null
+++ b/releng/org.eclipse.cdt.repo/antArtifactsUpdater.xml
@@ -0,0 +1,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>
diff --git a/releng/org.eclipse.cdt.repo/p2.xsl b/releng/org.eclipse.cdt.repo/p2.xsl
new file mode 100644
index 00000000000..8c804d3b7eb
--- /dev/null
+++ b/releng/org.eclipse.cdt.repo/p2.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:param name="mirrorsURL"/>
+
+ <!-- add p2.mirrorsURL and p2.statsURI properties -->
+ <xsl:template match="repository/properties">
+ <properties size='{@size+2}'>
+ <xsl:copy-of select="property"/>
+ <property name='p2.statsURI' value='http://download.eclipse.org/stats'/>
+ <xsl:element name="property">
+ <xsl:attribute name="name">p2.mirrorsURL</xsl:attribute>
+ <xsl:attribute name="value"><xsl:value-of select="$mirrorsURL"/></xsl:attribute>
+ </xsl:element>
+ </properties>
+ </xsl:template>
+
+ <!-- add p2.mirrorsURL property -->
+ <xsl:template match="repository/artifacts/artifact/properties[../@classifier='org.eclipse.update.feature']">
+ <properties size='{@size+1}'>
+ <xsl:copy-of select="property"/>
+ <property name='download.stats' value='{../@id}-{../@version}'/>
+ </properties>
+ </xsl:template>
+
+ <!-- copy everything else -->
+ <xsl:template match="* | @*">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/releng/org.eclipse.cdt.repo/pom.xml b/releng/org.eclipse.cdt.repo/pom.xml
index 93cb82f9016..ea4067b1600 100644
--- a/releng/org.eclipse.cdt.repo/pom.xml
+++ b/releng/org.eclipse.cdt.repo/pom.xml
@@ -23,28 +23,38 @@
<profile>
<id>production</id>
<properties>
- <cdt-download-dir>/home/data/httpd/download.eclipse.org/tools/cdt/builds/master/nightly</cdt-download-dir>
+ <cdt-download-dir>/home/data/httpd/download.eclipse.org/${repo-path}</cdt-download-dir>
</properties>
<build>
<plugins>
<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <configuration>
- <target>
- <delete dir="${cdt-download-dir}"/>
- <unzip src="target/org.eclipse.cdt.repo.zip"
- dest="${cdt-download-dir}"/>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <configuration>
+ <target>
+ <!-- first modify the artifacts.jar file -->
+ <!-- note that our zip file is already generated and won't have nor needs this change -->
+ <copy file="p2.xsl" todir="${project.build.directory}"/>
+ <copy file="antArtifactsUpdater.xml" todir="${project.build.directory}"/>
+ <ant antfile="${project.build.directory}/antArtifactsUpdater.xml"/>
+
+ <!-- now promote the update build to our download area -->
+ <delete dir="${cdt-download-dir}"/>
+ <copy includeemptydirs="false" todir="${cdt-download-dir}">
+ <fileset dir="target/repository">
+ <include name="**" />
+ </fileset>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>

Back to the top