Permalink
Browse files

370502 fixed missing a.jre.javase/config.a.jre.javase IUs

Updated SlicerResolutionStrategy to consider JRE IUs.

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
  • Loading branch information...
1 parent e32d2c7 commit ab78009a7516c625886fb09cb4b1d77929ce2778 @ifedorenko ifedorenko committed Feb 3, 2012
View
@@ -12,7 +12,7 @@ export MAVEN_PARAMS="-Dmaven.repo.local=/tmp/tycho-bootstrap.localrepo -Dit.cliO
$TYCHO_M2_HOME/bin/mvn clean install -U -e -V ${MAVEN_PARAMS} || exit
-$TYCHO_M2_HOME/bin/mvn -f tycho-its/pom.xml clean test -U -e -V ${TYCHO_TEST_TARGET_PLATFORM} ${MAVEN_PARAMS} || exit
+$TYCHO_M2_HOME/bin/mvn -f tycho-its/pom.xml clean test -Pparallel -U -e -V ${TYCHO_TEST_TARGET_PLATFORM} ${MAVEN_PARAMS} || exit
# uncomment to generate project documentation
# $TYCHO_M2_HOME/bin/mvn -Dsite.generation site:stage ${MAVEN_PARAMS} || exit
@@ -214,8 +214,11 @@ public void test370502_requireJREIUs() throws Exception {
logger);
VersionedId seed = new VersionedId("sdk", "1.0.0");
- TargetDefinition definition = definitionWith(new PlannerLocationStub(TestRepositories.REQUIREJREIUS, seed));
- TargetPlatformContent units = subject.resolveContent(definition);
+ TargetPlatformContent units = subject.resolveContent(definitionWith(new PlannerLocationStub(
+ TestRepositories.REQUIREJREIUS, seed)));
+ assertThat(versionedIdsOf(units), bagEquals(versionedIdList(seed)));
+
+ units = subject.resolveContent(definitionWith(new LocationStub(TestRepositories.REQUIREJREIUS, seed)));
assertThat(versionedIdsOf(units), bagEquals(versionedIdList(seed)));
}
@@ -21,6 +21,8 @@
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.director.Slicer;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.query.CollectionResult;
+import org.eclipse.equinox.p2.query.CompoundQueryable;
import org.eclipse.equinox.p2.query.IQueryable;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.tycho.core.facade.MavenLogger;
@@ -37,6 +39,10 @@ public SlicerResolutionStrategy(MavenLogger logger) {
public Collection<IInstallableUnit> resolve(Map<String, String> properties, IProgressMonitor monitor) {
properties = addFeatureJarFilter(properties);
+ @SuppressWarnings("unchecked")
+ IQueryable<IInstallableUnit> availableIUs = new CompoundQueryable<IInstallableUnit>(toArray(this.availableIUs,
+ new CollectionResult<IInstallableUnit>(jreIUs)));
+
if (logger.isExtendedDebugEnabled()) {
logger.debug("Available IUs:\n" + ResolverDebugUtils.toDebugString(availableIUs, false, monitor));
logger.debug("Root IUs:\n" + ResolverDebugUtils.toDebugString(rootIUs, true));
@@ -56,7 +62,19 @@ public SlicerResolutionStrategy(MavenLogger logger) {
throw newResolutionException(slicer.getStatus());
}
- return slice.query(QueryUtil.ALL_UNITS, monitor).toSet();
+ Set<IInstallableUnit> result = new LinkedHashSet<IInstallableUnit>(slice.query(QueryUtil.ALL_UNITS, monitor)
+ .toUnmodifiableSet());
+ result.removeAll(jreIUs);
+
+ if (logger.isExtendedDebugEnabled()) {
+ logger.debug("Resolved IUs:\n" + ResolverDebugUtils.toDebugString(result, false));
+ }
+
+ return result;
+ }
+
+ private static <T> T[] toArray(T... t) {
+ return t;
}
protected boolean ignoreFilters() {

0 comments on commit ab78009

Please sign in to comment.