01: /*******************************************************************************
02: * Copyright (c) 2000, 2004 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM - Initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.build;
11:
12: import java.io.IOException;
13: import java.io.OutputStream;
14: import java.util.LinkedHashMap;
15: import java.util.Map;
16: import org.eclipse.core.runtime.CoreException;
17: import org.eclipse.pde.internal.build.builder.FeatureBuildScriptGenerator;
18: import org.eclipse.update.core.Feature;
19: import org.eclipse.update.core.IIncludedFeatureReference;
20:
21: public class SourceFeatureWriter extends FeatureWriter {
22:
23: public SourceFeatureWriter(OutputStream out, Feature feature,
24: FeatureBuildScriptGenerator generator) throws IOException {
25: super (out, feature, generator);
26: }
27:
28: public void printIncludes() {
29: Map parameters = new LinkedHashMap();
30: // TO CHECK Here we should have the raw list...
31: IIncludedFeatureReference[] features = feature
32: .getFeatureIncluded();
33: for (int i = 0; i < features.length; i++) {
34: parameters.clear();
35: try {
36: parameters
37: .put(
38: "id", features[i].getVersionedIdentifier().getIdentifier()); //$NON-NLS-1$
39: parameters
40: .put(
41: "version", features[i].getVersionedIdentifier().getVersion()); //$NON-NLS-1$
42: } catch (CoreException e) {
43: e.printStackTrace(); //TO CHECK better handling of exception
44: }
45:
46: printTag("includes", parameters, true, true, true); //$NON-NLS-1$
47: }
48: }
49: }
|