KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > build > packager > PackagerGenerator


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

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