use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class LocalDependencyResolver method resolveDependencies.
@Override
public DependencyArtifacts resolveDependencies(MavenSession session, MavenProject project, TargetPlatform resolutionContext, List<ReactorProject> reactorProjects, DependencyResolverConfiguration resolverConfiguration) {
DefaultDependencyArtifacts platform = new DefaultDependencyArtifacts(DefaultReactorProject.adapt(project));
for (File site : layout.getSites()) {
for (File plugin : layout.getPlugins(site)) {
ArtifactKey artifactKey = getArtifactKey(session, plugin);
if (artifactKey != null) {
platform.addArtifactFile(artifactKey, plugin, null);
}
}
for (File feature : layout.getFeatures(site)) {
Feature desc = Feature.loadFeature(feature);
ArtifactKey key = new DefaultArtifactKey(ArtifactType.TYPE_ECLIPSE_FEATURE, desc.getId(), desc.getVersion());
platform.addArtifactFile(key, feature, null);
}
}
addProjects(session, platform);
addDependencies(session, project, platform);
if (platform.isEmpty()) {
getLogger().warn("Could not find any bundles or features in " + layout.getLocation());
}
return platform;
}
use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class ProvisionedInstallationDescription method getSystemBundle.
@Override
public ArtifactDescriptor getSystemBundle() {
if (systemBundleDescriptor != null) {
return systemBundleDescriptor;
}
File pluginsDir = new File(location, "plugins");
File[] systemBundles = pluginsDir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.isFile() && file.getName().startsWith(EquinoxContainer.NAME + "_");
}
});
File systemBundle;
if (systemBundles.length == 0) {
throw new IllegalArgumentException("No framework bundle " + EquinoxContainer.NAME + " found in " + pluginsDir);
} else if (systemBundles.length > 1) {
throw new IllegalArgumentException("Multiple versions of the framework bundle " + EquinoxContainer.NAME + " found in " + pluginsDir);
} else {
systemBundle = systemBundles[0];
}
String version = bundleReader.loadManifest(systemBundle).getBundleVersion();
ArtifactKey systemBundleKey = new DefaultArtifactKey(ArtifactType.TYPE_ECLIPSE_PLUGIN, EquinoxContainer.NAME, version);
systemBundleDescriptor = new DefaultArtifactDescriptor(systemBundleKey, systemBundle, null, null, null);
return systemBundleDescriptor;
}
Aggregations