01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.packager;
11:
12: import java.util.List;
13: import org.eclipse.core.runtime.CoreException;
14: import org.eclipse.pde.internal.build.*;
15: import org.eclipse.pde.internal.build.BuildScriptGenerator;
16: import org.eclipse.pde.internal.build.Utils;
17: import org.eclipse.pde.internal.build.site.BuildTimeSiteFactory;
18:
19: public class PackagerGenerator extends BuildScriptGenerator {
20: private String featureList = null;
21: private String propertyFile;
22: private boolean groupConfigs;
23:
24: public PackagerGenerator() {
25: generateBuildScript = false;
26: children = true;
27: groupConfigs = false;
28: }
29:
30: public void setFeatureList(String features) {
31: featureList = features;
32: }
33:
34: protected void sortElements(List features, List plugins) {
35: String[] allFeatures = Utils.getArrayFromString(featureList);
36: for (int i = 0; i < allFeatures.length; i++) {
37: features.add(allFeatures[i]);
38: }
39: }
40:
41: protected void generatePackageScripts(
42: AssemblyInformation assemblageInformation,
43: String[] featureInfo, BuildTimeSiteFactory factory)
44: throws CoreException {
45: PackageScriptGenerator assembler = null;
46: if (groupConfigs)
47: assembler = new DeltaPackScriptGenerator(workingDirectory,
48: assemblageInformation, featureInfo[0]);
49: else
50: assembler = new PackageScriptGenerator(workingDirectory,
51: assemblageInformation, featureInfo[0]);
52:
53: assembler.setSignJars(signJars);
54: assembler.setGenerateJnlp(generateJnlp);
55: assembler.setArchivesFormat(getArchivesFormat());
56: assembler.setPropertyFile(propertyFile);
57: assembler.setBackwardCompatibleName(true);
58: assembler.setBuildSiteFactory(factory);
59: assembler.generate();
60: }
61:
62: public void setPropertyFile(String propertyFile) {
63: this .propertyFile = propertyFile;
64: }
65:
66: public void groupConfigs(boolean value) {
67: groupConfigs = value;
68: }
69: }
|