View | Details | Raw Unified | Return to bug 101241 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizard.java (+1 lines)
Lines 46-51 Link Here
46
		info.useJarFormat = fPage.useJARFormat();
46
		info.useJarFormat = fPage.useJARFormat();
47
		info.exportSource = fPage.doExportSource();
47
		info.exportSource = fPage.doExportSource();
48
		info.allowBinaryCycles = fPage.allowBinaryCycles();
48
		info.allowBinaryCycles = fPage.allowBinaryCycles();
49
		info.useWorkspaceCompiledClasses = fPage.useWorkspaceCompiledClasses();
49
		info.destinationDirectory = fPage.getDestination();
50
		info.destinationDirectory = fPage.getDestination();
50
		info.zipFileName = fPage.getFileName();
51
		info.zipFileName = fPage.getFileName();
51
		info.items = fPage.getSelectedItems();
52
		info.items = fPage.getSelectedItems();
(-)src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizardPage.java (+4 lines)
Lines 287-292 Link Here
287
		return fOptionsTab.doBinaryCycles();
287
		return fOptionsTab.doBinaryCycles();
288
	}
288
	}
289
289
290
	protected boolean useWorkspaceCompiledClasses() {
291
		return fOptionsTab.useWorkspaceCompiledClasses();
292
	}
293
290
	protected boolean doGenerateAntFile() {
294
	protected boolean doGenerateAntFile() {
291
		return fOptionsTab.doGenerateAntFile();
295
		return fOptionsTab.doGenerateAntFile();
292
	}
296
	}
(-)src/org/eclipse/pde/internal/ui/wizards/exports/ExportOptionsTab.java (-2 / +21 lines)
Lines 31-36 Link Here
31
	private static final String S_QUALIFIER = "qualifier"; //$NON-NLS-1$
31
	private static final String S_QUALIFIER = "qualifier"; //$NON-NLS-1$
32
	private static final String S_QUALIFIER_NAME = "qualifierName"; //$NON-NLS-1$
32
	private static final String S_QUALIFIER_NAME = "qualifierName"; //$NON-NLS-1$
33
	private static final String S_ALLOW_BINARY_CYCLES = "allowBinaryCycles"; //$NON-NLS-1$
33
	private static final String S_ALLOW_BINARY_CYCLES = "allowBinaryCycles"; //$NON-NLS-1$
34
	private static final String S_USE_WORKSPACE_COMPILED_CLASSES = "useWorkspaceCompiledClasses"; //$NON-NLS-1$
34
35
35
	private Button fIncludeSource;
36
	private Button fIncludeSource;
36
	protected Button fJarButton;
37
	protected Button fJarButton;
Lines 40-45 Link Here
40
	private Button fQualifierButton;
41
	private Button fQualifierButton;
41
	private Text fQualifierText;
42
	private Text fQualifierText;
42
	private Button fAllowBinaryCycles;
43
	private Button fAllowBinaryCycles;
44
	private Button fUseWSCompiledClasses;
43
45
44
	public ExportOptionsTab(BaseExportWizardPage page) {
46
	public ExportOptionsTab(BaseExportWizardPage page) {
45
		super(page);
47
		super(page);
Lines 56-61 Link Here
56
		addQualifierOption(container);
58
		addQualifierOption(container);
57
		addAntSection(container);
59
		addAntSection(container);
58
		addAllowBinaryCyclesSection(container);
60
		addAllowBinaryCyclesSection(container);
61
		addUseWorkspaceCompiledClassesSection(container);
59
62
60
		return container;
63
		return container;
61
	}
64
	}
Lines 79-84 Link Here
79
		fAllowBinaryCycles.setText(PDEUIMessages.ExportOptionsTab_allowBinaryCycles);
82
		fAllowBinaryCycles.setText(PDEUIMessages.ExportOptionsTab_allowBinaryCycles);
80
	}
83
	}
81
84
85
	protected void addUseWorkspaceCompiledClassesSection(Composite comp) {
86
		fUseWSCompiledClasses = new Button(comp, SWT.CHECK);
87
		fUseWSCompiledClasses.setText("Use class files compiled in the workspace");
88
	}
