Search in sources :

Example 6 with DefaultArtifactKey

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;
}
Also used : DefaultClasspathEntry(org.eclipse.tycho.core.osgitools.DefaultClasspathEntry) ArrayList(java.util.ArrayList) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) ClasspathEntry(org.eclipse.tycho.classpath.ClasspathEntry) DefaultClasspathEntry(org.eclipse.tycho.core.osgitools.DefaultClasspathEntry)

Example 7 with DefaultArtifactKey

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);
}
Also used : StringTokenizer(java.util.StringTokenizer) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey)

Example 8 with DefaultArtifactKey

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);
}
Also used : HashMap(java.util.HashMap) ArtifactCollection(org.eclipse.tycho.core.osgitools.targetplatform.ArtifactCollection) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) Properties(java.util.Properties) File(java.io.File)

Example 9 with DefaultArtifactKey

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);
}
Also used : ProductConfiguration(org.eclipse.tycho.model.ProductConfiguration) DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey)

Example 10 with DefaultArtifactKey

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");
}
Also used : DefaultArtifactKey(org.eclipse.tycho.DefaultArtifactKey) BeforeClass(org.junit.BeforeClass)

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