Bug 462201 - Remove support for building Eclipse 2.x-style plug-ins

Removes dependency on o.e.runtime.compatibility bundle and removes all
dead code resulting from no longer supporting old-style plug-ins.

Only thing that remains is the "buildingOSGi" option in the buildscript
generator ant task, which is deprecated and de-implemented instead of
removed so as not to break any existing scripts. This should also be
removed in the future.

Change-Id: I0edfb61298654de91a667c4a041fec13839ddbe2
Signed-off-by: Mat Booth <mat.booth@redhat.com>
diff --git a/org.eclipse.pde.build/META-INF/MANIFEST.MF b/org.eclipse.pde.build/META-INF/MANIFEST.MF
index 7fc74b3..97b0a3f 100644
--- a/org.eclipse.pde.build/META-INF/MANIFEST.MF
+++ b/org.eclipse.pde.build/META-INF/MANIFEST.MF
@@ -20,7 +20,6 @@
 Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
  org.eclipse.ant.core;bundle-version="[3.1.100,4.0.0)",
  org.eclipse.update.configurator;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.core.runtime.compatibility;bundle-version="[3.1.100,4.0.0)";resolution:=optional,
  org.eclipse.osgi;bundle-version="[3.3.0,4.0.0)",
  org.eclipse.equinox.p2.jarprocessor;bundle-version="[1.0.1,2.0.0)",
  org.eclipse.equinox.p2.publisher;bundle-version="1.1.0",
diff --git a/org.eclipse.pde.build/feature/feature.xml b/org.eclipse.pde.build/feature/feature.xml
index 70cac54..85292e6 100644
--- a/org.eclipse.pde.build/feature/feature.xml
+++ b/org.eclipse.pde.build/feature/feature.xml
@@ -48,12 +48,6 @@
          version="0.0.0"/>
 
    <plugin
-         id="org.eclipse.core.runtime.compatibility"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"/>
-
-   <plugin
          id="org.eclipse.jdt.core"
          download-size="0"
          install-size="0"
diff --git a/org.eclipse.pde.build/localbuild.xml b/org.eclipse.pde.build/localbuild.xml
index 8d2bc82..bbfb071 100644
--- a/org.eclipse.pde.build/localbuild.xml
+++ b/org.eclipse.pde.build/localbuild.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!--
-     Copyright (c) 2008 IBM Corporation and others.
+     Copyright (c) 2008, 2015 IBM Corporation and others.
      All rights reserved. This program and the accompanying materials
      are made available under the terms of the Eclipse Public License v1.0
      which accompanies this distribution, and is available at
@@ -25,7 +25,6 @@
 			buildDirectory="${buildDirectory}" 
 			configInfo="*,*,*" 
 			baseLocation="${baseLocation}" 
-			buildingOSGi="true" 
 			outputUpdateJars="false"
 			pluginpath="${thisPlugin}"
 			forceContextQualifier="z${DSTAMP}${TSTAMP}"
diff --git a/org.eclipse.pde.build/scripts/genericTargets.xml b/org.eclipse.pde.build/scripts/genericTargets.xml
index 0021191..a5a13c2 100644
--- a/org.eclipse.pde.build/scripts/genericTargets.xml
+++ b/org.eclipse.pde.build/scripts/genericTargets.xml
@@ -1,5 +1,5 @@
 <!--
-    Copyright (c) 2003, 2010 IBM Corporation and others.
+    Copyright (c) 2003, 2015 IBM Corporation and others.
     All rights reserved. This program and the accompanying materials
     are made available under the terms of the Eclipse Public License v1.0
     which accompanies this distribution, and is available at
@@ -29,7 +29,6 @@
 <property name="fetchTag" value=""/>
 <property name="customEESources" value="" />
 <property name="transformedRepoLocation" value="" />
-<property name="buildingOSGi" value="true"/>
 <property name="generateJnlp" value="false"/>
 <property name="signJars" value="false"/>
 <property name="generateFeatureVersionSuffix" value="false" />
@@ -81,7 +80,6 @@
 		buildDirectory="${buildDirectory}"
 		configInfo="${configs}"
 		baseLocation="${baseLocation}"
-		buildingOSGi="${buildingOSGi}"
 		outputUpdateJars="${outputUpdateJars}"
 		archivesFormat="${archivesFormat}"
 		product="${product}"
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java
index 65ed757..ba45543 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -56,7 +56,6 @@
 	protected static boolean forceUpdateJarFormat = false;
 	private static List<Config> configInfos;
 	protected static String workingDirectory;
-	protected static boolean buildingOSGi = true;
 	protected URI[] contextMetadata = null;
 	protected URI[] contextArtifacts = null;
 	protected AntScript script;
@@ -265,14 +264,6 @@
 		script.close();
 	}
 
-	public void setBuildingOSGi(boolean b) {
-		buildingOSGi = b;
-	}
-
-	public static boolean isBuildingOSGi() {
-		return buildingOSGi;
-	}
-
 	public static String getWorkingDirectory() {
 		return workingDirectory;
 	}
@@ -301,10 +292,6 @@
 		return "*, *, *"; //$NON-NLS-1$
 	}
 
