Skip to content

Commit

Permalink
adjusted p2 site and composite
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 29, 2023
1 parent 81b46d1 commit 291b211
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 132 deletions.
11 changes: 10 additions & 1 deletion releng/org.eclipse.xsemantics.parent/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ Contributors:
Lorenzo Bettini - Initial contribution and API
*******************************************************************************

MAVEN_OPTS="-Xms40m -Xmx384m -XX:MaxPermSize=256m"
To test a composite release locally, from the root folder

mkdir -p ${HOME}/tmp/download-area

mvn -f releng/org.eclipse.xsemantics.releng/pom.xml package \
-DskipTests=true \
-Dxtext.maven.skip=true \
-Dcbi.jarsigner.skip=true \
-Dxsemantics.download.area=${HOME}/tmp/download-area \
-Prelease-composite,release-milestone
21 changes: 9 additions & 12 deletions releng/org.eclipse.xsemantics.parent/ant/packaging-p2composite.ant
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<?xml version="1.0"?>
<project name="project">

<!--
The properties
parsedVersion.majorVersion
parsedVersion.minorVersion
are expected to be provided (see the POM and the use of build-helper-maven-plugin
-->
<target name="getMajorMinorVersion">
<script language="javascript">
<![CDATA[
// getting the value
buildnumber = project.getProperty("unqualifiedVersion");
index = buildnumber.lastIndexOf(".");
counter = buildnumber.substring(0, index);
project.setProperty("majorMinorVersion",counter);
]]>
</script>
<property name="majorMinorVersion" value="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}" />
<echo message="majorMinorVersion: ${majorMinorVersion}" />
</target>

<target name="test_getMajorMinor" depends="getMajorMinorVersion">
<echo message="majorMinorVersion: ${majorMinorVersion}"/>
<echo message="majorMinorVersion: ${majorMinorVersion}" />
</target>

<!--
Expand Down
104 changes: 104 additions & 0 deletions releng/org.eclipse.xsemantics.parent/old-ant/packaging-p2composite.ant
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0"?>
<project name="project">

<target name="getMajorMinorVersion">
<script language="javascript">
<![CDATA[
// getting the value
buildnumber = project.getProperty("unqualifiedVersion");
index = buildnumber.lastIndexOf(".");
counter = buildnumber.substring(0, index);
project.setProperty("majorMinorVersion",counter);
]]>
</script>
</target>

<target name="test_getMajorMinor" depends="getMajorMinorVersion">
<echo message="majorMinorVersion: ${majorMinorVersion}"/>
</target>

<!--
site.label The name/title/label of the created composite site
unqualifiedVersion The version without any qualifier replacement
buildQualifier The build qualifier
-->
<target name="compute.child.repository.data" depends="getMajorMinorVersion">
<property name="full.version" value="${unqualifiedVersion}.${buildQualifier}" />

<property name="software.download.area" location="${user.home}/p2.repositories" />
<property name="updates.dir" value="updates" />

<property name="site.composite.name" value="${site.label} ${majorMinorVersion}" />
<property name="main.site.composite.name" value="${site.label} All Versions" />

<property name="main.composite.repository.directory" location="${software.download.area}/${updates.dir}" />

<property name="composite.repository.directory" value="${main.composite.repository.directory}/${majorMinorVersion}" />
<property name="child.repository" value="${full.version}" />
<property name="child.repository.directory" value="${composite.repository.directory}/${child.repository}/" />
</target>

<target name="p2.composite.add" depends="compute.child.repository.data">
<property name="source.repository" location="${project.build.directory}/repository"/>

<echo message=" " />

<echo message="Source repository path: ${source.repository}" />

<echo message="Copying to ${child.repository.directory}..." />

<mkdir dir="${child.repository.directory}"/>
<copy todir="${child.repository.directory}" overwrite="true">
<fileset dir="${source.repository}" />
</copy>

<add.composite.repository.internal
composite.repository.location="${composite.repository.directory}"
composite.repository.name="${site.composite.name}"
composite.repository.child="${child.repository}"
/>

<add.composite.repository.internal
composite.repository.location="${main.composite.repository.directory}"
composite.repository.name="${main.site.composite.name}"
composite.repository.child="${majorMinorVersion}"
/>

</target>

<!-- = = = = = = = = = = = = = = = = =
macrodef: add.composite.repository.internal
= = = = = = = = = = = = = = = = = -->
<macrodef name="add.composite.repository.internal">
<attribute name="composite.repository.location" />
<attribute name="composite.repository.name" />
<attribute name="composite.repository.child" />
<sequential>

<echo message=" " />
<echo message="Composite repository : @{composite.repository.location}" />
<echo message="Composite name : @{composite.repository.name}" />
<echo message="Adding child repository : @{composite.repository.child}" />

<p2.composite.repository>
<repository
compressed="false"
location="@{composite.repository.location}"
name="@{composite.repository.name}" />
<add>
<repository location="@{composite.repository.child}" />
</add>
</p2.composite.repository>

<echo file="@{composite.repository.location}/p2.index">version=1
metadata.repository.factory.order=compositeContent.xml,\!
artifact.repository.factory.order=compositeArtifacts.xml,\!
</echo>

</sequential>
</macrodef>


</project>
34 changes: 25 additions & 9 deletions releng/org.eclipse.xsemantics.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Contributors:
<maven.compiler.target>1.8</maven.compiler.target>
<xtext.version>2.33.0</xtext.version>
<xtextVersion>${xtext.version}</xtextVersion>
<eclipse-version>2023-12</eclipse-version>
<mwe2Version>2.16.0</mwe2Version>
<platform-version>[3.9,4.0)</platform-version>
<fornax-oaw-m2-plugin-version>3.5.1</fornax-oaw-m2-plugin-version>
Expand Down Expand Up @@ -507,6 +508,30 @@ Contributors:
<version>${maven-antrun-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<!--
To generate download statistics:
https://wiki.eclipse.org/Tycho/Release_Notes/1.3#download.stats_artifact_metadata_property
-->
<configuration>
<generateDownloadStatsProperty>true</generateDownloadStatsProperty>
</configuration>
</plugin>

<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -622,7 +647,6 @@ Contributors:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>attach-p2-metadata</id>
Expand Down Expand Up @@ -655,14 +679,6 @@ Contributors:
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<finalName>${project.artifactId}-${qualifiedVersion}</finalName>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Loading

0 comments on commit 291b211

Please sign in to comment.