89
82
	protected String getJarButtonText() {
90
	protected String getJarButtonText() {
83
		return PDEUIMessages.BaseExportWizardPage_packageJARs;
91
		return PDEUIMessages.BaseExportWizardPage_packageJARs;
84
	}
92
	}
Lines 143-148 Link Here
143
		fQualifierText.setText(getInitialQualifierText(settings));
151
		fQualifierText.setText(getInitialQualifierText(settings));
144
		fQualifierText.setEnabled(fQualifierButton.getSelection());
152
		fQualifierText.setEnabled(fQualifierButton.getSelection());
145
		fAllowBinaryCycles.setSelection(getInitialAllowBinaryCyclesSelection(settings));
153
		fAllowBinaryCycles.setSelection(getInitialAllowBinaryCyclesSelection(settings));
154
		fUseWSCompiledClasses.setSelection(getInitialUseWorkspaceCompiledClassesSelection(settings));
146
		hookListeners();
155
		hookListeners();
147
	}
156
	}
148
157
Lines 153-158 Link Here
153
		settings.put(S_QUALIFIER, fQualifierButton.getSelection());
162
		settings.put(S_QUALIFIER, fQualifierButton.getSelection());
154
		settings.put(S_QUALIFIER_NAME, fQualifierText.getText());
163
		settings.put(S_QUALIFIER_NAME, fQualifierText.getText());
155
		settings.put(S_ALLOW_BINARY_CYCLES, fAllowBinaryCycles.getSelection());
164
		settings.put(S_ALLOW_BINARY_CYCLES, fAllowBinaryCycles.getSelection());
165
		settings.put(S_USE_WORKSPACE_COMPILED_CLASSES, fUseWSCompiledClasses.getSelection());
156
		saveCombo(settings, S_ANT_FILENAME, fAntCombo);
166
		saveCombo(settings, S_ANT_FILENAME, fAntCombo);
157
	}
167
	}
158
168
Lines 165-176 Link Here
165
175
166
	protected boolean getInitialJarButtonSelection(IDialogSettings settings) {
176
	protected boolean getInitialJarButtonSelection(IDialogSettings settings) {
167
		String selected = settings.get(S_JAR_FORMAT);
177
		String selected = settings.get(S_JAR_FORMAT);
168
		return selected == null ? TargetPlatformHelper.getTargetVersion() >= 3.1 : "true".equals(selected); //$NON-NLS-1$
178
		return selected == null ? TargetPlatformHelper.getTargetVersion() >= 3.1 : Boolean.valueOf(selected).booleanValue();
169
	}
179
	}
170
180
171
	protected boolean getInitialAllowBinaryCyclesSelection(IDialogSettings settings) {
181
	protected boolean getInitialAllowBinaryCyclesSelection(IDialogSettings settings) {
172
		String selected = settings.get(S_ALLOW_BINARY_CYCLES);
182
		String selected = settings.get(S_ALLOW_BINARY_CYCLES);
173
		return selected == null ? true : "true".equals(selected); //$NON-NLS-1$
183
		return selected == null ? true : Boolean.valueOf(selected).booleanValue();
184
	}
185
186
	protected boolean getInitialUseWorkspaceCompiledClassesSelection(IDialogSettings settings) {
187
		String selected = settings.get(S_USE_WORKSPACE_COMPILED_CLASSES);
188
		return selected == null ? false : Boolean.valueOf(selected).booleanValue();
174
	}
189
	}
175
190
176
	protected void hookListeners() {
191
	protected void hookListeners() {
Lines 233-238 Link Here
233
		return fAllowBinaryCycles.getSelection();
248
		return fAllowBinaryCycles.getSelection();
234
	}
249
	}
235
250
251
	protected boolean useWorkspaceCompiledClasses() {
252
		return fUseWSCompiledClasses.getSelection();
253
	}
254
236
	protected boolean useJARFormat() {
255
	protected boolean useJARFormat() {
237
		return fJarButton.getSelection();
256
		return fJarButton.getSelection();
238
	}
257
	}
