Skip to content

Commit

Permalink
updated p2 composite procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 25, 2022
1 parent e75563f commit 675c526
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 104 deletions.
194 changes: 194 additions & 0 deletions releng/org.eclipse.emf.parsley.parent/old-files/old-repository-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<!--
(1)
See <http://wiki.eclipse.org/Equinox/p2/p2.mirrorsURL>.
This will add the mirror and statistics properties to your
artifacts.jar, but NOT to artifacts.xml.xz,
since p2 can only read artifacts.xml.zx but now write into it
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=467779).
artifacts.xml.xz will be handled later (from (2) on). -->
<id>add-repo-properties</id>
<goals>
<goal>eclipse-run</goal>
</goals>
<phase>package</phase>
<configuration>
<applicationsArgs>
<arg>-application</arg>
<arg>org.eclipse.wtp.releng.tools.addRepoProperties</arg>
</applicationsArgs>
<jvmArgs>
<arg>-DartifactRepoDirectory=${project.build.directory}/repository</arg>
<arg>-Dp2MirrorsURL=${p2.mirrorsURL}</arg>
<arg>-Dp2StatsURI=${p2.statsURL}</arg>
<arg>-DstatsTrackedArtifacts=${p2.statsTrackedArtifacts}</arg>
<arg>-DstatsArtifactsSuffix=-${project.version}</arg>
</jvmArgs>
<work>${project.build.directory}/eclipserun-work-first</work>
<dependencies>
<dependency>
<artifactId>org.eclipse.wtp.releng.tools.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
</dependencies>
<repositories>
<repository>
<url>http://download.eclipse.org/webtools/releng/repository</url>
<layout>p2</layout>
</repository>
<repository>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
</repositories>
</configuration>
</execution>
<execution>
<id>add-p2-composite-repository</id>
<goals>
<goal>eclipse-run</goal>
</goals>
<!-- this must be executed after package, since during package we also
deal with XZ compressed artifacts -->
<phase>verify</phase>
<configuration>
<applicationsArgs>
<arg>-application</arg>
<arg>org.eclipse.ant.core.antRunner</arg>
<arg>-buildfile</arg>
<arg>${project.basedir}/../org.eclipse.emf.parsley.parent/ant/packaging-p2composite.ant</arg>
<arg>p2.composite.add</arg>
<arg>-Dsoftware.download.area=${parsley.download.area}</arg>
<arg>-Dupdates.dir=${parsley.updates.dir}</arg>
<arg>-Dsite.label="EMF Parsley Site"</arg>
<arg>-Dproject.build.directory=${project.build.directory}</arg>
<arg>-DunqualifiedVersion=${unqualifiedVersion}</arg>
<arg>-DbuildQualifier=${buildQualifier}</arg>
<arg>-DparsedVersion.majorVersion=${parsedVersion.majorVersion}</arg>
<arg>-DparsedVersion.minorVersion=${parsedVersion.minorVersion}</arg>
</applicationsArgs>
<repositories>
<repository>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<artifactId>org.eclipse.ant.core</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.apache.ant</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.repository.tools</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.core.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.extras.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.ds</artifactId>
<type>eclipse-plugin</type>
</dependency>
</dependencies>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<!-- copy the zipped p2 repository into download zips area -->
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<dependencies>
<!-- Needed for XZ compression -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-compress</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>copy-to-zips-download</id>
<phase>package</phase>
<configuration>
<target>
<echo message="" />
<echo message="Source path: ${project.build.directory}" />
<echo message="Built version: ${unqualifiedVersion}.${buildQualifier}" />
<echo message="" />

