public List<Dependency> write(Set<ProjectInfo> projectDeps, List<Dependency> deps) throws CoreException, IOException {
		
		List<String> lines = new ArrayList<String>(getContent());
		
		if (!isTrue(lines, "Allow-ESBT")) return deps;
		
		for (int i = lines.size() - 1; i >= 0; i--) {
			String line = lines.get(i).trim();
			if (line.isEmpty()) {
				lines.remove(i);
			}
		}
		
//		boolean embedDependencies = isTrue(lines, "Embed-Dependencies");
		
		manifest.getAttribute("Allow-ESBT").setValue("true");
		manifest.getAttribute("Bundle-ManifestVersion").setValue("2", false);
		manifest.getAttribute("Bundle-Name").setValue(project.getName());
		manifest.getAttribute("Bundle-SymbolicName").setValue(getSymbolicName());
		manifest.getAttribute("Bundle-Version").setValue(getVersion());


		// add direct dependencies
		List<String> depLines = new ArrayList<String>();
		Attribute requireBundles = manifest.getAttribute("Require-Bundle");
		for (Dependency dep : project.getDependencies()) {
			String version = dep.version.replace('-', '.');
			String symbolicName = dep.organization + "." + dep.name;
			Value value = requireBundles.addUnique(symbolicName);
			value.setAnnotation("bundle-version", version);
//			depLines.add(symbolicName + ";bundle-version=\"" + version + "\""+(embedDependencies ? ";visibility:=reexport" : ""));
		}
		
		// remove org.osgi.core
		requireBundles.removeValue("org.osgi.core");
		Attribute importPackage = manifest.getAttribute("Import-Package");
		importPackage.addUnique("org.osgi.framework");
		
		
		// copy dep extent into osgi dir
		for (Dependency dep : deps) {
			OsgiifyIvy.osgiify(new File(dep.jar), dep.organization + "." + dep.name, dep.version, false);
		}
		// copy eclipse.osgi bundles
		File pluginsDir = new File(new File(URI.create(System.getProperty("eclipse.home.location"))), "plugins");
		if (pluginsDir.isDirectory()) {
			for (File jar : pluginsDir.listFiles()) {
				if (jar.getName().startsWith("org.eclipse.osgi.") && jar.getName().endsWith(".jar")) {
					copy(jar, new File(OsgiifyIvy.targetDir, jar.getName()), true);
				}
			}
		}

		set(lines, "Require-Bundle", depLines, true);
		
		// add libs
//		List<String> cp = new ArrayList<String>();
//		cp.add(".");
//		libDir.refreshLocal(1, null);
//		if (libDir.exists()) {
//			for (IResource resource : libDir.members()) {
//				if (resource.getName().endsWith(".jar")) {
//					cp.add("lib/" + resource.getName());
//				}
//			}
//		}
//		set(lines, "Bundle-ClassPath", cp, true);
//		super.doWrite(asList(manifest.toString(",\n  ", new StringBuilder()).toString().split("\n")));
		super.doWrite(manifest.write());
//		super.doWrite(lines);
		return deps;
	}