1 11 package org.eclipse.pde.internal.build.tasks; 12 13 import java.io.File ; 14 import java.util.Properties ; 15 import org.apache.tools.ant.BuildException; 16 import org.apache.tools.ant.Task; 17 import org.eclipse.core.runtime.CoreException; 18 import org.eclipse.pde.internal.build.*; 19 import org.eclipse.pde.internal.build.site.BuildTimeSiteFactory; 20 21 25 public class FeatureGeneratorTask extends Task { 26 private FeatureGenerator generator = new FeatureGenerator(); 27 private Properties antProperties = new Properties (); 28 29 public void execute() throws BuildException { 30 try { 31 BundleHelper.getDefault().setLog(this); 32 String value = getProject().getProperty(IBuildPropertiesConstants.RESOLVER_DEV_MODE); 33 if (Boolean.valueOf(value).booleanValue()) 34 antProperties.put(IBuildPropertiesConstants.RESOLVER_DEV_MODE, "true"); generator.setImmutableAntProperties(antProperties); 36 run(); 37 BundleHelper.getDefault().setLog(null); 38 } catch (CoreException e) { 39 throw new BuildException(TaskHelper.statusToString(e.getStatus(), null).toString()); 40 } 41 } 42 43 public void run() throws CoreException { 44 generator.generate(); 45 } 46 47 51 public void setBuildDirectory(String buildDirectory) { 52 generator.setWorkingDirectory(buildDirectory); 53 } 54 55 59 public void setProductFile(String productFile) { 60 generator.setProductFile(productFile); 61 } 62 63 68 public void setIncludeLaunchers(boolean includeLaunchers) { 69 generator.setIncludeLaunchers(includeLaunchers); 70 } 71 76 public void setBaseLocation(String baseLocation) { 77 BuildTimeSiteFactory.setInstalledBaseSite(baseLocation); 78 } 79 80 84 public void setPluginList(String pluginList) { 85 if (pluginList != null && !pluginList.startsWith("${")) generator.setPluginList(Utils.getArrayFromString(pluginList)); 87 } 88 89 93 public void setFragmentList(String fragmentList) { 94 if(fragmentList != null && !fragmentList.startsWith("${")) generator.setFragmentList(Utils.getArrayFromString(fragmentList)); 96 } 97 98 102 public void setFeatureList(String featureList) { 103 if (featureList != null && !featureList.startsWith("${")) generator.setFeatureList(Utils.getArrayFromString(featureList)); 105 } 106 107 111 public void setFeatureId(String featureId) { 112 generator.setFeatureId(featureId); 113 } 114 115 120 public void setPluginPath(String pluginPath) { 121 generator.setPluginPath(Utils.getArrayFromString(pluginPath, File.pathSeparator)); 122 } 123 124 128 public void setVerify(boolean verify) { 129 generator.setVerify(verify); 130 } 131 132 137 public void setConfigInfo(String configInfo) throws CoreException { 138 AbstractScriptGenerator.setConfigInfo(configInfo); 139 } 140 } 141 | Popular Tags |