mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
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>
This commit is contained in:
parent
49997a17b3
commit
16886a1f2a
4 changed files with 110 additions and 18 deletions
1
pom.xml
1
pom.xml
|
@ -19,6 +19,7 @@
|
||||||
<tycho-extras-version>0.22.0</tycho-extras-version>
|
<tycho-extras-version>0.22.0</tycho-extras-version>
|
||||||
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
|
<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>
|
<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.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
|
||||||
<sonar.jacoco.reportPath>${project.basedir}/../../target/jacoco.exec</sonar.jacoco.reportPath>
|
<sonar.jacoco.reportPath>${project.basedir}/../../target/jacoco.exec</sonar.jacoco.reportPath>
|
||||||
<target-platform>cdt-e4.4</target-platform>
|
<target-platform>cdt-e4.4</target-platform>
|
||||||
|
|
46
releng/org.eclipse.cdt.repo/antArtifactsUpdater.xml
Normal file
46
releng/org.eclipse.cdt.repo/antArtifactsUpdater.xml
Normal file
|
@ -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}&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>
|
35
releng/org.eclipse.cdt.repo/p2.xsl
Normal file
35
releng/org.eclipse.cdt.repo/p2.xsl
Normal file
|
@ -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>
|
|
@ -23,28 +23,38 @@
|
||||||
<profile>
|
<profile>
|
||||||
<id>production</id>
|
<id>production</id>
|
||||||
<properties>
|
<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>
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-antrun-plugin</artifactId>
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>verify</phase>
|
<phase>verify</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<target>
|
<target>
|
||||||
<delete dir="${cdt-download-dir}"/>
|
<!-- first modify the artifacts.jar file -->
|
||||||
<unzip src="target/org.eclipse.cdt.repo.zip"
|
<!-- note that our zip file is already generated and won't have nor needs this change -->
|
||||||
dest="${cdt-download-dir}"/>
|
<copy file="p2.xsl" todir="${project.build.directory}"/>
|
||||||
</target>
|
<copy file="antArtifactsUpdater.xml" todir="${project.build.directory}"/>
|
||||||
</configuration>
|
<ant antfile="${project.build.directory}/antArtifactsUpdater.xml"/>
|
||||||
<goals>
|
|
||||||
<goal>run</goal>
|
<!-- now promote the update build to our download area -->
|
||||||
</goals>
|
<delete dir="${cdt-download-dir}"/>
|
||||||
</execution>
|
<copy includeemptydirs="false" todir="${cdt-download-dir}">
|
||||||
</executions>
|
<fileset dir="target/repository">
|
||||||
|
<include name="**" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
Loading…
Add table
Reference in a new issue