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 222480 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/p2/metadata/generator/features/FeatureParser.java (+6 lines)
Lines 251-256 Link Here
251
			String arch = attributes.getValue("arch"); //$NON-NLS-1$
251
			String arch = attributes.getValue("arch"); //$NON-NLS-1$
252
			result.setEnvironment(os, ws, arch, nl);
252
			result.setEnvironment(os, ws, arch, nl);
253
253
254
			result.setApplication(attributes.getValue("application")); //$NON-NLS-1$
255
			result.setPlugin(attributes.getValue("plugin")); //$NON-NLS-1$
256
			result.setExclusive(Boolean.valueOf(attributes.getValue("exclusive")).booleanValue()); //$NON-NLS-1$
257
			result.setPrimary(Boolean.valueOf(attributes.getValue("primary")).booleanValue()); //$NON-NLS-1$
258
			result.setColocationAffinity(attributes.getValue("colocation-affinity")); //$NON-NLS-1$
259
254
			//TODO rootURLs
260
			//TODO rootURLs
255
			if (url != null && "file".equals(url.getProtocol())) { //$NON-NLS-1$
261
			if (url != null && "file".equals(url.getProtocol())) { //$NON-NLS-1$
256
				File f = new File(url.getFile().replace('/', File.separatorChar));
262
				File f = new File(url.getFile().replace('/', File.separatorChar));
(-)src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Feature.java (+45 lines)
Lines 23-28 Link Here
23
	private String version;
23
	private String version;
24
	private String label;
24
	private String label;
25
	private String image;
25
	private String image;
26
	private String pluginId;
27
	private boolean primary = false;
28
	private boolean exclusive = false;
29
	private String application;
30
	private String colocationAffinity;
26
31
27
	private URLEntry description;
32
	private URLEntry description;
28
	private URLEntry license;
33
	private URLEntry license;
Lines 70-79 Link Here
70
		entries.add(plugin);
75
		entries.add(plugin);
71
	}
76
	}
72
77
78
	public String getApplication() {
79
		return application;
80
	}
81
73
	public String getArch() {
82
	public String getArch() {
74
		return arch;
83
		return arch;
75
	}
84
	}
76
85
86
	public String getColocationAffinity() {
87
		return colocationAffinity;
88
	}
89
77
	public String getCopyright() {
90
	public String getCopyright() {
78
		if (copyright != null)
91
		if (copyright != null)
79
			return copyright.getAnnotation();
92
			return copyright.getAnnotation();
Lines 162-167 Link Here
162
		return os;
175
		return os;
163
	}
176
	}
164
177
178
	public String getPlugin() {
179
		return pluginId;
180
	}
181
165
	public String getProviderName() {
182
	public String getProviderName() {
166
		return providerName;
183
		return providerName;
167
	}
184
	}
Lines 186-191 Link Here
186
		return ws;
203
		return ws;
187
	}
204
	}
188
205
206
	public boolean isExclusive() {
207
		return exclusive;
208
	}
209
210
	public boolean isPrimary() {
211
		return primary;
212
	}
213
214
	public void setApplication(String application) {
215
		this.application = application;
216
	}
217
218
	public void setColocationAffinity(String colocationAffinity) {
219
		this.colocationAffinity = colocationAffinity;
220
	}
221
189
	public void setCopyright(String copyright) {
222
	public void setCopyright(String copyright) {
190
		if (this.copyright == null)
223
		if (this.copyright == null)
191
			this.copyright = new URLEntry();
224
			this.copyright = new URLEntry();
Lines 217-222 Link Here
217
		this.nl = nl;
250
		this.nl = nl;
218
	}
251
	}
219
252
253
	public void setExclusive(boolean exclusive) {
254
		this.exclusive = exclusive;
255
	}
256
220
	public void setImage(String image) {
257
	public void setImage(String image) {
221
		this.image = image;
258
		this.image = image;
222
	}
259
	}
Lines 257-262 Link Here
257
		this.location = location;
294
		this.location = location;
258
	}
295
	}
259
296
297
	public void setPlugin(String pluginId) {
298
		this.pluginId = pluginId;
299
	}
300
301
	public void setPrimary(boolean primary) {
302
		this.primary = primary;
303
	}
304
260
	public void setProviderName(String value) {
305
	public void setProviderName(String value) {
261
		providerName = value;
306
		providerName = value;
262
	}
307
	}
(-)src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java (+12 lines)
Lines 96-101 Link Here
96
	private static final String LAUNCHER_ID_PREFIX = "org.eclipse.launcher"; //$NON-NLS-1$
96
	private static final String LAUNCHER_ID_PREFIX = "org.eclipse.launcher"; //$NON-NLS-1$
97
97
98
	private static final String ECLIPSE_INSTALL_HANDLER_PROP = "org.eclipse.update.installHandler"; //$NON-NLS-1$
98
	private static final String ECLIPSE_INSTALL_HANDLER_PROP = "org.eclipse.update.installHandler"; //$NON-NLS-1$
99
	private static final String UPDATE_FEATURE_APPLICATION_PROP = "org.eclipse.update.feature.application"; //$NON-NLS-1$
