use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class AbstractJUnitProviderTest method classPath.
static List<ClasspathEntry> classPath(String... entries) {
List<ClasspathEntry> result = new ArrayList<>();
for (String entry : entries) {
int colonIndex = entry.indexOf(':');
assertNotSame(-1, colonIndex);
String id = entry.substring(0, colonIndex);
String version = entry.substring(colonIndex + 1);
result.add(new DefaultClasspathEntry(null, new DefaultArtifactKey(ArtifactType.TYPE_ECLIPSE_PLUGIN, id, version), null, null));
}
return result;
}
use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class DevWorkspaceResolver method toArtifactKey.
private DefaultArtifactKey toArtifactKey(String key) {
StringTokenizer st = new StringTokenizer(key, ":");
String type = st.nextToken();
String id = st.nextToken();
String version = st.nextToken();
return new DefaultArtifactKey(type, id, version);
}
use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class DevWorkspaceResolver method initialize.
@Override
public void initialize() throws InitializationException {
Map<File, String> workspaceDeventries = new HashMap<>();
Map<File, File> workspaceBasedirs = new HashMap<>();
ArtifactCollection workspaceBundles = new ArtifactCollection();
String stateLocation = System.getProperty(SYSPROP_STATELOCATION);
if (stateLocation != null) {
Properties properties = loadWorkspaceState(new File(stateLocation, FILE_WORKSPACESTATE));
for (Object key : properties.keySet()) {
String stringKey = (String) key;
if (stringKey.endsWith(SUFFIX_LOCATION)) {
DefaultArtifactKey artifactKey = toArtifactKey(stringKey);
File location = toLocation(properties.getProperty(stringKey));
workspaceBundles.addArtifactFile(artifactKey, location, null);
// workspace projects
// normalize
stringKey = toStringKey(artifactKey);
String basedir = properties.getProperty(stringKey + SUFFIX_BASEDIR);
if (basedir != null) {
workspaceBasedirs.put(new File(basedir), location);
String deventries = properties.getProperty(stringKey + SUFFIX_ENTRIES);
if (deventries != null) {
workspaceDeventries.put(location, deventries);
}
}
}
}
this.stateLocation = new File(stateLocation);
}
this.workspaceBundles = workspaceBundles;
this.workspaceBasedirs = Collections.unmodifiableMap(workspaceBasedirs);
this.workspaceDeventries = Collections.unmodifiableMap(workspaceDeventries);
}
use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class EclipseApplicationProject method getArtifactKey.
@Override
public ArtifactKey getArtifactKey(ReactorProject project) {
ProductConfiguration product = loadProduct(project);
String id = product.getId() != null ? product.getId() : project.getArtifactId();
String version = product.getVersion() != null ? product.getVersion() : getOsgiVersion(project);
// TODO this is an invalid type constant for an ArtifactKey
return new DefaultArtifactKey(PackagingType.TYPE_ECLIPSE_APPLICATION, id, version);
}
use of org.eclipse.tycho.DefaultArtifactKey in project tycho by eclipse.
the class FeatureXmlTransformerTest method initTestResources.
@BeforeClass
public static void initTestResources() throws Exception {
rcpFeatureInTP = new DefaultArtifactKey("eclipse-feature", "org.eclipse.rcp", "4.5.0.v20140918");
junit4InTP = new DefaultArtifactKey("eclipse-plugin", "org.junit4", "4.8.1.v20100302");
junit4JarLocation = TestUtil.getTestResourceLocation("eclipse/plugins/org.junit4_4.8.1.v20100302.jar");
}
Aggregations