Skip to content

Commit

Permalink
[revert] Not all (direct) requirements of a feature are considered when
Browse files Browse the repository at this point in the history
building an update-site
  • Loading branch information
laeubi committed Aug 25, 2022
1 parent 328fed8 commit 01549a4
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 145 deletions.
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Expand Up @@ -2,6 +2,12 @@

This page describes the noteworthy improvements provided by each release of Eclipse Tycho.

## 2.7.5

Fixes:

- [reverted] Not all (direct) requirements of a feature are considered when building an update-site

## 2.7.4

Fixes:
Expand Down
Expand Up @@ -19,19 +19,12 @@
import java.util.stream.Stream;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.director.Slicer;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.mirroring.Mirroring;
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor;
import org.eclipse.equinox.p2.internal.repository.tools.SlicingOptions;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
import org.eclipse.equinox.p2.query.IQueryable;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryReference;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
Expand Down Expand Up @@ -68,46 +61,6 @@ protected IArtifactRepository initializeDestination(RepositoryDescriptor toInit,
return result;
}

@Override
protected Slicer createSlicer(SlicingOptions options) {
Map<String, String> context = options.getFilter();
boolean includeOptionalDependencies = options.includeOptionalDependencies();
boolean onlyFilteredRequirements = options.followOnlyFilteredRequirements();
boolean considerFilter = (context != null && context.size() > 1) ? true : false;
PermissiveSlicer slicer = new PermissiveSlicer(getCompositeMetadataRepository(), context,
includeOptionalDependencies, options.isEverythingGreedy(), options.forceFilterTo(),
options.considerStrictDependencyOnly(), onlyFilteredRequirements) {
@Override
protected boolean isApplicable(IInstallableUnit iu, IRequirement req) {
if (QueryUtil.isGroup(iu)) {
if (req instanceof IRequiredCapability) {
if (IInstallableUnit.NAMESPACE_IU_ID.equals(((IRequiredCapability) req).getNamespace())) {
if (!includeOptionalDependencies) {
if (req.getMin() == 0) {
return false;
}
}
IMatchExpression<IInstallableUnit> filter = req.getFilter();
if (considerFilter) {
if (onlyFilteredRequirements && filter == null) {
return false;
}
return filter == null || filter.isMatch(selectionContext);
}
if (filter == null && onlyFilteredRequirements) {
return false;
}
return true;
}
}
}
return super.isApplicable(iu, req);
}

};
return slicer;
}

@Override
protected IMetadataRepository initializeDestination(RepositoryDescriptor toInit, IMetadataRepositoryManager mgr)
throws ProvisionException {
Expand Down
Expand Up @@ -144,7 +144,7 @@ public void testMirrorPatch() throws Exception {
subject.mirrorReactor(sourceRepos("patch", "e352"), destinationRepo, seedFor(FEATURE_PATCH_IU), context, false,
false, null);

//TODO why mirror tool emits a warning here? logVerifier.expectNoWarnings();
logVerifier.expectNoWarnings();
assertTrue(repoFile(destinationRepo, "plugins/org.eclipse.core.runtime_3.5.0.v20090525.jar").exists());
assertTrue(repoFile(destinationRepo, "features/" + FEATURE_PATCH + "_1.0.0.jar").exists());
}
Expand Down
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="Target platform for Tycho's bundles" sequenceNumber="324">
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Target platform for Tycho's bundles" sequenceNumber="324">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
Expand Down Expand Up @@ -42,10 +40,5 @@
</dependency>
</dependencies>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/eclipse/updates/4.24/R-4.24-202206070700/"/>
<unit id="org.eclipse.equinox.p2.director" version="2.5.300.v20220421-0708"/>
<unit id="org.eclipse.equinox.p2.repository.tools" version="2.3.100.v20220504-1755"/>
</location>
</locations>
</target>

This file was deleted.

10 changes: 0 additions & 10 deletions tycho-its/projects/feature.dependency/feature/feature.xml

This file was deleted.

39 changes: 0 additions & 39 deletions tycho-its/projects/feature.dependency/pom.xml

This file was deleted.

4 changes: 0 additions & 4 deletions tycho-its/projects/feature.dependency/site/category.xml

This file was deleted.

This file was deleted.

Expand Up @@ -60,7 +60,7 @@ public void testEclipseRepositoryNonTransitive() {
assertTrue(checkFileWithPrefixExists(pluginsDir, "tycho551.bundle1_"));

assertFalse(checkFileWithPrefixExists(pluginsDir, "tycho551.bundle2_"));
assertTrue(checkFileWithPrefixExists(pluginsDir, "tycho551.bundle3_"));
assertFalse(checkFileWithPrefixExists(pluginsDir, "tycho551.bundle3_"));
assertFalse(checkFileWithPrefixExists(pluginsDir, "org.eclipse.osgi_"));
assertFalse(checkFileWithPrefixExists(pluginsDir, "org.junit_"));
}
Expand Down

0 comments on commit 01549a4

Please sign in to comment.