<copy includeemptydirs="false" todir="${parsley.download.area}/${parsley.zips.dir}">
<fileset dir="${project.build.directory}">
<include name="*.zip" />
</fileset>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<!-- (2)
Unpack artifacts.jar (which has already been processed) -->
<id>unjar-artifacts</id>
<phase>package</phase>
<configuration>
<target>
<unzip src="${project.build.directory}/repository/artifacts.jar"
dest="${project.build.directory}/repository/" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<!-- (3)
pack artifacts.xml into artifacts.xml.xz (rewrite) -->
<id>xz-artifacts</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="xz-artifacts-xml">
<taskdef resource="org/apache/ant/compress/antlib.xml"
classpathref="maven.plugin.classpath" />
<xz
srcfile="${project.build.directory}/repository/artifacts.xml"
destfile="${project.build.directory}/repository/artifacts.xml.xz" />
</target>
</configuration>
</execution>
<execution>
<!-- (4)
Remove artifacts.xml (we don't need that anymore) -->
<id>remove-artifacts-xml</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete file="${project.build.directory}/repository/artifacts.xml"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
115 changes: 11 additions & 104 deletions releng/org.eclipse.emf.parsley.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,59 +122,12 @@
<artifactId>tycho-eclipserun-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<!--
(1)
See <http://wiki.eclipse.org/Equinox/p2/p2.mirrorsURL>.
This will add the mirror and statistics properties to your
artifacts.jar, but NOT to artifacts.xml.xz,
since p2 can only read artifacts.xml.zx but now write into it
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=467779).
artifacts.xml.xz will be handled later (from (2) on). -->
<id>add-repo-properties</id>
<goals>
<goal>eclipse-run</goal>
</goals>
<phase>package</phase>
<configuration>
<applicationsArgs>
<arg>-application</arg>
<arg>org.eclipse.wtp.releng.tools.addRepoProperties</arg>
</applicationsArgs>
<jvmArgs>
<arg>-DartifactRepoDirectory=${project.build.directory}/repository</arg>
<arg>-Dp2MirrorsURL=${p2.mirrorsURL}</arg>
<arg>-Dp2StatsURI=${p2.statsURL}</arg>
<arg>-DstatsTrackedArtifacts=${p2.statsTrackedArtifacts}</arg>
<arg>-DstatsArtifactsSuffix=-${project.version}</arg>
</jvmArgs>
<work>${project.build.directory}/eclipserun-work-first</work>
<dependencies>
<dependency>
<artifactId>org.eclipse.wtp.releng.tools.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
</dependencies>
<repositories>
<repository>
<url>http://download.eclipse.org/webtools/releng/repository</url>
<layout>p2</layout>
</repository>
<repository>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
</repositories>
</configuration>
</execution>
<execution>
<id>add-p2-composite-repository</id>
<goals>
<goal>eclipse-run</goal>
</goals>
<!-- this must be executed after package, since during package we also
deal with XZ compressed artifacts -->
<phase>verify</phase>
<phase>package</phase>
<configuration>
<applicationsArgs>
<arg>-application</arg>
Expand All @@ -193,8 +146,9 @@
</applicationsArgs>
<repositories>
<repository>
<url>http://download.eclipse.org/releases/neon</url>
<id>2021-12</id>
<layout>p2</layout>
<url>https://download.eclipse.org/releases/2021-12</url>
</repository>
</repositories>
<dependencies>
Expand All @@ -218,10 +172,18 @@
<artifactId>org.eclipse.equinox.p2.extras.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.osgi.compatibility.state</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.ds</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.core.net</artifactId>
<type>eclipse-plugin</type>
</dependency>
</dependencies>
</configuration>
</execution>
Expand All @@ -232,14 +194,6 @@
<!-- copy the zipped p2 repository into download zips area -->
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<dependencies>
<!-- Needed for XZ compression -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-compress</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>copy-to-zips-download</id>
Expand All @@ -262,53 +216,6 @@
<goal>run</goal>
</goals>
</execution>
<execution>
<!-- (2)
Unpack artifacts.jar (which has already been processed) -->
<id>unjar-artifacts</id>
<phase>package</phase>
<configuration>
<target>
<unzip src="${project.build.directory}/repository/artifacts.jar"
dest="${project.build.directory}/repository/" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<!-- (3)
pack artifacts.xml into artifacts.xml.xz (rewrite) -->
<id>xz-artifacts</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="xz-artifacts-xml">
<taskdef resource="org/apache/ant/compress/antlib.xml"
classpathref="maven.plugin.classpath" />
<xz
srcfile="${project.build.directory}/repository/artifacts.xml"
destfile="${project.build.directory}/repository/artifacts.xml.xz" />
</target>
</configuration>
</execution>
<execution>
<!-- (4)
Remove artifacts.xml (we don't need that anymore) -->
<id>remove-artifacts-xml</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete file="${project.build.directory}/repository/artifacts.xml"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down

0 comments on commit 675c526

Please sign in to comment.