Skip to content

Commit

Permalink
Add Oomph's bundle pools to PDE's artifact repositories for resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
merks authored and HannesWell committed Nov 5, 2023
1 parent 84b2e1e commit 5c54fd8
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.File;
import java.net.URI;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -45,6 +46,7 @@
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.garbagecollector.GarbageCollector;
import org.eclipse.equinox.internal.p2.repository.helpers.RepositoryHelper;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
Expand Down Expand Up @@ -1395,7 +1397,7 @@ private IQueryResult<IInstallableUnit> slice(IInstallableUnit[] units, IQueryabl
* @exception CoreException
*/
private Collection<URI> getArtifactRepositories(ITargetDefinition target) throws CoreException {
Set<URI> result = new HashSet<>();
Set<URI> result = new LinkedHashSet<>();
ITargetLocation[] containers = target.getTargetLocations();
if (containers == null) {
containers = new ITargetLocation[0];
Expand All @@ -1418,7 +1420,16 @@ private Collection<URI> getArtifactRepositories(ITargetDefinition target) throws
// get all the artifact repos we know in the manager currently
result.addAll(Arrays.asList(manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL)));

// Add in the IDE profile bundle pool and all known workspaces
if (Boolean.parseBoolean(System.getProperty("pde.usePoolsInfo", "true"))) { //$NON-NLS-1$ //$NON-NLS-2$
try {
result.addAll(RepositoryHelper.getSharedBundlePools().stream().map(Path::toUri).toList());
} catch (Exception e) {
//$FALL-THROUGH$
}
}

// Add in the IDE profile bufindProfileReposndle pool and all known
// workspaces
findProfileRepos(result);
findWorkspaceRepos(result);
}
Expand Down

0 comments on commit 5c54fd8

Please sign in to comment.