1 26 27 package org.omg.lifl.eclipse.plugin.project.OpenCCM.utils; 28 29 import java.util.Iterator ; 30 31 import org.apache.tools.ant.types.FilterSet; 32 import org.omg.lifl.eclipse.plugin.project.OpenCCM.ProjectCreationWizardPage; 33 34 41 public class BuildPropertySet { 42 private String ORBName; 43 private String importPath; 44 private String orbPath; 45 private String installOpenCCM; 46 private String transactionPath; 47 private String transactionJar; 48 private String nsPath; 49 private String cppPath; 50 private String javaccPath; 51 private String compilOptionDebug; 53 private String compilOptionDeprecated; 54 private String compilOptionOptimize; 55 56 private static final String undefined = "unused"; 57 58 public BuildPropertySet(ProjectCreationWizardPage page) { 59 if (page.getCvsFSchooser().getCheckGroup().isSubGroupVisible()) 61 importPath = page.getCvsFSchooser().get_CVSsrcFSPathValue(); 62 if (page.getOpenccmConfigChooser().get_ORBpreference().isEnable()) 63 orbPath = 64 page.getOpenccmConfigChooser().get_ORBpreference().get_Name(); 65 ORBName = page.getOpenccmConfigChooser().get_ORBName(); 66 if (page.getOpenccmConfigChooser().get_InstallOpenCCM().isEnable()) 67 installOpenCCM = 68 page.getOpenccmConfigChooser().get_InstallOpenCCM().get_Name(); 69 if (page 70 .getOpenccmConfigChooser() 71 .get_TransactionpreferenceHome() 72 .isEnable()) 73 transactionPath = 74 page 75 .getOpenccmConfigChooser() 76 .get_TransactionpreferenceHome() 77 .get_Name(); 78 if (page 79 .getOpenccmConfigChooser() 80 .get_TransactionpreferenceJar() 81 .isEnable()) 82 transactionJar = 83 page 84 .getOpenccmConfigChooser() 85 .get_TransactionpreferenceJar() 86 .get_Name(); 87 if (page.getOpenccmConfigChooser().get_NSDirPreference().isEnable()) 88 nsPath = 89 page.getOpenccmConfigChooser().get_NSDirPreference().get_Name(); 90 if (page 91 .getOpenccmConfigChooser() 92 .get_PreprocessorPreference() 93 .isEnable()) 94 cppPath = 95 page 96 .getOpenccmConfigChooser() 97 .get_PreprocessorPreference() 98 .get_Name(); 99 if (page.getOpenccmConfigChooser().get_JavaccPreference().isEnable()) 100 javaccPath = 101 page 102 .getOpenccmConfigChooser() 103 .get_JavaccPreference() 104 .get_Name(); 105 if (page 106 .getOpenccmConfigChooser() 107 .get_CompilationOptionDebugPreference() 108 .isEnable()) 109 compilOptionDebug = 110 page 111 .getOpenccmConfigChooser() 112 .get_CompilationOptionDebugPreference() 113 .get_Name(); 114 if (page 115 .getOpenccmConfigChooser() 116 .get_CompilationOptionDeprecationPreference() 117 .isEnable()) 118 compilOptionDeprecated = 119 page 120 .getOpenccmConfigChooser() 121 .get_CompilationOptionDeprecationPreference() 122 .get_Name(); 123 if (page 124 .getOpenccmConfigChooser() 125 .get_CompilationOptionOptimizePreference() 126 .isEnable()) 127 compilOptionOptimize = 128 page 129 .getOpenccmConfigChooser() 130 .get_CompilationOptionOptimizePreference() 131 .get_Name(); 132 } 133 134 public void createFilter( 135 FilterSet fs, 136 String tagTab[], 137 String value[]) { 138 TagGroup tag = new TagGroup(tagTab, value); 139 Iterator it = tag.getTheTags().keySet().iterator(); 140 while (it.hasNext()) { 141 String key = (String ) it.next(); 142 fs.addFilter(key, (String ) tag.getTheTags().get(key)); 143 } 144 } 145 146 147 148 151 public void createOpenCCMFilter(FilterSet fs) { 152 String tagTab[] = 154 { 155 "ORB.NAME", 156 "INSTALL.OPENCCM.DIR", 157 "ORB.HOME.DIR", 158 "NS.HOME.DIR", 159 "OTS.HOME.DIR", 160 "OTS.JAR", 161 "CPP.COMPILER", 162 "JAVACC.DIR", 163 "BUILD.DEBUG", 164 "BUILD.DEPRECATION", 165 "BUILD.OPTIMIZE" }; 166 String value[] = 167 { 168 getValue(this.getORBName()), 169 getValue(this.getInstallOpenCCM()), 170 getValue(this.getOrbPAth()), 171 getValue(this.getNsPath()), 172 getValue(this.getTransactionPath()), 173 getValue(this.getTransactionJar()), 174 getValue(this.getCppPath()), 175 getValue(this.getJavaccPath()), 176 getValue(this.getCompilOptionDebug()), 177 getValue(this.getCompilOptionDeprecated()), 178 getValue(this.getCompilOptionOptimize())}; 179 180 createFilter(fs,tagTab,value); 181 } 182 183 186 public void createClasspathFilter(FilterSet fs) { 187 String tagTab[] = 189 { 190 "ORB.HOME.DIR", 191 "NS.HOME.DIR", 192 "OTS.HOME.DIR", 193 "OTS.JAR", 194 "JAVACC.DIR"}; 195 String value[] = 196 { 197 getValue(this.getOrbPAth()), 198 getValue(this.getNsPath()), 199 getValue(this.getTransactionPath()), 200 getValue(this.getTransactionJar()), 201 getValue(this.getJavaccPath())}; 202 203 createFilter(fs,tagTab,value); 204 } 205 206 210 public String showDebug(boolean show) { 211 if (show) { 212 return "generate build.properties with this parameter :\n" 213 + "import :" 214 + getValue(this.getImportPath()) 215 + "\n" 216 + "ORB directory :" 217 + getValue(this.getOrbPAth()) 218 + "\n" 219 + "OpenCCM install dir :" 220 + getValue(this.getInstallOpenCCM()) 221 + "\n" 222 + "Transaction directory :" 223 + getValue(this.getTransactionPath()) 224 + "\n" 225 + "Transaction Jar dir :" 226 + getValue(this.getTransactionJar()) 227 + "\n" 228 + "NS home directory :" 229 + getValue(this.getNsPath()) 230 + "\n" 231 + "CPP directory :" 232 + getValue(this.getCppPath()) 233 + "\n" 234 + "JavaCC home dir :" 235 + getValue(this.getJavaccPath()) 236 + "\n" 237 + "Compil Opt Debug :" 238 + getValue(this.getCompilOptionDebug()) 239 + "\n" 240 + "Compil Opt Deprecated :" 241 + getValue(this.getCompilOptionDeprecated()) 242 + "\n" 243 + "Compil Opt Optimize :" 244 + getValue(this.getCompilOptionOptimize()); 245 } else 246 return "don't generate build.properties"; 247 } 248 249 252 private String getValue(String value) { 253 return ((value != null && value.compareTo("") != 0) ? value : "unused"); 254 } 255 256 259 public String getCompilOptionDebug() { 260 return compilOptionDebug; 261 } 262 263 266 public String getCompilOptionDeprecated() { 267 return compilOptionDeprecated; 268 } 269 270 273 public String getCompilOptionOptimize() { 274 return compilOptionOptimize; 275 } 276 277 280 public String getCppPath() { 281 return cppPath; 282 } 283 284 287 public String getImportPath() { 288 return importPath; 289 } 290 291 294 public String getJavaccPath() { 295 return javaccPath; 296 } 297 298 301 public String getNsPath() { 302 return nsPath; 303 } 304 305 308 public String getOrbPAth() { 309 return orbPath; 310 } 311 312 315 public String getTransactionJar() { 316 return transactionJar; 317 } 318 319 322 public String getTransactionPath() { 323 return transactionPath; 324 } 325 326 329 public void setCompilOptionDebug(String string) { 330 compilOptionDebug = string; 331 } 332 333 336 public void setCompilOptionDeprecated(String string) { 337 compilOptionDeprecated = string; 338 } 339 340 343 public void setCompilOptionOptimize(String string) { 344 compilOptionOptimize = string; 345 } 346 347 350 public void setCppPath(String string) { 351 cppPath = string; 352 } 353 354 357 public void setImportPath(String string) { 358 importPath = string; 359 } 360 361 364 public void setJavaccPath(String string) { 365 javaccPath = string; 366 } 367 368 371 public void setNsPath(String string) { 372 nsPath = string; 373 } 374 375 378 public void setOrbPAth(String string) { 379 orbPath = string; 380 } 381 382 385 public void setTransactionJar(String string) { 386 transactionJar = string; 387 } 388 389 392 public void setTransactionPath(String string) { 393 transactionPath = string; 394 } 395 396 399 public String getInstallOpenCCM() { 400 return installOpenCCM; 401 } 402 403 406 public void setInstallOpenCCM(String string) { 407 installOpenCCM = string; 408 } 409 410 413 public String getORBName() { 414 return ORBName; 415 } 416 417 420 public void setORBName(String string) { 421 ORBName = string; 422 } 423 424 } 425 | Popular Tags |