You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BuildSpec.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC),
  4. * 2005 Contributors.
  5. * All rights reserved.
  6. * This program and the accompanying materials are made available
  7. * under the terms of the Eclipse Public License v1.0
  8. * which accompanies this distribution and is available at
  9. * http://www.eclipse.org/legal/epl-v10.html
  10. *
  11. * Contributors:
  12. * Xerox/PARC initial implementation
  13. * ******************************************************************/
  14. package org.aspectj.internal.tools.build;
  15. import java.io.File;
  16. /**
  17. * Open struct for specifying builds for both modules and products.
  18. * Separated from bulder to permit this to build many modules
  19. * concurrently.
  20. */
  21. public class BuildSpec {
  22. public static final String DEFAULT_VERSION = "DEVELOPMENT";
  23. // shared
  24. public File baseDir;
  25. public File moduleDir;
  26. public File jarDir;
  27. public File tempDir;
  28. public File stagingDir;
  29. public String buildConfig;
  30. public String version;
  31. public boolean rebuild;
  32. public boolean trimTesting;
  33. public boolean assembleAll;
  34. public boolean failonerror;
  35. public boolean verbose;
  36. // building products
  37. public File productDir;
  38. public boolean createInstaller;
  39. public File distDir;
  40. // building modules
  41. public String module;
  42. public BuildSpec() {
  43. version = DEFAULT_VERSION;
  44. }
  45. public boolean isProduct() {
  46. return (Util.canReadDir(productDir));
  47. }
  48. public boolean isModule() {
  49. return (!isProduct() && Util.canReadDir(moduleDir));
  50. }
  51. public boolean isValid() {
  52. return (isProduct() || isModule());
  53. }
  54. public String toString() {
  55. if (null != productDir) {
  56. return "product " + productDir.getName();
  57. } else if (null != moduleDir) {
  58. return "module " + moduleDir.getName();
  59. } else {
  60. return "<bad BuildSpec - "
  61. + " baseDir=" + baseDir
  62. + " jarDir=" + jarDir
  63. + " buildConfig=" + buildConfig
  64. + " module=" + module
  65. + ">";
  66. }
  67. }
  68. }