(-)src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java (+1 lines)
Lines 63-68 Link Here
63
		info.useJarFormat = fPage.useJARFormat();
63
		info.useJarFormat = fPage.useJARFormat();
64
		info.exportSource = fPage.doExportSource();
64
		info.exportSource = fPage.doExportSource();
65
		info.allowBinaryCycles = fPage.allowBinaryCycles();
65
		info.allowBinaryCycles = fPage.allowBinaryCycles();
66
		info.useWorkspaceCompiledClasses = fPage.useWorkspaceCompiledClasses();
66
		info.destinationDirectory = fPage.getDestination();
67
		info.destinationDirectory = fPage.getDestination();
67
		info.zipFileName = fPage.getFileName();
68
		info.zipFileName = fPage.getFileName();
68
		if (fPage2 != null && ((FeatureExportWizardPage) fPage).doMultiPlatform())
69
		if (fPage2 != null && ((FeatureExportWizardPage) fPage).doMultiPlatform())
(-)src/org/eclipse/pde/ui/tests/ee/ExportBundleTests.java (+2 lines)
Lines 80-85 Link Here
80
			info.useJarFormat = true;
80
			info.useJarFormat = true;
81
			info.exportSource = false;
81
			info.exportSource = false;
82
			info.allowBinaryCycles = false;
82
			info.allowBinaryCycles = false;
83
			info.useWorkspaceCompiledClasses = false;
83
			info.destinationDirectory = EXPORT_PATH.toOSString();
84
			info.destinationDirectory = EXPORT_PATH.toOSString();
84
			info.zipFileName = null;
85
			info.zipFileName = null;
85
			info.items = new Object[]{PluginRegistry.findModel(project.getProject())};
86
			info.items = new Object[]{PluginRegistry.findModel(project.getProject())};
Lines 121-126 Link Here
121
			info.useJarFormat = true;
122
			info.useJarFormat = true;
122
			info.exportSource = false;
123
			info.exportSource = false;
123
			info.allowBinaryCycles = false;
124
			info.allowBinaryCycles = false;
125
			info.useWorkspaceCompiledClasses = false;
124
			info.destinationDirectory = EXPORT_PATH.toOSString();
126
			info.destinationDirectory = EXPORT_PATH.toOSString();
125
			info.zipFileName = null;
127
			info.zipFileName = null;
126
			info.items = new Object[]{PluginRegistry.findModel(project.getProject())};
128
			info.items = new Object[]{PluginRegistry.findModel(project.getProject())};
(-)src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java (-5 / +233 lines)
Lines 17-26 Link Here
17
import java.util.*;
17
import java.util.*;
18
import javax.xml.parsers.*;
18
import javax.xml.parsers.*;
19
import org.eclipse.ant.core.*;
19
import org.eclipse.ant.core.*;
20
import org.eclipse.core.resources.IFile;
20
import org.eclipse.core.resources.*;
21
import org.eclipse.core.runtime.*;
21
import org.eclipse.core.runtime.*;
22
import org.eclipse.core.runtime.jobs.Job;
22
import org.eclipse.core.runtime.jobs.Job;
23
import org.eclipse.jdt.core.JavaCore;
23
import org.eclipse.jdt.core.*;
24
import org.eclipse.jdt.launching.JavaRuntime;
24
import org.eclipse.jdt.launching.JavaRuntime;
25
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
25
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
26
import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
26
import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
Lines 33-38 Link Here
33
import org.eclipse.pde.internal.build.site.QualifierReplacer;
33
import org.eclipse.pde.internal.build.site.QualifierReplacer;
34
import org.eclipse.pde.internal.core.*;
34
import org.eclipse.pde.internal.core.*;
35
import org.eclipse.pde.internal.core.build.WorkspaceBuildModel;
35
import org.eclipse.pde.internal.core.build.WorkspaceBuildModel;
36
import org.eclipse.pde.internal.core.builders.PDEMarkerFactory;
36
import org.eclipse.pde.internal.core.feature.FeatureChild;
37
import org.eclipse.pde.internal.core.feature.FeatureChild;
37
import org.eclipse.pde.internal.core.ifeature.*;
38
import org.eclipse.pde.internal.core.ifeature.*;
38
import org.eclipse.pde.internal.core.util.CoreUtility;
39
import org.eclipse.pde.internal.core.util.CoreUtility;
Lines 47-52 Link Here
47
	private String fDevProperties;
