use of org.eclipse.tycho.ReactorProjectIdentities in project tycho by eclipse.
the class TargetPlatformFactoryTest method testConfiguredFiltersOnReactorIUsInFinalTP.
@Test
public void testConfiguredFiltersOnReactorIUsInFinalTP() throws Exception {
TargetPlatformFilter filter = TargetPlatformFilter.removeAllFilter(CapabilityPattern.patternWithoutVersion(CapabilityType.P2_INSTALLABLE_UNIT, "iu.p2.inf"));
tpConfig.addFilters(Arrays.asList(filter));
P2TargetPlatform preliminaryTP = subject.createTargetPlatform(tpConfig, NOOP_EE_RESOLUTION_HANDLER, null, null);
Map<IInstallableUnit, ReactorProjectIdentities> finalUnits = new HashMap<>();
finalUnits.put(InstallableUnitUtil.createIU("test.feature.feature.group"), DUMMY_PROJECT);
finalUnits.put(InstallableUnitUtil.createIU("iu.p2.inf"), DUMMY_PROJECT);
P2TargetPlatform finalTP = subject.createTargetPlatformWithUpdatedReactorUnits(preliminaryTP, finalUnits, REACTOR_ARTIFACTS);
assertThat(finalTP.getInstallableUnits(), hasItem(unitWithId("test.feature.feature.group")));
assertThat(finalTP.getInstallableUnits(), not(hasItem(unitWithId("iu.p2.inf"))));
}
use of org.eclipse.tycho.ReactorProjectIdentities in project tycho by eclipse.
the class TargetPlatformFactoryImpl method extractProjectResultIUs.
private static Map<IInstallableUnit, ReactorProjectIdentities> extractProjectResultIUs(List<PublishingRepository> projectResults) {
Map<IInstallableUnit, ReactorProjectIdentities> reactorUnits = new LinkedHashMap<>();
for (PublishingRepository projectResult : projectResults) {
Set<IInstallableUnit> projectUnits = projectResult.getMetadataRepository().query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet();
ReactorProjectIdentities project = projectResult.getProjectIdentities();
for (IInstallableUnit projectUnit : projectUnits) {
reactorUnits.put(projectUnit, project);
}
}
return reactorUnits;
}
use of org.eclipse.tycho.ReactorProjectIdentities in project tycho by eclipse.
the class P2ResolverImpl method addUnit.
private void addUnit(DefaultP2ResolutionResult result, IInstallableUnit iu, ReactorProject currentProject, Set<String> missingArtifacts) {
if (currentProjectUnits.contains(iu)) {
addReactorProject(result, currentProject.getIdentities(), iu);
return;
}
ReactorProjectIdentities otherProject = context.getOriginalReactorProjectMap().get(iu);
if (otherProject != null) {
addReactorProject(result, otherProject, iu);
return;
}
IArtifactFacade mavenArtifact = context.getOriginalMavenArtifactMap().get(iu);
if (mavenArtifact != null) {
addExternalMavenArtifact(result, mavenArtifact, iu);
return;
}
for (IArtifactKey key : iu.getArtifacts()) {
// this downloads artifacts if necessary; TODO parallelize download?
File artifactLocation = context.getLocalArtifactFile(key);
if (artifactLocation == null) {
missingArtifacts.add(key.toString());
} else {
addArtifactFile(result, iu, key, artifactLocation);
}
}
}
use of org.eclipse.tycho.ReactorProjectIdentities in project tycho by eclipse.
the class MirrorApplicationServiceTest method initTestContext.
@Before
public void initTestContext() throws Exception {
destinationRepo = new DestinationRepositoryDescriptor(tempFolder.newFolder("dest"), DEFAULT_NAME);
File projectFolder = tempFolder.getRoot();
ReactorProjectIdentities currentProject = new ReactorProjectIdentitiesStub(projectFolder);
context = new BuildContext(currentProject, DEFAULT_QUALIFIER, DEFAULT_ENVIRONMENTS);
subject = new MirrorApplicationServiceImpl();
MavenContext mavenContext = new MavenContextImpl(null, logVerifier.getLogger());
subject.setMavenContext(mavenContext);
}
Aggregations