Search in sources :

Example 1 with JREAction

use of org.eclipse.equinox.p2.publisher.actions.JREAction in project tycho by eclipse.

the class PublisherServiceImpl method publishEEProfile.

@Override
public Collection<DependencySeed> publishEEProfile(File profileFile) throws FacadeException {
    validateProfile(profileFile);
    IPublisherAction jreAction = new JREAction(profileFile);
    Collection<IInstallableUnit> allIUs = publisherRunner.executeAction(jreAction, publishingRepository.getMetadataRepository(), publishingRepository.getArtifactRepository());
    return toSeeds(null, allIUs);
}
Also used : IPublisherAction(org.eclipse.equinox.p2.publisher.IPublisherAction) JREAction(org.eclipse.equinox.p2.publisher.actions.JREAction) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit)

Example 2 with JREAction

use of org.eclipse.equinox.p2.publisher.actions.JREAction in project tycho by eclipse.

the class CustomEEResolutionHintsTest method testConsistencyWithJREAction.

@Test
public void testConsistencyWithJREAction() throws Exception {
    JREAction jreAction = new JREAction(resourceFile("profiles/TestMe-1.8.profile"));
    PublisherResult results = new PublisherResult();
    jreAction.perform(new PublisherInfo(), results, null);
    Set<IInstallableUnit> publishedUnits = results.query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet();
    subject = new CustomEEResolutionHints("TestMe-1.8");
    for (IInstallableUnit unit : publishedUnits) {
        if (subject.isEESpecificationUnit(unit)) {
            // success: we find the unit create by the JREAction
            return;
        }
    }
    fail("'a.jre' unit for profile 'TestMe-1.8' not found in" + publishedUnits);
}
Also used : PublisherInfo(org.eclipse.equinox.p2.publisher.PublisherInfo) JREAction(org.eclipse.equinox.p2.publisher.actions.JREAction) PublisherResult(org.eclipse.equinox.p2.publisher.PublisherResult) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) Test(org.junit.Test)

Example 3 with JREAction

use of org.eclipse.equinox.p2.publisher.actions.JREAction in project tycho by eclipse.

the class StandardEEResolutionHints method addIUsFromEnvironment.

static void addIUsFromEnvironment(String executionEnvironment, Map<VersionedId, IInstallableUnit> units) {
    // generate real IUs that represent requested execution environment
    PublisherResult results = new PublisherResult();
    new JREAction(executionEnvironment).perform(new PublisherInfo(), results, null);
    results.query(QueryUtil.ALL_UNITS, null);
    Iterator<IInstallableUnit> iterator = results.query(QueryUtil.ALL_UNITS, null).iterator();
    while (iterator.hasNext()) {
        put(units, iterator.next());
    }
}
Also used : PublisherInfo(org.eclipse.equinox.p2.publisher.PublisherInfo) PublisherResult(org.eclipse.equinox.p2.publisher.PublisherResult) JREAction(org.eclipse.equinox.p2.publisher.actions.JREAction) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit)

Aggregations

IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)3 JREAction (org.eclipse.equinox.p2.publisher.actions.JREAction)3 PublisherInfo (org.eclipse.equinox.p2.publisher.PublisherInfo)2 PublisherResult (org.eclipse.equinox.p2.publisher.PublisherResult)2 IPublisherAction (org.eclipse.equinox.p2.publisher.IPublisherAction)1 Test (org.junit.Test)1