-	public static boolean getDefaultBuildingOSGi() {
-		return true;
-	}
-
 	protected static boolean loadP2Class() {
 		try {
 			BundleHelper.getDefault().getClass().getClassLoader().loadClass("org.eclipse.equinox.p2.publisher.Publisher"); //$NON-NLS-1$
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/BuildScriptGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/BuildScriptGenerator.java
index c7ff534..c21e45c 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/BuildScriptGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/BuildScriptGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -168,7 +168,6 @@
 				generator.setPluginPath(pluginPath);
 				generator.setDevEntries(devEntries);
 				generator.setCompiledElements(generator.getCompiledElements());
-				generator.setBuildingOSGi(isBuildingOSGi());
 				generator.setSignJars(signJars);
 				generator.setGenerateSourceReferences(sourceReferences);
 				generator.generate();
@@ -185,7 +184,6 @@
 					generator.setPluginPath(pluginPath);
 					generator.setDevEntries(devEntries);
 					generator.setCompiledElements(generator.getCompiledElements());
-					generator.setBuildingOSGi(isBuildingOSGi());
 					generator.setSignJars(signJars);
 					generator.setGenerateSourceReferences(sourceReferences);
 					generator.generate();
@@ -229,7 +227,6 @@
 			generator.setDevEntries(devEntries);
 			generator.setSourceToGather(new SourceFeatureInformation());//
 			generator.setCompiledElements(generator.getCompiledElements());
-			generator.setBuildingOSGi(isBuildingOSGi());
 			generator.includePlatformIndependent(includePlatformIndependent);
 			generator.setReportResolutionErrors(reportResolutionErrors);
 			generator.setIgnoreMissingPropertiesFile(ignoreMissingPropertiesFile);
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/BuildDirector.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/BuildDirector.java
index a6cf951..dfc147b 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/BuildDirector.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/BuildDirector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -542,7 +542,6 @@
 			generator.setModel(model); // setModel has to be called before configurePersistentProperties because it reads the model's properties
 			generator.setFeatureGenerator(this);
 			generator.setPluginPath(getPluginPath());
-			generator.setBuildingOSGi(isBuildingOSGi());
 			generator.setDevEntries(devEntries);
 			generator.includePlatformIndependent(isPlatformIndependentIncluded());
 			generator.setSignJars(signJars);
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ClasspathComputer2_1.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ClasspathComputer2_1.java
deleted file mode 100644
index 2cb3fe3..0000000
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ClasspathComputer2_1.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *      IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.build.builder;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.*;
-import org.eclipse.core.internal.boot.PlatformURLHandler;
-import org.eclipse.core.runtime.*;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.pde.internal.build.*;
-import org.eclipse.pde.internal.build.site.PDEState;
-
-public class ClasspathComputer2_1 implements IClasspathComputer, IPDEBuildConstants, IXMLConstants, IBuildPropertiesConstants {
-	private final ModelBuildScriptGenerator generator;
-
-	public ClasspathComputer2_1(ModelBuildScriptGenerator modelGenerator) {
-		this.generator = modelGenerator;
-	}
-
-	/**
-	 * Compute the classpath for the given jar.
-	 * The path returned conforms to Parent / Self / Prerequisite
-	 * 
-	 * @param model the plugin containing the jar compiled
-	 * @param jar the jar for which the classpath is being compiled
-	 * @return String the classpath
-	 * @throws CoreException
-	 */
-	@Override
-	public List<Object> getClasspath(BundleDescription model, ModelBuildScriptGenerator.CompiledEntry jar) throws CoreException {
-		List<Object> classpath = new ArrayList<Object>(20);
-		List<BundleDescription> pluginChain = new ArrayList<BundleDescription>(10);
-		Set<BundleDescription> addedPlugins = new HashSet<BundleDescription>(20);
-		String location = generator.getLocation(model);
-
-		//PARENT
-		addPlugin(getPlugin(PI_BOOT, null), classpath, location);
-
-		//SELF
-		addSelf(model, jar, classpath, location, pluginChain, addedPlugins);
-
-		//PREREQUISITE
-		addPrerequisites(model, classpath, location, pluginChain, addedPlugins);
-
-		return classpath;
-
-	}
-
-	/**
-	 * Add the specified plugin (including its jars) and its fragments 
-	 * @param plugin
-	 * @param classpath
-	 * @param location
-	 * @throws CoreException
-	 */
-	private void addPlugin(BundleDescription plugin, List<Object> classpath, String location) throws CoreException {
-		addRuntimeLibraries(plugin, classpath, location);
-		addFragmentsLibraries(plugin, classpath, location);
-	}
-
-	/**
-	 * Add the runtime libraries for the specified plugin. 
-	 * @param model
-	 * @param classpath
-	 * @param baseLocation
-	 * @throws CoreException
-	 */
-	private void addRuntimeLibraries(BundleDescription model, List<Object> classpath, String baseLocation) throws CoreException {
-		String[] libraries = getClasspathEntries(model);
-		String root = generator.getLocation(model);
-		IPath base = Utils.makeRelative(new Path(root), new Path(baseLocation));
-		Properties modelProps = getBuildPropertiesFor(model);
-		for (int i = 0; i < libraries.length; i++) {
-			addDevEntries(model, baseLocation, classpath, Utils.getArrayFromString(generator.getBuildProperties().getProperty(PROPERTY_OUTPUT_PREFIX + libraries[i])));
-			addPathAndCheck(model, base, libraries[i], modelProps, classpath);
-		}
-	}
-
-	/**
-	 * Return the plug-in model object from the plug-in registry for the given
-	 * plug-in identifier and version. If the plug-in is not in the registry then
-	 * throw an exception.
-	 * 
-	 * @param id the plug-in identifier
-	 * @param version the plug-in version
-	 * @return BundleDescription
-	 * @throws CoreException if the specified plug-in version does not exist in the registry
-	 */
-	private BundleDescription getPlugin(String id, String version) throws CoreException {
-		return generator.getSite(false).getRegistry().getResolvedBundle(id, version);
-	}
-
-	/**
-	 * Add all fragments of the given plugin
-	 * @param plugin
-	 * @param classpath
-	 * @param baseLocation
-	 * @throws CoreException
-	 */
-	private void addFragmentsLibraries(BundleDescription plugin, List<Object> classpath, String baseLocation) throws CoreException {
-		// if plugin is not a plugin, it's a fragment and there is no fragment for a fragment. So we return.
-		BundleDescription[] fragments = plugin.getFragments();
-		if (fragments == null)
-			return;
-
-		for (int i = 0; i < fragments.length; i++) {
-			if (fragments[i] == generator.getModel())
-				continue;
-			addPluginLibrariesToFragmentLocations(plugin, fragments[i], classpath, baseLocation);
-			addRuntimeLibraries(fragments[i], classpath, baseLocation);
-		}
-	}
-
-	/**
-	 * There are cases where the plug-in only declares a library but the real JAR is under
-	 * a fragment location. This method gets all the plugin libraries and place them in the
-	 * possible fragment location.
-	 * 
-	 * @param plugin
-	 * @param fragment
-	 * @param classpath
-	 * @param baseLocation
-	 * @throws CoreException
-	 */
-	private void addPluginLibrariesToFragmentLocations(BundleDescription plugin, BundleDescription fragment, List<Object> classpath, String baseLocation) throws CoreException {
-		//TODO This methods causes the addition of a lot of useless entries. See bug #35544
-		//If we reintroduce the test below, we reintroduce the problem 35544	
-		//	if (fragment.getRuntime() != null)
-		//		return;
-
-		String[] libraries = getClasspathEntries(plugin);
-		String root = generator.getLocation(fragment);
-		IPath base = Utils.makeRelative(new Path(root), new Path(baseLocation));
-		Properties modelProps = getBuildPropertiesFor(fragment);
-		for (int i = 0; i < libraries.length; i++) {
-			addPathAndCheck(fragment, base, libraries[i], modelProps, classpath);
-		}
-	}
-
-	private Properties getBuildPropertiesFor(BundleDescription bundle) {
-		try {
-			return AbstractScriptGenerator.readProperties(generator.getLocation(bundle), PROPERTIES_FILE, IStatus.OK);
-		} catch (CoreException e) {
-			//ignore
-		}
-		return null;
-	}
-
-	// Add a path into the classpath for a given model
-	// path : The path to add
-	// classpath : The classpath in which we want to add this path 
-	private void addPathAndCheck(BundleDescription model, IPath basePath, String libraryName, Properties modelProperties, List<Object> classpath) {
-		String pluginKey = model != null ? model.getSymbolicName() + "_" + model.getVersion() : null; //$NON-NLS-1$
-		String path = basePath.append(libraryName).toString();
-		path = ModelBuildScriptGenerator.replaceVariables(path, pluginKey == null ? false : generator.getCompiledElements().contains(pluginKey));
-		if (generator.getCompiledElements().contains(pluginKey)) {
-			if (modelProperties == null || modelProperties.getProperty("source." + libraryName) != null) //$NON-NLS-1$
-				path = Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER) + '/' + path;
-		}
-		if (!classpath.contains(path))
-			classpath.add(path);
-	}
-
-	private void addSelf(BundleDescription model, ModelBuildScriptGenerator.CompiledEntry jar, List<Object> classpath, String location, List<BundleDescription> pluginChain, Set<BundleDescription> addedPlugins) throws CoreException {
-		// If model is a fragment, we need to add in the classpath the plugin to which it is related
-		HostSpecification host = model.getHost();
-		if (host != null) {
-			BundleDescription[] hosts = host.getHosts();
-			for (int i = 0; i < hosts.length; i++)
-				addPluginAndPrerequisites(hosts[i], classpath, location, pluginChain, addedPlugins);
-		}
-
-		// Add the libraries
-		Properties modelProperties = generator.getBuildProperties();
-		String jarOrder = (String) modelProperties.get(PROPERTY_JAR_ORDER);
-		if (jarOrder == null) {
-			// if no jar order was specified in build.properties, we add all the libraries but the current one
-			// based on the order specified by the plugin.xml. Both library that we compile and .jar provided are processed
-			String[] libraries = getClasspathEntries(model);
-			if (libraries != null) {
-				for (int i = 0; i < libraries.length; i++) {
-					String libraryName = libraries[i];
-					if (jar.getName(false).equals(libraryName))
-						continue;
-
-					boolean isSource = (modelProperties.getProperty(PROPERTY_SOURCE_PREFIX + libraryName) != null);
-					if (isSource) {
-						addDevEntries(model, location, classpath, Utils.getArrayFromString(modelProperties.getProperty(PROPERTY_OUTPUT_PREFIX + libraryName)));
-					}
-					//Potential pb: here there maybe a nasty case where the libraries variable may refer to something which is part of the base
-					//but $xx$ will replace it by the $xx instead of $basexx. The solution is for the user to use the explicitly set the content
-					// of its build.property file
-					addPathAndCheck(model, Path.EMPTY, libraryName, modelProperties, classpath);
-				}
-			}
-		} else {
-			// otherwise we add all the predecessor jars
-			String[] order = Utils.getArrayFromString(jarOrder);
-			for (int i = 0; i < order.length; i++) {
-				if (order[i].equals(jar.getName(false)))
-					break;
-				addDevEntries(model, location, classpath, Utils.getArrayFromString((String) modelProperties.get(PROPERTY_OUTPUT_PREFIX + order[i])));
-				addPathAndCheck(model, Path.EMPTY, order[i], modelProperties, classpath);
-			}
-			// Then we add all the "pure libraries" (the one that does not contain source)
-			String[] libraries = getClasspathEntries(model);
-			for (int i = 0; i < libraries.length; i++) {
-				String libraryName = libraries[i];
-				if (modelProperties.get(PROPERTY_SOURCE_PREFIX + libraryName) == null) {
-					//Potential pb: if the pure library is something that is being compiled (which is supposetly not the case, but who knows...)
-					//the user will get $basexx instead of $ws 
-					addPathAndCheck(model, Path.EMPTY, libraryName, modelProperties, classpath);
-				}
-			}
-		}
-
-		// add extra classpath if it exists. this code is kept for backward compatibility
-		String extraClasspath = (String) modelProperties.get(PROPERTY_JAR_EXTRA_CLASSPATH);
-		if (extraClasspath != null) {
-			String[] extra = Utils.getArrayFromString(extraClasspath, ";,"); //$NON-NLS-1$
-
-			for (int i = 0; i < extra.length; i++) {
-				//Potential pb: if the path refers to something that is being compiled (which is supposetly not the case, but who knows...)
-				//the user will get $basexx instead of $ws 
-				addPathAndCheck(null, new Path(computeExtraPath(extra[i], location)), "", modelProperties, classpath); //$NON-NLS-1$
-			}
-		}
-
-		//	add extra classpath if it is specified for the given jar
-		String[] jarSpecificExtraClasspath = jar.getExtraClasspath();
-		for (int i = 0; i < jarSpecificExtraClasspath.length; i++) {
-			//Potential pb: if the path refers to something that is being compiled (which is supposetly not the case, but who knows...)
-			//the user will get $basexx instead of $ws 
-			addPathAndCheck(null, new Path(computeExtraPath(jarSpecificExtraClasspath[i], location)), "", modelProperties, classpath); //$NON-NLS-1$
-		}
-	}
-
-	/** 
-	 * Convenience method that compute the relative classpath of extra.classpath entries  
-	 * @param url a url
-	 * @param location location used as a base location to compute the relative path 
-	 * @return String the relative path 
-	 * @throws CoreException
-	 */
-	private String computeExtraPath(String url, String location) throws CoreException {
-		String relativePath = null;
-
-		String[] urlfragments = Utils.getArrayFromString(url, "/"); //$NON-NLS-1$
-
-		// A valid platform url for a plugin has a leat 3 segments.
-		if (urlfragments.length > 2 && urlfragments[0].equals(PlatformURLHandler.PROTOCOL + PlatformURLHandler.PROTOCOL_SEPARATOR)) {
-			String modelLocation = null;
-			if (urlfragments[1].equalsIgnoreCase(PLUGIN))
-				modelLocation = generator.getLocation(generator.getSite(false).getRegistry().getResolvedBundle(urlfragments[2]));
-
-			if (urlfragments[1].equalsIgnoreCase(FRAGMENT))
-				modelLocation = generator.getLocation(generator.getSite(false).getRegistry().getResolvedBundle(urlfragments[2]));
-
-			if (urlfragments[1].equalsIgnoreCase("resource")) { //$NON-NLS-1$
-				String message = NLS.bind(Messages.exception_url, generator.getPropertiesFileName() + "::" + url); //$NON-NLS-1$
-				throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_MALFORMED_URL, message, null));
-			}
-			if (modelLocation != null) {
-				for (int i = 3; i < urlfragments.length; i++) {
-					if (i == 3)
-						modelLocation += urlfragments[i];
-					else
-						modelLocation += '/' + urlfragments[i];
-				}
-				return Utils.makeRelative(new Path(modelLocation), new Path(location)).toOSString();
-			}
-		}
-
-		// Then it's just a regular URL, or just something that will be added at the end of the classpath for backward compatibility.......
-		try {
-			URL extraURL = new URL(url);
-			try {
-				relativePath = Utils.makeRelative(new Path(FileLocator.resolve(extraURL).getFile()), new Path(location)).toOSString();
-			} catch (IOException e) {
-				String message = NLS.bind(Messages.exception_url, generator.getPropertiesFileName() + "::" + url); //$NON-NLS-1$
-				throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_MALFORMED_URL, message, e));
-			}
-		} catch (MalformedURLException e) {
-			String message = NLS.bind(Messages.exception_url, PROPERTIES_FILE + "::" + url); //$NON-NLS-1$
-			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, IPDEBuildConstants.EXCEPTION_MALFORMED_URL, message, e));
-		}
-		return relativePath;
-	}
-
-	//Add the prerequisite of a given plugin (target)
-	private void addPrerequisites(BundleDescription target, List<Object> classpath, String baseLocation, List<BundleDescription> pluginChain, Set<BundleDescription> addedPlugins) throws CoreException {
-
-		if (pluginChain.contains(target)) {
-			if (target == getPlugin(PI_RUNTIME, null))
-				return;
-			String cycleString = ""; //$NON-NLS-1$
-			for (Iterator<BundleDescription> iter = pluginChain.iterator(); iter.hasNext();)
-				cycleString += iter.next().toString() + ", "; //$NON-NLS-1$
-			cycleString += target.toString();
-			String message = NLS.bind(Messages.error_pluginCycle, cycleString);
-			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_CLASSPATH_CYCLE, message, null));
-		}
-
-		if (addedPlugins.contains(target)) {
-			return;
-		}
-
-		//	The first prerequisite is ALWAYS runtime	
-		if (target != getPlugin(PI_RUNTIME, null))
-			addPluginAndPrerequisites(getPlugin(PI_RUNTIME, null), classpath, baseLocation, pluginChain, addedPlugins);
-
-		// add libraries from pre-requisite plug-ins.  Don't worry about the export flag
-		// as all required plugins may be required for compilation.
-		BundleDescription[] requires = PDEState.getDependentBundles(target);
-		if (requires != null) {
-			pluginChain.add(target);
-			for (int i = 0; i < requires.length; i++) {
-				BundleDescription plugin = getPlugin(requires[i].getSymbolicName(), requires[i].getVersion().toString());
-				if (plugin != null)
-					addPluginAndPrerequisites(plugin, classpath, baseLocation, pluginChain, addedPlugins);
-			}
-			pluginChain.remove(target);
-			addedPlugins.add(target);
-		}
-
-	}
-
-	/**
-	 * The pluginChain parameter is used to keep track of possible cycles. If prerequisite is already
-	 * present in the chain it is not included in the classpath.
-	 * 
-	 * @param target : the plugin for which we are going to introduce
-	 * @param classpath 
-	 * @param baseLocation
-	 * @param pluginChain
-	 * @param addedPlugins 
-	 * @throws CoreException
-	 */
-	private void addPluginAndPrerequisites(BundleDescription target, List<Object> classpath, String baseLocation, List<BundleDescription> pluginChain, Set<BundleDescription> addedPlugins) throws CoreException {
-		addPlugin(target, classpath, baseLocation);
-		addPrerequisites(target, classpath, baseLocation, pluginChain, addedPlugins);
-	}
-
-	/**
-	 * 
-	 * @param model
-	 * @param baseLocation
-	 * @param classpath
-	 */
-	private void addDevEntries(BundleDescription model, String baseLocation, List<Object> classpath, String[] jarSpecificEntries) {
-		if (generator.devEntries == null && (jarSpecificEntries == null || jarSpecificEntries.length == 0))
-			return;
-
-		String[] entries;
-		// if jarSpecificEntries is given, then it overrides devEntries 
-		if (jarSpecificEntries != null && jarSpecificEntries.length > 0)
-			entries = jarSpecificEntries;
-		else
-			entries = generator.devEntries.getDevClassPath(model.getSymbolicName());
-
-		IPath root = Utils.makeRelative(new Path(generator.getLocation(model)), new Path(baseLocation));
-		for (int i = 0; i < entries.length; i++) {
-			addPathAndCheck(model, root, entries[i], null, classpath);
-		}
-	}
-
-	//Return the jar name from the classpath 
-	private String[] getClasspathEntries(BundleDescription bundle) throws CoreException {
-		return generator.getClasspathEntries(bundle);
-	}
-}
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java
index 7c0a0f7..065ab24 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2015 IBM Corporation and others. All rights reserved.
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -145,9 +145,6 @@
 		//		if (featureGenerator != null && featureGenerator.getBuildProperties().containsKey(GENERATION_SOURCE_PLUGIN_PREFIX + model.getSymbolicName()))
 		//			return;
 
