use of org.eclipse.tycho.ArtifactKey in project tycho by eclipse.
the class TargetPlatformTest method testResolveFixedVersion.
@Test
public void testResolveFixedVersion() throws Exception {
ArtifactKey key = subject.resolveArtifact("eclipse-plugin", "some.bundle", "1.1.0.v2013");
assertThat(key.getType(), is(ArtifactType.TYPE_ECLIPSE_PLUGIN));
assertThat(key.getId(), is("some.bundle"));
assertThat(key.getVersion(), is("1.1.0.v2013"));
}
use of org.eclipse.tycho.ArtifactKey in project tycho by eclipse.
the class TargetPlatformTest method testResolveIU.
@Test
public void testResolveIU() throws Exception {
candidateIUs = createSet(createBundleIU("unit", "2.0.0"), createProductIU("unit", "1.99.0"));
subject = createTP();
ArtifactKey key = subject.resolveArtifact("p2-installable-unit", "unit", ANY_VERSION);
assertThat(key.getType(), is(ArtifactType.TYPE_INSTALLABLE_UNIT));
assertThat(key.getId(), is("unit"));
assertThat(key.getVersion(), is("2.0.0"));
}
use of org.eclipse.tycho.ArtifactKey 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());
}
use of org.eclipse.tycho.ArtifactKey in project tycho by eclipse.
the class OsgiBundleProject method addExtraClasspathEntries.
private void addExtraClasspathEntries(List<ClasspathEntry> classpath, ReactorProject project, DependencyArtifacts artifacts) {
EclipsePluginProject pdeProject = getEclipsePluginProject(project);
Collection<BuildOutputJar> outputJars = pdeProject.getOutputJarMap().values();
for (BuildOutputJar buildOutputJar : outputJars) {
List<String> entries = buildOutputJar.getExtraClasspathEntries();
for (String entry : entries) {
Pattern platformURL = Pattern.compile("platform:/(plugin|fragment)/([^/]*)/*(.*)");
Matcher m = platformURL.matcher(entry.trim());
String bundleId = null;
String path = null;
if (m.matches()) {
bundleId = m.group(2).trim();
path = m.group(3).trim();
if (path != null && path.length() <= 0) {
path = null;
}
ArtifactDescriptor matchingBundle = artifacts.getArtifact(ArtifactType.TYPE_ECLIPSE_PLUGIN, bundleId, null);
if (matchingBundle != null) {
List<File> locations;
if (matchingBundle.getMavenProject() != null) {
locations = getOtherProjectClasspath(matchingBundle, matchingBundle.getMavenProject(), path);
} else if (path != null) {
locations = getBundleEntry(matchingBundle, path);
} else {
locations = getBundleClasspath(matchingBundle);
}
classpath.add(new DefaultClasspathEntry(matchingBundle.getMavenProject(), matchingBundle.getKey(), locations, null));
} else {
getLogger().warn("Missing extra classpath entry " + entry.trim());
}
} else {
entry = entry.trim();
File file = new File(project.getBasedir(), entry).getAbsoluteFile();
if (file.exists()) {
List<File> locations = Collections.singletonList(file);
ArtifactKey projectKey = getArtifactKey(project);
classpath.add(new DefaultClasspathEntry(project, projectKey, locations, null));
} else {
getLogger().warn("Missing extra classpath entry " + entry);
}
}
}
}
}
use of org.eclipse.tycho.ArtifactKey in project tycho by eclipse.
the class OsgiBundleProject method setupProject.
@Override
public void setupProject(MavenSession session, MavenProject project) {
ArtifactKey key = readArtifactKey(project.getBasedir());
project.setContextValue(CTX_ARTIFACT_KEY, key);
}
Aggregations