48
	private String fDevProperties;
48
	private static boolean fHasErrors;
49
	private static boolean fHasErrors;
49
	protected HashMap fAntBuildProperties;
50
	protected HashMap fAntBuildProperties;
51
	protected IProject[] fWorkspaceProjects;
50
52
51
	protected State fStateCopy;
53
	protected State fStateCopy;
52
54
Lines 76-82 Link Here
76
			if (configurations == null)
78
			if (configurations == null)
77
				configurations = new String[][] {null};
79
				configurations = new String[][] {null};
78
80
79
			monitor.beginTask("", configurations.length * fInfo.items.length * 11); //$NON-NLS-1$
81
			monitor.beginTask("", (configurations.length * fInfo.items.length * 11) + 1); //$NON-NLS-1$
82
			testBuildWorkspaceBeforeExport(new SubProgressMonitor(monitor, 1));
83
			// TODO Proper progress for the build!
80
			for (int i = 0; i < configurations.length; i++) {
84
			for (int i = 0; i < configurations.length; i++) {
81
				for (int j = 0; j < fInfo.items.length; j++) {
85
				for (int j = 0; j < fInfo.items.length; j++) {
82
					if (monitor.isCanceled())
86
					if (monitor.isCanceled())
Lines 95-100 Link Here
95
			}
99
			}
96
		} catch (InvocationTargetException e) {
100
		} catch (InvocationTargetException e) {
97
			return new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.FeatureBasedExportOperation_ProblemDuringExport, e.getCause() != null ? e.getCause() : e);
101
			return new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.FeatureBasedExportOperation_ProblemDuringExport, e.getCause() != null ? e.getCause() : e);
102
		} catch (CoreException e) {
103
			return new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.FeatureBasedExportOperation_ProblemDuringExport, e.getCause() != null ? e.getCause() : e);
98
		} finally {
104
		} finally {
99
			monitor.done();
105
			monitor.done();
100
		}
106
		}
Lines 205-212 Link Here
205
211
206
	protected void doExport(String featureID, String version, String featureLocation, String os, String ws, String arch, IProgressMonitor monitor) throws CoreException, InvocationTargetException {
212
	protected void doExport(String featureID, String version, String featureLocation, String os, String ws, String arch, IProgressMonitor monitor) throws CoreException, InvocationTargetException {
207
		fHasErrors = false;
213
		fHasErrors = false;
208
		monitor.beginTask("", 9); //$NON-NLS-1$
214
		monitor.beginTask("", 10); //$NON-NLS-1$
209
		monitor.setTaskName(PDECoreMessages.FeatureExportJob_taskName);
215
		monitor.setTaskName(PDECoreMessages.FeatureExportJob_taskName);
216
210
		try {
217
		try {
211
			HashMap properties = createAntBuildProperties(os, ws, arch);
218
			HashMap properties = createAntBuildProperties(os, ws, arch);
212
			BuildScriptGenerator generator = new BuildScriptGenerator();
219
			BuildScriptGenerator generator = new BuildScriptGenerator();
Lines 505-511 Link Here
505
		generator.setArchivesFormat(format);
512
		generator.setArchivesFormat(format);
506
		generator.setPDEState(getState(os, ws, arch));
513
		generator.setPDEState(getState(os, ws, arch));
507
		generator.setNextId(TargetPlatformHelper.getPDEState().getNextId());
514
		generator.setNextId(TargetPlatformHelper.getPDEState().getNextId());
508
		generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState()));
515
516
		if (fInfo.useWorkspaceCompiledClasses) {
517
			generator.setUseWorkspaceBinaries(true);
518
			generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState()), getWorkspacePluginOutputFolders());
519
		} else {
520
			generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState()));
521
		}
522
509
		AbstractScriptGenerator.setForceUpdateJar(false);
