varMap.put("ws", new File(dirList[i] + File.separator + "ws" + File.separator + ws).getPath());
varMap.put("ws", new File(dirList[i] + File.separator + "ws" + File.separator + ws).getPath().replace('\\', '/'));
	public EclipseClasspath execute() throws EclipseClasspathException, DocumentException, IOException {		// Build plugin directory map		File pluginDir = new File(eclipseDir, "plugins");		File[] dirList = pluginDir.listFiles(new FileFilter() {			public boolean accept(File pathname) {				return pathname.isDirectory();			}		});		if (dirList == null)			throw new EclipseClasspathException("Could not list plugins in directory " + pluginDir);		for (int i = 0; i < dirList.length; ++i) {			String dirName = dirList[i].getName();			String pluginId = getPluginId(dirName);			if (pluginId != null) {				//System.out.println(pluginId + " ==> " + dirList[i]);				pluginDirectoryMap.put(pluginId, dirList[i]);				// HACK - see if we can deduce the value of the special "ws" variable.				if (pluginId.startsWith("org.eclipse.swt.")) {					String ws = pluginId.substring("org.eclipse.swt.".length());					varMap.put("ws", new File(dirList[i] + File.separator + "ws" + File.separator + ws).getPath());				}			}		}		Map<String, Plugin> requiredPluginMap = new HashMap<String, Plugin>();		LinkedList<WorkListItem> workList = new LinkedList<WorkListItem>();		workList.add(new WorkListItem(rootPluginDir, false));		while (!workList.isEmpty()) {			WorkListItem item = workList.removeFirst();			// Read the plugin file			SAXReader reader = new SAXReader();			Document doc = reader.read(new EclipseXMLReader(new FileReader(item.getDescriptorFileName())));			// Add to the map			Plugin plugin = new Plugin(item.getDirectory(), doc, item.isDependent());			requiredPluginMap.put(plugin.getId(), plugin);			if (!plugin.isDependent()) {				if (rootPlugin != null) throw new IllegalStateException("multiple root plugins");				this.rootPlugin = plugin;			}			// Add unresolved required plugins to the worklist			for (Iterator<String> i = plugin.requiredPluginIdIterator(); i.hasNext(); ) {				String requiredPluginId = i.next();				if (requiredPluginMap.get(requiredPluginId) == null) {					// Find the plugin's directory					File requiredPluginDir = pluginDirectoryMap.get(requiredPluginId);					if (requiredPluginDir == null)						throw new EclipseClasspathException("Unable to find plugin " + requiredPluginId);					workList.add(new WorkListItem(requiredPluginDir.getPath(), true));				}			}		}		//System.out.println("Found " + requiredPluginMap.size() + " required plugins");		importList = new LinkedList<String>();		for (Iterator<Plugin> i = requiredPluginMap.values().iterator(); i.hasNext(); ) {			Plugin plugin = i.next();			if (plugin.isDependent()) {				for (Iterator<String> j = plugin.exportedLibraryIterator(); j.hasNext(); ) {					//System.out.println("Import: " + j.next());					importList.add(j.next());				}			}		}		return this;	}