|
| 1 | +# Eclipse Linux Tools – Copilot Instructions |
| 2 | + |
| 3 | +## Build and Test |
| 4 | + |
| 5 | +```bash |
| 6 | +mvn clean verify |
| 7 | +``` |
| 8 | + |
| 9 | +Tests require a virtual display (Xvnc) because they run in a UI harness. On CI this is handled automatically. Locally, use `Xvfb` or skip UI tests with `-DskipTests`. |
| 10 | + |
| 11 | +## Architecture |
| 12 | + |
| 13 | +This is a **multi-module Eclipse/OSGi plugin project** built with **Maven + Tycho**. It is not a standard Java application — every plugin is an OSGi bundle declared in `META-INF/MANIFEST.MF`, not just a Maven artifact. |
| 14 | + |
| 15 | +### Top-level modules |
| 16 | + |
| 17 | +| Directory | Content | |
| 18 | +|---------------|---------| |
| 19 | +| `containers/` | Docker integration (UI, core, Dockerfile LS, tests) | |
| 20 | +| `rpm/` | RPM `.spec` editor, rpmlint integration, RPM core | |
| 21 | +| `profiling/` | Shared profiling launch framework, data viewers, remote/SSH proxy | |
| 22 | +| `gcov/` | GCov coverage analysis | |
| 23 | +| `gprof/` | GProf call-graph profiling | |
| 24 | +| `valgrind/` | Valgrind heap analysis | |
| 25 | +| `perf/` | Linux `perf` call profiling | |
| 26 | +| `systemtap/` | SystemTap IDE integration | |
| 27 | +| `changelog/` | ChangeLog editor/formatter | |
| 28 | +| `libhover/` | C library hover documentation | |
| 29 | +| `lttng/` | LTTng tracing support | |
| 30 | +| `vagrant/` | Vagrant VM integration | |
| 31 | +| `releng/` | Update sites, target platform, release engineering | |
| 32 | + |
| 33 | +Each top-level directory is itself a Maven aggregator `pom.xml` listing its plugins, features, docs, and test plugins as `<module>` entries. |
| 34 | + |
| 35 | +### Target platform |
| 36 | + |
| 37 | +All dependencies are defined in: |
| 38 | +``` |
| 39 | +releng/org.eclipse.linuxtools.target/linuxtools-latest.target |
| 40 | +``` |
| 41 | +This file is auto-updated daily against the latest Eclipse Orbit and SimRel repositories. Do **not** hand-edit dependency versions for Eclipse platform dependencies in `pom.xml` — add them to the `.target` file instead. |
| 42 | + |
| 43 | +### Plugin naming conventions |
| 44 | + |
| 45 | +- **Core logic:** `org.eclipse.linuxtools.<component>.core` |
| 46 | +- **UI:** `org.eclipse.linuxtools.<component>.ui` |
| 47 | +- **Tests:** `org.eclipse.linuxtools.<component>.*.tests` — packaged as `eclipse-test-plugin` |
| 48 | +- **Features:** `org.eclipse.linuxtools.<component>-feature` — packaged as `eclipse-feature` |
| 49 | +- **Internal (non-API) packages:** `org.eclipse.linuxtools.internal.<component>.*` |
| 50 | + |
| 51 | +Public API lives in `org.eclipse.linuxtools.<component>.*`; implementation details live under `org.eclipse.linuxtools.internal.<component>.*`. |
| 52 | + |
| 53 | +### Two separate update sites |
| 54 | + |
| 55 | +The `releng/` module produces two p2 repositories: |
| 56 | +- `org.eclipse.linuxtools.releng-site` — all tools except containers |
| 57 | +- `org.eclipse.linuxtools.docker-site` — Docker/container tools only |
| 58 | + |
| 59 | +## Key Conventions |
| 60 | + |
| 61 | +### Java and OSGi |
| 62 | +- **Java 21** is required (`Bundle-RequiredExecutionEnvironment: JavaSE-21` in all manifests). |
| 63 | +- Plugin dependencies are declared in `META-INF/MANIFEST.MF` via `Require-Bundle` or `Import-Package`, not Maven `<dependency>`. Tycho resolves the classpath from these. |
| 64 | +- Each plugin `pom.xml` contains almost nothing — just the parent reference and `<packaging>eclipse-plugin</packaging>`. |
| 65 | + |
| 66 | +### Tests |
| 67 | +- Tests use **JUnit 5 (Jupiter)**: `org.junit.jupiter.api.Assertions`, `@Test`, `@BeforeEach`, `@AfterEach`. |
| 68 | +- Test plugins run inside a live Eclipse workbench (`useUIHarness=true`, `useUIThread=true`). Tests can use Eclipse workspace and UI APIs directly. |
| 69 | + |
| 70 | +### Copyright header |
| 71 | +Every Java file must start with: |
| 72 | +```java |
| 73 | +/******************************************************************************* |
| 74 | + * Copyright (c) <year> <Author> and others. |
| 75 | + * |
| 76 | + * This program and the accompanying materials are made |
| 77 | + * available under the terms of the Eclipse Public License 2.0 |
| 78 | + * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| 79 | + * |
| 80 | + * SPDX-License-Identifier: EPL-2.0 |
| 81 | + * |
| 82 | + * Contributors: |
| 83 | + * <Author> - initial API and implementation |
| 84 | + *******************************************************************************/ |
| 85 | +``` |
| 86 | + |
| 87 | +### Commits |
| 88 | +Non-committers must add a `Signed-off-by` trailer and have a signed [Eclipse Contributor Agreement (ECA)](http://www.eclipse.org/legal/ECA.php) on file. |
| 89 | + |
| 90 | +### Release branches |
| 91 | +Stable branches are named `stable-<x>` (e.g., `stable-8.5`). The `master` branch always targets the next SNAPSHOT version. |
0 commit comments