/** * p2 repositories are polluted with useless a.jre/config.a.jre IUs. These IUs do not represent * current/desired JRE and can expose resolver to packages that are not actually available. */ @Override public boolean isNonApplicableEEUnit(IInstallableUnit iu) { // See JREAction return iu.getId().startsWith("a.jre") || iu.getId().startsWith("config.a.jre"); }
private Collection<IInstallableUnit> getIUs(Collection<IInstallableUnit> ius, String prefix) { Set<IInstallableUnit> result = new HashSet<>(); for (IInstallableUnit tmp : ius) { if (tmp.getId().startsWith(prefix)) result.add(tmp); } return result; }
private Collection<IInstallableUnit> getIUs(Collection<IInstallableUnit> ius, String prefix) { Set<IInstallableUnit> result = new HashSet<IInstallableUnit>(); for (IInstallableUnit tmp : ius) { if (tmp.getId().startsWith(prefix)) result.add(tmp); } return result; }
public String getLabel(Object o) { IInstallableUnit iu = getIU(); if (iu != null) return iu.getId(); return null; }
public String getText(Object element) { IInstallableUnit iu = ProvUI.getAdapter(element, IInstallableUnit.class); return iu.getId(); } });
public String getText(Object element) { if (element instanceof RemedyIUDetail) { RemedyIUDetail iu = (RemedyIUDetail) element; return iu.getIu().getId(); } return ""; //$NON-NLS-1$ } });
private String getIUString(IInstallableUnit iu) { if (iu == null) return Messages.PlanAnalyzer_Items; // Get the iu name in the default locale String name = iu.getProperty(IInstallableUnit.PROP_NAME, null); if (name != null) return name; return iu.getId(); }
@Override public Map<String, String> getArtifactProperties(IInstallableUnit iu, IArtifactDescriptor descriptor) { final StringBuilder builder = new StringBuilder(); builder.append(iu.getId()); builder.append('/'); builder.append(iu.getVersion()); // Workaround bug Bug 539672 ((ArtifactDescriptor) descriptor).setProperty(PROPERTY_NAME, builder.toString()); return null; }
protected IStatus initializeOperand(IProfile profile, InstallableUnitOperand operand, Map<String, Object> parameters, IProgressMonitor monitor) { IInstallableUnit iu = operand.second(); monitor.subTask(NLS.bind(Messages.Phase_Configure_Task, iu.getId())); parameters.put(PARM_IU, iu); Collection<IArtifactKey> artifacts = iu.getArtifacts(); if (artifacts != null && artifacts.size() > 0) parameters.put(PARM_ARTIFACT, artifacts.iterator().next()); return Status.OK_STATUS; } }
@Override protected IStatus initializeOperand(IProfile profile, InstallableUnitOperand operand, Map<String, Object> parameters, IProgressMonitor monitor) { IInstallableUnit iu = operand.second(); monitor.subTask(NLS.bind(Messages.Phase_Configure_Task, iu.getId())); parameters.put(PARM_IU, iu); Collection<IArtifactKey> artifacts = iu.getArtifacts(); if (artifacts != null && artifacts.size() > 0) parameters.put(PARM_ARTIFACT, artifacts.iterator().next()); return Status.OK_STATUS; } }
public static org.eclipse.tycho.ArtifactKey toTychoArtifact(IInstallableUnit unit) { // TODO 428889 unit test & add more cases if (Boolean.valueOf(unit.getProperty(InstallableUnitDescription.PROP_TYPE_GROUP))) { // TODO 428889 check suffix String id = unit.getId(); return new DefaultArtifactKey(ArtifactType.TYPE_ECLIPSE_FEATURE, id.substring(0, id.length() - ".feature.group".length()), unit.getVersion().toString()); } throw new IllegalArgumentException(unit.toString()); }
public static IStatus getInstallHandlerStatus(IProvisioningPlan plan) { IQueryResult<IInstallableUnit> result = plan.getAdditions().query(QueryUtil.createIUAnyQuery(), null); for (Iterator<IInstallableUnit> iterator = result.iterator(); iterator.hasNext();) { IInstallableUnit iu = iterator.next(); if (iu != null && iu.getProperty(ECLIPSE_INSTALL_HANDLER_PROP) != null) return new Status(IStatus.ERROR, ProvUIActivator.PLUGIN_ID, NLS.bind(ProvUIMessages.UpdateManagerCompatibility_ItemRequiresUpdateManager, iu.getId())); } return Status.OK_STATUS; }
public Map<String, String> getIUProperties(IInstallableUnit iu) { if (iusPropertiesHandler == null) return null; Map<String, Map<String, String>> iusPropertiesMap = iusPropertiesHandler.getIUsPropertiesMap(); if (iusPropertiesMap == null) return null; String iuIdentity = iu.getId() + "_" + iu.getVersion().toString(); //$NON-NLS-1$ return iusPropertiesMap.get(iuIdentity); } }
private static IInstallableUnit removeExportedPackages(IInstallableUnit initialUnit) { InstallableUnitDescription iud = new InstallableUnitDescription(); iud.setId(initialUnit.getId()); iud.setVersion(initialUnit.getVersion()); initialUnit.getProvidedCapabilities().stream() .filter(cap -> !PublisherHelper.CAPABILITY_NS_JAVA_PACKAGE.equals(cap.getNamespace())) .map(Collections::singleton).forEach(iud::addProvidedCapabilities); return MetadataFactory.createInstallableUnit(iud); }
public int compareTo(IInstallableUnit other) { int cmp = getId().compareTo(other.getId()); if (cmp == 0) cmp = getVersion().compareTo(other.getVersion()); return cmp; }
public int compareTo(IInstallableUnit other) { int cmp = getId().compareTo(other.getId()); if (cmp == 0) cmp = getVersion().compareTo(other.getVersion()); return cmp; }
private static IRequirement createStrictRequirementTo(IInstallableUnit unit) { VersionRange strictRange = new VersionRange(unit.getVersion(), true, unit.getVersion(), true); int min = 1; int max = Integer.MAX_VALUE; boolean greedy = true; IRequirement requirement = MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, unit.getId(), strictRange, unit.getFilter(), min, max, greedy); return requirement; } }
private void addExternalMavenArtifact(DefaultP2ResolutionResult result, IArtifactFacade mavenArtifact, IInstallableUnit iu) { String id = iu.getId(); String version = iu.getVersion().toString(); String mavenClassifier = iu.getProperty(RepositoryLayoutHelper.PROP_CLASSIFIER); File location = mavenArtifact.getLocation(); addMavenArtifact(result, iu, id, version, mavenClassifier, location); }
private void createAdditionRemedyDetail(IInstallableUnit iu, Remedy remedy) { RemedyIUDetail iuDetail = new RemedyIUDetail(iu); iuDetail.setStatus(RemedyIUDetail.STATUS_ADDED); iuDetail.setBeingInstalledVersion(iu.getVersion()); iuDetail.setRequestedVersion(searchInOriginalRequest(iu.getId())); remedy.addRemedyIUDetail(iuDetail); }