Skip to content

Commit 8c4d0bc

Browse files
authored
Merge branch 'master' into expand_collapse_Bar_in_UI
2 parents ad58c92 + a2b45e2 commit 8c4d0bc

File tree

326 files changed

+3167
-2017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+3167
-2017
lines changed

.github/copilot-instructions.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Eclipse PDE - Copilot Coding Agent Instructions
2+
3+
## Repository Overview
4+
5+
**Eclipse PDE** provides Eclipse tooling for developing OSGi bundles and RCP applications. ~150MB, 384 bundles, 8 modules.
6+
7+
**Stack:** Maven 3.3.1+ with Tycho 4.0.13, Java 17+ (CI: JDK 21), OSGi/Eclipse RCP, Tycho Surefire tests.
8+
9+
**Critical:** Requires `eclipse-platform-parent` POM from Eclipse Platform aggregator. Standalone `mvn clean verify` will fail with parent resolution errors - this is expected.
10+
11+
## Build & Test
12+
13+
**Prerequisites:** Maven 3.3.1+, JDK 17+ (CI: JDK 21), display server for UI tests (xvnc/Xvfb)
14+
15+
**CI Build (from Jenkinsfile):**
16+
```bash
17+
mvn clean verify -Dmaven.repo.local=$WORKSPACE/.m2/repository \
18+
--fail-at-end --batch-mode --no-transfer-progress \
19+
-Pbree-libs -Papi-check -Pjavadoc -Ptck \
20+
-Dmaven.test.failure.ignore=true \
21+
-Dcompare-version-with-baselines.skip=false
22+
```
23+
24+
**Profiles:** `-Pbree-libs` (BREE check), `-Papi-check` (API baseline), `-Pjavadoc` (docs), `-Ptck` (TCK tests)
25+
26+
**Maven Config (`.mvn/`):** Tycho 4.0.13 extension, `-Pbuild-individual-bundles`, `-DtrimStackTrace=false`
27+
28+
**Tests:** ~1,045 test files. Results: `**/target/surefire-reports/*.xml`. UI tests need display server.
29+
30+
**Artifacts:** `repository/target/repository/` (P2 site), `**/target/compilelogs/` (compile), `**/target/apianalysis/*.xml` (API)
31+
32+
**Timeout:** CI build limit is 60 minutes.
33+
34+
## Project Structure
35+
36+
**8 Top-Level Modules (pom.xml):**
37+
- `apitools/` - API analysis, baseline checking (4 bundles including tests)
38+
- `ui/` - Main PDE UI (26 bundles: core, editors, launching, tests, spy tools)
39+
- `build/` - PDE Build (legacy, maintenance mode - use Tycho instead)
40+
- `ds/` - Declarative Services tooling
41+
- `e4tools/` - Eclipse 4 tools
42+
- `ua/` - User Assistance
43+
- `features/` - 6 feature definitions
44+
- `org.eclipse.pde.doc.user/` - Documentation
45+
- `repository/` - P2 repository (not in default build)
46+
47+
**Root Files:** `pom.xml` (parent: eclipse-platform-parent:4.38.0-SNAPSHOT), `Jenkinsfile`, `.mvn/` config, `prepareNextDevCycle.sh`
48+
49+
**Bundle Structure:** `META-INF/MANIFEST.MF`, `build.properties`, `plugin.xml`, `src/`, `.project`, `pom.xml`
50+
51+
## CI/CD & Quality Gates
52+
53+
**GitHub Workflows (.github/workflows/):**
54+
- `ci.yml` - Main build (triggers: push/PR to master): license check + `mvn clean verify -Ptck`
55+
- `pr-checks.yml` - PR validations: freeze period, no merge commits, version increments (bot: "Eclipse PDE Bot")
56+
- `unit-tests.yml` - Publishes test results
57+
- `version-increments.yml` - Publishes version check results
58+
- `checkDependencies.yml` - Daily dependency range validation
59+
- `codeql.yml`, `htmlvalidator.yml`, `licensecheck.yml`, `doCleanCode.yml` - Additional checks
60+
61+
**Quality Gates (Jenkinsfile):** Compiler warnings (`**/target/compilelogs/*.xml`), API issues (`**/target/apianalysis/*.xml`), Maven console, Javadoc errors. Threshold: 1 NEW issue → unstable.
62+
63+
**Pre-commit Validation:** Run `mvn clean verify -Ptck`, check version increments, review `**/target/compilelogs/` and `**/target/apianalysis/`
64+
65+
## Common Issues & Solutions
66+
67+
**Parent POM not found:** Expected - requires eclipse-platform-parent from Eclipse Platform aggregator.
68+
69+
**API baseline violations:** Update bundle version per Eclipse API rules. See `docs/API_Tools.md`.
70+
71+
**Test failures (headless):** Use `xvfb-run mvn clean verify` or set DISPLAY.
72+
73+
**Build timeout >60 min:** Review added tests/code for performance impact.
74+
75+
## API Tools & Versioning
76+
77+
**API Baseline:** Verifies binary compatibility. Critical for CI.
78+
79+
**Javadoc Tags:** `@noimplement`, `@noextend`, `@noreference`, `@noinstantiate`, `@nooverride`, `@category`
80+
81+
**Version Rules:** Service (compatible fixes), Minor (API additions), Major (breaking changes). Missing `@since` = error.
82+
83+
**Docs:** `docs/API_Tools.md` for comprehensive API Tools documentation.
84+
85+
## OSGi Semantic Versioning
86+
87+
**PDE follows OSGi semantic versioning principles** (https://docs.osgi.org/whitepaper/semantic-versioning/):
88+
89+
**Version Format:** `major.minor.micro.qualifier`
90+
- **Major:** Breaking changes (incompatible API changes)
91+
- **Minor:** Backward-compatible API additions
92+
- **Micro:** Backward-compatible bug fixes
93+
- **Qualifier:** Build metadata (e.g., timestamps, commit hashes)
94+
95+
**Version Ranges for Dependencies:**
96+
- Use version ranges to specify compatible dependency versions
97+
- **Inclusive lower bound:** `[1.2.3,2.0.0)` includes 1.2.3
98+
- **Exclusive upper bound:** `[1.2.3,2.0.0)` excludes 2.0.0
99+
- **Best practice:** Lower bound inclusive, upper bound at next major (exclusive)
100+
- Example: For version `1.2.3`, use `[1.2.3,2.0.0)` to accept any 1.x version
101+
- Example: For version `2.5.0`, use `[2.5.0,3.0.0)` to accept any 2.x version
102+
103+
**Why exclude next major?** Major version changes indicate breaking changes, so dependencies should not automatically upgrade across major versions.
104+
105+
**PDE Support:** PDE manifest editor and dialogs should help users create proper version ranges following these principles when adding or updating bundle/package dependencies.
106+
107+
## Key Notes
108+
109+
**Tycho:** Eclipse-specific Maven extension managing OSGi dependencies, P2 repos, Eclipse metadata (MANIFEST.MF, plugin.xml, feature.xml).
110+
111+
**PDE Build (`build/`):** Maintenance mode. Use Tycho for new projects. Only IDE export bugs fixed.
112+
113+
**Development:** Use Oomph for IDE setup: `https://raw.githubusercontent.com/eclipse-pde/eclipse.pde/master/releng/org.eclipse.pde.setup/PDEConfiguration.setup`
114+
115+
**Trust These Instructions:** Only search if incomplete, encountering undocumented errors, or instructions appear outdated. Consult: `Jenkinsfile` (CI config), `README.md`, `docs/` (API Tools, FAQ, User Guide), `.github/workflows/` (pipelines).

.github/workflows/doCleanCode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
author: Eclipse PDE Bot <pde-bot@eclipse.org>
1515
do-quickfix: false
1616
do-cleanups: true
17-
bundle-folders: ui/*/ ua/*/ ds/*/ build/*/ apitools/*/ e4tools/*/
17+
bundle-folders: ui/*/ ua/*/ ds/*/ build/*/ apitools/*/ e4tools/bundles/*/
1818
secrets:
1919
token: ${{ secrets.PDE_BOT_PAT }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: HTML Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.htm*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5 # Requried will all actions
13+
- name: Checks HTML5
14+
uses: Cyb3r-Jak3/html5validator-action@v8.0.0
15+
with:
16+
root: /github/workspace/org.eclipse.pde.doc.user
17+
blacklist: about.html notices.html

apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.pde.api.tools.tests
5-
Bundle-Version: 1.4.200.qualifier
5+
Bundle-Version: 1.4.300.qualifier
66
Bundle-Vendor: %Bundle-Vendor
77
Require-Bundle: org.eclipse.core.runtime,
88
org.eclipse.pde.api.tools;bundle-version="1.0.600",

apitools/org.eclipse.pde.api.tools.tests/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
<parent>
1515
<groupId>org.eclipse.pde</groupId>
1616
<artifactId>eclipse.pde</artifactId>
17-
<version>4.37.0-SNAPSHOT</version>
17+
<version>4.38.0-SNAPSHOT</version>
1818
<relativePath>../../</relativePath>
1919
</parent>
2020
<artifactId>org.eclipse.pde.api.tools.tests</artifactId>
21-
<version>1.4.200-SNAPSHOT</version>
21+
<version>1.4.300-SNAPSHOT</version>
2222
<packaging>eclipse-test-plugin</packaging>
2323
<properties>
2424
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>

apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/ProjectTypeContainerTests.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,36 @@ public void visit(String packageName, IApiTypeRoot typeroot) {
250250
assertThat(pkgNames).containsAll(getAllPackageNames());
251251
}
252252

253+
/**
254+
* Tests that packages are correctly discovered in projects with multiple
255+
* source folders that share the same output folder. This is a regression
256+
* test for issue #2096 where packages were missing when multiple source
257+
* folders output to the same location.
258+
*/
259+
public void testMultipleSourceFoldersWithSharedOutput() throws CoreException {
260+
IApiComponent component = getComponent("bundle.multisource"); //$NON-NLS-1$
261+
IApiTypeContainer[] containers = component.getApiTypeContainers();
262+
assertEquals("Wrong number of API type containers", 1, containers.length); //$NON-NLS-1$
263+
IApiTypeContainer container = containers[0];
264+
assertEquals("Should be a composite type container", IApiTypeContainer.COMPOSITE, //$NON-NLS-1$
265+
container.getContainerType());
266+
267+
String[] packageNames = container.getPackageNames();
268+
Set<String> pkgSet = new HashSet<>();
269+
for (String pkg : packageNames) {
270+
pkgSet.add(pkg);
271+
}
272+
273+
// Both packages from different source folders should be found
274+
assertTrue("Missing package test.pkg1 from src1 folder", pkgSet.contains("test.pkg1")); //$NON-NLS-1$ //$NON-NLS-2$
275+
assertTrue("Missing package test.pkg2 from src2 folder", pkgSet.contains("test.pkg2")); //$NON-NLS-1$ //$NON-NLS-2$
276+
277+
// Verify we can find types from both source folders
278+
IApiTypeRoot type1 = container.findTypeRoot("test.pkg1.TestClass1"); //$NON-NLS-1$
279+
assertNotNull("Should find TestClass1 from src1", type1); //$NON-NLS-1$
280+
281+
IApiTypeRoot type2 = container.findTypeRoot("test.pkg2.TestClass2"); //$NON-NLS-1$
282+
assertNotNull("Should find TestClass2 from src2", type2); //$NON-NLS-1$
283+
}
284+
253285
}

apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/leak/InterfaceExtendsLeak.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,28 @@ private void x14(boolean inc) {
371371
String typename = "Etest14"; //$NON-NLS-1$
372372
deployLeakTest(typename + ".java", inc);//$NON-NLS-1$
373373
}
374+
375+
/**
376+
* Tests that a static inner class implementing its parent interface does NOT produce
377+
* a leak warning (inner class referencing enclosing type should be excluded)
378+
* using a full build
379+
*/
380+
public void testStaticInnerClassImplementsParent15F() {
381+
x15(false);
382+
}
383+
384+
/**
385+
* Tests that a static inner class implementing its parent interface does NOT produce
386+
* a leak warning (inner class referencing enclosing type should be excluded)
387+
* using an incremental build
388+
*/
389+
public void testStaticInnerClassImplementsParent15I() {
390+
x15(true);
391+
}
392+
393+
private void x15(boolean inc) {
394+
expectingNoProblems();
395+
String typename = "Etest15"; //$NON-NLS-1$
396+
deployLeakTest(typename + ".java", inc);//$NON-NLS-1$
397+
}
374398
}

apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/ApiDescriptionTests.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,4 +800,38 @@ public void testBinaryHasApiDescription() throws CoreException {
800800
IApiComponent componentA = profile.getApiComponent("component.a"); //$NON-NLS-1$
801801
assertTrue("Should have an .api_description file", componentA.hasApiDescription()); //$NON-NLS-1$
802802
}
803+
804+
/**
805+
* Tests that nested types with restrictions are persisted in XML.
806+
* This is a regression test for issue #1949 where nested classes marked
807+
* with @noreference were not being included in the .api_description file.
808+
*/
809+
@Test
810+
public void testNestedTypesWithRestrictionsPersisted() throws CoreException {
811+
// Create an API description with an outer class and a nested class with restrictions
812+
IApiDescription description = newDescription();
813+
814+
// Set package visibility to API
815+
description.setVisibility(Factory.packageDescriptor("test.pkg"), VisibilityModifiers.API); //$NON-NLS-1$
816+
817+
// Nested class with @noreference restriction
818+
IReferenceTypeDescriptor nestedType = Factory.typeDescriptor("test.pkg.OuterClass$NestedClass"); //$NON-NLS-1$
819+
description.setRestrictions(nestedType, RestrictionModifiers.NO_REFERENCE);
820+
821+
// Create component and generate XML
822+
IApiComponent component = TestSuiteHelper.createTestingApiComponent("test", "test", description); //$NON-NLS-1$ //$NON-NLS-2$
823+
Document xml = getApiDescriptionXML(component);
824+
String xmlString = Util.serializeDocument(xml);
825+
826+
// Verify the XML contains the nested type
827+
assertTrue("XML should contain nested type", xmlString.contains("OuterClass$NestedClass")); //$NON-NLS-1$ //$NON-NLS-2$
828+
829+
// Restore from XML and verify the restriction is preserved
830+
IApiDescription restored = new ApiDescription(null);
831+
ApiDescriptionProcessor.annotateApiSettings(null, restored, xmlString);
832+
833+
IApiAnnotations annotations = restored.resolveAnnotations(nestedType);
834+
assertEquals("Nested type should have NO_REFERENCE restriction", //$NON-NLS-1$
835+
RestrictionModifiers.NO_REFERENCE, annotations.getRestrictions());
836+
}
803837
}

apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TestSuiteHelper.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,27 @@ public static void addAllRequired(IApiBaseline baseline, Set<String> done, IApiC
433433
}
434434
}
435435
}
436+
// The org.eclipse.core.contenttype bundle has new requirement for 4.38.
437+
// Require-Capability: osgi.extender;
438+
// filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
439+
// We need to manually add non-bundle requirements as a result.
440+
if (component.getSymbolicName().equals("org.eclipse.core.contenttype")) { //$NON-NLS-1$
441+
@SuppressWarnings("nls")
442+
String[] others = new String[] { "org.apache.felix.scr", "org.osgi.service.component",
443+
"org.osgi.util.promise", "org.osgi.util.function" };
444+
for (String implicit : others) {
445+
if (!done.contains(implicit)) {
446+
File bundle = getBundle(implicit);
447+
if (bundle != null) {
448+
IApiComponent apiComponent = ApiModelFactory.newApiComponent(baseline,
449+
bundle.getAbsolutePath());
450+
collection.add(apiComponent);
451+
done.add(apiComponent.getSymbolicName());
452+
addAllRequired(baseline, done, apiComponent, collection);
453+
}
454+
}
455+
}
456+
}
436457
if (error) {
437458
throw new CoreException(Status.error("Check the property : -DrequiredBundles=...\nMissing required bundle(s): " + String.valueOf(buffer))); //$NON-NLS-1$
438459
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src1"/>
6+
<classpathentry kind="src" path="src2"/>
7+
<classpathentry kind="output" path="bin"/>
8+
</classpath>

0 commit comments

Comments
 (0)