<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Copyright 2003-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd">
<document>

  <header>    
    <title>GOM :  Project</title>
  	<authors>
  		<person name="Sam Ruby" email="rubys@us.ibm.com"/>
  		<person name="Adam R. B. Jack" email="ajack@apache.org"/>
  	</authors>
  </header>


<body>
  <section><title>project</title>
    <p>A project is the atomic unit of integration.  It can describe an
    installable package or a buildable product.  The nested elements of
    a project definition fall into three different "groups", each optional:</p>

    <ul>
    <li>Build instructions: &lt;ant&gt; and &lt;script&gt;.  Describes how to
    produce the outputs from the inputs.</li>
    <li>Inputs: &lt;depend&gt;, &lt;option&gt;, and &lt;work&gt;.  Describes
    where to find the inputs (primarily jar files, but can be directories and
    files).</li>
    <li>Outputs: &lt;home&gt; and &lt;jar&gt;.  Describes where to locate
    the output files.</li>
    </ul>

    <p>Note that &lt;depend&gt; elements nested within &lt;ant&gt;
    elements are precisely equivalent to specifying both a property to be
    passed to Ant, as well as a separate depend element.</p>

    <table>
      <tr>
        <th>Attribute</th>
        <th>Description</th>
        <th>Required?</th>
      </tr>
      <tr>
        <td>name</td>
        <td>The name of the project.</td>
        <td>Yes</td>
      </tr>
      <tr>
        <td>target</td>
        <td>Override the <link href="ant.html">ant</link> target to be used.</td>
        <td>No</td>
      </tr>
      <tr>
        <td>buildfile</td>
        <td>Override the <link href="ant.html">ant</link> build file to be used.</td>
        <td>No</td>
      </tr>
      <tr>
        <td>basedir</td>
        <td>Override the base directory used for the ant build file.</td>
        <td>No</td>
      </tr>
      <tr>
        <td>vm</td>
        <td>Override the Java Virtual Machine version expected to be used.</td>
        <td>No</td>
      </tr>
    </table>

    <warning>vm is not currently implemented</warning>

    <section><title>ant</title>
      <p>Identifies this project as "buildable", and specifies the
      target to build and the properties to be passed to ant.  The full
      description of this XML element can be found
      <link href="ant.html">here</link></p>

      <p><link href="http://ant.apache.org/">Apache Ant</link> is the
      defacto build tool used by a large number of Open Source Java
      projects.</p>
    </section>

    <section><title>script</title>
      <p>Identifies this project as "buildable", and specifies the
      script to be executed in order to make this happen.  The assumption
      is that the script can be invoked in a platform independent manner,
      though the contents of the script may be platform specific.
      Specifically, if the name of the script is "name", it will be
      invoked as follows:</p>

      <p>At the present time, the only use of this is during the bootstrap
      process for Ant.</p>

      <ul>
        <li>On Windows/batch, "call .\name.bat"</li>
        <li>On Unix/bash, "./name.sh"</li>
      </ul>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>name</td>
          <td>The name of the script to execute.</td>
          <td>Yes</td>
        </tr>
      </table>
    </section>

    <section><title>depend</title>
      <p>Specifies the name of a required prerequisite project.  If a
      definition for that project is not found in the workspace, the
      generation will fail.</p>

      <p>For a build "all", the invocation of ant or the script is bypassed
      if any of the outputs of the specified project can not be found.</p>

      <p>For both script and ant based builds, any jars defined by the
      specified project as outputs are added to the CLASSPATH prior to
      invoking the build operation, unless you nest a
      &lt;noclasspath&gt; element into the &lt;depend&gt; element.</p>

	<warning>
          <link href="../python/index.html">Python Gump</link> does
          NOT (currently) support the &lt;noclasspath&gt; feature.
  	</warning>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>project</td>
          <td>The name of the project depended on.</td>
          <td>Yes</td>
        </tr>
        <tr>
          <td>inherit</td>
          <td>Specifies whether dependendencies of this dependency are to be
          inherited.  Default is "none".  Other choices are "all" which will
          copy all dependencies as, "runtime" which will only copy the runtime
          dependencies, and "hard" which will not only copy all
          dependencies, but will also convert option elements into depend
          elements in the process, and "jars" which will actually copy the
          dependent jars into the list of jars exported by this project.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>runtime</td>
          <td>Specifies whether this dependency is needed at runtime.
          Choices are "true" and "false" with the default being false.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>ids</td>
          <td>Space separated list of <link href="#jarid">id</link>s for the
          jars this project depends on.  Can be used if only a
          subset of all jars is needed.  If ommitted, all jars of the
          referenced project will be used.</td>
          <td>No</td>
        </tr>
      </table>
    </section>

    <section><title>option</title>
      <p>Specifies the name of an optional prerequisite project.  If a
      definition for that project is not found in the workspace, the
      dependency is ignored.</p>

      <p>For both script and ant based builds, any jars defined by the
      specified project as outputs are added to the CLASSPATH prior to
      invoking the build operation, unless you nest a
      &lt;noclasspath&gt; element into the &lt;option&gt; element.  If
      the files are not present, this will have little effect.</p>

	<warning>
          <link href="../python/index.html">Python Gump</link> does
          NOT (currently) support the &lt;noclasspath&gt; feature.
  	</warning>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>project</td>
          <td>The name of the project depended on.</td>
          <td>Yes</td>
        </tr>
        <tr>
          <td>inherit</td>
          <td>Specifies whether dependendencies of this dependency are to be
          inherited.  Default is "none".  Other choices are "all" which will
          copy all dependencies as, "runtime" which will only copy the runtime
          dependencies, and "hard" which will not only copy all
          dependencies, but will also convert option elements into depend
          elements in the process.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>runtime</td>
          <td>Specifies whether this dependency is needed at runtime.
          Choices are "true" and "false" with the default being false.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>ids</td>
          <td>Space separated list of <link href="#jarid">id</link>s for the
          jars this project depends on.  Can be used if only a
          subset of all jars is needed.  If ommitted, all jars of the
          referenced project will be used.</td>
          <td>No</td>
        </tr>
      </table>
    </section>

    <section><title>work</title>
      <p>Adds a directory or a file to the class path.  This is to allow
      projects which have compilation dependencies on byproducts of the build
      (e.g., tests which import the project itself).  This is necessary when
      using the Ant build.sysclasspath="ignore".</p>

      <p>If the directory is not present prior to the build, some VMs
      may drop it from the CLASSPATH.  If this happens, use a <link
      href="#mkdir">&lt;mkdir&gt;</link> element to create it before
      building the project.</p>

      <p>If this directory is deleted during the course of the build,
      the behavior of the JVM may become unpredictable.  The same is
      true if the element points to a jar file and that file is
      modified during the build.</p>

      <p>If neither the parent nor the nested attributes are present, then
      the srcdir for the module is added to the classpath.</p>

      <p>Note that the entries specified by &lt;work&gt; elements are
      prepended to the class path.  If a class can be found both in a
      &lt;work&gt; entry and a jar refered to by &lt;depend&gt;, the
      one from the &lt;work&gt; entry will be loaded.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>parent</td>
          <td>Name of a directory or file, relative to the base directory
          of the workspace.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>nested</td>
          <td>Name of a directory or file, relative to the srcdir of the module
          containing this project.</td>
          <td>No</td>
        </tr>
      </table>
    </section>

    <section><title>home</title>
      <p>The home directory for a project is the directory which contains the
      files referenceable by another project.  In many cases, it is possible
      for another project element by the same name (see the
      <link href="index.html">overview</link>) to extend a project definition
      for an installable package in such a way that the result actually builds
      the project.</p>

      <p>A home attribute on a project definition will override this value.</p>

      <p>A package attribute on a project will provide a default for this
      value.  Such a default would be relative to the workspace pkgdir</p>

      <p>If none of these attributes or elements, the default value is
      the srcdir for the module.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>parent</td>
          <td>Name of a directory or file, relative to the base directory
          of the workspace.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>nested</td>
          <td>Name of a directory or file, relative to the srcdir of the module
          containing this project.</td>
          <td>No</td>
        </tr>
      </table>
    </section>

    <section><title>license</title>
      <p>The filename of the license, relative to the src directory.
      This file will accompany any redistributable jars.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>name</td>
	  <td>The filename of the license file</td>
          <td>Yes</td>
        </tr>
      </table>
    </section>

    <section><title>jar</title>
      <p>The name of an output jar, relative to the home directory.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>name</td>
          <td>The name of the jar</td>
          <td>Yes</td>
        </tr>
        <tr>
          <td>id</td>
          <td>Provides a unique id which can be used to provide selection
          between multiple jars definitions.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>type</td>
          <td>If the value of this attribute is "boot" then the jar is
          prepended to the bootclasspath instead of being appended to the 
          classpath.  This attribute is ignored unless bootclass="yes"
          is specified on the <link href="workspace.html">workspace</link>.</td>
          <td>No</td>
        </tr>
      </table>
    </section>

    <section><title>javadoc</title>
      <p>This declares where the outputs of the
      <link href="http://java.sun.com/j2se/javadoc/index.html">javadoc</link> tool
      outputs are placed.  This option only has any meaning if the
      <link href="workspace.html#javadoc">&lt;javadoc&gt;</link> element is present
      in the workspace definition.</p>

	<warning>
    <link href="../python/index.html">Python Gump</link> does NOT (currently) support
    this feature.
  	</warning>
  	
      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>nested</td>
          <td>Name of a directory or file, relative to the srcdir of
          the module containing this project. <strong>Note that this
          ignores any</strong> <link href="#home">&lt;home&gt;</link>
          <strong>settings.</strong></td>
          <td>No</td>
        </tr>
        <tr>
          <td>parent</td>
          <td>Name of a directory or file, relative to the base directory
          of the workspace.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>project</td>
          <td>Label to use in the javadoc listing (see below). Default
          is the name of the project.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>module</td>
          <td>Make the entry for this project in the javadoc listing
          (see below) appear under the named module instead of the
          enclosing module.</td>
          <td>No</td>
        </tr>
      </table>

      <p>&lt;javadoc&gt; supports a nested &lt;description&gt;
      element, which can be used to set the title in the javadoc
      listing.  If no &lt;description&gt; element has been specified,
      the title defaults to the description of the
      project. &lt;description&gt; itself only supports nested
      text and an optional dir attribute.</p>

      <p>The &lt;javadoc&gt; elements of all projects are used to
      create two pages, &quot;javadoc.html&quot; (like 
      <link href="http://nagoya.apache.org/~rubys/gump/javadoc.html">this</link>)
      and &quot;nojavadoc.html&quot; (like 
      <link href="http://nagoya.apache.org/~rubys/gump/nojavadoc.html">this</link>)
      listing the available sets of documentation and the modules
      without documentation.</p>

      <p>There are three different layouts a &lt;javadoc&gt; element
      may create in the javadoc listing &quot;javadoc.html&quot;:</p>

      <ol>
        <li>This is the only &lt;javadoc&gt; element associated with
        the module, the result will look like<br/><br/>
        <link href="#">label</link> - description<br/><br/></li>

        <li>There are several &lt;javadoc&gt; elements associated with
        the module, their labels are different from the name of the
        module - the result will look like<br/><br/>
        <strong>name of the module</strong> - description of the module
        <br/>
            <link href="#">label</link> - description<br/>
            <link href="#">label2</link> - description2<br/>
        </li>

        <li>There are several &lt;javadoc&gt; elements associated with
        the module, their labels are all the same as the name of the
        module - the result will look like<br/><br/>
        <strong>name of the module</strong> - description of the module
        <br/>
            <link href="#">description</link><br/>
            <link href="#">description2</link><br/>
        </li>

      </ol>

      <p><em>label</em> in this lists will be created from the project
      attribute and <em>description</em> from the description child
      element of &lt;javadoc&gt;</p>

      <p>If a given project wants to publish more than one javadoc
      set, multiple &lt;description&gt; elements like in</p>

      <source>
    &lt;javadoc nested=&quot;java/build/docs/javadocs&quot; project=&quot;xml-xerces2&quot;&gt;
      &lt;description dir=&quot;api&quot;&gt;XML Standard API&lt;/description&gt;
      &lt;description dir=&quot;xni&quot;&gt;Xerces Native Interface&lt;/description&gt;
      &lt;description dir=&quot;xerces&quot;&gt;Xerces2 Implementation&lt;/description&gt;
      &lt;description dir=&quot;other&quot;&gt;Other Classes&lt;/description&gt;
    &lt;/javadoc&gt;
		</source>

      <p>must be used.</p>

    </section>

    <section><title>junitreport</title>
      <p>This declares where the outputs of the
      <link href="http://ant.apache.org/manual/OptionalTasks/junitreport.html">junitreport</link>
      tool outputs are placed.  This option only has any meaning if the
      <link href="workspace.html#junitreport">&lt;junitreport&gt;</link> element
      is present in the workspace definition.</p>
   
	<warning>
    <link href="../python/index.html">Python Gump</link> only takes the nested and parent 
    references as a directory reference, and lists the contents of the files in that
    directory. It does this irrespective of any entry in the workspace.
  	</warning>
  	
      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>nested</td>
          <td>Name of a directory or file, relative to the srcdir of
          the module containing this project. <strong>Note that this
          ignores any</strong> <link href="#home">&lt;home&gt;</link>
          <strong>settings.</strong></td>
          <td>No</td>
        </tr>
        <tr>
          <td>parent</td>
          <td>Name of a directory or file, relative to the base directory
          of the workspace.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>project</td>
          <td>Label to use in the junitreport listing (see below).
          Default is the name of the project.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>module</td>
          <td>Make the entry for this project in the junitreport listing
          (see below) appear under the named module instead of the
          enclosing module.</td>
          <td>No</td>
        </tr>
      </table>

      <p>&lt;junitreport&gt; supports a nested &lt;description&gt;
      element, which can be used to set the title in the junitreport
      listing.  If no &lt;description&gt; element has been specified,
      the title defaults to the description of the
      project. &lt;description&gt; itself only supports nested
      text and an optional dir attribute.</p>

      <p>The &lt;junitreport&gt; elements of all projects are used to
      create a single page, &quot;junitreport.html&quot; (like 
      <link href="http://lsd.student.utwente.nl/gump/junitreport.html">this</link>)
      listing the available sets of junit reports.</p>

      <p>There are three different layouts a &lt;junitreport&gt; element
      may create in the junitreport listing &quot;junitreport.html&quot;:</p>

      <ol>
        <li>This is the only &lt;junitreport&gt; element associated with
        the module, the result will look like<br/><br/>
        <link href="#">label</link> - description<br/><br/></li>

        <li>There are several &lt;junitreport&gt; elements associated with
        the module, their labels are different from the name of the
        module - the result will look like<br/><br/>
        <strong>name of the module</strong> - description of the module
        <br/>
            <link href="#">label</link> - description<br/>
            <link href="#">label2</link> - description2<br/>
        </li>

        <li>There are several &lt;junitreport&gt; elements associated with
        the module, their labels are all the same as the name of the
        module - the result will look like<br/><br/>
        <strong>name of the module</strong> - description of the module
        <br/>
            <link href="#">description</link><br/>
            <link href="#">description2</link><br/>
        </li>

      </ol>

      <p><em>label</em> in this lists will be created from the project
      attribute and <em>description</em> from the description child
      element of &lt;junitreport&gt;</p>

      <p>If a given project wants to publish more than one junitreport
      set, multiple &lt;description&gt; elements like in</p>

      <source>
    &lt;junitreport nested=&quot;java/build/docs/reports&quot; project=&quot;xml-xerces2&quot;&gt;
      &lt;description dir=&quot;api&quot;&gt;XML Standard API&lt;/description&gt;
      &lt;description dir=&quot;xni&quot;&gt;Xerces Native Interface&lt;/description&gt;
      &lt;description dir=&quot;xerces&quot;&gt;Xerces2 Implementation&lt;/description&gt;
      &lt;description dir=&quot;other&quot;&gt;Other Classes&lt;/description&gt;
    &lt;/junitreport&gt;
		</source>

      <p>must be used.</p>

    </section>

    <section><title>nag</title>
      <p>If this element is present, an entry for this project will be
      created in the file naglist.  This enables email reports of
      build failures.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>subject</td>
          <td>value for the Subject header of the mail report.
          Defaults to &quot;Build Failure - &quot; and the name of the
          project.  Will be prefixed by the prefix defined in the <link
          href="workspace.html#nag">workspace</link>.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>from</td>
          <td>Sender address for the email report.</td>
          <td>Yes, unless there is a &quot;from&quot; attribute in
          each nested regexp element.</td>
        </tr>
        <tr>
          <td>to</td>
          <td>Recipient of the email report.  Will be overridden by a
          &quot;to&quot; attribute in the 
          <link href="workspace.html#nag">workspace</link>.</td>
          <td>Yes, unless there is a &quot;to&quot; attribute in each
          nested regexp element.</td>
        </tr>
      </table>
      
	<warning>
    <link href="../python/index.html">Python Gump</link> does not use regular expressions,
    it soley relies upon the exit code of the called builder or script.
  	</warning>
  	
      <p>A build failure is detected by matching the output of the
      build against Perl regular expressions, the default expression
      is <code>/BUILD FAILED/i</code>.  The regular expressions are
      specified using nested regexp elements - you can associate
      different email addresses and subjects with each expression.</p>

      <p>The regexp element supports the same attributes as the nag
      element with an additional (required) pattern attribute.  This
      attribute specifies the Perl regular expression to be used when
      looking for a build failure.</p>

      <p>The nag element itself can be used to set default values for
      nested child elements:</p>

      <source>
