com.finalist.tools.ant.taskdefs
Class CheckoutLibTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bycom.finalist.tools.ant.taskdefs.CheckoutLibTask

public class CheckoutLibTask
extends org.apache.tools.ant.Task

This task is used to checkout 3rd-party libraries. The libraries that are to be checked out are read from the libXmlFile specified in the build.xml file. They are checked out to the libDir which is also specified in the build.xml file. In the versions.properties file the tags of the checked out files are stored. If a stored tag does not comply with the tag specified in the libXmlFile, the file is deleted and checked out again to get the correct version. Files that are removed from the libXmlFile but still exist in the libDir will be removed.

An individual library may be fetched from one of two kinds of source:

  • the library is checked out from a CVS server, or
  • the library is fetched from a URL.
  • The source if configured per library in the accompanying lib.xml file. If the library is fetched from a URL, no check is done on the server so it can be used locally.

    Usage in build.xml:

    <target description="CVS-checkout for needed JARs." name="checkout.lib" depends="init.ant">
    <taskdef name="checkout"
    classname="com.finalist.tools.ant.taskdefs.CheckoutLibTask"
    classpathref="ant.classpath"/>
    <checkout libXmlFile="lib.xml" libDir="${lib.dir}"/>
    </target>


    Field Summary
    static java.lang.String LIBVERSION_PROPERTIES_FILENAME
              The name of the properties file created by this task, containing the latest checked-out lib versions.
     
    Fields inherited from class org.apache.tools.ant.Task
    description, location, target, taskName, taskType, wrapper
     
    Fields inherited from class org.apache.tools.ant.ProjectComponent
    project
     
    Constructor Summary
    CheckoutLibTask()
               
     
    Method Summary
     void execute()
              Method which is called by ant to execute the task.
     void setLibDir(java.io.File libDir)
              Optional destination directory, defaults to "lib".
     void setLibXmlFile(java.io.File libXmlFile)
              Setter for property libFile.
     void setTmpDir(java.io.File tmpDir)
              Setter for property tmpDir.
     
    Methods inherited from class org.apache.tools.ant.Task
    getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
     
    Methods inherited from class org.apache.tools.ant.ProjectComponent
    getProject, setProject
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    LIBVERSION_PROPERTIES_FILENAME

    public static final java.lang.String LIBVERSION_PROPERTIES_FILENAME
    The name of the properties file created by this task, containing the latest checked-out lib versions.

    See Also:
    Constant Field Values
    Constructor Detail

    CheckoutLibTask

    public CheckoutLibTask()
    Method Detail

    execute

    public void execute()
                 throws org.apache.tools.ant.BuildException
    Method which is called by ant to execute the task.

    Throws:
    org.apache.tools.ant.BuildException - Exception which is thrown to stop the build process and display an error message

    setLibDir

    public void setLibDir(java.io.File libDir)
    Optional destination directory, defaults to "lib".

    Parameters:
    libDir - Directory in which the checked out libraries should be stored.

    setLibXmlFile

    public void setLibXmlFile(java.io.File libXmlFile)
    Setter for property libFile.

    Parameters:
    libXmlFile - The lib file which specifies what files are to be checked out

    setTmpDir

    public void setTmpDir(java.io.File tmpDir)
    Setter for property tmpDir.

    Parameters:
    tmpDir - New value of property tmpDir.


    Copyright © 2003-2004 SourceForge. All Rights Reserved.