-		if (!AbstractScriptGenerator.isBuildingOSGi())
-			checkBootAndRuntime();
-
 		initializeVariables();
 		if (BundleHelper.getDefault().isDebugging())
 			System.out.println("Generating plugin " + model.getSymbolicName()); //$NON-NLS-1$
@@ -166,20 +163,6 @@
 		}
 	}
 
-	/**
-	 * Check that boot and runtime are available, otherwise throws an exception because the build will fail.
-	 */
-	private void checkBootAndRuntime() throws CoreException {
-		if (getSite(false).getRegistry().getResolvedBundle(PI_BOOT) == null) {
-			IStatus status = new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PLUGIN_MISSING, NLS.bind(Messages.exception_missingPlugin, PI_BOOT), null);
-			throw new CoreException(status);
-		}
-		if (getSite(false).getRegistry().getResolvedBundle(PI_RUNTIME) == null) {
-			IStatus status = new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PLUGIN_MISSING, NLS.bind(Messages.exception_missingPlugin, PI_RUNTIME), null);
-			throw new CoreException(status);
-		}
-	}
-
 	public static String getNormalizedName(BundleDescription bundle) {
 		return bundle.getSymbolicName() + '_' + bundle.getVersion();
 	}
@@ -1241,11 +1224,7 @@
 
 		// Put the jars in a correct compile order
 		String jarOrder = (String) getBuildProperties().get(PROPERTY_JAR_ORDER);
