Search in sources :

Example 1 with ArtifactCollection

use of org.eclipse.tycho.core.osgitools.targetplatform.ArtifactCollection 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)

Aggregations

File (java.io.File)1 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 DefaultArtifactKey (org.eclipse.tycho.DefaultArtifactKey)1 ArtifactCollection (org.eclipse.tycho.core.osgitools.targetplatform.ArtifactCollection)1