&lt;nag from=&quot;from@example.org&quot; to=&quot;to@example.org&quot; /&gt;
</source>

      <p>is a short-cut for</p>

      <source>
&lt;nag&gt;
  &lt;regexp pattern=&quot;/BUILD FAILED/i&quot;
          from=&quot;from@example.org&quot; 
          to=&quot;to@example.org&quot; 
          subject=&quot;Build Failure - @name of project element@&quot;/&gt;
&lt;/nag&gt;
</source>

       <p>
         Multiple <code>regexp</code> elements may be specified. The
         first pattern that matches will be the one used to send the
         nag email.
       </p>
       
       <p>
         To send email on success or failure, you could use:
       </p>
      <source>
&lt;nag&gt;
  &lt;!-- pattern default is /BUILD FAILED/i --&gt;
  &lt;regexp from=&quot;from@example.org&quot; 
          to=&quot;to@example.org&quot; 
          subject=&quot;Build Failure - @name of project element@&quot;/&gt;
  &lt;regexp pattern=&quot;/BUILD SUCCCESSFUL/&quot;
          from=&quot;from@example.org&quot; 
          to=&quot;to@example.org&quot; 
          subject=&quot;Gump Build Success - @name of project element@&quot;/&gt;
&lt;/nag&gt;
</source>
      <p>
        You may want to nag on deprecation if you are particularly
        sensitive to a given dependency. The nag for that would
        look like this:
      </p>
      <source>
