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

Collapse All | Expand All

(-)src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java (-12 / +33 lines)
Lines 59-75 Link Here
59
		iu.setId(id);
59
		iu.setId(id);
60
		Version version = Version.parseVersion(feature.getVersion());
60
		Version version = Version.parseVersion(feature.getVersion());
61
		iu.setVersion(version);
61
		iu.setVersion(version);
62
63
		// set properties for other feature attributes
64
		iu.setProperty(IInstallableUnit.PROP_NAME, feature.getLabel());
65
		if (feature.getDescription() != null)
66
			iu.setProperty(IInstallableUnit.PROP_DESCRIPTION, feature.getDescription());
67
		if (feature.getDescriptionURL() != null)
68
			iu.setProperty(IInstallableUnit.PROP_DESCRIPTION_URL, feature.getDescriptionURL());
69
		if (feature.getProviderName() != null)
70
			iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName());
62
		if (feature.getLicense() != null)
71
		if (feature.getLicense() != null)
63
			iu.setLicense(MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense()));
72
			iu.setLicense(MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense()));
64
		if (feature.getCopyright() != null)
73
		if (feature.getCopyright() != null)
65
			iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
74
			iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
66
67
		// The required capabilities are not specified at this level because we don't want the feature jar to be attractive to install.
68
		iu.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI);
69
		iu.setFilter(INSTALL_FEATURES_FILTER);
70
		iu.setSingleton(true);
71
72
		// set properties for other feature attributes
73
		if (feature.getApplication() != null)
75
		if (feature.getApplication() != null)
74
			iu.setProperty(UPDATE_FEATURE_APPLICATION_PROP, feature.getApplication());
76
			iu.setProperty(UPDATE_FEATURE_APPLICATION_PROP, feature.getApplication());
75
		if (feature.getPlugin() != null)
77
		if (feature.getPlugin() != null)
Lines 79-84 Link Here
79
		if (feature.isPrimary())
81
		if (feature.isPrimary())
80
			iu.setProperty(UPDATE_FEATURE_PRIMARY_PROP, Boolean.TRUE.toString());
82
			iu.setProperty(UPDATE_FEATURE_PRIMARY_PROP, Boolean.TRUE.toString());
81
83
84
		// The required capabilities are not specified at this level because we don't want the feature jar to be attractive to install.
85
		iu.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI);
86
		iu.setFilter(INSTALL_FEATURES_FILTER);
87
		iu.setSingleton(true);
88
82
		if (feature.getInstallHandler() != null && feature.getInstallHandler().trim().length() > 0) {
89
		if (feature.getInstallHandler() != null && feature.getInstallHandler().trim().length() > 0) {
83
			String installHandlerProperty = "handler=" + feature.getInstallHandler(); //$NON-NLS-1$
90
			String installHandlerProperty = "handler=" + feature.getInstallHandler(); //$NON-NLS-1$
84
91
Lines 91-108 Link Here
91
			iu.setProperty(PublisherHelper.ECLIPSE_INSTALL_HANDLER_PROP, installHandlerProperty);
98
			iu.setProperty(PublisherHelper.ECLIPSE_INSTALL_HANDLER_PROP, installHandlerProperty);
92
		}
99
		}
93
100
101
		ArrayList providedCapabilities = new ArrayList();
102
		providedCapabilities.add(PublisherHelper.createSelfCapability(id, version));
103
		providedCapabilities.add(PublisherHelper.FEATURE_CAPABILITY);
104
		providedCapabilities.add(MetadataFactory.createProvidedCapability(PublisherHelper.CAPABILITY_NS_UPDATE_FEATURE, feature.getId(), version));
105
94
		iu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version), PublisherHelper.FEATURE_CAPABILITY, MetadataFactory.createProvidedCapability(PublisherHelper.CAPABILITY_NS_UPDATE_FEATURE, feature.getId(), version)});
106
		iu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version), PublisherHelper.FEATURE_CAPABILITY, MetadataFactory.createProvidedCapability(PublisherHelper.CAPABILITY_NS_UPDATE_FEATURE, feature.getId(), version)});
95
		iu.setArtifacts(new IArtifactKey[] {createFeatureArtifactKey(feature.getId(), version.toString())});
107
		iu.setArtifacts(new IArtifactKey[] {createFeatureArtifactKey(feature.getId(), version.toString())});
96
108
97
		// TODO its not clear when this would ever be false reasonably.  Features are always
98
		// supposed to be installed unzipped.  It is also not clear what it means to set this prop.
99
		// Anyway, in the future it seems reasonable that features be installed as JARs...
100
		// Note: We have decided to always unzip features when they are installed (regardless of whether they
101
		//were zipped when we found them). https://bugs.eclipse.org/bugs/show_bug.cgi?id=267282
102
		Map touchpointData = new HashMap();
109
		Map touchpointData = new HashMap();
103
		touchpointData.put("zipped", "true"); //$NON-NLS-1$ //$NON-NLS-2$
110
		touchpointData.put("zipped", "true"); //$NON-NLS-1$ //$NON-NLS-2$
104
		iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
111
		iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
105
112
113
		Map localizations = feature.getLocalizations();
114
		if (localizations != null) {
115
			for (Iterator iter = localizations.keySet().iterator(); iter.hasNext();) {
116
				Locale locale = (Locale) iter.next();
117
				Properties translatedStrings = (Properties) localizations.get(locale);
118
				Enumeration propertyKeys = translatedStrings.propertyNames();
119
				while (propertyKeys.hasMoreElements()) {
120
					String nextKey = (String) propertyKeys.nextElement();
121
					iu.setProperty(locale.toString() + '.' + nextKey, translatedStrings.getProperty(nextKey));
122
				}
123
				providedCapabilities.add(PublisherHelper.makeTranslationCapability(id, locale));
124
			}
125
		}
126
106
		processInstallableUnitPropertiesAdvice(iu, info);
127
		processInstallableUnitPropertiesAdvice(iu, info);
107
		return MetadataFactory.createInstallableUnit(iu);
128
		return MetadataFactory.createInstallableUnit(iu);
108
	}
129
	}

Return to bug 274695