523
		AbstractScriptGenerator.setForceUpdateJar(false);
510
		AbstractScriptGenerator.setEmbeddedSource(fInfo.exportSource);
524
		AbstractScriptGenerator.setEmbeddedSource(fInfo.exportSource);
511
525
Lines 732-735 Link Here
732
		}
746
		}
733
		return false;
747
		return false;
734
	}
748
	}
749
750
	protected void testBuildWorkspaceBeforeExport(IProgressMonitor monitor) throws CoreException {
751
		try {
752
			monitor.beginTask("Compiling classes in workspace before export", 1);
753
			if (fInfo.useWorkspaceCompiledClasses) {
754
				IProject[] projects = getExportedWorkspaceProjects();
755
				for (int i = 0; i < projects.length; i++) {
756
					projects[i].build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
757
				}
758
759
				List errors = new ArrayList();
760
				for (int i = 0; i < projects.length; i++) {
761
					IMarker[] markers = projects[i].findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
762
					if (markers.length > 0) {
763
						for (int j = 0; j < markers.length; j++) {
764
							Integer severity = (Integer) (markers[j].getAttribute(IMarker.SEVERITY));
765
							if (severity != null && severity.intValue() >= IMarker.SEVERITY_ERROR) {
766
								if (markers[j].getType().equals(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER) || markers[j].getType().equals(PDEMarkerFactory.MARKER_ID)) {
767
									errors.add(projects[i]);
768
								}
769
							}
770
						}
771
					}
772
				}
773
774
				if (!errors.isEmpty()) {
775
					// TODO Inform user of errors?
776
					PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, "Build problems present in projects being exported."));
777
				}
778
			}
779
		} finally {
780
			monitor.done();
781
		}
782
	}
783
784
	/**
785
	 * Returns an array of projects in their suggested build order
786
	 * containing all of the projects specified by <code>baseProjects</code>
787
	 * and all of their referenced projects.
788
	 *  
789
	 * @param baseProjects a collection of projects
790
	 * @return an array of projects in their suggested build order
791
	 * containing all of the projects specified by <code>baseProjects</code>
792
	 * @throws CoreException if an error occurs while computing referenced
793
	 *  projects
794
	 */
795
	protected IProject[] computeReferencedBuildOrder(IProject[] baseProjects) throws CoreException {
796
		HashSet unorderedProjects = new HashSet();
797
		for (int i = 0; i < baseProjects.length; i++) {
798
			unorderedProjects.add(baseProjects[i]);
799
			addReferencedProjects(baseProjects[i], unorderedProjects);
800
		}
801
		IProject[] projectSet = (IProject[]) unorderedProjects.toArray(new IProject[unorderedProjects.size()]);
802
		return computeBuildOrder(projectSet);
803
	}
804
805
	/**
806
	 * Adds all projects referenced by <code>project</code> to the given
807
	 * set.
808
	 * 
809
	 * @param project project
810
	 * @param references set to which referenced projects are added
811
	 * @throws CoreException if an error occurs while computing referenced
812
	 *  projects
813
	 */
814
	protected void addReferencedProjects(IProject project, Set references) throws CoreException {
815
		if (project.isOpen()) {
816
			IProject[] projects = project.getReferencedProjects();
817
			for (int i = 0; i < projects.length; i++) {
818
				IProject refProject = projects[i];
819
				if (refProject.exists() && !references.contains(refProject)) {
820
					references.add(refProject);
821
					addReferencedProjects(refProject, references);
822
				}
823
			}
824
		}
825
	}
826
827
	/**  
828
	 * Returns a list of projects in their suggested build order from the
829
	 * given unordered list of projects.
830
	 * 
831
	 * @param projects the list of projects to sort into build order
832
	 * @return a new array containing all projects from <code>projects</code> sorted
833
	 *   according to their build order.
834
	 */
