protected boolean isTychoP2Plugin(PluginDescriptor pluginDescriptor) { if (pluginDescriptor.getArtifactMap().containsKey("org.eclipse.tycho:tycho-p2-facade")) { return true; } for (ComponentDependency dependency : pluginDescriptor.getDependencies()) { if ("org.eclipse.tycho".equals(dependency.getGroupId()) && "tycho-p2-facade".equals(dependency.getArtifactId())) { return true; } } return false; }
private void validateConfiguration( ComponentSetDescriptor componentSetDescriptor ) throws ComponentDescriptorCreatorException { List dependencies = componentSetDescriptor.getDependencies(); if ( dependencies == null ) { return; } for ( Iterator it = dependencies.iterator(); it.hasNext(); ) { ComponentDependency dependency = (ComponentDependency) it.next(); if ( StringUtils.isEmpty( dependency.getGroupId() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'groupId'." ); } if ( StringUtils.isEmpty( dependency.getArtifactId() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'artifactId'." ); } if ( StringUtils.isEmpty( dependency.getVersion() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'version'." ); } if ( StringUtils.isEmpty( dependency.getType() ) ) { throw new ComponentDescriptorCreatorException( "Missing dependency element: 'type'." ); } } }
private File getDependencyFile(ComponentDependency dep) { ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler(dep.getType()); Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), null, dep.getType(), null, artifactHandler); return getArtifactFile(artifact); }
/** * @param w not null writer * @param pluginDescriptor not null */ public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor ) { w.startElement( "dependencies" ); for ( Iterator it = pluginDescriptor.getDependencies().iterator(); it.hasNext(); ) { ComponentDependency dep = (ComponentDependency) it.next(); w.startElement( "dependency" ); PluginUtils.element( w, "groupId", dep.getGroupId() ); PluginUtils.element( w, "artifactId", dep.getArtifactId() ); PluginUtils.element( w, "type", dep.getType() ); PluginUtils.element( w, "version", dep.getVersion() ); w.endElement(); } w.endElement(); }
/** * @param w not null writer * @param pluginDescriptor not null */ public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor ) { w.startElement( "dependencies" ); for ( Iterator it = pluginDescriptor.getDependencies().iterator(); it.hasNext(); ) { ComponentDependency dep = (ComponentDependency) it.next(); w.startElement( "dependency" ); PluginUtils.element( w, "groupId", dep.getGroupId() ); PluginUtils.element( w, "artifactId", dep.getArtifactId() ); PluginUtils.element( w, "type", dep.getType() ); PluginUtils.element( w, "version", dep.getVersion() ); w.endElement(); } w.endElement(); }
private void writeDependencyElement( ComponentDependency dependency, XMLWriter w ) { w.startElement( "dependency" ); String groupId = dependency.getGroupId(); element( w, "groupId", groupId ); String artifactId = dependency.getArtifactId(); element( w, "artifactId", artifactId ); String type = dependency.getType(); if ( type != null ) { element( w, "type", type ); } String version = dependency.getVersion(); element( w, "version", version ); w.endElement(); }
private void writeDependencyElement( ComponentDependency dependency, XMLWriter w ) { w.startElement( "dependency" ); String groupId = dependency.getGroupId(); element( w, "groupId", groupId ); String artifactId = dependency.getArtifactId(); element( w, "artifactId", artifactId ); String type = dependency.getType(); if ( type != null ) { element( w, "type", type ); } String version = dependency.getVersion(); element( w, "version", version ); w.endElement(); }
/** * @param w not null writer * @param pluginDescriptor not null */ public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor ) { w.startElement( "dependencies" ); @SuppressWarnings( "unchecked" ) List<ComponentDependency> deps = pluginDescriptor.getDependencies(); for ( ComponentDependency dep : deps ) { w.startElement( "dependency" ); element( w, "groupId", dep.getGroupId() ); element( w, "artifactId", dep.getArtifactId() ); element( w, "type", dep.getType() ); element( w, "version", dep.getVersion() ); w.endElement(); } w.endElement(); }