Search in sources :

Example 1 with PublisherService

use of org.eclipse.tycho.p2.tools.publisher.facade.PublisherService in project tycho by eclipse.

the class PublisherServiceFactoryImpl method createPublisher.

@Override
public PublisherService createPublisher(ReactorProject project, List<TargetEnvironment> environments) {
    P2TargetPlatform targetPlatform = (P2TargetPlatform) reactorRepoManager.getFinalTargetPlatform(project);
    PublisherActionRunner publisherRunner = getPublisherRunnerForProject(targetPlatform, environments);
    PublishingRepository publishingRepository = reactorRepoManager.getPublishingRepository(project.getIdentities());
    return new PublisherServiceImpl(publisherRunner, project.getBuildQualifier(), publishingRepository);
}
Also used : P2TargetPlatform(org.eclipse.tycho.p2.target.P2TargetPlatform) PublishingRepository(org.eclipse.tycho.repository.publishing.PublishingRepository)

Example 2 with PublisherService

use of org.eclipse.tycho.p2.tools.publisher.facade.PublisherService 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);
    }
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) FacadeException(org.eclipse.tycho.p2.tools.FacadeException) Category(org.eclipse.tycho.model.Category) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) PublisherService(org.eclipse.tycho.p2.tools.publisher.facade.PublisherService) ArrayList(java.util.ArrayList) File(java.io.File)

Example 3 with PublisherService

use of org.eclipse.tycho.p2.tools.publisher.facade.PublisherService 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);
    }
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) FacadeException(org.eclipse.tycho.p2.tools.FacadeException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) PublisherService(org.eclipse.tycho.p2.tools.publisher.facade.PublisherService)

Aggregations

MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 DependencySeed (org.eclipse.tycho.core.resolver.shared.DependencySeed)2 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)2 PublisherService (org.eclipse.tycho.p2.tools.publisher.facade.PublisherService)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Category (org.eclipse.tycho.model.Category)1 P2TargetPlatform (org.eclipse.tycho.p2.target.P2TargetPlatform)1 PublishingRepository (org.eclipse.tycho.repository.publishing.PublishingRepository)1