Package dev.equo.solstice.p2
package dev.equo.solstice.p2
A simple implementation of p2 with the goal of making p2 an optional component of a project. It
accomplishes this by making it possible to incrementally switch some artifacts off of p2 and onto
maven central.
var session = new P2Session(); // stores all p2 metadata in memory
try (var client = new P2Client(cacheDir)) { // loads p2 metadata from a URL (and a disk cache) into the session
session.populateFrom(client, "https://download.eclipse.org/eclipse/updates/4.26")
}
var query = new P2Query(); // stores the results of a query against the p2 metadata, including requires/provides
query.platform(SwtPlatform.getRunning()); // filters artifacts based on the platform
query.resolve(session.getUnitById("org.eclipse.platform.ide.categoryIU")); // resolves dependencies of the given IU
for (String mavenCoord : query.jarsOnMavenCentral()) {
System.out.println("maven coordinate: " + mavenCoord);
}
for (P2Unit iu : query.jarsNotOnMavenCentral()) {
System.out.println("p2 only: " + ui.getId());
}
-
ClassDescriptionThere are a few things which EquoIDE needs to cache on the developer's machine.Formats P2Unit for display at the console.Determines which format to print the table in.Performs network requests and parsing against a P2 repository, aided by caching.The various caching modes that
P2Clientsupports.Follows the dependency information of a set ofP2Unitso that they can be installed from maven or directly from p2 if necessary.In-memory store of all p2 metadata, especially provides/requires dependency information.Keeps track of every unit which provides the given capability.Usually represents a jar file in a p2 repository, but could also be a "feature" or "group".Determines where a P2Unit is available.Maintains a registry of EquoIDE workspaces.