예제 #1
0
  /** Returns the configured environments in a format suitable for the p2 tools facade. */
  private List<TargetEnvironment> getEnvironmentsForFacade() {
    // TODO use shared class everywhere?

    List<org.eclipse.tycho.core.TargetEnvironment> original =
        TychoProjectUtils.getTargetPlatformConfiguration(project).getEnvironments();
    List<TargetEnvironment> converted = new ArrayList<TargetEnvironment>(original.size());
    for (org.eclipse.tycho.core.TargetEnvironment env : original) {
      converted.add(new TargetEnvironment(env.getWs(), env.getOs(), env.getArch()));
    }
    return converted;
  }
  private List<Map<String, String>> getEnvironments(TargetPlatformConfiguration configuration) {
    ArrayList<Map<String, String>> environments = new ArrayList<Map<String, String>>();

    for (TargetEnvironment environment : configuration.getEnvironments()) {
      Properties properties = new Properties();
      properties.put(PlatformPropertiesUtils.OSGI_OS, environment.getOs());
      properties.put(PlatformPropertiesUtils.OSGI_WS, environment.getWs());
      properties.put(PlatformPropertiesUtils.OSGI_ARCH, environment.getArch());
      ExecutionEnvironmentUtils.loadVMProfile(properties);

      // TODO does not belong here
      properties.put("org.eclipse.update.install.features", "true");

      Map<String, String> map = new LinkedHashMap<String, String>();
      for (Object key : properties.keySet()) {
        map.put(key.toString(), properties.getProperty(key.toString()));
      }
      environments.add(map);
    }

    return environments;
  }
예제 #3
0
 static String getOsWsArch(TargetEnvironment env, char separator) {
   return env.getOs() + separator + env.getWs() + separator + env.getArch();
 }