Search in sources :

Example 1 with RepositoryDescriptor

use of org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor in project tycho by eclipse.

the class MirrorApplicationServiceImpl method createMirrorApplication.

private static MirrorApplication createMirrorApplication(RepositoryReferences sources, DestinationRepositoryDescriptor destination, IProvisioningAgent agent, boolean includePacked) {
    final MirrorApplication mirrorApp = new MirrorApplication(agent, includePacked);
    List<RepositoryDescriptor> sourceDescriptors = createSourceDescriptors(sources);
    for (RepositoryDescriptor sourceDescriptor : sourceDescriptors) {
        mirrorApp.addSource(sourceDescriptor);
    }
    mirrorApp.addDestination(createDestinationDescriptor(destination));
    return mirrorApp;
}
Also used : DestinationRepositoryDescriptor(org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor) RepositoryDescriptor(org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor)

Example 2 with RepositoryDescriptor

use of org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor in project tycho by eclipse.

the class MirrorApplicationServiceImpl method createDestinationDescriptor.

private static RepositoryDescriptor createDestinationDescriptor(DestinationRepositoryDescriptor destination) {
    final RepositoryDescriptor destinationDescriptor = new RepositoryDescriptor();
    destinationDescriptor.setLocation(destination.getLocation().toURI());
    destinationDescriptor.setAppend(destination.isAppend());
    destinationDescriptor.setName(destination.getName());
    destinationDescriptor.setCompressed(destination.isCompress());
    if (destination.isMetaDataOnly()) {
        // only mirror metadata
        destinationDescriptor.setKind(RepositoryDescriptor.KIND_METADATA);
    } else {
    // metadata and artifacts is the default
    }
    return destinationDescriptor;
}
Also used : DestinationRepositoryDescriptor(org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor) RepositoryDescriptor(org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor)

Example 3 with RepositoryDescriptor

use of org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor in project tycho by eclipse.

the class MirrorApplication method initializeDestination.

@Override
protected IArtifactRepository initializeDestination(RepositoryDescriptor toInit, IArtifactRepositoryManager mgr) throws ProvisionException {
    IArtifactRepository result = super.initializeDestination(toInit, mgr);
    // simple.SimpleArtifactRepository.PUBLISH_PACK_FILES_AS_SIBLINGS is not public
    result.setProperty("publishPackFilesAsSiblings", "true");
    return result;
}
Also used : IArtifactRepository(org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)

Example 4 with RepositoryDescriptor

use of org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor in project tycho by eclipse.

the class MirrorApplicationServiceImpl method recreateArtifactRepository.

private void recreateArtifactRepository(DestinationRepositoryDescriptor destination) throws FacadeException {
    // create the missing md5 checksums
    if (destination.isMetaDataOnly()) {
        return;
    }
    RepositoryDescriptor descriptor = new RepositoryDescriptor();
    descriptor.setAppend(true);
    descriptor.setFormat(null);
    // $NON-NLS-1$
    descriptor.setKind("artifact");
    descriptor.setLocation(destination.getLocation().toURI());
    RecreateRepositoryApplication application = new RecreateRepositoryApplication();
    application.setArtifactRepository(descriptor);
    try {
        application.run(new NullProgressMonitor());
    } catch (ProvisionException e) {
        throw new FacadeException("Recreate artifact repository failed", e);
    }
}
Also used : FacadeException(org.eclipse.tycho.p2.tools.FacadeException) DestinationRepositoryDescriptor(org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor) RepositoryDescriptor(org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProvisionException(org.eclipse.equinox.p2.core.ProvisionException) RecreateRepositoryApplication(org.eclipse.equinox.p2.internal.repository.tools.RecreateRepositoryApplication)

Example 5 with RepositoryDescriptor

use of org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor in project tycho by eclipse.

the class MirrorApplicationServiceImpl method createSourceRepositories.

private static void createSourceRepositories(List<RepositoryDescriptor> result, Collection<URI> repositoryLocations, String repositoryKind) {
    for (URI repositoryLocation : repositoryLocations) {
        RepositoryDescriptor repository = new RepositoryDescriptor();
        repository.setKind(repositoryKind);
        repository.setLocation(repositoryLocation);
        result.add(repository);
    }
}
Also used : DestinationRepositoryDescriptor(org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor) RepositoryDescriptor(org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor) URI(java.net.URI)

Aggregations

RepositoryDescriptor (org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor)4 DestinationRepositoryDescriptor (org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor)4 URI (java.net.URI)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 ProvisionException (org.eclipse.equinox.p2.core.ProvisionException)1 RecreateRepositoryApplication (org.eclipse.equinox.p2.internal.repository.tools.RecreateRepositoryApplication)1 IArtifactRepository (org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)1 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)1