1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs.optional.ide;
  18. import java.util.Vector;
  19. import org.apache.tools.ant.BuildException;
  20. /**
  21. * Load project versions into the Visual Age for Java workspace.
  22. * Each project is identified by its name and a version qualifier.
  23. * Allowed qualifiers are:
  24. * <ul>
  25. * <li>Any valid Visual Age version name</li>
  26. * <li>* (loads the latest <b>versioned</b> edition)</li>
  27. * <li>** (loads the latest edition, including open editions)</li>
  28. * </ul>
  29. * Example:
  30. * <blockquote>
  31. * <vajload>
  32. *  <project name="MyVAProject" version="*"/>
  33. *  <project name="Apache Xerces" version="1.2.0"/>
  34. *  <project name="Brand New Stuff" version="**"/>
  35. * </vajload>
  36. * </blockquote>
  37. *
  38. * <p>Parameters:</p>
  39. * <table border="1" cellpadding="2" cellspacing="0">
  40. * <tr>
  41. * <td valign="top"><b>Attribute</b></td>
  42. * <td valign="top"><b>Description</b></td>
  43. * <td align="center" valign="top"><b>Required</b></td>
  44. * </tr>
  45. * <tr>
  46. * <td valign="top">remote</td>
  47. * <td valign="top">remote tool server to run this command against
  48. * (format: <servername> : <port no>)</td>
  49. * <td align="center" valign="top">No</td>
  50. * </tr>
  51. * <tr>
  52. * <td valign="top">haltonerror</td>
  53. * <td valign="top">stop the build process if an error occurs,
  54. * defaults to "yes"</td>
  55. * <td align="center" valign="top">No</td>
  56. * </tr>
  57. * </table>
  58. * </p>
  59. *
  60. */
  61. public class VAJLoad extends VAJTask {
  62. Vector projectDescriptions = new Vector();
  63. /**
  64. * Load specified projects.
  65. */
  66. public void execute() {
  67. try {
  68. getUtil().loadProjects(projectDescriptions);
  69. } catch (BuildException ex) {
  70. if (haltOnError) {
  71. throw ex;
  72. } else {
  73. log(ex.toString());
  74. }
  75. }
  76. }
  77. /**
  78. * Add a project description entry on the project list.
  79. */
  80. public VAJProjectDescription createVAJProject() {
  81. VAJProjectDescription d = new VAJProjectDescription();
  82. projectDescriptions.addElement(d);
  83. return d;
  84. }
  85. }