Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/p2-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ jobs:
cache: maven
- name: Build and verify p2 repository
run: ./mvnw --batch-mode clean verify
- name: Assert p2 repository metadata
run: |
test -f "$P2_REPO/p2.index"
test -f "$P2_REPO/content.jar"
test -f "$P2_REPO/artifacts.jar"
test -f "$P2_REPO/content.xml"
test -f "$P2_REPO/artifacts.xml"
test -f "$P2_REPO/site.xml"
grep -q 'org.eclipse.egit.pullrequest.feature' "$P2_REPO/content.xml"
test -n "$(find "$P2_REPO/features" -name 'org.eclipse.egit.pullrequest.feature_*.jar')"
test -n "$(find "$P2_REPO/plugins" -name 'org.eclipse.egit.pullrequest_*.jar')"
- name: Resolve feature installation
run: >-
./mvnw --batch-mode --non-recursive
Expand Down Expand Up @@ -78,9 +89,12 @@ jobs:
rm -rf p2
mkdir p2
cp -a "$SITE"/. p2/
org.eclipse.egit.pullrequest.repository/finalize-p2-repository.sh p2
# Browsers get install instructions; p2 clients ignore index.html
# because they request content.jar and artifacts.jar by name.
cp site/p2-index.html p2/index.html
# because they request content.xml / content.jar by name.
test -f p2/p2.index
test -f p2/content.xml
test -f p2/artifacts.xml
- name: Commit the published update site
run: |
git config user.name 'github-actions[bot]'
Expand Down
20 changes: 11 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,24 @@ ALL source files must include EPL-2.0 header:
eclipse-pullrequest-plugin/
├── pom.xml # Parent POM
├── org.eclipse.egit.pullrequest.target/ # Target platform
├── org.eclipse.egit.pullrequest/ # Main plugin (37 Java files)
├── org.eclipse.egit.pullrequest/ # Main plugin
│ ├── src/org/eclipse/egit/pullrequest/
│ │ ├── Activator.java # Bundle activator
│ │ └── internal/
│ │ ├── model/ # Data models (4 files)
│ │ ├── client/ # Abstraction layer (4 files)
│ │ ├── bitbucket/ # Bitbucket provider (2 files)
│ │ ├── github/ # GitHub provider (3 files)
│ │ ├── model/ # Data models
│ │ ├── client/ # Abstraction layer
│ │ ├── bitbucket/ # Bitbucket provider
│ │ ├── github/ # GitHub provider
│ │ └── ui/ # Synchronize/compare integration
│ ├── META-INF/MANIFEST.MF # OSGi bundle manifest
│ ├── plugin.xml # Extension points
│ └── plugin.properties # Externalized strings
└── org.eclipse.egit.pullrequest.test/ # Test fragment (2 test files)
└── src/org/eclipse/egit/pullrequest/internal/
├── bitbucket/BitbucketClientTest.java
└── github/GitHubJsonParserTest.java
├── org.eclipse.egit.pullrequest.test/ # Test fragment
├── org.eclipse.egit.pullrequest.feature/ # Installable feature
└── org.eclipse.egit.pullrequest.repository/ # Update site / p2 repository
├── category.xml # p2 categories (Tycho)
├── site.xml # Classic Eclipse update site
└── finalize-p2-repository.sh # p2.index + uncompressed XML
```

### Key Packages
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ Before building this plugin, you must build JGit and EGit to create their p2 rep
```

The p2 update site is written to
`org.eclipse.egit.pullrequest.repository/target/repository/`. Add that
folder in Eclipse as a local repository to test a build before publishing.
`org.eclipse.egit.pullrequest.repository/target/repository/`. That
folder is a complete Equinox p2 repository (`p2.index`, `content.xml`,
`artifacts.xml`, and the compressed `.jar` / `.xz` variants) plus a
classic `site.xml`. Add the folder in Eclipse as a local repository to
test a build before publishing.

