Search in sources :

Example 16 with DefaultArtifactKey

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;
}
Also used : DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) ArtifactKey(org.eclipse.tycho.ArtifactKey) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) File(java.io.File) Feature(org.eclipse.tycho.model.Feature)

Example 17 with DefaultArtifactKey

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;
}
Also used : DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) ArtifactKey(org.eclipse.tycho.ArtifactKey) DefaultArtifactDescriptor(org.eclipse.tycho.core.osgitools.DefaultArtifactDescriptor) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) FileFilter(java.io.FileFilter) File(java.io.File)

Aggregations

DefaultArtifactKey (org.eclipse.tycho.DefaultArtifactKey)17 File (java.io.File)10 ArtifactKey (org.eclipse.tycho.ArtifactKey)9 DefaultDependencyArtifacts (org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts)7 Test (org.junit.Test)6 DefaultArtifactDescriptor (org.eclipse.tycho.core.osgitools.DefaultArtifactDescriptor)3 ReactorProject (org.eclipse.tycho.ReactorProject)2 DefaultReactorProject (org.eclipse.tycho.core.osgitools.DefaultReactorProject)2 BeforeClass (org.junit.BeforeClass)2 FileFilter (java.io.FileFilter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 StringTokenizer (java.util.StringTokenizer)1 MavenProject (org.apache.maven.project.MavenProject)1 BundleStartLevel (org.eclipse.sisu.equinox.launching.BundleStartLevel)1 DefaultEquinoxInstallationDescription (org.eclipse.sisu.equinox.launching.DefaultEquinoxInstallationDescription)1 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)1 ClasspathEntry (org.eclipse.tycho.classpath.ClasspathEntry)1 DefaultClasspathEntry (org.eclipse.tycho.core.osgitools.DefaultClasspathEntry)1