Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 92420 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/build/ProductExportJob.java (-47 / +60 lines)
Lines 38-44 Link Here
38
38
39
	private String fRoot;
39
	private String fRoot;
40
40
41
	public ProductExportJob(IProductModel model, String productRoot, boolean toDirectory, boolean exportSource, String destination, String zipFileName) {
41
	public ProductExportJob(IProductModel model, String productRoot, boolean toDirectory, boolean exportSource, String destination, String zipFileName, String[][] targets) {
42
		super(PDEUIMessages.ProductExportJob_jobName); //$NON-NLS-1$
42
		super(PDEUIMessages.ProductExportJob_jobName); //$NON-NLS-1$
43
		fProduct = model.getProduct();
43
		fProduct = model.getProduct();
44
		fExportToDirectory = toDirectory;
44
		fExportToDirectory = toDirectory;
Lines 46-51 Link Here
46
		fDestinationDirectory = destination;
46
		fDestinationDirectory = destination;
47
		fZipFilename = zipFileName;
47
		fZipFilename = zipFileName;
48
		fRoot = productRoot;
48
		fRoot = productRoot;
49
		ftargets = targets;
50
		// TODO remove when there is UI to set ftargets
51
		if (ftargets == null)
52
			ftargets = new String[][] { { "linux", "gtk", "x86", ""} , {"win32", "win32", "x86", ""} };
49
		if (fProduct.useFeatures()) {
53
		if (fProduct.useFeatures()) {
50
			fItems = getFeatureModels();
54
			fItems = getFeatureModels();
51
		} else {
55
		} else {
Lines 83-112 Link Here
83
87
84
	protected void doExports(IProgressMonitor monitor)
88
	protected void doExports(IProgressMonitor monitor)
85
			throws InvocationTargetException, CoreException {
89
			throws InvocationTargetException, CoreException {
86
		try {
90
		String[][] configurations = ftargets;
87
            monitor.beginTask("", 10);
91
		if (configurations == null)
88
			// create a feature to wrap all plug-ins and features
92
			configurations = new String[][] { {TargetPlatform.getOS(), TargetPlatform.getWS(), TargetPlatform.getOSArch(), TargetPlatform.getNL() } };
89
			String featureID = "org.eclipse.pde.container.feature"; //$NON-NLS-1$
93
		for (int i = 0; i < configurations.length; i++) {
90
			fFeatureLocation = fBuildTempLocation + File.separator + featureID;
94
			try {
91
			createFeature(featureID, fFeatureLocation);
95
				String[] config = configurations[i];
92
			createBuildPropertiesFile(fFeatureLocation);
96
	            monitor.beginTask("", 10);
93
			createConfigIniFile();
97
				// create a feature to wrap all plug-ins and features
94
			createEclipseProductFile();
98
				String featureID = "org.eclipse.pde.container.feature"; //$NON-NLS-1$
95
			createLauncherIniFile();
99
				fFeatureLocation = fBuildTempLocation + File.separator + featureID;
96
			doExport(featureID, 
100
				createFeature(featureID, fFeatureLocation, config);
97
                        null, 
101
				createBuildPropertiesFile(fFeatureLocation);
98
                        fFeatureLocation, 
102
				createConfigIniFile();
99
                        TargetPlatform.getOS(),
103
				createEclipseProductFile();
100
                        TargetPlatform.getWS(), 
104
				createLauncherIniFile();
101
                        TargetPlatform.getOSArch(), 
105
				doExport(featureID, 
102
                        new SubProgressMonitor(monitor, 7));
106
	                        null, 
103
		} catch (IOException e) {
107
	                        fFeatureLocation, 
104
		} finally {
108
	                        config[0], 
105
			for (int i = 0; i < fItems.length; i++) {
109
	                        config[1], 
106
				deleteBuildFiles((IModel)fItems[i]);
110
	                        config[2], 
111
	                        new SubProgressMonitor(monitor, 7));
112
			} catch (IOException e) {
113
			} finally {
114
				for (int j = 0; j < fItems.length; j++) {
115
					deleteBuildFiles((IModel)fItems[j]);
116
				}
117
				cleanup(ftargets == null ? null : configurations[i], new SubProgressMonitor(monitor, 3));
118
				monitor.done();
107
			}
119
			}
108
			cleanup(new SubProgressMonitor(monitor, 3));
109
			monitor.done();
110
		}
120
		}
111
	}
121
	}
112
	
122
	
Lines 140-178 Link Here
140
		File file = new File(featureLocation);
150
		File file = new File(featureLocation);
141
		if (!file.exists() || !file.isDirectory())
151
		if (!file.exists() || !file.isDirectory())
142
			file.mkdirs();
152
			file.mkdirs();
153
		boolean hasLaunchers = false;
154
		IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager().getModels();
155
		for (int i = 0; i < models.length; i++) {
156
			if ("org.eclipse.platform.launchers".equals(models[i].getFeature().getId()))
157
				hasLaunchers = true;
158
		}
143
159
144
		Properties properties = new Properties();
160
		Properties properties = new Properties();
145
		properties.put(IBuildPropertiesConstants.ROOT, getRootFileLocations()); //To copy a folder
161
		properties.put(IBuildPropertiesConstants.ROOT, getRootFileLocations(hasLaunchers)); //To copy a folder
146
		properties.put("root.permissions.755", getLauncherName()); //$NON-NLS-1$
162
		if (!hasLaunchers) {
147
		if (TargetPlatform.getOS().equals("linux")) { //$NON-NLS-1$
163
			properties.put("root.permissions.755", getLauncherName()); //$NON-NLS-1$
148
			properties.put("root.linux.motif.x86.link", "libXm.so.2.1,libXm.so.2,libXm.so.2.1,libXm.so"); //$NON-NLS-1$ //$NON-NLS-2$
164
			if (TargetPlatform.getOS().equals("linux")) { //$NON-NLS-1$
149
			properties.put("root.linux.motif.x86.permissions.755", "*.so*"); //$NON-NLS-1$ //$NON-NLS-2$
165
				properties.put("root.linux.motif.x86.link", "libXm.so.2.1,libXm.so.2,libXm.so.2.1,libXm.so"); //$NON-NLS-1$ //$NON-NLS-2$
166
				properties.put("root.linux.motif.x86.permissions.755", "*.so*"); //$NON-NLS-1$ //$NON-NLS-2$
167
			}
150
		}
168
		}
151
		save(new File(file, "build.properties"), properties, "Build Configuration"); //$NON-NLS-1$ //$NON-NLS-2$
169
		save(new File(file, "build.properties"), properties, "Build Configuration"); //$NON-NLS-1$ //$NON-NLS-2$
152
	}
170
	}
153
	
171
	
154
	private String getRootFileLocations() {
172
	private String getRootFileLocations(boolean hasLaunchers) {
155
		StringBuffer buffer = new StringBuffer();
173
		StringBuffer buffer = new StringBuffer();
156
		
174
157
		File homeDir = ExternalModelManager.getEclipseHome().toFile();
175
		if (!hasLaunchers) {
158
		if (homeDir.exists() && homeDir.isDirectory()) {
176
			File homeDir = ExternalModelManager.getEclipseHome().toFile();
159
			File[] files = homeDir.listFiles();
177
			if (homeDir.exists() && homeDir.isDirectory()) {
160
			for (int i = 0; i < files.length; i++) {
178
				buffer.append("absolute:file:"); //$NON-NLS-1$
161
				// TODO for now copy everything except .eclipseproduct
179
				buffer.append(new File(homeDir, "eclipse").getAbsolutePath());
162
				// Once the branded executable is generated, we should not copy
180
				buffer.append(","); //$NON-NLS-1$
163
				// eclipse.exe nor icon.xpm
181
				buffer.append(new File(homeDir, "eclipse.exe").getAbsolutePath());
164
				if (files[i].isFile() && !files[i].getName().startsWith(".")  //$NON-NLS-1$
182
				buffer.append(","); //$NON-NLS-1$
165
						&& !files[i].getName().endsWith(".html")) { //$NON-NLS-1$
183
				buffer.append(new File(homeDir, "startup.jar").getAbsolutePath());
166
					buffer.append("absolute:file:"); //$NON-NLS-1$
184
				buffer.append(","); //$NON-NLS-1$
167
					buffer.append(files[i].getAbsolutePath());
185
			}	
168
					buffer.append(","); //$NON-NLS-1$
169
				}	
170
			}		
171
		}
186
		}
172
		// add content of temp folder (.eclipseproduct, configuration/config.ini)
187
		// add content of temp folder (.eclipseproduct, configuration/config.ini)
173
		buffer.append("/temp/"); //$NON-NLS-1$
188
		buffer.append("/temp/"); //$NON-NLS-1$
174
		buffer.append(","); //$NON-NLS-1$
175
176
		return buffer.toString();
189
		return buffer.toString();
177
	}
190
	}
178
	
191
	
(-)src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportJob.java (-37 / +103 lines)
Lines 21-26 Link Here
21
import org.eclipse.core.runtime.jobs.*;
21
import org.eclipse.core.runtime.jobs.*;
22
import org.eclipse.jdt.core.*;
22
import org.eclipse.jdt.core.*;
23
import org.eclipse.jface.dialogs.*;
23
import org.eclipse.jface.dialogs.*;
24
import org.eclipse.osgi.service.resolver.BundleDescription;
25
import org.eclipse.osgi.service.resolver.State;
24
import org.eclipse.osgi.util.NLS;
26
import org.eclipse.osgi.util.NLS;
25
import org.eclipse.pde.core.*;
27
import org.eclipse.pde.core.*;
26
import org.eclipse.pde.core.build.*;
28
import org.eclipse.pde.core.build.*;
Lines 61-66 Link Here
61
	
63
	
62
	protected static String FEATURE_POST_PROCESSING = "features.postProcessingSteps.properties"; //$NON-NLS-1$
64
	protected static String FEATURE_POST_PROCESSING = "features.postProcessingSteps.properties"; //$NON-NLS-1$
63
	protected static String PLUGIN_POST_PROCESSING = "plugins.postProcessingSteps.properties"; //$NON-NLS-1$
65
	protected static String PLUGIN_POST_PROCESSING = "plugins.postProcessingSteps.properties"; //$NON-NLS-1$
66
	protected String[][] ftargets;
64
67
65
	class SchedulingRule implements ISchedulingRule {
68
	class SchedulingRule implements ISchedulingRule {
66
69
Lines 85-91 Link Here
85
		setRule(new SchedulingRule());
88
		setRule(new SchedulingRule());
86
	}
89
	}
87
	
90
	
88
	public FeatureExportJob(boolean toDirectory, boolean useJarFormat, boolean exportSource, String destination, String zipFileName, Object[] items, String[] signingInfo, String[] jnlpInfo) {
91
	public FeatureExportJob(boolean toDirectory, boolean useJarFormat, boolean exportSource, String destination, String zipFileName, Object[] items, String[] signingInfo, String[] jnlpInfo, String[][] targets) {
89
		super(PDEUIMessages.FeatureExportJob_name); //$NON-NLS-1$
92
		super(PDEUIMessages.FeatureExportJob_name); //$NON-NLS-1$
90
		fExportToDirectory = toDirectory;
93
		fExportToDirectory = toDirectory;
91
		fUseJarFormat = useJarFormat;
94
		fUseJarFormat = useJarFormat;
Lines 95-106 Link Here
95
		fItems = items;
98
		fItems = items;
96
		fSigningInfo = signingInfo;
99
		fSigningInfo = signingInfo;
97
		fJnlpInfo = jnlpInfo;
100
		fJnlpInfo = jnlpInfo;
101
		ftargets = targets;
102
		// TODO remove when there is UI to set ftargets
103
		if (ftargets == null)
104
			ftargets = new String[][] { { "linux", "gtk", "x86", ""} , {"win32", "win32", "x86", ""} };
98
		fBuildTempLocation = PDEPlugin.getDefault().getStateLocation().append("temp").toString(); //$NON-NLS-1$
105
		fBuildTempLocation = PDEPlugin.getDefault().getStateLocation().append("temp").toString(); //$NON-NLS-1$
99
		setRule(new SchedulingRule());
106
		setRule(new SchedulingRule());
100
	}
107
	}
101
108
102
	public FeatureExportJob(boolean toDirectory, boolean useJarFormat, boolean exportSource, String destination, String zipFileName, Object[] items) {
109
	public FeatureExportJob(boolean toDirectory, boolean useJarFormat, boolean exportSource, String destination, String zipFileName, Object[] items) {
103
		this(toDirectory, useJarFormat, exportSource, destination, zipFileName, items, null, null);
110
		this(toDirectory, useJarFormat, exportSource, destination, zipFileName, items, null, null, null);
104
	}
111
	}
105
112
106
	/*
113
	/*
Lines 150-179 Link Here
150
	protected void doExports(IProgressMonitor monitor) throws InvocationTargetException, CoreException {
157
	protected void doExports(IProgressMonitor monitor) throws InvocationTargetException, CoreException {
151
		createDestination();
158
		createDestination();
152
		monitor.beginTask("", fItems.length + 1); //$NON-NLS-1$
159
		monitor.beginTask("", fItems.length + 1); //$NON-NLS-1$
153
		try {
160
		String[][] configurations = ftargets;
154
			for (int i = 0; i < fItems.length; i++) {
161
		if (configurations == null)
155
				if (monitor.isCanceled())
162
			configurations = new String[][] { null };
156
					throw new OperationCanceledException();
163
		for (int i = 0; i < configurations.length; i++) {
157
				IFeatureModel model = (IFeatureModel) fItems[i];
164
			try {
158
				try {
165
				for (int j = 0; j < fItems.length; j++) {
159
					String location = model.getInstallLocation();
166
					if (monitor.isCanceled())
160
					if (fUseJarFormat) {
167
						throw new OperationCanceledException();
161
						createPostProcessingFile(new File(location, FEATURE_POST_PROCESSING));
168
					doExport((IFeatureModel) fItems[j], configurations[i], monitor);
162
						createPostProcessingFile(new File(location, PLUGIN_POST_PROCESSING));
163
					}
164
					IFeature feature = model.getFeature();
165
					String id = feature.getId();
166
					String os = getOS(feature);
167
					String ws = getWS(feature);
168
					String arch = getOSArch(feature);
169
					doExport(id, model.getFeature().getVersion(), model.getInstallLocation(), os, ws, arch, new SubProgressMonitor(monitor, 1));
170
				} finally {
171
					deleteBuildFiles(model);
172
				}
169
				}
170
			} finally {
171
				cleanup(configurations[i], new SubProgressMonitor(monitor, 1));
172
				monitor.done();
173
			}
174
		}
175
	}
176
177
	private void doExport(IFeatureModel model, String os, String ws, String arch, IProgressMonitor monitor) throws CoreException, InvocationTargetException {
178
		try {
179
			String location = model.getInstallLocation();
180
			if (fUseJarFormat) {
181
				createPostProcessingFile(new File(location, FEATURE_POST_PROCESSING));
182
				createPostProcessingFile(new File(location, PLUGIN_POST_PROCESSING));
173
			}
183
			}
184
			IFeature feature = model.getFeature();
185
			doExport(feature.getId(), feature.getVersion(), location, os, ws, arch, new SubProgressMonitor(monitor, 1));
174
		} finally {
186
		} finally {
175
			cleanup(new SubProgressMonitor(monitor, 1));
187
			deleteBuildFiles(model);
176
			monitor.done();
177
		}
188
		}
178
	}
189
	}
179
	
190
	
Lines 224-229 Link Here
224
		}
235
		}
225
	}
236
	}
226
237
238
	private void createDestination(String os, String ws, String arch) throws InvocationTargetException {
239
		if (!fExportToDirectory)
240
			return;
241
		File file = new File(fDestinationDirectory, os + '.' + ws + '.' + arch);
242
		if (!file.exists() || !file.isDirectory()) {
243
			if (!file.mkdirs())
244
				throw new InvocationTargetException(new Exception(PDEUIMessages.ExportWizard_badDirectory)); //$NON-NLS-1$
245
		}
246
	}
247
248
	protected void doExport(IFeatureModel model, String[] config, IProgressMonitor monitor) throws CoreException, InvocationTargetException {
249
		// TODO progress monitoring
250
		if (config == null) {
251
			IFeature feature = model.getFeature();
252
			doExport(model, getOS(feature), getWS(feature), getOSArch(feature), monitor);
253
		} else {
254
			createDestination(config[0], config[1], config[2]);
255
			doExport(model, config[0], config[1], config[2], monitor);
256
		}
257
	}
258
		
227
	protected void doExport(String featureID, String version, String featureLocation, String os, String ws, String arch, IProgressMonitor monitor) throws CoreException, InvocationTargetException {
259
	protected void doExport(String featureID, String version, String featureLocation, String os, String ws, String arch, IProgressMonitor monitor) throws CoreException, InvocationTargetException {
228
		monitor.beginTask("", 5); //$NON-NLS-1$
260
		monitor.beginTask("", 5); //$NON-NLS-1$
229
		monitor.setTaskName(PDEUIMessages.FeatureExportJob_taskName); //$NON-NLS-1$
261
		monitor.setTaskName(PDEUIMessages.FeatureExportJob_taskName); //$NON-NLS-1$
Lines 291-300 Link Here
291
			fAntBuildProperties.put(IXMLConstants.PROPERTY_COLLECTING_FOLDER, "."); //$NON-NLS-1$
323
			fAntBuildProperties.put(IXMLConstants.PROPERTY_COLLECTING_FOLDER, "."); //$NON-NLS-1$
292
			String prefix = Platform.getOS().equals("macosx") ? "." : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
324
			String prefix = Platform.getOS().equals("macosx") ? "." : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
293
			fAntBuildProperties.put(IXMLConstants.PROPERTY_ARCHIVE_PREFIX, prefix);
325
			fAntBuildProperties.put(IXMLConstants.PROPERTY_ARCHIVE_PREFIX, prefix);
294
			if (!fExportToDirectory)
326
			if (!fExportToDirectory) {
295
				fAntBuildProperties.put(IXMLConstants.PROPERTY_ARCHIVE_FULLPATH, fDestinationDirectory + File.separator + fZipFilename);
327
				String filename = fZipFilename;
296
			else
328
				if (ftargets != null) {
297
				fAntBuildProperties.put(IXMLConstants.PROPERTY_ASSEMBLY_TMP, fDestinationDirectory);
329
					int i = filename.lastIndexOf('.');
330
					filename = filename.substring(0, i) + '.' + os + '.' + ws + '.' + arch + filename.substring(i);
331
				}
332
				fAntBuildProperties.put(IXMLConstants.PROPERTY_ARCHIVE_FULLPATH, fDestinationDirectory + File.separator + filename);
333
			} else {
334
				String dir = fDestinationDirectory;
335
				if (ftargets != null)
336
					dir += File.separatorChar + os + '.' + ws + '.' + arch;
337
				fAntBuildProperties.put(IXMLConstants.PROPERTY_ASSEMBLY_TMP, dir);
338
			}
298
			fAntBuildProperties.put(IXMLConstants.PROPERTY_TAR_ARGS, ""); //$NON-NLS-1$
339
			fAntBuildProperties.put(IXMLConstants.PROPERTY_TAR_ARGS, ""); //$NON-NLS-1$
299
		}
340
		}
300
		return fAntBuildProperties;
341
		return fAntBuildProperties;
Lines 455-461 Link Here
455
			paths.add(models[i].getInstallLocation() + IPath.SEPARATOR + "feature.xml"); //$NON-NLS-1$
496
			paths.add(models[i].getInstallLocation() + IPath.SEPARATOR + "feature.xml"); //$NON-NLS-1$
456
		}
497
		}
457
498
458
		String[] plugins = TargetPlatform.createPluginPath();
499
		State state = TargetPlatform.getState();
500
		BundleDescription[] descriptions = state.getBundles();
501
		String[] plugins = new String[descriptions.length];
502
		for (int i = 0; i < descriptions.length; i++) 
503
			plugins[i] = descriptions[i].getLocation();
504
//		String[] plugins = TargetPlatform.createPluginPath();
459
		String[] features = (String[]) paths.toArray(new String[paths.size()]);
505
		String[] features = (String[]) paths.toArray(new String[paths.size()]);
460
		String[] all = new String[plugins.length + paths.size()];
506
		String[] all = new String[plugins.length + paths.size()];
461
		System.arraycopy(plugins, 0, all, 0, plugins.length);
507
		System.arraycopy(plugins, 0, all, 0, plugins.length);
Lines 482-497 Link Here
482
		return writer;
528
		return writer;
483
	}
529
	}
484
530
485
	protected void cleanup(IProgressMonitor monitor) {
531
	protected void cleanup(String[] config, IProgressMonitor monitor) {
486
        monitor.beginTask("", 2);
532
        monitor.beginTask("", 2);
533
        // TODO clear out some cached values that depend on the configuration being built.
534
        fDevProperties = null;
535
        fAntBuildProperties = null;
487
		File scriptFile = null;
536
		File scriptFile = null;
488
		try {
537
		try {
489
			scriptFile = createScriptFile();
538
			scriptFile = createScriptFile();
490
			writer = new PrintWriter(new FileWriter(scriptFile), true);
539
			writer = new PrintWriter(new FileWriter(scriptFile), true);
491
			generateHeader(writer);
540
			generateHeader(writer);
492
			generateDeleteZipTarget(writer);
541
			generateDeleteZipTarget(writer, config);
493
			generateCleanTarget(writer);
542
			generateCleanTarget(writer);
494
			boolean errors = generateZipLogsTarget(writer);
543
			boolean errors = generateZipLogsTarget(writer, config);
495
			generateClosingTag(writer);
544
			generateClosingTag(writer);
496
			writer.close();
545
			writer.close();
497
546
Lines 534-549 Link Here
534
		writer.println("</target>"); //$NON-NLS-1$
583
		writer.println("</target>"); //$NON-NLS-1$
535
	}
584
	}
536
585
537
	private void generateDeleteZipTarget(PrintWriter writer) {
586
	private String logName(String[] config) {
587
		if (config == null)
588
			return "/logs.zip";
589
		return "/logs." + config[0] + '.' + config[1] + '.' + config[2] + ".zip"; 
590
	}
591
	private void generateDeleteZipTarget(PrintWriter writer, String[] config) {
538
		writer.println("<target name=\"deleteZip\">"); //$NON-NLS-1$
592
		writer.println("<target name=\"deleteZip\">"); //$NON-NLS-1$
539
		writer.println("<delete file=\"" + fDestinationDirectory + "/logs.zip\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
593
		writer.println("<delete file=\"" + fDestinationDirectory + logName(config) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
540
		writer.println("</target>"); //$NON-NLS-1$
594
		writer.println("</target>"); //$NON-NLS-1$
541
	}
595
	}
542
596
543
	private boolean generateZipLogsTarget(PrintWriter writer) {
597
	private boolean generateZipLogsTarget(PrintWriter writer, String[] config) {
544
		if (logFile != null && logFile.exists() && logFile.length() > 0) {
598
		if (logFile != null && logFile.exists() && logFile.length() > 0) {
545
			writer.println("<target name=\"zip.logs\">"); //$NON-NLS-1$
599
			writer.println("<target name=\"zip.logs\">"); //$NON-NLS-1$
546
			writer.println("<zip zipfile=\"" + fDestinationDirectory + "/logs.zip\" basedir=\"" + fBuildTempLocation + "/pde.logs\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
600
			writer.println("<zip zipfile=\"" + fDestinationDirectory + logName(config) + "\" basedir=\"" + fBuildTempLocation + "/pde.logs\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
547
			writer.println("</target>"); //$NON-NLS-1$
601
			writer.println("</target>"); //$NON-NLS-1$
548
			return true;
602
			return true;
549
		}
603
		}
Lines 577-583 Link Here
577
		return NLS.bind(PDEUIMessages.ExportJob_error_message, fDestinationDirectory + File.separator + "logs.zip"); //$NON-NLS-1$ //$NON-NLS-2$
631
		return NLS.bind(PDEUIMessages.ExportJob_error_message, fDestinationDirectory + File.separator + "logs.zip"); //$NON-NLS-1$ //$NON-NLS-2$
578
	}
632
	}
579
    
633
    
580
    protected void createFeature(String featureID, String featureLocation) throws IOException {
634
    protected void createFeature(String featureID, String featureLocation, String[] config) throws IOException {
581
        File file = new File(featureLocation);
635
        File file = new File(featureLocation);
582
        if (!file.exists() || !file.isDirectory())
636
        if (!file.exists() || !file.isDirectory())
583
            file.mkdirs();
637
            file.mkdirs();
Lines 588-594 Link Here
588
        writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
642
        writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
589
        writer.println("<feature id=\"" + featureID + "\" version=\"1.0\">"); //$NON-NLS-1$ //$NON-NLS-2$
643
        writer.println("<feature id=\"" + featureID + "\" version=\"1.0\">"); //$NON-NLS-1$ //$NON-NLS-2$
590
644
591
        Dictionary environment = TargetPlatform.getTargetEnvironment();
645
		IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager().getModels();
646
		for (int i = 0; i < models.length; i++) {
647
			IFeature feature = models[i].getFeature();
648
			if ("org.eclipse.platform.launchers".equals(feature.getId()))
649
		        writer.println("<includes id=\"" + feature.getId() + "\" version=\"" + feature.getVersion() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
650
		}
651
652
        Dictionary environment = new Hashtable(4);
653
        environment.put("osgi.os", config[0]);
654
        environment.put("osgi.ws", config[1]);
655
        environment.put("osgi.arch", config[2]);
656
        environment.put("osgi.nl", config[3]);
657
        	
592
        BundleContext context = PDEPlugin.getDefault().getBundleContext();
658
        BundleContext context = PDEPlugin.getDefault().getBundleContext();
593
        for (int i = 0; i < fItems.length; i++) {
659
        for (int i = 0; i < fItems.length; i++) {
594
            if (fItems[i] instanceof IPluginModelBase) {
660
            if (fItems[i] instanceof IPluginModelBase) {
(-)src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java (-1 / +2 lines)
Lines 46-52 Link Here
46
				fPage1.getFileName(),
46
				fPage1.getFileName(),
47
				((ExportWizardPageWithTable)fPage1).getSelectedItems(),
47
				((ExportWizardPageWithTable)fPage1).getSelectedItems(),
48
				signingInfo,
48
				signingInfo,
49
				jnlpInfo);
49
				jnlpInfo,
50
				null);
50
		job.setUser(true);
51
		job.setUser(true);
51
		job.schedule();
52
		job.schedule();
52
		job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ);
53
		job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ);
(-)src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportJob.java (-3 / +4 lines)
Lines 40-46 Link Here
40
			String zipFileName,
40
			String zipFileName,
41
			Object[] items,
41
			Object[] items,
42
			String[] signingInfo) {
42
			String[] signingInfo) {
43
			super(toDirectory, useJarFormat, exportSource, destination, zipFileName, items, signingInfo, null);
43
			super(toDirectory, useJarFormat, exportSource, destination, zipFileName, items, signingInfo, null, null);
44
		}
44
		}
45
45
46
	/* (non-Javadoc)
46
	/* (non-Javadoc)
Lines 53-59 Link Here
53
			// create a feature to contain all plug-ins
53
			// create a feature to contain all plug-ins
54
			String featureID = "org.eclipse.pde.container.feature"; //$NON-NLS-1$
54
			String featureID = "org.eclipse.pde.container.feature"; //$NON-NLS-1$
55
			fFeatureLocation = fBuildTempLocation + File.separator + featureID;
55
			fFeatureLocation = fBuildTempLocation + File.separator + featureID;
56
			createFeature(featureID, fFeatureLocation);
56
			String[] config = new String[] {TargetPlatform.getOS(), TargetPlatform.getWS(), TargetPlatform.getOSArch(), TargetPlatform.getNL() };
57
			createFeature(featureID, fFeatureLocation, config);
57
			createBuildPropertiesFile(fFeatureLocation);
58
			createBuildPropertiesFile(fFeatureLocation);
58
			if (fUseJarFormat)
59
			if (fUseJarFormat)
59
				createPostProcessingFile(new File(fFeatureLocation, PLUGIN_POST_PROCESSING));
60
				createPostProcessingFile(new File(fFeatureLocation, PLUGIN_POST_PROCESSING));
Lines 65-71 Link Here
65
				if (fItems[i] instanceof IPluginModelBase)
66
				if (fItems[i] instanceof IPluginModelBase)
66
					deleteBuildFiles((IPluginModelBase)fItems[i]);
67
					deleteBuildFiles((IPluginModelBase)fItems[i]);
67
			}
68
			}
68
			cleanup(new SubProgressMonitor(monitor, 3));
69
			cleanup(null, new SubProgressMonitor(monitor, 3));
69
			monitor.done();
70
			monitor.done();
70
		}
71
		}
71
	}
72
	}
(-)src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizard.java (-1 / +2 lines)
Lines 62-68 Link Here
62
										page.doExportToDirectory(),
62
										page.doExportToDirectory(),
63
										page.doExportSource(), 
63
										page.doExportSource(), 
64
										page.getDestination(), 
64
										page.getDestination(), 
65
										page.getFileName());
65
										page.getFileName(),
66
										null);
66
		job.setUser(true);
67
		job.setUser(true);
67
		job.schedule();
68
		job.schedule();
68
		job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ);
69
		job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ);

Return to bug 92420