User: user57  
  Date: 02/02/27 22:47:42

  Added:       tasks/src/main/org/jboss/tools/buildmagic/task/module
                        ModuleInit.java
  Log:
   o Added ModuleLibrary, a minor hack of Library to reuse Library+
     LibrarySet functionality for module classpath config
   o Added ModuleInit
  
  Revision  Changes    Path
  1.1                  
buildmagic/tasks/src/main/org/jboss/tools/buildmagic/task/module/ModuleInit.java
  
  Index: ModuleInit.java
  ===================================================================
  /***************************************
   *                                     *
   *  JBoss: The OpenSource J2EE WebOS   *
   *                                     *
   *  Distributable under LGPL license.  *
   *  See terms of license at gnu.org.   *
   *                                     *
   ***************************************/
  
  package org.jboss.tools.buildmagic.task.module;
  
  import org.apache.tools.ant.Task;
  import org.apache.tools.ant.BuildException;
  
  import org.jboss.tools.buildmagic.task.MissingAttributeException;
  import org.jboss.tools.buildmagic.task.MissingElementException;
  import org.jboss.tools.buildmagic.task.util.TaskLogger;
  
  /**
   * A helper for initializing a modules environment.
   *
   * <p>Usage:
   * <xmp>
   *
   *
   *
   * </xmp>
   *
   * @version <tt>$Revision: 1.1 $</tt>
   * @author  <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
   */
  public class ModuleInit
     extends Task 
  {
     /** Instance logger. */
     protected final TaskLogger log = new TaskLogger(this);
  
     protected String name;
     protected String title;
     protected String version;
  
     public void setName(final String name)
     {
        this.name = name;
     }
  
     public void setTitle(final String title)
     {
        this.title = title;
     }
  
     public void setVersion(final String version)
     {
        this.version = version;
     }
  
     /**
      * Validate the attributes for this task.
      *
      * @throws BuildException    Attributes are not valid.
      */
     protected void validate() throws BuildException 
     {
        if (name == null)
           throw new MissingAttributeException("name", this);
     }
  
     /**
      * Execute the task.
      *
      * @throws BuildException    Failed to execute.
      */
     public void execute() throws BuildException 
     {
        validate();
  
        project.setProperty("module.name", name);
        log.debug("name: " + name);
  
        if (title == null) {
           title = name;
        }
        project.setProperty("module.title", name);
        project.setProperty("module.Name", name); // deprecated
        log.debug("title: " + title);
  
        if (version == null) {
           version = "DEV";
        }
        project.setProperty("module.version", name);
        log.debug("version: " + version);
     }
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to