<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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><link href="builder.html">Build instructions</link>:
    &lt;ant&gt;, &lt;nant&gt;, &lt;mvn1&gt;, &lt;mvn2&gt;, &lt;mvn3&gt;,
    &lt;gradle&gt;, &lt;script&gt;, &lt;configure&gt;, &lt;make&gt; and &lt;msbuild&gt;.<br/>
    Describes how to produce the outputs from the inputs.
    See also &lt;delete&gt; and &lt;mkdir&gt; below.
    </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;, &lt;license&gt;, &lt;output&gt;, &lt;jar&gt; and &lt;pom&gt;.  Describes where to locate
    the output files.</li>
    </ul>

    <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="builder.html#ant">ant</link> target to be used.</td>
        <td>No</td>
      </tr>
      <tr>
        <td>buildfile</td>
        <td>Override the <link href="builder.html#ant">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>
      <tr>
        <td>groupId</td>
        <td>mvn groupId for artifacts built by this project.</td>
        <td>No, inherits the value from the containing module.</td>
      </tr>
    </table>

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

  </section>

  <section><title>Inputs</title>

    <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>
	  
	  <note>See <link href="builder.html#depend">here</link> for a &lt;depend&gt; within a builder, e.g. Ant.</note>

      <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>

      <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>

  <section><title>Outputs</title>

    <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>output</title>
      <p>The name of something a project creates.  This is a generic
        element and there are specialized elements for jars and POMs
        for example.</p>

      <p>Each output must have a type attribute and may have an id
        attribute.  ids must be unique among all outputs of the same
        type.</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>name</td>
          <td>The file name of the output.<br/>
            May contain shell glob patterns
            (<code>*</code>, <code>?</code> or ranges
            like <code>[a-z]</code>) in which case the pattern must
            match exactly one existing file.  The path is relative to
            the project's home-directory if it has been defined.</td>
          <td>Yes</td>
        </tr>
        <tr>
          <td>id</td>
          <td>Provides a unique id which can be used to provide selection
          between multiple output definitions of the same type.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>type</td>
          <td>One of "jar", "pom", "boot" (a jar that should be added
          to the bootclasspath), "testsjar" or "assembly".</td>
          <td>Yes</td>
        </tr>
      </table>
    </section>

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

      <p>This is a shortcut for an output element with type="jar".</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>name</td>
          <td>The name of the jar.<br/>
            May contain shell glob patterns
            (<code>*</code>, <code>?</code> or ranges
            like <code>[a-z]</code>) in which case the pattern must
            match exactly one existing file.</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, defaults to "jar"</td>
        </tr>
      </table>
    </section>

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

      <p>This is a shortcut for an output element with type="pom".</p>

      <table>
        <tr>
          <th>Attribute</th>
          <th>Description</th>
          <th>Required?</th>
        </tr>
        <tr>
          <td>name</td>
          <td>The name of the POM.<br/>
            May contain shell glob patterns
            (<code>*</code>, <code>?</code> or ranges
            like <code>[a-z]</code>) in which case the pattern must
            match exactly one existing file.</td>
          <td>Yes</td>
        </tr>
        <tr>
          <td>id</td>
          <td>Provides a unique id which can be used to provide selection
          between multiple poms definitions.</td>
          <td>No</td>
        </tr>
        <tr>
          <td>type</td>
          <td>Same as output's type attribute.</td>
          <td>No, defaults to "pom".</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>

  <section><title>Other</title>

    <section><title>report</title>
      <p>This declares where any sort of report - for example
        the outputs of the
      <link href="https://ant.apache.org/manual/Tasks/junitreport.html">junitreport</link>
      tool - are placed.</p>
   
      <p>The name <code>junitreport</code> can be used as a synonym
      for <code>report</code>.</p>

      <p>
        Apache Gump takes the nested and parent references as a directory
        reference, and lists the contents of the files in that
        directory.
      </p>
  	
      <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 <link href="site:nagged">email reports</link> 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.</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.</td>
        </tr>
      </table>
      
      <p>A build failure is detected by the exit code of the builder.</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, unless <em>file</em> is specified.</td>
        </tr>
        <tr>
          <td>file</td>
          <td>The file to delete, relative to srcdir of the
          module containing this project.</td>
          <td>Yes, unless <em>dir</em> is specified</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>

