diff --git a/build.xml b/build.xml index 1d89bea2d..ec7daff90 100644 --- a/build.xml +++ b/build.xml @@ -20,12 +20,12 @@ - - + + - + @@ -41,11 +41,12 @@ - @@ -53,9 +54,9 @@ - @@ -69,7 +70,7 @@ - + @@ -99,7 +100,7 @@ - + @@ -107,7 +108,7 @@ - + @@ -127,7 +128,7 @@ - + @@ -142,7 +143,9 @@ - + + + @@ -151,13 +154,13 @@ - + - + diff --git a/docs/index.html b/docs/index.html index c44f28f48..e731343c7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,8 +2,6 @@ - - Ant @@ -17,7 +15,7 @@
  • Arnout J. Kuiper (ajkuiper@wxs.nl)
  • Stefano Mazzocchi (stefano@apache.org)
  • -

    Version 1.0.3 - 2000/02/06

    +

    Version 1.0.4 - 2000/02/10


    Table of Contents

      @@ -228,10 +226,12 @@ the compile target. Ant resolves all these dependencies.

      Ant tries to execute the targets in the depends attribute in the order they appear (from left to right). Keep in mind that it is possible that a target can get executed earlier when an earlier target depends on it:

      +
      <target name="A"/>
       <target name="B" depends="A"/>
       <target name="C" depends="B"/>
       <target name="D" depends="C,B,A"/>
      +

      Suppose we want to execute target D. From its depends attribute, you might think that first target C, then B and then A is executed. Wrong! C depends on B, and B depends on A, so first A is executed, then B, then C, and finally D.

      @@ -239,6 +239,15 @@ on B, and B depends on A, so first A is executed, then B, then C, and finally D. targets in the depends attributes.

      A target gets executed only once. Even when more targets depend on it (see the previous example).

      +

      A target has also the ability to perform its execution if a property has been +set. This allows, for example, better control on the building process depending +on the state of the system (java version, OS, command line properties, etc...). +To make target sense this property you should add the if attribute +with the name of the property that the target should react to, for example

      +
      +
      <target name="build-module-A" if="module-A-present"/>
      +
      +

      If no if attribute is present, the target will always be executed.

      A target has the following attributes:

      @@ -257,6 +266,12 @@ the previous example).

      target depends. + + + + +
      No
      ifthe name of the property that must be set in order for this + target to execute.No

      Tasks

      A task is a piece of code that can be executed.

      @@ -403,6 +418,7 @@ but excludes all "*.gif" files from the copy.

      Built in tasks

      • Ant
      • +
      • Available
      • Chmod
      • Copydir
      • Copyfile
      • @@ -423,6 +439,7 @@ but excludes all "*.gif" files from the copy.

      • Property
      • Replace
      • Rmic
      • +
      • Tar
      • Taskdef
      • Tstamp
      • Zip
      • @@ -468,6 +485,45 @@ These properties will override the properties that are set in the new project.

        <ant dir="subproject" />


        +

        Available

        +

        Description

        +

        Sets a property is a resource is available at runtime. This resource can be a +file resource, a class in classpath or a JVM system resource.

        +

        The value part of the properties being set is true if the resource is +present, otherwise, the property is not set.

        +

        Normally, this task is used to set properties that are useful to avoid target +execution depending on system parameters.

        +

        Parameters

        + + + + + + + + + + + + + + + + + + + + + + + + +
        AttributeDescriptionRequired
        namethe name of the property to set.Yes
        classthe class to look for in classpath.Yes
        resourcethe resource to look for in the JVM
        filethe file to look for.
        +

        Examples

        +
          <available class="org.whatever.Myclass" property="Myclass.present" />
        +

        sets the property Myclass.present to the value "true" +if the org.whatever.Myclass is found in Ant's classpath.

        +

        Chmod

        Description

        Changes the permissions of a file. Right now it has efect only under Unix. @@ -1504,22 +1560,20 @@ This also holds for properties loaded from a property file.

        name the name of the property to set. - No + Yes value the value of the property. - No + Yes resource the resource name of the property file. - No file the filename of the property file . - No

        Examples

        @@ -1588,6 +1642,83 @@ This also holds for properties loaded from a property file.

        runs the rmic compiler for the class com.xyz.FooBar. The compiled files will be stored in the directory ${build}/classes.


        +

        Tar

        +

        Description

        +

        Creates a tar archive.

        +

        The basedir attribute is the reference directory from where to tar.

        +

        It is possible to refine the set of files that are being tarred. This can be +done with the includes, excludes and defaultexcludes +attributes. With the includes attribute you specify the files you want to +have included by using patterns. The exclude attribute is used to specify +the files you want to have excluded. This is also done with patterns. And +finally with the defaultexcludes attribute, you can specify whether you +want to use default exclusions or not. See the section on directory based tasks, on how the +inclusion/exclusion of files works, and how to write patterns. The patterns are +relative to the basedir directory.

        +

        The includes, excludes and defaultexcludes attributes +replace the items and ignore attributes. The following explains +how the deprecated items and ignore attribute behave.

        +

        When "*" is used for items, all files in the basedir, and +its subdirectories, will be tarred. Otherwise all the files and directories +mentioned in the items list will tarred. When a directory is specified, then all +files within it are also tarred.

        +

        With the ignore attribute, you can specify files or directories to +ignore. These files will not be tarred. The items in the ignore attribute +override the items in the items attribute. The names specified in the ignore +attribute are just names, they do not contain any path information!

        +

        Note that this task does not perform compression. You might want to use the GZip +task to come up with a .tar.gz package.

        +

        Parameters

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        AttributeDescriptionRequired
        tarfilethe tar-file to create.Yes
        basedirthe directory from which to zip the files.Yes
        includescomma separated list of patterns of files that must be + included. All files are included when omitted.No
        excludescomma separated list of patterns of files that must be + excluded. No files (except default excludes) are excluded when omitted.No
        defaultexcludesindicates whether default excludes should be used or not + ("yes"/"no"). Default excludes are used when omitted.No
        +

        Examples

        +
          <tar tarfile="${dist}/manual.tar" basedir="htdocs/manual" />
        +  <gzip zipfile="${dist}/manual.tar.gz" src="${dist}/manual.tar" />
        +

        tars all files in the htdocs/manual directory in a file called manual.tar +in the ${dist} directory, then applies the gzip task to compress +it.

        +
          <tar tarfile="${dist}/manual.tar"
        +       basedir="htdocs/manual"
        +       excludes="mydocs/**, **/todo.html"
        +  />
        +

        tars all files in the htdocs/manual directory in a file called manual.tar +in the ${dist} directory. Files in the directory mydocs, +or files with the name todo.html are excluded.

        +

        Taskdef

        Description

        Adds a task definition to the current project, such that this new task can be