Search in sources :

Example 1 with ArtifactDescriptor

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

the class DefaultDependencyArtifactsTest method testMultiEnvironmentMetadataMerge.

@Test
public void testMultiEnvironmentMetadataMerge() {
    ArtifactKey key = new DefaultArtifactKey("type", "id", "version");
    File location = new File("location");
    DefaultDependencyArtifacts tpA = new DefaultDependencyArtifacts();
    tpA.addArtifactFile(key, location, asSet("a"));
    DefaultDependencyArtifacts tpB = new DefaultDependencyArtifacts();
    tpB.addArtifactFile(key, location, asSet("a", "b"));
    MultiEnvironmentDependencyArtifacts tp = new MultiEnvironmentDependencyArtifacts();
    tp.addPlatform(new TargetEnvironment("a", "a", "a"), tpA);
    tp.addPlatform(new TargetEnvironment("b", "b", "b"), tpB);
    List<ArtifactDescriptor> artifacts = tp.getArtifacts();
    Assert.assertEquals(1, artifacts.size());
    Set<Object> units = artifacts.get(0).getInstallableUnits();
    Assert.assertEquals(2, units.size());
    Assert.assertTrue(units.contains("a"));
    Assert.assertTrue(units.contains("b"));
}
Also used : DefaultDependencyArtifacts(org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) ArtifactKey(org.eclipse.tycho.ArtifactKey) DefaultArtifactDescriptor(org.eclipse.tycho.core.osgitools.DefaultArtifactDescriptor) ArtifactDescriptor(org.eclipse.tycho.ArtifactDescriptor) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) File(java.io.File) MultiEnvironmentDependencyArtifacts(org.eclipse.tycho.core.osgitools.targetplatform.MultiEnvironmentDependencyArtifacts) Test(org.junit.Test)

Example 2 with ArtifactDescriptor

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

the class LocalDependencyResolverTest method testBundleIdParsing.

public void testBundleIdParsing() throws Exception {
    DependencyArtifacts platform = getTargetPlatform(new File("src/test/resources/targetplatforms/basic"));
    ArtifactDescriptor artifact = platform.getArtifact(ArtifactType.TYPE_ECLIPSE_PLUGIN, "bundle01", null);
    ArtifactKey key = artifact.getKey();
    assertEquals("bundle01", key.getId());
    assertEquals("0.0.1", key.getVersion());
    File file = artifact.getLocation();
    assertEquals("bundle01_0.0.1", file.getName());
}
Also used : DependencyArtifacts(org.eclipse.tycho.artifacts.DependencyArtifacts) ArtifactKey(org.eclipse.tycho.ArtifactKey) ArtifactDescriptor(org.eclipse.tycho.ArtifactDescriptor) File(java.io.File)

Example 3 with ArtifactDescriptor

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

the class LocalDependencyResolverTest method testBundleRelativePath.

public void testBundleRelativePath() throws Exception {
    File platformPath = new File("src/test/resources/targetplatforms/basic").getAbsoluteFile();
    DependencyArtifacts platform = getTargetPlatform(platformPath);
    File bundlePath = new File("src/test/resources/targetplatforms/basic/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar");
    Map<String, ArtifactDescriptor> artifact = platform.getArtifact(bundlePath);
    assertNotNull(artifact);
}
Also used : DependencyArtifacts(org.eclipse.tycho.artifacts.DependencyArtifacts) ArtifactDescriptor(org.eclipse.tycho.ArtifactDescriptor) File(java.io.File)

Example 4 with ArtifactDescriptor

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

the class LocalDependencyResolverTest method testPlatformRelativePath.

public void testPlatformRelativePath() throws Exception {
    File platformPath = new File("src/test/resources/targetplatforms/basic");
    DependencyArtifacts platform = getTargetPlatform(platformPath);
    // absolute path to a bundle
    File bundlePath = new File(platformPath, "plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar").getAbsoluteFile();
    Map<String, ArtifactDescriptor> artifact = platform.getArtifact(bundlePath);
    assertNotNull(artifact);
}
Also used : DependencyArtifacts(org.eclipse.tycho.artifacts.DependencyArtifacts) ArtifactDescriptor(org.eclipse.tycho.ArtifactDescriptor) File(java.io.File)

Example 5 with ArtifactDescriptor

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

the class TestMojo method getTestApplication.

private String getTestApplication(EquinoxInstallationDescription testRuntime) {
    if (useUIHarness) {
        ArtifactDescriptor systemBundle = testRuntime.getSystemBundle();
        Version osgiVersion = Version.parseVersion(systemBundle.getKey().getVersion());
        if (osgiVersion.compareTo(EquinoxInstallationDescription.EQUINOX_VERSION_3_3_0) < 0) {
            return "org.eclipse.tycho.surefire.osgibooter.uitest32";
        } else {
            return "org.eclipse.tycho.surefire.osgibooter.uitest";
        }
    } else {
        return "org.eclipse.tycho.surefire.osgibooter.headlesstest";
    }
}
Also used : ArtifactDescriptor(org.eclipse.tycho.ArtifactDescriptor) Version(org.osgi.framework.Version)

Aggregations

ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)32 File (java.io.File)20 ArtifactKey (org.eclipse.tycho.ArtifactKey)13 ReactorProject (org.eclipse.tycho.ReactorProject)10 DependencyArtifacts (org.eclipse.tycho.artifacts.DependencyArtifacts)8 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)5 IOException (java.io.IOException)4 DefaultArtifactKey (org.eclipse.tycho.DefaultArtifactKey)4 DefaultArtifactDescriptor (org.eclipse.tycho.core.osgitools.DefaultArtifactDescriptor)4 DefaultReactorProject (org.eclipse.tycho.core.osgitools.DefaultReactorProject)4 ArrayList (java.util.ArrayList)3 LinkedHashMap (java.util.LinkedHashMap)3 PluginDescription (org.eclipse.tycho.core.PluginDescription)3 Version (org.osgi.framework.Version)3 FileOutputStream (java.io.FileOutputStream)2 HashSet (java.util.HashSet)2 LinkedHashSet (java.util.LinkedHashSet)2 Map (java.util.Map)2 Properties (java.util.Properties)2 ZipFile (java.util.zip.ZipFile)2