Package org.eclipse.tycho.p2.resolver
Class P2ResolverImpl
- java.lang.Object
-
- org.eclipse.tycho.p2.resolver.P2ResolverImpl
-
- All Implemented Interfaces:
P2Resolver
public class P2ResolverImpl extends java.lang.Object implements P2Resolver
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
additionalFilterProperties
private java.util.List<org.eclipse.equinox.p2.metadata.IRequirement>
additionalRequirements
private P2TargetPlatform
context
private java.util.Set<org.eclipse.equinox.p2.metadata.IInstallableUnit>
currentProjectUnits
private java.util.List<TargetEnvironment>
environments
private MavenLogger
logger
private org.eclipse.core.runtime.IProgressMonitor
monitor
private TargetPlatformFactoryImpl
targetPlatformFactory
private java.util.Set<org.eclipse.equinox.p2.metadata.IInstallableUnit>
usedTargetPlatformUnits
-
Fields inherited from interface org.eclipse.tycho.p2.resolver.facade.P2Resolver
ANY_QUALIFIER
-
-
Constructor Summary
Constructors Constructor Description P2ResolverImpl(TargetPlatformFactoryImpl targetPlatformFactory, MavenLogger logger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addArtifactFile(DefaultP2ResolutionResult result, org.eclipse.equinox.p2.metadata.IInstallableUnit iu, org.eclipse.equinox.p2.metadata.IArtifactKey p2ArtifactKey, P2TargetPlatform context)
private void
addDependenciesForTests()
void
addDependency(java.lang.String type, java.lang.String id, java.lang.String versionRange)
private void
addExternalMavenArtifact(DefaultP2ResolutionResult result, IArtifactFacade mavenArtifact, org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
protected void
addMavenArtifact(DefaultP2ResolutionResult result, org.eclipse.equinox.p2.metadata.IInstallableUnit iu, java.lang.String id, java.lang.String version, java.lang.String mavenClassifier, java.io.File location)
private void
addReactorProject(DefaultP2ResolutionResult result, ReactorProjectIdentities project, org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
private void
addUnit(DefaultP2ResolutionResult result, org.eclipse.equinox.p2.metadata.IInstallableUnit iu, ReactorProject currentProject, java.util.Set<java.lang.String> missingArtifacts)
private void
collectNonReactorIUs(DefaultP2ResolutionResult result, java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> newState)
P2ResolutionResult
collectProjectDependencies(TargetPlatform targetPlatform, ReactorProject project)
private void
failIfArtifactsMissing(java.util.Set<java.lang.String> missingArtifacts)
java.util.List<org.eclipse.equinox.p2.metadata.IRequirement>
getAdditionalRequirements()
private java.lang.String
getFeatureId(org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
P2ResolutionResult
getTargetPlatformAsResolutionResult(TargetPlatformConfigurationStub tpConfiguration, java.lang.String eeName)
private boolean
isBundleOrFragmentWithId(org.eclipse.equinox.p2.metadata.IInstallableUnit iu, java.lang.String id)
private boolean
isMatchingEnv(java.util.Set<?> metadata, TargetEnvironment environment)
Check if the Metadata contains any constraints that forbid the givenTargetEnvironment
private boolean
isProduct(org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
private boolean
isPureIU(org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
private static org.eclipse.equinox.p2.metadata.IRequirement
optionalGreedyRequirementTo(java.lang.String bundleId)
protected P2ResolutionResult
resolveDependencies(ReactorProject project, AbstractResolutionStrategy strategy, TargetEnvironment environment)
P2ResolutionResult
resolveInstallableUnit(TargetPlatform targetPlatform, java.lang.String id, java.lang.String versionRange)
Resolves specified installable unit identified by id and versionRange.P2ResolutionResult
resolveMetadata(TargetPlatformConfigurationStub tpConfiguration, java.lang.String eeName)
java.util.Map<TargetEnvironment,P2ResolutionResult>
resolveTargetDependencies(TargetPlatform targetPlatform, ReactorProject project)
Returns list ordered of resolution result, one per requested TargetEnvironment.void
setAdditionalFilterProperties(java.util.Map<java.lang.String,java.lang.String> additionalFilterProperties)
Sets additional properties that will be used to evaluate filter expressions in the p2 metadata.private void
setContext(TargetPlatform targetPlatform, ReactorProject currentProject)
void
setEnvironments(java.util.List<TargetEnvironment> environments)
private P2ResolutionResult
toResolutionResult(java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> newState, ReactorProject currentProject)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.tycho.p2.resolver.facade.P2Resolver
resolveDependencies
-
-
-
-
Field Detail
-
logger
private final MavenLogger logger
-
monitor
private final org.eclipse.core.runtime.IProgressMonitor monitor
-
environments
private java.util.List<TargetEnvironment> environments
-
additionalFilterProperties
private java.util.Map<java.lang.String,java.lang.String> additionalFilterProperties
-
additionalRequirements
private final java.util.List<org.eclipse.equinox.p2.metadata.IRequirement> additionalRequirements
-
targetPlatformFactory
private TargetPlatformFactoryImpl targetPlatformFactory
-
context
private P2TargetPlatform context
-
currentProjectUnits
private java.util.Set<org.eclipse.equinox.p2.metadata.IInstallableUnit> currentProjectUnits
-
usedTargetPlatformUnits
private java.util.Set<org.eclipse.equinox.p2.metadata.IInstallableUnit> usedTargetPlatformUnits
-
-
Constructor Detail
-
P2ResolverImpl
public P2ResolverImpl(TargetPlatformFactoryImpl targetPlatformFactory, MavenLogger logger)
-
-
Method Detail
-
setContext
private void setContext(TargetPlatform targetPlatform, ReactorProject currentProject)
-
resolveTargetDependencies
public java.util.Map<TargetEnvironment,P2ResolutionResult> resolveTargetDependencies(TargetPlatform targetPlatform, ReactorProject project)
Description copied from interface:P2Resolver
Returns list ordered of resolution result, one per requested TargetEnvironment.- Specified by:
resolveTargetDependencies
in interfaceP2Resolver
project
- The reactor project to be resolved. May benull
, in which case only the additional dependencies are resolved.- See Also:
P2Resolver.addDependency(String, String, String)
-
isMatchingEnv
private boolean isMatchingEnv(java.util.Set<?> metadata, TargetEnvironment environment)
Check if the Metadata contains any constraints that forbid the givenTargetEnvironment
- Parameters:
metadata
-environment
-- Returns:
-
collectProjectDependencies
public P2ResolutionResult collectProjectDependencies(TargetPlatform targetPlatform, ReactorProject project)
- Specified by:
collectProjectDependencies
in interfaceP2Resolver
-
resolveMetadata
public P2ResolutionResult resolveMetadata(TargetPlatformConfigurationStub tpConfiguration, java.lang.String eeName)
- Specified by:
resolveMetadata
in interfaceP2Resolver
-
getTargetPlatformAsResolutionResult
public P2ResolutionResult getTargetPlatformAsResolutionResult(TargetPlatformConfigurationStub tpConfiguration, java.lang.String eeName)
- Specified by:
getTargetPlatformAsResolutionResult
in interfaceP2Resolver
-
resolveDependencies
protected P2ResolutionResult resolveDependencies(ReactorProject project, AbstractResolutionStrategy strategy, TargetEnvironment environment)
-
toResolutionResult
private P2ResolutionResult toResolutionResult(java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> newState, ReactorProject currentProject)
-
addUnit
private void addUnit(DefaultP2ResolutionResult result, org.eclipse.equinox.p2.metadata.IInstallableUnit iu, ReactorProject currentProject, java.util.Set<java.lang.String> missingArtifacts)
-
failIfArtifactsMissing
private void failIfArtifactsMissing(java.util.Set<java.lang.String> missingArtifacts)
-
collectNonReactorIUs
private void collectNonReactorIUs(DefaultP2ResolutionResult result, java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> newState)
-
addArtifactFile
private void addArtifactFile(DefaultP2ResolutionResult result, org.eclipse.equinox.p2.metadata.IInstallableUnit iu, org.eclipse.equinox.p2.metadata.IArtifactKey p2ArtifactKey, P2TargetPlatform context)
-
addReactorProject
private void addReactorProject(DefaultP2ResolutionResult result, ReactorProjectIdentities project, org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
-
addExternalMavenArtifact
private void addExternalMavenArtifact(DefaultP2ResolutionResult result, IArtifactFacade mavenArtifact, org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
-
addMavenArtifact
protected void addMavenArtifact(DefaultP2ResolutionResult result, org.eclipse.equinox.p2.metadata.IInstallableUnit iu, java.lang.String id, java.lang.String version, java.lang.String mavenClassifier, java.io.File location)
-
isPureIU
private boolean isPureIU(org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
-
getFeatureId
private java.lang.String getFeatureId(org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
-
isBundleOrFragmentWithId
private boolean isBundleOrFragmentWithId(org.eclipse.equinox.p2.metadata.IInstallableUnit iu, java.lang.String id)
-
isProduct
private boolean isProduct(org.eclipse.equinox.p2.metadata.IInstallableUnit iu)
-
setEnvironments
public void setEnvironments(java.util.List<TargetEnvironment> environments)
- Specified by:
setEnvironments
in interfaceP2Resolver
-
setAdditionalFilterProperties
public void setAdditionalFilterProperties(java.util.Map<java.lang.String,java.lang.String> additionalFilterProperties)
Description copied from interface:P2Resolver
Sets additional properties that will be used to evaluate filter expressions in the p2 metadata. These properties are also known as "profile properties" in p2.- Specified by:
setAdditionalFilterProperties
in interfaceP2Resolver
-
addDependency
public void addDependency(java.lang.String type, java.lang.String id, java.lang.String versionRange) throws IllegalArtifactReferenceException
- Specified by:
addDependency
in interfaceP2Resolver
- Throws:
IllegalArtifactReferenceException
-
addDependenciesForTests
private void addDependenciesForTests()
-
optionalGreedyRequirementTo
private static org.eclipse.equinox.p2.metadata.IRequirement optionalGreedyRequirementTo(java.lang.String bundleId)
-
getAdditionalRequirements
public java.util.List<org.eclipse.equinox.p2.metadata.IRequirement> getAdditionalRequirements()
-
resolveInstallableUnit
public P2ResolutionResult resolveInstallableUnit(TargetPlatform targetPlatform, java.lang.String id, java.lang.String versionRange)
Description copied from interface:P2Resolver
Resolves specified installable unit identified by id and versionRange. The unit with latest version is return if id/versionRange match multiple units.- Specified by:
resolveInstallableUnit
in interfaceP2Resolver
-
-