100
	private static final String UPDATE_FEATURE_PLUGIN_PROP = "org.eclipse.update.feature.plugin"; //$NON-NLS-1$
101
	private static final String UPDATE_FEATURE_EXCLUSIVE_PROP = "org.eclipse.update.feature.exclusive"; //$NON-NLS-1$
102
	private static final String UPDATE_FEATURE_PRIMARY_PROP = "org.eclipse.update.feature.primary"; //$NON-NLS-1$
99
103
100
	//TODO - need to come up with a way to infer launcher version
104
	//TODO - need to come up with a way to infer launcher version
101
	private static final Version LAUNCHER_VERSION = new Version(1, 0, 0);
105
	private static final Version LAUNCHER_VERSION = new Version(1, 0, 0);
Lines 571-576 Link Here
571
			iu.setLicense(new License(feature.getLicenseURL(), feature.getLicense()));
575
			iu.setLicense(new License(feature.getLicenseURL(), feature.getLicense()));
572
		if (feature.getCopyright() != null)
576
		if (feature.getCopyright() != null)
573
			iu.setCopyright(new Copyright(feature.getCopyrightURL(), feature.getCopyright()));
577
			iu.setCopyright(new Copyright(feature.getCopyrightURL(), feature.getCopyright()));
578
		if (feature.getApplication() != null)
579
			iu.setProperty(UPDATE_FEATURE_APPLICATION_PROP, feature.getApplication());
580
		if (feature.getPlugin() != null)
581
			iu.setProperty(UPDATE_FEATURE_PLUGIN_PROP, feature.getPlugin());
582
		if (feature.isExclusive())
583
			iu.setProperty(UPDATE_FEATURE_EXCLUSIVE_PROP, Boolean.TRUE.toString());
584
		if (feature.isPrimary())
585
			iu.setProperty(UPDATE_FEATURE_PRIMARY_PROP, Boolean.TRUE.toString());
574
586
575
		// The required capabilities are not specified at this level because we don't want the feature jar to be attractive to install.
587
		// The required capabilities are not specified at this level because we don't want the feature jar to be attractive to install.
576
588
(-)src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java (+5 lines)
Lines 190-195 Link Here
190
		addedFeature.setId(id);
190
		addedFeature.setId(id);
191
		addedFeature.setVersion(version);
191
		addedFeature.setVersion(version);
192
		addedFeature.setUrl(makeFeatureURL(id, version));
192
		addedFeature.setUrl(makeFeatureURL(id, version));
193
		addedFeature.setApplication(application);
194
		addedFeature.setPluginIdentifier(pluginIdentifier);
195
		addedFeature.setPluginVersion(pluginVersion);
196
		addedFeature.setRoots(root);
197
		addedFeature.setPrimary(primary);
193
		site.addFeature(addedFeature);
198
		site.addFeature(addedFeature);
194
		return Status.OK_STATUS;
199
		return Status.OK_STATUS;
195
	}
200
	}
(-)src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallFeatureAction.java (-1 / +9 lines)
Lines 20-25 Link Here
20
20
21
public class InstallFeatureAction extends ProvisioningAction {
21
public class InstallFeatureAction extends ProvisioningAction {
22
	public static final String ID = "installFeature"; //$NON-NLS-1$
22
	public static final String ID = "installFeature"; //$NON-NLS-1$
23
	private static final String UPDATE_FEATURE_APPLICATION_PROP = "org.eclipse.update.feature.application"; //$NON-NLS-1$
24
	private static final String UPDATE_FEATURE_PLUGIN_PROP = "org.eclipse.update.feature.plugin"; //$NON-NLS-1$
25
	private static final String UPDATE_FEATURE_PRIMARY_PROP = "org.eclipse.update.feature.primary"; //$NON-NLS-1$
23
26
24
	public IStatus execute(Map parameters) {
27
	public IStatus execute(Map parameters) {
25
		return InstallFeatureAction.installFeature(parameters);
28
		return InstallFeatureAction.installFeature(parameters);
Lines 65-70 Link Here
65
		if (file == null || !file.exists()) {
68
		if (file == null || !file.exists()) {
66
			return Util.createError(NLS.bind(Messages.artifact_file_not_found, artifactKey));
69
			return Util.createError(NLS.bind(Messages.artifact_file_not_found, artifactKey));
67
		}
70
		}
68
		return configuration.addFeatureEntry(file, featureId, featureVersion, artifactKey.getId(), artifactKey.getVersion().toString(), /*primary*/false, /*application*/null, /*root*/null);
71
		String pluginId = iu.getProperty(UPDATE_FEATURE_PLUGIN_PROP);
72
		boolean isPrimary = Boolean.valueOf(iu.getProperty(UPDATE_FEATURE_PRIMARY_PROP)).booleanValue();
73
		String application = iu.getProperty(UPDATE_FEATURE_APPLICATION_PROP);
74
		// TODO this isn't right... but we will leave it for now because we don't actually use the value in the install
75
		String pluginVersion = artifactKey.getVersion().toString();
76
		return configuration.addFeatureEntry(file, featureId, featureVersion, pluginId, pluginVersion, isPrimary, application, /*root*/null);
69
	}
77
	}
70
}
78
}

Return to bug 222480