-		IClasspathComputer classpath;
-		if (AbstractScriptGenerator.isBuildingOSGi())
-			classpath = new ClasspathComputer3_0(this);
-		else
-			classpath = new ClasspathComputer2_1(this);
+		IClasspathComputer classpath = new ClasspathComputer3_0(this);
 
 		if (jarOrder != null) {
 			String[] order = Utils.getArrayFromString(jarOrder);
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/SourceGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/SourceGenerator.java
index 6bd95f2..0a9d4c3 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/SourceGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/SourceGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,11 +29,8 @@
 public class SourceGenerator implements IPDEBuildConstants, IBuildPropertiesConstants {
 	private static final String COMMENT_START_TAG = "<!--"; //$NON-NLS-1$
 	private static final String COMMENT_END_TAG = "-->"; //$NON-NLS-1$
-	private static final String PLUGIN_START_TAG = "<plugin"; //$NON-NLS-1$
 	private static final String FEATURE_START_TAG = "<feature";//$NON-NLS-1$
-	private static final String FRAGMENT_START_TAG = "<fragment"; //$NON-NLS-1$
 	private static final String VERSION = "version";//$NON-NLS-1$
-	private static final String PLUGIN_VERSION = "plugin-version"; //$NON-NLS-1$
 	private static final String TEMPLATE = "data"; //$NON-NLS-1$
 
 	private String featureRootLocation;
@@ -159,10 +156,7 @@
 			}
 		} else {
 			/* one source bundle + platform fragments */
-			if (AbstractScriptGenerator.isBuildingOSGi())
-				sourcePlugin = create30SourcePlugin(sourceFeature);
-			else
-				sourcePlugin = createSourcePlugin(sourceFeature);
+			sourcePlugin = create30SourcePlugin(sourceFeature);
 
 			generateSourceFragments(sourceFeature, sourcePlugin);
 		}
