Skip to content

Commit

Permalink
Category match requirement must match 0...n items
Browse files Browse the repository at this point in the history
(cherry picked from commit e5463f5)
  • Loading branch information
laeubi committed Jan 19, 2024
1 parent 0079237 commit e0ad936
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 326 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public AbstractSiteDependenciesAction(String id, String version) {
this.version = version;
}

abstract SiteModel getSiteModel();
protected abstract SiteModel getSiteModel();

@Override
protected Set<IRequirement> getRequiredCapabilities() {
Expand Down Expand Up @@ -90,7 +90,7 @@ private IRequirement getRequirement(SiteIU iu) {
} else if ("match".equals(type)) {
IMatchExpression<IInstallableUnit> iuMatcher = ExpressionUtil.getFactory()
.<IInstallableUnit> matchExpression(ExpressionUtil.parse(expression), params);
return MetadataFactory.createRequirement(iuMatcher, null, 0, 1, true);
return MetadataFactory.createRequirement(iuMatcher, null, 0, Integer.MAX_VALUE, true);
} else if ("context".equals(type)) {
throw new IllegalStateException(
"Context iu queries are not supported in Tycho. Faulty expression is " + expression);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
import org.eclipse.equinox.internal.p2.updatesite.SiteModel;

public class CategoryDependenciesAction extends AbstractSiteDependenciesAction {
private final SiteModel siteModel;
private final SiteModel siteModel;

public CategoryDependenciesAction(SiteModel siteModel, String id, String version) {
super(id, version);
this.siteModel = siteModel;
}
public CategoryDependenciesAction(SiteModel siteModel, String id, String version) {
super(id, version);
this.siteModel = siteModel;
}

@Override
SiteModel getSiteModel() {
return this.siteModel;
}
@Override
protected SiteModel getSiteModel() {
return this.siteModel;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void afterProjectsRead(MavenSession session) throws MavenExecutionExcepti
+ session.getUserProperties().getProperty(TychoConstants.SESSION_PROPERTY_TYCHO_MODE, "project"));
log.info("Tycho Builder: "
+ session.getUserProperties().getProperty(TychoConstants.SESSION_PROPERTY_TYCHO_BUILDER, "maven"));
log.info("Build Threads: " + session.getRequest().getDegreeOfConcurrency());
if (disableLifecycleParticipation(session)) {
buildListeners.notifyBuildStart(session);
return;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.spi.p2.publisher.PublisherHelper;
import org.eclipse.tycho.p2maven.actions.AbstractDependenciesAction;

public class FeatureDependenciesAction extends AbstractDependenciesAction {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.eclipse.equinox.p2.publisher.AdviceFileAdvice;
import org.eclipse.equinox.p2.publisher.IPublisherInfo;
import org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry;
import org.eclipse.tycho.p2maven.actions.AbstractDependenciesAction;

public class ProductDependenciesAction extends AbstractDependenciesAction {
private final IProductDescriptor product;
Expand All @@ -53,7 +54,7 @@ protected Set<IRequirement> getRequiredCapabilities() {
ProductContentType type = product.getProductContentType();
if (type == ProductContentType.FEATURES || type == ProductContentType.MIXED) {
for (IVersionedId feature : product.getFeatures()) {
String id = feature.getId() + FEATURE_GROUP_IU_SUFFIX; //$NON-NLS-1$
String id = feature.getId() + FEATURE_GROUP_IU_SUFFIX;
Version version = feature.getVersion();

addRequiredCapability(required, id, version, null, false);
Expand Down
Loading

0 comments on commit e0ad936

Please sign in to comment.