835
	private IProject[] computeBuildOrder(IProject[] projects) {
836
		String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder();
837
		if (orderedNames != null) {
838
			List orderedProjects = new ArrayList(projects.length);
839
			//Projects may not be in the build order but should be built if selected
840
			List unorderedProjects = new ArrayList(projects.length);
841
			for (int i = 0; i < projects.length; ++i) {
842
				unorderedProjects.add(projects[i]);
843
			}
844
845
			for (int i = 0; i < orderedNames.length; i++) {
846
				String projectName = orderedNames[i];
847
				for (Iterator iterator = unorderedProjects.iterator(); iterator.hasNext();) {
848
					IProject project = (IProject) iterator.next();
849
					if (project.getName().equals(projectName)) {
850
						orderedProjects.add(project);
851
						iterator.remove();
852
						break;
853
					}
854
				}
855
			}
856
			//Add anything not specified before we return
857
			orderedProjects.addAll(unorderedProjects);
858
			return (IProject[]) orderedProjects.toArray(new IProject[orderedProjects.size()]);
859
		}
860
861
		// Computing build order returned null, try the project prerequisite order
862
		IWorkspace.ProjectOrder po = ResourcesPlugin.getWorkspace().computeProjectOrder(projects);
863
		return po.projects;
864
	}
865
866
	/**
867
	 * Returns a map containing information associating libraries to the output locations the
868
	 * workspace compiles them to.  Uses information in the build.properties and the classpath.
869
	 * The map will be of the following form: 
870
	 * String symbolic name > lib output map
871
	 * The lib output map will be of the following form:
872
	 * String lib name > Set of IPath output folders
873
	 *
874
	 * @return a map of library output folders for each plugin in the workspace
875
	 */
876
	protected Map getWorkspacePluginOutputFolders() throws CoreException {
877
		IProject[] projects = getExportedWorkspaceProjects();
878
		Map result = new HashMap(projects.length);
879
		for (int i = 0; i < projects.length; i++) {
880
			IFile buildFile = projects[i].getFile("build.properties"); //$NON-NLS-1$
881
			if (buildFile.exists()) {
882
				IBuildModel buildModel = new WorkspaceBuildModel(buildFile);
883
				buildModel.load();
884
				IJavaProject javaProject = JavaCore.create(projects[i]);
885
				if (javaProject.exists()) {
886
					Map modelOutput = getPluginOutputFolders(buildModel, javaProject);
887
					if (!modelOutput.isEmpty()) {
888
						IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(projects[i]);
889
						if (model != null) {
890
							result.put(model.getBundleDescription().getSymbolicName(), modelOutput);
891
						}
892
					}
893
				}
894
			}
895
		}
896
		return result;
897
	}
898
899
	private Map getPluginOutputFolders(IBuildModel buildModel, IJavaProject javaProject) throws JavaModelException {
900
		Map outputEntries = new HashMap();
901
902
		IBuildEntry[] buildEntries = buildModel.getBuild().getBuildEntries();
903
		for (int i = 0; i < buildEntries.length; i++) {
904
			String name = buildEntries[i].getName();
905
			if (name.startsWith(IBuildPropertiesConstants.PROPERTY_SOURCE_PREFIX)) {
906
				Set outputPaths = new HashSet();
907
908
				String[] sourceFolders = buildEntries[i].getTokens();
909
				for (int j = 0; j < sourceFolders.length; j++) {
910
911
					IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
912
					for (int k = 0; k < classpathEntries.length; k++) {
913
						if (classpathEntries[k].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
914
							IPath sourcePath = classpathEntries[k].getPath().removeFirstSegments(1); // Entries include project as first segment
915
							if (sourcePath.equals(new Path(sourceFolders[j]))) {
916
								IPath outputPath = classpathEntries[k].getOutputLocation();
917
								if (outputPath == null) {
918
									outputPath = javaProject.getOutputLocation();
919
								}
920
								outputPaths.add(outputPath.removeFirstSegments(1)); // Entries include project as first segment
921
							}
922
						}
923
					}
924
				}
925
				if (!outputPaths.isEmpty()) {
926
					outputEntries.put(name.substring(IBuildPropertiesConstants.PROPERTY_SOURCE_PREFIX.length()), outputPaths);
927
				}
928
			}
929
		}
930
		return outputEntries;
931
	}
