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

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java (-4 / +6 lines)
Lines 789-796 Link Here
789
	 * @param modelId
789
	 * @param modelId
790
	 * @throws CoreException
790
	 * @throws CoreException
791
	 */
791
	 */
792
	public void setModelId(String modelId) throws CoreException {
792
	public void setModelId(String modelId, String modelVersion) throws CoreException {
793
		BundleDescription newModel = getModel(modelId);
793
		BundleDescription newModel = getModel(modelId, modelVersion);
794
		if (newModel == null) {
794
		if (newModel == null) {
795
			String message = NLS.bind(Messages.exception_missingElement, modelId);
795
			String message = NLS.bind(Messages.exception_missingElement, modelId);
796
			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ELEMENT_MISSING, message, null));
796
			throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ELEMENT_MISSING, message, null));
Lines 1295-1302 Link Here
1295
	 * @param modelId the identifier of the model object to lookup
1295
	 * @param modelId the identifier of the model object to lookup
1296
	 * @return the model object or <code>null</code>
1296
	 * @return the model object or <code>null</code>
1297
	 */
1297
	 */
1298
	protected BundleDescription getModel(String modelId) throws CoreException {
1298
	protected BundleDescription getModel(String modelId, String modelVersion) throws CoreException {
1299
		return getSite(false).getRegistry().getResolvedBundle(modelId);
1299
		if (modelVersion == null)
1300
			return getSite(false).getRegistry().getResolvedBundle(modelId);
1301
		return getSite(false).getRegistry().getResolvedBundle(modelId, modelVersion);
1300
	}
1302
	}
1301
1303
1302
	public IPluginEntry getAssociatedEntry() {
1304
	public IPluginEntry getAssociatedEntry() {
(-)src/org/eclipse/pde/internal/build/BuildScriptGenerator.java (-5 / +27 lines)
Lines 72-77 Link Here
72
	private boolean generateVersionsList = false;
72
	private boolean generateVersionsList = false;
73
73
74
	private Properties antProperties = null;
74
	private Properties antProperties = null;
75
	private BundleDescription[] bundlesToBuild;
75
	
76
	
76
	private static final String PROPERTY_ARCHIVESFORMAT = "archivesFormat"; //$NON-NLS-1$
77
	private static final String PROPERTY_ARCHIVESFORMAT = "archivesFormat"; //$NON-NLS-1$
77
78
Lines 112-117 Link Here
112
	 * Separate elements by kind.
113
	 * Separate elements by kind.
113
	 */
114
	 */
114
	protected void sortElements(List features, List plugins) {
115
	protected void sortElements(List features, List plugins) {
116
		if (elements == null)
117
			return;
115
		for (int i = 0; i < elements.length; i++) {
118
		for (int i = 0; i < elements.length; i++) {
116
			int index = elements[i].indexOf('@');
119
			int index = elements[i].indexOf('@');
117
			String type = elements[i].substring(0, index);
120
			String type = elements[i].substring(0, index);
Lines 135-146 Link Here
135
				generator = new ModelBuildScriptGenerator();
138
				generator = new ModelBuildScriptGenerator();
136
				generator.setReportResolutionErrors(reportResolutionErrors);
139
				generator.setReportResolutionErrors(reportResolutionErrors);
137
				generator.setIgnoreMissingPropertiesFile(ignoreMissingPropertiesFile);
140
				generator.setIgnoreMissingPropertiesFile(ignoreMissingPropertiesFile);
138
				//Filtering is not required here, since we are only generating the
141
				//Filtering is not required here, since we are only generating the build for a plugin or a fragment
139
				// build for a plugin or a fragment
142
				String[] modelInfo = getNameAndVersion((String) iterator.next());
140
				String model = (String) iterator.next();
141
				generator.setBuildSiteFactory(siteFactory);
143
				generator.setBuildSiteFactory(siteFactory);
142
				generator.setModelId(model);
144
				generator.setModelId(modelInfo[0], modelInfo[1]);
143
145
				
144
				generator.setPluginPath(pluginPath);
146
				generator.setPluginPath(pluginPath);
145
				generator.setDevEntries(devEntries);
147
				generator.setDevEntries(devEntries);
146
				generator.setCompiledElements(generator.getCompiledElements());
148
				generator.setCompiledElements(generator.getCompiledElements());
Lines 148-153 Link Here
148
				generator.setSignJars(signJars);
150
				generator.setSignJars(signJars);
149
				generator.generate();
151
				generator.generate();
150
			}
152
			}
153
			if (bundlesToBuild != null)
154
				for (int i = 0; i < bundlesToBuild.length; i++) {
155
					generator = new ModelBuildScriptGenerator();
156
					generator.setReportResolutionErrors(reportResolutionErrors);
157
					generator.setIgnoreMissingPropertiesFile(ignoreMissingPropertiesFile);
158
					//Filtering is not required here, since we are only generating the build for a plugin or a fragment
159
					generator.setBuildSiteFactory(siteFactory);
160
					generator.setModel(bundlesToBuild[i]);
161
					
162
					generator.setPluginPath(pluginPath);
163
					generator.setDevEntries(devEntries);
164
					generator.setCompiledElements(generator.getCompiledElements());
165
					generator.setBuildingOSGi(isBuildingOSGi());
166
					generator.setSignJars(signJars);
167
					generator.generate();
168
				}
151
		} finally {
169
		} finally {
152
			if (generator != null)
170
			if (generator != null)
153
				generator.getSite(false).getRegistry().cleanupOriginalState();
171
				generator.getSite(false).getRegistry().cleanupOriginalState();
Lines 506-509 Link Here
506
	public void setImmutableAntProperties(Properties properties) {
524
	public void setImmutableAntProperties(Properties properties) {
507
		antProperties = properties;
525
		antProperties = properties;
508
	}
526
	}
527
	
528
	public void setBundles(BundleDescription[] bundles) {
529
		bundlesToBuild = bundles;
530
	}
509
}
531
}

Return to bug 186204