@@ -229,10 +223,7 @@
 			sourceFragment.setEnvironment(configInfo.getOs(), configInfo.getWs(), configInfo.getArch(), null);
 			sourceFragment.setFragment(true);
 			//sourceFeature.addPluginEntryModel(sourceFragment);
-			if (AbstractScriptGenerator.isBuildingOSGi())
-				create30SourceFragment(sourceFragment, sourcePlugin);
-			else
-				createSourceFragment(sourceFragment, sourcePlugin);
+			create30SourceFragment(sourceFragment, sourcePlugin);
 
 			sourceFeature.addEntry(sourceFragment);
 		}
@@ -282,71 +273,6 @@
 		return result;
 	}
 
-	/**
-	 * Method createSourcePlugin.
-	 */
-	private FeatureEntry createSourcePlugin(BuildTimeFeature sourceFeature) throws CoreException {
-		//Create an object representing the plugin
-		FeatureEntry result = new FeatureEntry(sourceFeature.getId(), sourceFeature.getVersion(), true);
-		sourceFeature.addEntry(result);
-		// create the directory for the plugin
-		IPath sourcePluginDirURL = new Path(getWorkingDirectory() + '/' + DEFAULT_PLUGIN_LOCATION + '/' + getSourcePluginName(result, true));
-		File sourcePluginDir = sourcePluginDirURL.toFile();
-		sourcePluginDir.mkdirs();
-
-		// Create the plugin.xml
-		StringBuffer buffer;
-		Path templatePluginXML = new Path(TEMPLATE + "/21/plugin/" + Constants.PLUGIN_FILENAME_DESCRIPTOR); //$NON-NLS-1$
-		URL templatePluginURL = BundleHelper.getDefault().find(templatePluginXML);
-		if (templatePluginURL == null) {
-			IStatus status = new Status(IStatus.WARNING, PI_PDEBUILD, IPDEBuildConstants.EXCEPTION_READING_FILE, NLS.bind(Messages.error_readingDirectory, templatePluginXML), null);
-			BundleHelper.getDefault().getLog().log(status);
-			return null;
-		}
-		try {
-			buffer = Utils.readFile(templatePluginURL.openStream());
-		} catch (IOException e1) {
-			String message = NLS.bind(Messages.exception_readingFile, templatePluginURL.toExternalForm());
-			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_READING_FILE, message, e1));
-		}
-		int beginId = Utils.scan(buffer, 0, REPLACED_PLUGIN_ID);
-		buffer.replace(beginId, beginId + REPLACED_PLUGIN_ID.length(), result.getId());
-		//set the version number
-		beginId = Utils.scan(buffer, beginId, REPLACED_PLUGIN_VERSION);
-		buffer.replace(beginId, beginId + REPLACED_PLUGIN_VERSION.length(), result.getVersion());
-		try {
-			Utils.transferStreams(new ByteArrayInputStream(buffer.toString().getBytes()), new FileOutputStream(sourcePluginDirURL.append(Constants.PLUGIN_FILENAME_DESCRIPTOR).toOSString()));
-		} catch (IOException e1) {
-			String message = NLS.bind(Messages.exception_writingFile, templatePluginURL.toExternalForm());
-			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_READING_FILE, message, e1));
-		}
-		Collection<String> copiedFiles = Utils.copyFiles(featureRootLocation + '/' + "sourceTemplatePlugin", sourcePluginDir.getAbsolutePath()); //$NON-NLS-1$
-		if (copiedFiles.contains(Constants.PLUGIN_FILENAME_DESCRIPTOR)) {
-			replaceXMLAttribute(sourcePluginDirURL.append(Constants.PLUGIN_FILENAME_DESCRIPTOR).toOSString(), PLUGIN_START_TAG, VERSION, result.getVersion());
-		}
-		//	If a build.properties file already exist then we use it supposing it is correct.
-		File buildProperty = sourcePluginDirURL.append(PROPERTIES_FILE).toFile();
-		if (!buildProperty.exists()) {
-			copiedFiles.add(Constants.PLUGIN_FILENAME_DESCRIPTOR); //Because the plugin.xml is not copied, we need to add it to the file
-			copiedFiles.add("src/**/*.zip"); //$NON-NLS-1$
-			Properties sourceBuildProperties = new Properties();
-			sourceBuildProperties.put(PROPERTY_BIN_INCLUDES, Utils.getStringFromCollection(copiedFiles, ",")); //$NON-NLS-1$
-			sourceBuildProperties.put(SOURCE_PLUGIN_ATTRIBUTE, "true"); //$NON-NLS-1$
-			try {
-				Utils.writeProperties(sourceBuildProperties, buildProperty, null);
-			} catch (IOException e) {
-				String message = NLS.bind(Messages.exception_writingFile, buildProperty.getAbsolutePath());
-				throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_WRITING_FILE, message, e));
-			}
-		}
-		PDEState state = getSite().getRegistry();
-		BundleDescription oldBundle = state.getResolvedBundle(result.getId());
-		if (oldBundle != null)
-			state.getState().removeBundle(oldBundle);
-		state.addBundle(sourcePluginDir);
-		return result;
-	}
-
 	private void create30SourceFragment(FeatureEntry fragment, FeatureEntry plugin) throws CoreException {
 		// create the directory for the plugin
 		Path sourceFragmentDirURL = new Path(getWorkingDirectory() + '/' + DEFAULT_PLUGIN_LOCATION + '/' + getSourcePluginName(fragment, true));
@@ -423,65 +349,6 @@
 		state.addBundle(sourceFragmentDir);
 	}
 
