Class MirrorApplicationServiceImpl
- java.lang.Object
-
- org.eclipse.tycho.p2.tools.mirroring.MirrorApplicationServiceImpl
-
- All Implemented Interfaces:
MirrorApplicationService
public class MirrorApplicationServiceImpl extends java.lang.Object implements MirrorApplicationService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
MirrorApplicationServiceImpl.LogListener
-
Field Summary
Fields Modifier and Type Field Description private MavenContext
mavenContext
private static java.lang.String
MIRROR_FAILURE_MESSAGE
-
Constructor Summary
Constructors Constructor Description MirrorApplicationServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addFilterForFeatureJARs(java.util.Map<java.lang.String,java.lang.String> filter)
Set filter value so that the feature JAR units and artifacts are included when mirroring.private void
checkStatus(org.eclipse.core.runtime.IStatus status, boolean ignoreErrors)
private static org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor
createDestinationDescriptor(DestinationRepositoryDescriptor destination)
private static MirrorApplication
createMirrorApplication(RepositoryReferences sources, DestinationRepositoryDescriptor destination, org.eclipse.equinox.p2.core.IProvisioningAgent agent, boolean includePacked)
private static org.eclipse.equinox.p2.query.IQuery<org.eclipse.equinox.p2.metadata.IInstallableUnit>
createQuery(IUDescription iu)
private static org.eclipse.equinox.p2.internal.repository.tools.SlicingOptions
createSlicingOptions(MirrorOptions mirrorOptions)
private static java.util.List<org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor>
createSourceDescriptors(RepositoryReferences sources)
private static void
createSourceRepositories(java.util.List<org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor> result, java.util.Collection<java.net.URI> repositoryLocations, java.lang.String repositoryKind)
void
mirrorReactor(RepositoryReferences sources, DestinationRepositoryDescriptor destination, java.util.Collection<DependencySeed> projectSeeds, BuildContext context, boolean includeAllDependencies, boolean includePacked, java.util.Map<java.lang.String,java.lang.String> filterProperties)
Copies the given installable units and their dependencies into the p2 repository at the destination location.void
mirrorStandalone(RepositoryReferences sources, DestinationRepositoryDescriptor destination, java.util.Collection<IUDescription> seedIUs, MirrorOptions mirrorOptions, BuildOutputDirectory tempDirectory)
Copies installable units from the source repositories to the destination repository.private static java.util.List<org.eclipse.equinox.p2.metadata.IInstallableUnit>
querySourceIus(java.util.Collection<IUDescription> sourceIUs, org.eclipse.equinox.p2.repository.metadata.IMetadataRepository repository, RepositoryReferences sources)
private void
recreateArtifactRepository(DestinationRepositoryDescriptor destination)
void
setMavenContext(MavenContext mavenContext)
private static java.util.List<org.eclipse.equinox.p2.metadata.IInstallableUnit>
toInstallableUnitList(java.util.Collection<DependencySeed> seeds, org.eclipse.equinox.p2.repository.metadata.IMetadataRepository sourceRepository, RepositoryReferences sourceRepositoryNames)
private void
xzCompress(DestinationRepositoryDescriptor destination)
-
-
-
Field Detail
-
MIRROR_FAILURE_MESSAGE
private static final java.lang.String MIRROR_FAILURE_MESSAGE
- See Also:
- Constant Field Values
-
mavenContext
private MavenContext mavenContext
-
-
Method Detail
-
mirrorStandalone
public void mirrorStandalone(RepositoryReferences sources, DestinationRepositoryDescriptor destination, java.util.Collection<IUDescription> seedIUs, MirrorOptions mirrorOptions, BuildOutputDirectory tempDirectory) throws FacadeException
Description copied from interface:MirrorApplicationService
Copies installable units from the source repositories to the destination repository. The corresponding artifacts are also copied unless the mirror options specify otherwise.- Specified by:
mirrorStandalone
in interfaceMirrorApplicationService
- Parameters:
sources
- The p2 repositories from which content shall be copied.destination
- The p2 repository that shall be written to. The location must be a directory, which may be empty. Existing content is not overwritten but is appended to.seedIUs
- A set of installable units that span the content to be mirrored. May benull
if all available IUs shall be copied. The given installable units will be checked if they are actually present in the source repositories.mirrorOptions
- various mirror options. Must not benull
.tempDirectory
- A directory for storing temporary results. Typically the build target folder of a module.- Throws:
FacadeException
- if a checked exception occurs while mirroring
-
createSlicingOptions
private static org.eclipse.equinox.p2.internal.repository.tools.SlicingOptions createSlicingOptions(MirrorOptions mirrorOptions)
-
querySourceIus
private static java.util.List<org.eclipse.equinox.p2.metadata.IInstallableUnit> querySourceIus(java.util.Collection<IUDescription> sourceIUs, org.eclipse.equinox.p2.repository.metadata.IMetadataRepository repository, RepositoryReferences sources) throws FacadeException
- Throws:
FacadeException
-
createQuery
private static org.eclipse.equinox.p2.query.IQuery<org.eclipse.equinox.p2.metadata.IInstallableUnit> createQuery(IUDescription iu)
-
mirrorReactor
public void mirrorReactor(RepositoryReferences sources, DestinationRepositoryDescriptor destination, java.util.Collection<DependencySeed> projectSeeds, BuildContext context, boolean includeAllDependencies, boolean includePacked, java.util.Map<java.lang.String,java.lang.String> filterProperties) throws FacadeException
Description copied from interface:MirrorApplicationService
Copies the given installable units and their dependencies into the p2 repository at the destination location. By default this only includes the units and their dependencies with strict versions (i.e. included content). Optionally, all transitive dependencies of the given units are also copied, if includeAllDependencies is set totrue
.- Specified by:
mirrorReactor
in interfaceMirrorApplicationService
- Parameters:
sources
- The p2 repositories from which dependencies and artifacts are copieddestination
- The p2 repository that shall be written to. The location must be a directory, which may be empty. Existing content is not overwritten but is appended to.projectSeeds
- The dependency seeds that span the content to be copied. Note that the installable units obtained from the seeds are written into the destination p2 repository without checking if they are actually present in the source repositories. Therefore only units from the source repositories should be passed via this parameter.context
- Build context information; in particular this parameter defines a filter for environment specific installable unitsincludeAllDependencies
- Whether to include all transitive dependenciesincludePacked
- Whether to include packed artifactsfilterProperties
- additional filter properties to be set in the p2 slicing options. May benull
- Throws:
FacadeException
- if a checked exception occurs while mirroring
-
xzCompress
private void xzCompress(DestinationRepositoryDescriptor destination) throws FacadeException
- Throws:
FacadeException
-
recreateArtifactRepository
private void recreateArtifactRepository(DestinationRepositoryDescriptor destination) throws FacadeException
- Throws:
FacadeException
-
createMirrorApplication
private static MirrorApplication createMirrorApplication(RepositoryReferences sources, DestinationRepositoryDescriptor destination, org.eclipse.equinox.p2.core.IProvisioningAgent agent, boolean includePacked)
-
createDestinationDescriptor
private static org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor createDestinationDescriptor(DestinationRepositoryDescriptor destination)
-
addFilterForFeatureJARs
private static void addFilterForFeatureJARs(java.util.Map<java.lang.String,java.lang.String> filter)
Set filter value so that the feature JAR units and artifacts are included when mirroring.
-
createSourceDescriptors
private static java.util.List<org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor> createSourceDescriptors(RepositoryReferences sources)
-
createSourceRepositories
private static void createSourceRepositories(java.util.List<org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor> result, java.util.Collection<java.net.URI> repositoryLocations, java.lang.String repositoryKind)
-
toInstallableUnitList
private static java.util.List<org.eclipse.equinox.p2.metadata.IInstallableUnit> toInstallableUnitList(java.util.Collection<DependencySeed> seeds, org.eclipse.equinox.p2.repository.metadata.IMetadataRepository sourceRepository, RepositoryReferences sourceRepositoryNames) throws FacadeException
- Throws:
FacadeException
-
checkStatus
private void checkStatus(org.eclipse.core.runtime.IStatus status, boolean ignoreErrors) throws FacadeException
- Throws:
FacadeException
-
setMavenContext
public void setMavenContext(MavenContext mavenContext)
-
-