932
933
	protected IProject[] getExportedWorkspaceProjects() throws CoreException {
934
		if (fWorkspaceProjects == null) {
935
			// TODO This won't work for nested features either
936
			Set projects = new HashSet();
937
			for (int i = 0; i < fInfo.items.length; i++) {
938
				if (fInfo.items[i] instanceof IPluginModelBase) {
939
					IPath installLocation = new Path(((IPluginModelBase) fInfo.items[i]).getInstallLocation());
940
					IProject project = PDECore.getWorkspace().getRoot().getProject(installLocation.lastSegment());
941
					if (project.exists()) {
942
						projects.add(project);
943
					}
944
				} else if (fInfo.items[i] instanceof IFeatureModel) {
945
					IFeatureModel feature = (IFeatureModel) fInfo.items[i];
946
					IFeaturePlugin[] plugins = feature.getFeature().getPlugins();
947
					for (int j = 0; j < plugins.length; j++) {
948
						IPluginModelBase plugin = PDECore.getDefault().getModelManager().findModel(plugins[i].getId());
949
						IPath installLocation = new Path(plugin.getInstallLocation());
950
						IProject project = PDECore.getWorkspace().getRoot().getProject(installLocation.lastSegment());
951
						if (project.exists()) {
952
							projects.add(project);
953
						}
954
					}
955
956
				}
957
			}
958
			fWorkspaceProjects = computeReferencedBuildOrder((IProject[]) projects.toArray(new IProject[projects.size()]));
959
		}
960
		return fWorkspaceProjects;
961
	}
962
735
}
963
}
(-)src/org/eclipse/pde/internal/core/exports/FeatureBasedExportOperation.java (-1 / +2 lines)
Lines 33-39 Link Here
33
	protected IStatus run(IProgressMonitor monitor) {
33
	protected IStatus run(IProgressMonitor monitor) {
34
		try {
34
		try {
35
			createDestination();
35
			createDestination();
36
			monitor.beginTask("", 10); //$NON-NLS-1$
36
			monitor.beginTask("", 11); //$NON-NLS-1$
37
			// create a feature to contain all plug-ins
37
			// create a feature to contain all plug-ins
38
			String featureID = "org.eclipse.pde.container.feature"; //$NON-NLS-1$
38
			String featureID = "org.eclipse.pde.container.feature"; //$NON-NLS-1$
39
			fFeatureLocation = fBuildTempLocation + File.separator + featureID;
39
			fFeatureLocation = fBuildTempLocation + File.separator + featureID;
Lines 42-47 Link Here
42
			createBuildPropertiesFile(fFeatureLocation);
42
			createBuildPropertiesFile(fFeatureLocation);
43
			if (fInfo.useJarFormat)
43
			if (fInfo.useJarFormat)
44
				createPostProcessingFiles();
44
				createPostProcessingFiles();
45
			testBuildWorkspaceBeforeExport(new SubProgressMonitor(monitor, 1));
45
			doExport(featureID, null, fFeatureLocation, TargetPlatform.getOS(), TargetPlatform.getWS(), TargetPlatform.getOSArch(), new SubProgressMonitor(monitor, 7));
46
			doExport(featureID, null, fFeatureLocation, TargetPlatform.getOS(), TargetPlatform.getWS(), TargetPlatform.getOSArch(), new SubProgressMonitor(monitor, 7));
46
			if (monitor.isCanceled()) {
47
			if (monitor.isCanceled()) {
47
				return Status.CANCEL_STATUS;
48
				return Status.CANCEL_STATUS;
(-)src/org/eclipse/pde/internal/core/exports/FeatureExportInfo.java (+1 lines)
Lines 17-22 Link Here
17
	public boolean exportSource;
17
	public boolean exportSource;
18
	public boolean exportMetadata;
18
	public boolean exportMetadata;
19
	public boolean allowBinaryCycles;
19
	public boolean allowBinaryCycles;
20
	public boolean useWorkspaceCompiledClasses;
20
	public String destinationDirectory;
21
	public String destinationDirectory;
21
	public String zipFileName;
22
	public String zipFileName;
22
	public String qualifier;
23
	public String qualifier;

Return to bug 101241