-	private void createSourceFragment(FeatureEntry fragment, FeatureEntry plugin) throws CoreException {
-		// create the directory for the plugin
-		Path sourceFragmentDirURL = new Path(getWorkingDirectory() + '/' + DEFAULT_PLUGIN_LOCATION + '/' + getSourcePluginName(fragment, false));
-		File sourceFragmentDir = new File(sourceFragmentDirURL.toOSString());
-		sourceFragmentDir.mkdirs();
-		try {
-			// read the content of the template file
-			Path fragmentPath = new Path(TEMPLATE + "/21/fragment/" + Constants.FRAGMENT_FILENAME_DESCRIPTOR);//$NON-NLS-1$
-			URL templateLocation = BundleHelper.getDefault().find(fragmentPath);
-			if (templateLocation == null) {
-				IStatus status = new Status(IStatus.WARNING, PI_PDEBUILD, IPDEBuildConstants.EXCEPTION_READING_FILE, NLS.bind(Messages.error_readingDirectory, fragmentPath), null);
-				BundleHelper.getDefault().getLog().log(status);
-				return;
-			}
-
-			StringBuffer buffer = Utils.readFile(templateLocation.openStream());
-			//Set the Id of the fragment
-			int beginId = Utils.scan(buffer, 0, REPLACED_FRAGMENT_ID);
-			buffer.replace(beginId, beginId + REPLACED_FRAGMENT_ID.length(), fragment.getId());
-			//		set the version number
-			beginId = Utils.scan(buffer, beginId, REPLACED_FRAGMENT_VERSION);
-			buffer.replace(beginId, beginId + REPLACED_FRAGMENT_VERSION.length(), fragment.getVersion());
-			// Set the Id of the plugin for the fragment
-			beginId = Utils.scan(buffer, beginId, REPLACED_PLUGIN_ID);
-			buffer.replace(beginId, beginId + REPLACED_PLUGIN_ID.length(), plugin.getId());
-			//		set the version number of the plugin to which the fragment is attached to
-			beginId = Utils.scan(buffer, beginId, REPLACED_PLUGIN_VERSION);
-			buffer.replace(beginId, beginId + REPLACED_PLUGIN_VERSION.length(), plugin.getVersion());
-			Utils.transferStreams(new ByteArrayInputStream(buffer.toString().getBytes()), new FileOutputStream(sourceFragmentDirURL.append(Constants.FRAGMENT_FILENAME_DESCRIPTOR).toOSString()));
-			Collection<String> copiedFiles = Utils.copyFiles(featureRootLocation + '/' + "sourceTemplateFragment", sourceFragmentDir.getAbsolutePath()); //$NON-NLS-1$
-			if (copiedFiles.contains(Constants.FRAGMENT_FILENAME_DESCRIPTOR)) {
-				replaceXMLAttribute(sourceFragmentDirURL.append(Constants.FRAGMENT_FILENAME_DESCRIPTOR).toOSString(), FRAGMENT_START_TAG, VERSION, fragment.getVersion());
-				replaceXMLAttribute(sourceFragmentDirURL.append(Constants.FRAGMENT_FILENAME_DESCRIPTOR).toOSString(), FRAGMENT_START_TAG, PLUGIN_VERSION, plugin.getVersion());
-			}
-			File buildProperty = sourceFragmentDirURL.append(PROPERTIES_FILE).toFile();
-			if (!buildProperty.exists()) { //If a build.properties file already exist  then we don't override it.
-				copiedFiles.add(Constants.FRAGMENT_FILENAME_DESCRIPTOR); //Because the fragment.xml is not copied, we need to add it to the file
-				copiedFiles.add("src/**"); //$NON-NLS-1$
-				Properties sourceBuildProperties = new Properties();
-				sourceBuildProperties.put(PROPERTY_BIN_INCLUDES, Utils.getStringFromCollection(copiedFiles, ",")); //$NON-NLS-1$
-				sourceBuildProperties.put("sourcePlugin", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-				try {
-					Utils.writeProperties(sourceBuildProperties, buildProperty, null);
-				} catch (IOException e) {
-					String message = NLS.bind(Messages.exception_writingFile, buildProperty.getAbsolutePath());
-					throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_WRITING_FILE, message, e));
-				}
-			}
-		} catch (IOException e) {
-			String message = NLS.bind(Messages.exception_writingFile, sourceFragmentDir.getName());
-			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_WRITING_FILE, message, null));
-		}
-		PDEState state = getSite().getRegistry();
-		BundleDescription oldBundle = state.getResolvedBundle(fragment.getId());
-		if (oldBundle != null)
-			state.getState().removeBundle(oldBundle);
-		state.addBundle(sourceFragmentDir);
-	}
-
 	private void writeSourceFeature(BuildTimeFeature sourceFeature) throws CoreException {
 		String sourceFeatureDir = getWorkingDirectory() + '/' + DEFAULT_FEATURE_LOCATION + '/' + sourceFeatureId;
 		File sourceDir = new File(sourceFeatureDir);
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java
index d11b64c..8aa5a4f 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -84,16 +84,6 @@
 		return repositoryVersions;
 	}
 
