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;
}
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;
}
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;
}
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);
}
}
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);
}
}
Aggregations