Search in sources :

Example 41 with ArtifactKey

use of org.eclipse.tycho.ArtifactKey in project tycho by eclipse.

the class IUXmlTransformer method replaceQualifierInRequirements.

public void replaceQualifierInRequirements(IU iu, TargetPlatform targetPlatform) throws MojoFailureException {
    List<Element> requirements = iu.getRequiredCapabilites();
    if (requirements == null)
        return;
    for (Element req : requirements) {
        String range = req.getAttributeValue(IU.RANGE);
        if (range != null && range.endsWith(".qualifier") && IU.P2_IU_NAMESPACE.equals(req.getAttributeValue(IU.NAMESPACE))) {
            ArtifactKey artifact = resolveRequirementReference(targetPlatform, req.getAttributeValue(IU.NAME), range, req.toString());
            req.setAttribute(IU.RANGE, artifact.getVersion());
        }
    }
}
Also used : ArtifactKey(org.eclipse.tycho.ArtifactKey) Element(de.pdark.decentxml.Element)

Aggregations

ArtifactKey (org.eclipse.tycho.ArtifactKey)41 File (java.io.File)19 DefaultArtifactKey (org.eclipse.tycho.DefaultArtifactKey)15 Test (org.junit.Test)14 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)13 ReactorProject (org.eclipse.tycho.ReactorProject)8 DefaultArtifactDescriptor (org.eclipse.tycho.core.osgitools.DefaultArtifactDescriptor)6 DefaultDependencyArtifacts (org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts)6 DefaultReactorProject (org.eclipse.tycho.core.osgitools.DefaultReactorProject)5 LinkedHashMap (java.util.LinkedHashMap)3 MavenProject (org.apache.maven.project.MavenProject)3 BundleStartLevel (org.eclipse.sisu.equinox.launching.BundleStartLevel)3 DependencyArtifacts (org.eclipse.tycho.artifacts.DependencyArtifacts)3 FeatureRef (org.eclipse.tycho.model.FeatureRef)3 PluginRef (org.eclipse.tycho.model.PluginRef)3 Version (org.osgi.framework.Version)3 Element (de.pdark.decentxml.Element)2 Map (java.util.Map)2 Artifact (org.apache.maven.artifact.Artifact)2 Dependency (org.apache.maven.model.Dependency)2