-	/**
-	 * Create a PluginRegistryConverter, use this to avoid @deprecated warnings
-	 * @deprecated
-	 * @return PDEState
-	 */
-	@Deprecated
-	private PDEState createConverter() {
-		return new PluginRegistryConverter();
-	}
-
 	private Properties getUIPlatformProperties() {
 		Properties result = new Properties();
 		result.put(IPDEBuildConstants.PROPERTY_RESOLVE_OPTIONAL, IBuildPropertiesConstants.TRUE);
@@ -131,18 +121,14 @@
 				return state;
 			}
 
-			if (AbstractScriptGenerator.isBuildingOSGi()) {
-				if (filter) {
-					state = new FilteringState();
-					((FilteringState) state).setFilter(findAllReferencedPlugins());
-				} else {
-					state = new PDEState();
-				}
-				if (platformProperties != null)
-					state.setPlatformProperties(platformProperties);
+			if (filter) {
+				state = new FilteringState();
+				((FilteringState) state).setFilter(findAllReferencedPlugins());
 			} else {
-				state = createConverter();
+				state = new PDEState();
 			}
+			if (platformProperties != null)
+				state.setPlatformProperties(platformProperties);
 
 			Collection<File> bundles = removeDuplicates(provider.getPluginPaths());
 			state.addBundles(bundles);
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
index 5849663..11d4105 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
@@ -382,7 +382,7 @@
 		PluginConverter converter;
 		try {
 			converter = acquirePluginConverter();
-			Dictionary<String, String> manifest = converter.convertManifest(bundleLocation, false, AbstractScriptGenerator.isBuildingOSGi() ? null : "2.1", false, null); //$NON-NLS-1$
+			Dictionary<String, String> manifest = converter.convertManifest(bundleLocation, false, null, false, null);
 			if (convertedManifests != null)
 				convertedManifests.add(manifest);
 			return manifest;
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PluginRegistryConverter.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PluginRegistryConverter.java
deleted file mode 100644
index a38e0e8..0000000
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PluginRegistryConverter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.build.site;
-
-import java.io.File;
-import java.net.URL;
-import java.util.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.model.*;
-import org.eclipse.osgi.service.resolver.*;
-import org.eclipse.pde.internal.build.*;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-/** 
- * @deprecated
- */
-@Deprecated
-public class PluginRegistryConverter extends PDEState {
-	private PluginRegistryModel registry;
-
-	private URL[] removeInvalidURLs(URL[] files) {
-		URL[] validURLs = new URL[files.length];
-		int validURL = 0;
-		for (int i = 0; i < files.length; i++) {
-			if (!files[i].toExternalForm().endsWith("feature.xml") && !files[i].toExternalForm().endsWith("MANIFEST.MF")) //$NON-NLS-1$//$NON-NLS-2$
-				validURLs[validURL++] = files[i];
-		}
-		if (files.length == validURL)
-			return validURLs;
-		URL[] result = new URL[validURL];
-		System.arraycopy(validURLs, 0, result, 0, validURL);
-		return result;
-	}
-
-	private PluginRegistryModel getPluginRegistry(URL[] files) throws CoreException {
-		if (registry == null) {
-			files = removeInvalidURLs(files);
-			// create the registry according to the site where the code to compile is, and a existing installation of eclipse 
-			MultiStatus problems = new MultiStatus(IPDEBuildConstants.PI_PDEBUILD, EXCEPTION_MODEL_PARSE, Messages.exception_pluginParse, null);
-			Factory factory = new Factory(problems);
-			registry = PluginRegistryModel.parsePlugins(files, factory);
-			registry.resolve(true, false);
-			IStatus status = factory.getStatus();
-			if (!status.isOK())
-				throw new CoreException(status);
-		}
-		return registry;
-	}
-
-	public void addRegistryToState() {
-		PluginModel[] plugins = registry.getPlugins();
-		PluginFragmentModel[] fragments = registry.getFragments();
-
-		for (int i = 0; i < plugins.length; i++) {
-			BundleDescription bd = state.getFactory().createBundleDescription(getNextId(), plugins[i].getPluginId(), Version.parseVersion(plugins[i].getVersion()), plugins[i].getLocation(), createBundleSpecification(plugins[i].getRequires()), (HostSpecification) null, null, null, null, true);
-			String libs = createClasspath(plugins[i].getRuntime());
-			Map<String, String> manifest = new HashMap<String, String>();
-			if (libs != null)
-				manifest.put(Constants.BUNDLE_CLASSPATH, libs);
-			loadPropertyFileIn(manifest, new File(fragments[i].getLocation()));
-			bd.setUserObject(manifest);
-			addBundleDescription(bd);
-		}
-
-		for (int i = 0; i < fragments.length; i++) {
-			HostSpecification host = state.getFactory().createHostSpecification(fragments[i].getPluginId(), new VersionRange(fragments[i].getPluginVersion()));
-			BundleDescription bd = state.getFactory().createBundleDescription(getNextId(), fragments[i].getId(), Version.parseVersion(fragments[i].getVersion()), fragments[i].getLocation(), createBundleSpecification(fragments[i].getRequires()), host, null, null, null, true);
-			String libs = createClasspath(fragments[i].getRuntime());
-			Map<String, String> manifest = new HashMap<String, String>();
-			if (libs != null)
-				manifest.put(Constants.BUNDLE_CLASSPATH, libs);
-			loadPropertyFileIn(manifest, new File(fragments[i].getLocation()));
-			bd.setUserObject(manifest);
-			addBundleDescription(bd);
-		}
-	}
-
-	protected BundleSpecification[] createBundleSpecification(PluginPrerequisiteModel[] prereqs) {
-		if (prereqs == null)
-			return new BundleSpecification[0];
-		BundleSpecification[] specs = new BundleSpecification[prereqs.length];
-		for (int i = 0; i < prereqs.length; i++) {
-			specs[i] = state.getFactory().createBundleSpecification(prereqs[i].getPlugin(), new VersionRange(prereqs[i].getVersion()), prereqs[i].getExport(), prereqs[i].getOptional());
-		}
-		return specs;
-	}
-
-	private String createClasspath(LibraryModel[] libs) {
-		if (libs == null || libs.length == 0)
-			return null;
-
-		String result = ""; //$NON-NLS-1$
-		for (int i = 0; i < libs.length; i++) {
-			result += libs[i].getName() + (i == libs.length - 1 ? "" : ","); //$NON-NLS-1$//$NON-NLS-2$
-		}
-		return result;
-	}
-
-	@Override
-	public void addBundles(Collection<File> bundles) {
-		try {
-			getPluginRegistry(Utils.asURL(bundles));
-		} catch (CoreException e) {
-			IStatus status = new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, EXCEPTION_STATE_PROBLEM, Messages.exception_registryResolution, e);
-			BundleHelper.getDefault().getLog().log(status);
-		}
-		for (Iterator<File> iter = bundles.iterator(); iter.hasNext();) {
-			File bundle = iter.next();
-			addBundle(bundle);
-		}
-	}
-}
diff --git a/org.eclipse.pde.build/src_ant/org/eclipse/pde/internal/build/tasks/BuildScriptGeneratorTask.java b/org.eclipse.pde.build/src_ant/org/eclipse/pde/internal/build/tasks/BuildScriptGeneratorTask.java
index 5a1f3db..71be4f0 100644
--- a/org.eclipse.pde.build/src_ant/org/eclipse/pde/internal/build/tasks/BuildScriptGeneratorTask.java
+++ b/org.eclipse.pde.build/src_ant/org/eclipse/pde/internal/build/tasks/BuildScriptGeneratorTask.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -199,14 +199,15 @@
 	}
 
 	/**
-	 * Set the boolean value indicating whether or not the plug-ins and features for which scripts are being generated target eclipse 3.0 or greater. 
-	 * The default is set to true. 
-	 * This property is experimental and is likely to be renamed in the future.
-	 * @param osgi <code>true</code> if the scripts are generated for eclipse 3.0 or greated and <code>false</code> otherwise
+	 * Support for building Eclipse 2.x plug-ins has been removed. It is assumed that Eclipse 3.x-style OSGi bundles are always desired.
+	 * This setting will be removed in a future release.
+	 * @deprecated
+	 * @param osgi this parameter is ignored
 	 * @since 3.0.
 	 */
+	@Deprecated
 	public void setBuildingOSGi(boolean osgi) {
-		generator.setBuildingOSGi(osgi);
+		// this parameter is ignored
 	}
 
 	/**