#### Build without tests:
```bash
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.egit.pullrequest.repository/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin.includes = category.xml
bin.includes = category.xml,\
site.xml
8 changes: 4 additions & 4 deletions org.eclipse.egit.pullrequest.repository/category.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature
url="features/org.eclipse.egit.pullrequest.feature_7.6.0.qualifier.jar"
id="org.eclipse.egit.pullrequest.feature"
version="7.6.0.qualifier">
<description url="https://github.com/Philipp0205/eclipse-pull-request-plugin">
Pull Request Review update site.
</description>
<feature id="org.eclipse.egit.pullrequest.feature" version="0.0.0">
<category name="pullrequest"/>
</feature>
<category-def name="pullrequest" label="Pull Request Review">
Expand Down
73 changes: 73 additions & 0 deletions org.eclipse.egit.pullrequest.repository/finalize-p2-repository.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env bash
#*******************************************************************************
# Copyright (C) 2026, Philipp Hoenisch and others
#
# All rights reserved. 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
#*******************************************************************************
#
# Finish a Tycho eclipse-repository so it is a complete p2 update site:
# uncompressed XML (GitHub Pages friendly), p2.index covering every
# metadata format that is present, plus site.xml and a browser landing page.

set -euo pipefail

if [ "$#" -ne 1 ]; then
echo "usage: $0 <repository-directory>" >&2
exit 1
fi

REPO=$1
if [ ! -d "$REPO" ]; then
echo "not a directory: $REPO" >&2
exit 1
fi

SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)

unzip_jar() {
jar=$1
xml=$2
if [ -f "$REPO/$jar" ] && [ ! -f "$REPO/$xml" ]; then
unzip -o -d "$REPO" "$REPO/$jar"
fi
}

unzip_jar content.jar content.xml
unzip_jar artifacts.jar artifacts.xml

append_if_present() {
var_name=$1
file=$2
if [ -f "$REPO/$file" ]; then
eval "$var_name=\${$var_name}${file},"
fi
}

meta_order=
art_order=
append_if_present meta_order content.xml.xz
append_if_present meta_order content.xml
append_if_present meta_order content.jar
append_if_present art_order artifacts.xml.xz
append_if_present art_order artifacts.xml
append_if_present art_order artifacts.jar

cat > "$REPO/p2.index" <<EOF
version=1
metadata.repository.factory.order=${meta_order}!
artifact.repository.factory.order=${art_order}!
EOF

if [ -f "$SCRIPT_DIR/site.xml" ]; then
cp "$SCRIPT_DIR/site.xml" "$REPO/site.xml"
fi

ROOT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
if [ -f "$ROOT_DIR/site/p2-index.html" ]; then
cp "$ROOT_DIR/site/p2-index.html" "$REPO/index.html"
fi
27 changes: 27 additions & 0 deletions org.eclipse.egit.pullrequest.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<packaging>eclipse-repository</packaging>

<name>Pull Request Review Update Site</name>
<description>
Tycho p2 repository and Eclipse update site for the Pull Request
Review feature.
</description>

<build>
<plugins>
Expand All @@ -36,8 +40,31 @@
<includeAllDependencies>false</includeAllDependencies>
<createArtifactRepository>true</createArtifactRepository>
<compress>true</compress>
<xzCompress>true</xzCompress>
<repositoryName>Pull Request Review</repositoryName>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>finalize-p2-repository</id>
<phase>verify</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>${project.basedir}/finalize-p2-repository.sh</argument>
<argument>${project.build.directory}/repository</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
17 changes: 17 additions & 0 deletions org.eclipse.egit.pullrequest.repository/site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<description url="https://philipp0205.github.io/eclipse-pull-request-plugin/p2/">
Pull Request Review update site.
</description>
<feature
url="features/org.eclipse.egit.pullrequest.feature_7.6.0.qualifier.jar"
id="org.eclipse.egit.pullrequest.feature"
version="7.6.0.qualifier">
<category name="pullrequest"/>
</feature>
<category-def name="pullrequest" label="Pull Request Review">
<description>
Review GitHub and Bitbucket pull requests from inside Eclipse.
</description>
</category-def>
</site>