Skip to content

Commit

Permalink
Add m2e to the catalog (#95 first part of #18)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Feb 26, 2023
2 parents 350ed5a + 43becfd commit 250fb25
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 24 deletions.
15 changes: 9 additions & 6 deletions CATALOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
- [`kotlin`](#kotlin)
- [`cdt`](#cdt) and [`tmTerminal`](#tmterminal)
- [`rust`](#rust)
- [`m2e`](#m2e)
- [Wishlist](#wishlist)
- [Eclipse Corrosion (Rust)](#eclipse-rust)
- [Eclipse Groovy Development Tools](#eclipse-groovy)
- [Eclipse Web Tools Platform](#eclipse-wtp)
- [Eclipse m2e (Maven integration)](#eclipse-m2e)
- (PR's welcome!)

## Available in DSL
Expand Down Expand Up @@ -79,6 +78,14 @@ This catalog is a useful reference for the p2 urls, code repositories, and issue
- Latest release https://download.eclipse.org/corrosion/releases/1.2.4/
- Code & issues https://github.com/eclipse/corrosion

### `m2e`

- Latest release https://download.eclipse.org/technology/m2e/releases/2.1.2/
- Code & issues https://github.com/eclipse-m2e/m2e-core
- Also a transitive dependency on some jars from
- https://download.eclipse.org/webtools/downloads/drops/R3.28.0/R-3.28.0-20221120050827/repository/
- https://download.eclipse.org/lsp4j/updates/releases/0.20.0

## Wishlist

The projects below are not in the catalog yet, but
Expand All @@ -95,7 +102,3 @@ The projects below are not in the catalog yet, but
- Code & issues ?

<a name="eclipse-m2e"></a>
### Eclipse m2e (Maven integration)

- Latest release https://download.eclipse.org/technology/m2e/releases/2.1.2/
- Code & issues https://github.com/eclipse-m2e/m2e-core
3 changes: 2 additions & 1 deletion plugin-gradle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format.
- `equoIde` now downloads its dependencies only if it is called directly. This means that CI builds don't need to download IDE dependencies. ([#89]https://github.com/equodev/equo-ide/pull/89))
- Also, `equoIde` no longer adds `mavenCentral()` automatically.
- Gradle DSL now includes `rust`. ([#94](https://github.com/equodev/equo-ide/pull/94))
- Gradle DSL now includes `m2e`. ([#95](https://github.com/equodev/equo-ide/pull/95))

## [0.15.0] - 2023-02-19
### Added
Expand Down Expand Up @@ -124,4 +125,4 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format.
- Most of the Eclipse JDT UI now lights up, but we're still having problems with the JDT project nature.

## [0.1.0] - 2022-12-05
- First release to test publishing infrastructure, not meant for end users.
- First release to test publishing infrastructure, not meant for end users.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ public void pde() {
pde(null);
}

public static class M2E extends GradleCatalogDsl {
public M2E(String urlOverride, Project project) {
super(Catalog.M2E, urlOverride);
}
}

public void m2e(String urlOverride) {
add(new M2E(urlOverride, project));
}

public void m2e() {
m2e(null);
}

public static class Kotlin extends GradleCatalogDsl {
public Kotlin(String urlOverride, Project project) {
super(Catalog.KOTLIN, urlOverride);
Expand Down
4 changes: 3 additions & 1 deletion plugin-maven/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format.
- Maven DSL now includes `kotlin`. ([#91](https://github.com/equodev/equo-ide/pull/91))
- Maven DSL now includes `tmTerminal` and `cdt`. ([#92](https://github.com/equodev/equo-ide/pull/92))
- Maven DSL now includes `rust`. ([#94](https://github.com/equodev/equo-ide/pull/94))
- Maven DSL now includes `m2e`. ([#95](https://github.com/equodev/equo-ide/pull/95))
- Partially functional, watch [#18](https://github.com/equodev/equo-ide/issues/18) for progress on automatic import.
### Fixed
- Further improved Windows launch experience. ([#44](https://github.com/equodev/equo-ide/issues/44))

Expand Down Expand Up @@ -114,4 +116,4 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format.
- Fixes some missing fields in the plugin metadata.

## [0.1.0] - 2022-12-05
- First release to test publishing infrastructure, not meant for end users.
- First release to test publishing infrastructure, not meant for end users.
6 changes: 3 additions & 3 deletions plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Use it like this with `mvn equo-ide:launch`
## Task listing

- `equo-ide:launch` to launch
- `equoIde -Dclean=true` wipes all workspace settings and state before rebuilding and launching.
- `equoIde -DshowConsole=true` pipes console output of launched IDE to the build console.
- `equoIde -DinitOnly=true` initializes the runtime to check for errors then exits.
- `equoIde -Dclean` wipes all workspace settings and state before rebuilding and launching.
- `equoIde -DshowConsole` pipes console output of launched IDE to the build console.
- `equoIde -DinitOnly` initializes the runtime to check for errors then exits.
- `equoIde -DdebugClasspath=[names|paths]` dumps the classpath (in order) without starting the application.
- `equoIde -DdebugIde` blocks IDE startup and prints instructions to help you attach a remote debugger.
- `equoIde -DuseAtomos=[true|false]` determines whether to use Atomos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public Pde() {
}
}

@Parameter private M2E m2e;

public static class M2E extends MavenCatalogDsl {
public M2E() {
super(Catalog.M2E);
}
}

@Parameter private Kotlin kotlin;

public static class Kotlin extends MavenCatalogDsl {
Expand Down Expand Up @@ -116,7 +124,7 @@ protected void modifyModel(P2Model model, IdeHook.List ideHooks) {
new CatalogDsl.TransitiveAwareList<>();
// NB: each entry must be after all of its transitive dependencies
// e.g. jdt must be after platform
Stream.of(platform, jdt, gradleBuildship, pde)
Stream.of(platform, jdt, gradleBuildship, pde, m2e, kotlin, tmTerminal, cdt, rust)
.filter(Objects::nonNull)
.forEach(
dsl -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ equo-ide:launch
kotlin
(no description available)

m2e
(no description available)

p2repos
(no description available)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ equo-ide:list
kotlin
(no description available)

m2e
(no description available)

optional (Default: false)
User property: optional
Lists any optional requirements which were not installed.
Expand Down
5 changes: 3 additions & 2 deletions solstice/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format.
- Catalog now includes `kotlin`. ([#91](https://github.com/equodev/equo-ide/pull/91))
- Catalog now includes `tmTerminal` and `cdt`. ([#92](https://github.com/equodev/equo-ide/pull/92))
- Catalog now includes `rust`. ([#94](https://github.com/equodev/equo-ide/pull/94))
- Catalog now includes `m2e`. ([#95](https://github.com/equodev/equo-ide/pull/95))
### Fixed
- Bundles without activators are now treated as `lazy=true` since there's no need to eagerly activate them. ([#90](https://github.com/equodev/equo-ide/pull/90))
- Concurrent modification errors in service registry have been fixed by adding a custom datastructure. ([#90](https://github.com/equodev/equo-ide/pull/90))
- We can now handle p2 update sites without a `p2.index` file. ([#91](https://github.com/equodev/equo-ide/pull/91))
- Solstice Shim's URL handler now handles missing resources correctly. ([#91](https://github.com/equodev/equo-ide/pull/91))
- Solstice Shim's URL handler now handles missing resources correctly. ([#91](https://github.com/equodev/equo-ide/pull/91) and [#95](https://github.com/equodev/equo-ide/pull/95))
- The Eclipse home location system property is now a proper `file:/` URL. ([#92](https://github.com/equodev/equo-ide/pull/92))
- `IdeMainUi` now has a mechanism to allow certain lazy bundles to activate earlier than normal, which was needed for `tmTerminal`. ([#92](https://github.com/equodev/equo-ide/pull/92))
- Added support for the legacy header `Eclipse-LazyStart`. ([#92](https://github.com/equodev/equo-ide/pull/92))
Expand Down Expand Up @@ -136,4 +137,4 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format.
- Most of the Eclipse JDT UI now lights up, but we're still having problems with the JDT project nature.

## [0.1.0] - 2022-12-05
- First release to test publishing infrastructure, not meant for end users.
- First release to test publishing infrastructure, not meant for end users.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ public static void main(String[] args)
solstice.openShim(props);
ShimIdeBootstrapServices.apply(props, solstice.getContext());
}
solstice.start("org.apache.felix.scr");
solstice.startAllWithLazy(false);
solstice.start("org.eclipse.ui.ide.application");
if (useAtomos) {
Expand Down
26 changes: 25 additions & 1 deletion solstice/src/main/java/dev/equo/ide/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,38 @@ public class Catalog implements Comparable<Catalog> {
"3.1.6.v20220511-1359",
List.of("org.eclipse.buildship.feature.group"),
JDT);

/** Pure transitive of m2e and others */
private static final Catalog LSP4J =
new Catalog(
"lsp4j", "https://download.eclipse.org/lsp4j/updates/releases/" + V, "0.20.0", List.of());

/** Pure transitive of m2e and others */
private static final Catalog WST =
new Catalog(
"wst",
"https://download.eclipse.org/webtools/downloads/drops/" + V + "/repository/",
"R3.28.0/R-3.28.0-20221120050827",
List.of());

public static final Catalog M2E =
new Catalog(
"m2e",
"https://download.eclipse.org/technology/m2e/releases/" + V,
"2.1.2",
List.of("org.eclipse.m2e.feature.feature.group"),
JDT,
WST,
LSP4J);
public static final Catalog PDE =
new Catalog("pde", PLATFORM, List.of("org.eclipse.releng.pde.categoryIU"), JDT);

public static final Catalog KOTLIN =
new Catalog(
"kotlin",
"https://files.pkg.jetbrains.space/kotlin/p/kotlin-eclipse/main/" + V,
"0.8.21", // 0.8.24 is broken in many ways
"0.8.21", // 0.8.24 is broken in many
// ways
List.of(
"org.jetbrains.kotlin.feature.feature.group",
"org.jetbrains.kotlin.gradle.feature.feature.group"),
Expand Down
35 changes: 34 additions & 1 deletion solstice/src/main/java/dev/equo/solstice/Capability.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,42 @@ public void put(Capability cap, T value) {
map.put(cap.swap(2, 0, 1), value);
map.put(cap.swap(2, 1, 0), value);
break;
case 4:
map.put(cap, value);
// map.put(cap.swap(0, 1, 2, 3), value); // same as just cap
map.put(cap.swap(0, 1, 3, 2), value);
map.put(cap.swap(0, 2, 1, 3), value);
map.put(cap.swap(0, 2, 3, 1), value);
map.put(cap.swap(0, 3, 1, 2), value);
map.put(cap.swap(0, 3, 2, 1), value);
map.put(cap.swap(1, 0, 2, 3), value);
map.put(cap.swap(1, 0, 3, 2), value);
map.put(cap.swap(1, 2, 0, 3), value);
map.put(cap.swap(1, 2, 3, 0), value);
map.put(cap.swap(1, 3, 0, 2), value);
map.put(cap.swap(1, 3, 2, 0), value);
map.put(cap.swap(2, 0, 1, 3), value);
map.put(cap.swap(2, 0, 3, 1), value);
map.put(cap.swap(2, 1, 0, 3), value);
map.put(cap.swap(2, 1, 3, 0), value);
map.put(cap.swap(2, 3, 0, 1), value);
map.put(cap.swap(2, 3, 1, 0), value);
map.put(cap.swap(3, 0, 1, 2), value);
map.put(cap.swap(3, 0, 2, 1), value);
map.put(cap.swap(3, 1, 0, 2), value);
map.put(cap.swap(3, 1, 2, 0), value);
map.put(cap.swap(3, 2, 1, 0), value);
map.put(cap.swap(3, 2, 0, 1), value);
break;
default:
throw Unimplemented.onPurpose(
"Solstice only supports Capabilities with at most 3 properties, see Capabilities javadoc for how to remove this limitation");
"Solstice only supports Capabilities with at most 4 properties, this was "
+ cap.size()
+ "\n"
+ cap
+ " = "
+ value
+ ", see Capabilities javadoc for how to remove this limitation");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ public URL toFileURL(URL url) throws IOException {
}

@Override
public URL resolve(URL url) throws IOException {
throw Unimplemented.onPurpose();
public URL resolve(URL url) {
return url;
}

private static final String DOT_JAR_EX_SLASH = ".jar!/";
Expand Down
8 changes: 3 additions & 5 deletions solstice/src/main/java/dev/equo/solstice/Solstice.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand All @@ -38,10 +37,8 @@ public class Solstice {
* expressed in the manifest. This map is an easy way to fix cases such as this.
*/
private static Map<String, List<String>> knownMissingBundleDependencies() {
var missing = new HashMap<String, List<String>>();
missing.put(
return Map.of(
"org.eclipse.equinox.p2.reconciler.dropins", List.of("org.eclipse.equinox.p2.updatesite"));
return missing;
}

public static Solstice findBundlesOnClasspath() {
Expand Down Expand Up @@ -313,7 +310,8 @@ private void assertContextInitialized(boolean isInitialized) {

public void openAtomos(Map<String, String> props) throws BundleException {
assertContextInitialized(false);
// the spelled-out package is on purpose so that Atomos can remain an optional component
// the spelled-out package is on purpose so that Atomos can remain an optional
// component
// works together with
// https://github.com/equodev/equo-ide/blob/aa7d30cba9988bc740ff4bc4b3015475d30d187c/solstice/build.gradle#L16-L22
context = dev.equo.solstice.BundleContextAtomos.hydrate(this, props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected URLConnection openConnection(URL u) throws IOException {
}
var entry = bundle.getEntry(resource);
if (entry == null) {
return null;
throw new IOException("No such URL " + u);
}
return entry.openConnection();
} else {
Expand Down

0 comments on commit 250fb25

Please sign in to comment.