use of org.eclipse.tycho.core.ArtifactDependencyWalker in project tycho by eclipse.
the class OsgiBundleProject method getDependencyWalker.
@Override
public ArtifactDependencyWalker getDependencyWalker(MavenProject project) {
final DependencyArtifacts artifacts = getDependencyArtifacts(project);
final List<ClasspathEntry> cp = getClasspath(project);
return new ArtifactDependencyWalker() {
@Override
public void walk(ArtifactDependencyVisitor visitor) {
for (ClasspathEntry entry : cp) {
ArtifactDescriptor artifact = artifacts.getArtifact(entry.getArtifactKey());
ArtifactKey key = artifact.getKey();
File location = artifact.getLocation();
ReactorProject project = artifact.getMavenProject();
String classifier = artifact.getClassifier();
Set<Object> installableUnits = artifact.getInstallableUnits();
PluginDescription plugin = new DefaultPluginDescription(key, location, project, classifier, null, installableUnits);
visitor.visitPlugin(plugin);
}
}
@Override
public void traverseFeature(File location, Feature feature, ArtifactDependencyVisitor visitor) {
}
@Override
public void traverseUpdateSite(UpdateSite site, ArtifactDependencyVisitor artifactDependencyVisitor) {
}
@Override
public void traverseProduct(ProductConfiguration productConfiguration, ArtifactDependencyVisitor visitor) {
}
};
}
use of org.eclipse.tycho.core.ArtifactDependencyWalker in project tycho by eclipse.
the class ArtifactDependencyWalkerTest method walkProduct.
protected void walkProduct(String productFile, final ArrayList<PluginDescription> plugins, final ArrayList<FeatureDescription> features) throws Exception, IOException, XmlPullParserException {
DependencyArtifacts platform = getTargetPlatform();
final ProductConfiguration product = ProductConfiguration.read(new File(productFile));
ArtifactDependencyWalker walker = new AbstractArtifactDependencyWalker(platform) {
@Override
public void walk(ArtifactDependencyVisitor visitor) {
traverseProduct(product, visitor);
}
};
walker.walk(new ArtifactDependencyVisitor() {
@Override
public void visitPlugin(PluginDescription plugin) {
plugins.add(plugin);
}
@Override
public boolean visitFeature(FeatureDescription feature) {
features.add(feature);
return true;
}
});
}
Aggregations