1 11 package org.eclipse.pde.internal.build.tasks; 12 13 import java.io.File ; 14 import java.util.*; 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 import org.eclipse.pde.internal.build.site.QualifierReplacer; 21 22 25 public class BuildScriptGeneratorTask extends Task { 26 private Properties antProperties = new Properties(); 27 30 protected BuildScriptGenerator generator = new BuildScriptGenerator(); 31 32 40 public void setChildren(boolean children) { 41 generator.setChildren(children); 42 } 43 44 49 public void setDevEntries(String devEntries) { 50 generator.setDevEntries(devEntries); 51 } 52 53 58 public void setPluginPath(String pluginPath) { 59 generator.setPluginPath(Utils.getArrayFromString(pluginPath, File.pathSeparator)); 60 } 61 62 67 public void setElements(String elements) { 68 generator.setElements(Utils.getArrayFromString(elements)); 69 } 70 71 public void setSignificantVersionDigits(String significantDigits) { 72 antProperties.put(IBuildPropertiesConstants.PROPERTY_SIGNIFICANT_VERSION_DIGITS, significantDigits); 73 } 74 75 public void setGeneratedVersionLength(String generatedLength) { 76 antProperties.put(IBuildPropertiesConstants.PROPERTY_GENERATED_VERSION_LENGTH, generatedLength); 77 } 78 79 public void execute() throws BuildException { 80 try { 81 run(); 82 } catch (CoreException e) { 83 throw new BuildException(TaskHelper.statusToString(e.getStatus(), null).toString()); 84 } 85 } 86 87 public void run() throws CoreException { 88 generator.setReportResolutionErrors(true); 89 String value = getProject().getProperty(IBuildPropertiesConstants.RESOLVER_DEV_MODE); 90 if (Boolean.valueOf(value).booleanValue()) 91 antProperties.put(IBuildPropertiesConstants.RESOLVER_DEV_MODE, "true"); generator.setImmutableAntProperties(antProperties); 93 BundleHelper.getDefault().setLog(this); 94 generator.generate(); 95 BundleHelper.getDefault().setLog(null); 96 } 97 98 103 public void setBuildDirectory(String buildDirectory) { 104 generator.setWorkingDirectory(buildDirectory); 105 } 106 107 112 public void setInstall(String installLocation) { 113 generator.setWorkingDirectory(installLocation); 114 } 115 116 123 public void setRecursiveGeneration(boolean recursiveGeneration) { 124 generator.setRecursiveGeneration(recursiveGeneration); 125 } 126 127 133 public void setConfigInfo(String configInfo) throws CoreException { 134 AbstractScriptGenerator.setConfigInfo(configInfo); 135 } 136 137 138 144 public void setArchivesFormat(String archivesFormat) throws CoreException { 145 generator.setArchivesFormat(archivesFormat); 146 } 147 148 153 public void setBaseLocation(String baseLocation) { 154 BuildTimeSiteFactory.setInstalledBaseSite(baseLocation); 155 } 156 157 164 public void setBuildingOSGi(boolean osgi) { 165 generator.setBuildingOSGi(osgi); 166 } 167 168 176 public void setWorkingDirectory(String installLocation) { 177 generator.setWorkingDirectory(installLocation); 178 } 179 180 185 public void setProduct(String value) { 186 generator.setProduct(value); 187 } 188 189 193 public void setSignJars(boolean value) { 194 generator.setSignJars(value); 195 } 196 197 202 public void setGenerateJnlp(boolean value) { 203 generator.setGenerateJnlp(value); 204 } 205 206 public void setOutputUpdateJars(boolean value) { 207 AbstractScriptGenerator.setForceUpdateJar(value); 208 } 209 210 public void setForceContextQualifier(String value) { 211 QualifierReplacer.setGlobalQualifier(value); 212 } 213 214 219 public void setGenerateFeatureVersionSuffix(boolean value){ 220 generator.setGenerateFeatureVersionSuffix(value); 221 } 222 223 227 public void setGenerateVersionsLists(boolean value){ 228 generator.setGenerateVersionsList(value); 229 } 230 231 235 public void setGroupConfiguration(boolean value) { 236 generator.setGroupConfigs(value); 237 } 238 239 public void setFilteredDependencyCheck(boolean value) { 240 generator.setFilterState(value); 241 } 242 243 246 public void setPlatformProperties(String filename) { 247 generator.setPlatformProperties(filename); 248 } 249 } 250 | Popular Tags |