&lt;nag&gt;
  &lt;!-- pattern default is /BUILD FAILED/i --&gt;
  &lt;regexp from=&quot;from@example.org&quot; 
          to=&quot;to@example.org&quot; 
          subject=&quot;Build Failure - @name of project element@&quot;/&gt;
  &lt;regexp pattern=&quot;/deprecat/&quot;
          from=&quot;from@example.org&quot; 
          to=&quot;to@example.org&quot; 
          subject=&quot;Gump Build Warning - Deprecated methods used&quot;/&gt;
&lt;/nag&gt;
	</source>
    </section>

    <section><title>redistributable</title>
      <p>If present, indicates that outputs of builds from this module
      are redistributable.  Defaults to the redistributable value for
      the repository.</p>
    </section>

    <section><title>mkdir</title>

      <p>Creates a directory before starting the build.  This is
      sometimes needed in conjunction with <link
      href="#work">&lt;work&gt;</link>.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>dir</td>
          <td>The directory to create, relative to srcdir of the
          module containing this project.</td>
          <td>Yes</td>
        </tr>
      </table>
    </section>

    <section><title>delete</title>

      <p>Deletes a directory before starting the build.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>dir</td>
          <td>The directory to create, relative to srcdir of the
          module containing this project.</td>
          <td>Yes</td>
        </tr>
      </table>
    </section>
  </section>
</body>
</document>

