Search in sources :

Example 11 with DefaultArtifactKey

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

the class IUXmlTransformerTest method initTestResources.

@BeforeClass
public static void initTestResources() throws Exception {
    junit4InTP = new DefaultArtifactKey("eclipse-plugin", "org.junit4", "4.8.1.v20100302");
    hamcrestInTP = new DefaultArtifactKey("eclipse-plugin", "org.hamcrest.core", "1.1.0.v20090501071000");
}
Also used : DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) BeforeClass(org.junit.BeforeClass)

Example 12 with DefaultArtifactKey

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

the class P2DependencyResolver method newDefaultTargetPlatform.

protected DefaultDependencyArtifacts newDefaultTargetPlatform(ReactorProject project, Map<File, ReactorProject> projects, P2ResolutionResult result) {
    DefaultDependencyArtifacts platform = new DefaultDependencyArtifacts(project);
    platform.addNonReactorUnits(result.getNonReactorUnits());
    for (P2ResolutionResult.Entry entry : result.getArtifacts()) {
        ArtifactKey key = new DefaultArtifactKey(entry.getType(), entry.getId(), entry.getVersion());
        ReactorProject otherProject = projects.get(entry.getLocation());
        if (otherProject != null) {
            platform.addReactorArtifact(key, otherProject, entry.getClassifier(), entry.getInstallableUnits());
        } else {
            platform.addArtifactFile(key, entry.getLocation(), entry.getInstallableUnits());
        }
    }
    return platform;
}
Also used : DefaultDependencyArtifacts(org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) ArtifactKey(org.eclipse.tycho.ArtifactKey) ReactorProject(org.eclipse.tycho.ReactorProject) DefaultReactorProject(org.eclipse.tycho.core.osgitools.DefaultReactorProject) P2ResolutionResult(org.eclipse.tycho.p2.resolver.facade.P2ResolutionResult) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey)

Example 13 with DefaultArtifactKey

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

the class DefaultEquinoxInstallationFactoryTest method setup.

@Before
public void setup() {
    bundles = new HashMap<>();
    bundles.put(new DefaultArtifactKey("eclipse-plugin", "org.example.bundle1", "1.0"), mockFile("absolute/path/to/bundle1"));
    bundles.put(new DefaultArtifactKey("eclipse-plugin", "org.example.bundle2", "1.0"), mockFile("absolute/path/to/bundle2"));
    instDesc = new DefaultEquinoxInstallationDescription();
    defaultLevel = new BundleStartLevel(null, 7, false);
    subject = new DefaultEquinoxInstallationFactory(mock(Logger.class));
}
Also used : BundleStartLevel(org.eclipse.sisu.equinox.launching.BundleStartLevel) DefaultEquinoxInstallationDescription(org.eclipse.sisu.equinox.launching.DefaultEquinoxInstallationDescription) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) Before(org.junit.Before)

Example 14 with DefaultArtifactKey

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

the class DefaultDependencyArtifactsTest method testRelativePath.

@Test
public void testRelativePath() throws IOException {
    DefaultDependencyArtifacts tp = new DefaultDependencyArtifacts();
    File relative = new File("relative.xml");
    File canonical = new File("canonical.xml");
    tp.addArtifactFile(new DefaultArtifactKey("foo", "relative", "1"), relative, null);
    tp.addArtifactFile(new DefaultArtifactKey("foo", "canonical", "1"), canonical.getAbsoluteFile(), null);
    Assert.assertNotNull(tp.getArtifact(relative.getAbsoluteFile()));
    Assert.assertNotNull(tp.getArtifact(canonical));
}
Also used : DefaultDependencyArtifacts(org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) File(java.io.File) Test(org.junit.Test)

Example 15 with DefaultArtifactKey

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

the class DefaultDependencyArtifactsTest method testEqualArtifacts.

@Test
public void testEqualArtifacts() {
    DefaultDependencyArtifacts tp = new DefaultDependencyArtifacts();
    ArtifactKey key = new DefaultArtifactKey("type", "id", "version");
    File location = new File("location");
    tp.addArtifactFile(key, location, asSet("a"));
    tp.addArtifactFile(key, location, asSet("a"));
    Assert.assertEquals(1, tp.getArtifacts().size());
}
Also used : DefaultDependencyArtifacts(org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) ArtifactKey(org.eclipse.tycho.ArtifactKey) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) File(java.io.File) Test(org.junit.Test)

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