use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.
the class PublisherServiceTest method unitsById.
/**
* Returns the installable units from the given dependency seeds, indexed by the installable
* units's IDs.
*/
private static Map<String, IInstallableUnit> unitsById(Collection<DependencySeed> seeds) {
Map<String, IInstallableUnit> result = new HashMap<>();
for (DependencySeed seed : seeds) {
IInstallableUnit iu = (IInstallableUnit) seed.getInstallableUnit();
result.put(iu.getId(), iu);
}
return result;
}
use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.
the class PublisherServiceTest method testProfilePublishing.
@Test
public void testProfilePublishing() throws Exception {
File customProfile = resourceFile("publishers/virgo-1.6.profile");
Collection<DependencySeed> seeds = subject.publishEEProfile(customProfile);
assertThat(seeds.size(), is(2));
IInstallableUnit virgoProfileIU = unitsById(seeds).get("a.jre.virgo");
assertThat(virgoProfileIU, not(nullValue()));
Collection<IProvidedCapability> provided = virgoProfileIU.getProvidedCapabilities();
boolean customJavaxActivationVersionFound = false;
Version version_1_1_1 = Version.create("1.1.1");
for (IProvidedCapability capability : provided) {
if (PublisherHelper.CAPABILITY_NS_JAVA_PACKAGE.equals(capability.getNamespace())) {
if ("javax.activation".equals(capability.getName())) {
if (version_1_1_1.equals(capability.getVersion())) {
customJavaxActivationVersionFound = true;
break;
}
}
}
}
assertTrue("did not find capability for package javax.activation with custom version " + version_1_1_1, customJavaxActivationVersionFound);
assertThat(unitsById(seeds).keySet(), hasItem("config.a.jre.virgo"));
}
use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.
the class PublishCategoriesMojo method publishContent.
@Override
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException {
PublisherService publisherService = publisherServiceFactory.createPublisher(getReactorProject(), getEnvironments());
try {
List<DependencySeed> categoryIUs = new ArrayList<>();
for (Category category : getCategories()) {
final File buildCategoryFile = prepareBuildCategory(category, getBuildDirectory());
Collection<DependencySeed> ius = publisherService.publishCategories(buildCategoryFile);
categoryIUs.addAll(ius);
}
return categoryIUs;
} catch (FacadeException e) {
throw new MojoExecutionException("Exception while publishing categories: " + e.getMessage(), e);
}
}
use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.
the class PublishEEProfileMojo method publishContent.
@Override
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException {
PublisherService publisherService = publisherServiceFactory.createPublisher(getReactorProject(), getEnvironments());
try {
Collection<DependencySeed> ius = publisherService.publishEEProfile(profileFile);
getLog().info("Published profile IUs: " + ius);
return ius;
} catch (FacadeException e) {
throw new MojoExecutionException("Exception while publishing execution environment profile " + profileFile + ": " + e.getMessage(), e);
}
}
use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.
the class PublishProductMojo method publishContent.
@Override
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException {
Interpolator interpolator = new TychoInterpolator(getSession(), getProject());
PublishProductTool publisher = publisherServiceFactory.createProductPublisher(getReactorProject(), getEnvironments(), getQualifier(), interpolator);
List<DependencySeed> seeds = new ArrayList<>();
for (File productFile : getEclipseRepositoryProject().getProductFiles(getProject())) {
try {
ProductConfiguration productConfiguration = ProductConfiguration.read(productFile);
if (isEmpty(productConfiguration.getId())) {
throw new MojoExecutionException("The product file " + productFile.getName() + " does not contain the mandatory attribute 'uid'. Please ensure you entered an id in the product file.");
} else if (isEmpty(productConfiguration.getVersion())) {
throw new MojoExecutionException("The product file " + productFile.getName() + " does not contain the mandatory attribute 'version'. Please ensure you entered a version in the product file.");
}
seeds.addAll(publisher.publishProduct(productFile, productConfiguration.includeLaunchers() ? getExpandedLauncherBinaries() : null, flavor));
} catch (IOException e) {
throw new MojoExecutionException("I/O exception while writing product definition or copying launcher icons", e);
}
}
return seeds;
}
Aggregations