Skip to content

Commit

Permalink
Gather extra IUs from all reactor projects
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Dec 6, 2023
1 parent f7927c8 commit da859cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;

Expand Down Expand Up @@ -264,8 +265,10 @@ public P2TargetPlatform createTargetPlatform(TargetPlatformConfigurationStub tpC
return Optional.empty();
}).ifPresent(externalUIs::add);
}
//add p2.inf items...
gatherP2InfUnits(project, externalUIs);
//add p2.inf extra units from all projects...
for (ReactorProject reactorProject : Objects.requireNonNullElse(reactorProjects, List.<ReactorProject> of())) {
gatherP2InfUnits(reactorProject, externalUIs);
}

Map<IInstallableUnit, ReactorProjectIdentities> reactorProjectUIs = getPreliminaryReactorProjectUIs(
reactorProjects);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
import org.eclipse.equinox.p2.metadata.IVersionedId;
import org.eclipse.tycho.ArtifactType;
import org.eclipse.tycho.DefaultArtifactKey;
import org.eclipse.tycho.IRawArtifactFileProvider;
import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType;
import org.eclipse.tycho.IRawArtifactFileProvider;
import org.eclipse.tycho.PackagingType;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.ReactorProjectIdentities;
import org.eclipse.tycho.TargetEnvironment;
Expand Down Expand Up @@ -328,12 +329,12 @@ private String[] asArrayUnlessNull(String string) {
private ReactorProject createReactorProject(String artifactId, String[] primaryUnitIds, String[] secondaryUnitIds) {
File basedir = new File("tychotestdummy"); // not dereferenced in the code under test, so the path doesn't need to exist
ReactorProjectStub result = new ReactorProjectStub(basedir, artifactId);
result.setPackagingType(PackagingType.TYPE_ECLIPSE_PLUGIN);

DependencyMetadata dependencyMetadata = new DependencyMetadata();
dependencyMetadata.setDependencyMetadata(DependencyMetadataType.SEED, createUnits(primaryUnitIds));
dependencyMetadata.setDependencyMetadata(DependencyMetadataType.RESOLVE, createUnits(secondaryUnitIds));
result.setDependencyMetadata(dependencyMetadata);

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public String getPackaging() {
return unlessNull(packagingType);
}

public void setPackagingType(String packagingType) {
this.packagingType = packagingType;
}

@Override
public Set<IInstallableUnit> getDependencyMetadata(DependencyMetadataType type) {
return switch (type) {
Expand Down

0 comments on commit da859cc

Please sign in to comment.