avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/instrument-manager build.xml
Date Mon, 01 Apr 2002 07:35:50 GMT
jefft       02/03/31 23:35:50

  Modified:    .        Tag: depchecking depchecker.xml
               all      Tag: depchecking build.xml
               command  Tag: depchecking build.xml
               event    Tag: depchecking build.xml
               instrument-client Tag: depchecking build.xml
               instrument-manager Tag: depchecking build.xml
  Log:
  Wohoo.. support for HTTP retrieval of missing jars.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +90 -36    jakarta-avalon-excalibur/depchecker.xml
  
  Index: depchecker.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/depchecker.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- depchecker.xml	1 Apr 2002 05:57:08 -0000	1.1.2.1
  +++ depchecker.xml	1 Apr 2002 07:35:50 -0000	1.1.2.2
  @@ -1,45 +1,58 @@
   <?xml version="1.0"?>
   
   <!--
  -                               Dependency updater
  -                                  Version 2.2
  -                                jefft@apache.org
  -
  -                     This Ant script will recursively check 
  -               if all the dependencies for this project are met.
  -                   To use it, type 'ant -f dependencies.xml'
  --->
  +============================================================
  +                Dependency updater
  +                   Version 2.3
  +           Jeff Turner <jefft@apache.org>
  +
  +This Ant script provides "functions" to check if
  +dependencies are present, and take appropriate action if
  +they are not. "Appropriate action" may be:
  +
  +- Print an error message
  +- Build the project, if local
  +- Retrieve the jar dependency via HTTP GET
   
  +To use it, type 'ant -f depchecker.xml'
  +============================================================-->
   
   <!--
  -Algorithm is as follows:
  -
  -There are three parameters per requirement check:
  +checkRequiredFile parameters:
   
   name:
       Name of the jar. Eg 'avalon-collections.jar'
   path:
       Path to named jar. Eg ${avalon-collections.jar}
  -dependency:
  -    Path to local project which builds the jar. Only set if the jar could be
  -    local, eg another component.
  +proj.home (optional):
  +    Path to local project which builds the jar. Only set if
  +    the jar could be local, eg another component.
  +proj.target (optional):
  +    Ant script target to run in local project to build the jar
  +url (optional)
  +    URL of the jar, to retrieve to ${path} if it doesn't already exist at
  +    ${path}
  +
  +Algorithm is as follows:
   
  -IF the directory ${dependency} exists THEN:
  +IF the directory ${proj.home} exists THEN:
       // The dependency is local; if the jar doesn't exist, we can build it 
       IF file ${path} does not exist THEN:
  -       call ${dependency}/build.xml's 'dist.lite' target to build that
  +       call ${proj.home}/build.xml's 'dist.lite' target to build that
          project's jar, which will then build it's own dependencies if necessary
       ELSE we're fine
   ELSE
       // The dependency is remote; we can't build it,
       IF file ${path} does not exist THEN:
  -        print an error saying "Can't find file ${path}"
  -        // Or we could do a HTTP GET to retrieve the jar
  +        IF ${url} is present THEN:
  +            do a HTTP GET to retrieve the jar to ${path}
  +        ELSE
  +            print an error saying "Can't find file ${path}"
       ELSE we're fine
   -->
   
   <project name="dependencies" default="main" basedir=".">
  -    <!-- The target to call if ${target} isn't specified -->
  +    <!-- The target to call if ${proj.target} isn't specified -->
       <property name="default.target" value="dist.lite"/>
   
       <target name="main" depends="usage"/>
  @@ -54,23 +67,53 @@
   
               For example:
   
  -            <ant antfile="dependencies.xml" target="checkRequiredFile">
  +            <ant antfile="depchecker.xml" target="checkRequiredFile">
                   <properties name="name" value="excalibur-concurrent.jar"/>
  -                <properties name="path" value="${excalibur-concurrent.jar}"/>
  -                <properties name="dependency" value="../concurrent"/>
  +                <properties name="path" value="$${excalibur-concurrent.jar}"/>
  +                <properties name="proj.home" value="../concurrent"/>
  +                <properties name="proj.target" value="dist.lite"/>
               </ant>
  -            
  +
  +            That will check if $${excalibur-concurrent.jar} points to a jar, and
  +            if it doesn't, build the $${proj.home} project in order to generate
  +            the jar
  +
  +            or:
  +
  +            <ant antfile="depchecker.xml" target="checkRequiredFile">
  +                <property name="name" value="commons-io.jar"/>
  +                <property name="path" value="$${lib.repo}/commons-io.jar"/>
  +                <property name="url" value="http://jakarta.apache.org/turbine/jars/commons-io.jar"/>
  +            </ant>
  +
  +            That will check if $${lib.repo}/commons-io.jar exists, and if not,
  +            download it from $${url}
  +
  +
               The properties are as follows:
   
  +            For checkRequiredFile:
               name:
                   Name of the jar. Eg 'avalon-collections.jar'
               path:
  -                Path to named jar. Eg ${avalon-collections.jar}
  -            dependency (optional):
  -                Path to local project which builds the jar. Only set if
  -                the jar could be local, eg another component.
  -            target (optional):
  +                Path to named jar. Eg $${avalon-collections.jar}
  +
  +            proj.home (optional):
  +                Path to local project which builds the jar. Only set if the jar
  +                could be local, eg another component.
  +            proj.target (optional) [dist.lite]:
                   Ant script target to run in local project to build the jar
  +
  +            url (optional):
  +                URL to retrieve jar if not present on the local filesystem
  +            
  +            For checkRequiredClass:
  +            name:
  +                Name of jar in which the class usually resides
  +            class:
  +                Name of class to check for
  +            classpath:
  +                String classpath (; or : separated) to search for $${class} in
               =======================================================
               ]]></echo>
       </target>
  @@ -90,8 +133,8 @@
       <!-- ====================================================== -->
       <target name="checkRequiredFile" depends="checkIfLocal, checkRequiredFileLocal,
checkRequiredFileRemote"/>
   
  -    <target name="checkIfLocal" if="dependency">
  -        <available type="dir" file="${dependency}" property="local"/>
  +    <target name="checkIfLocal" if="proj.home">
  +        <available type="dir" file="${proj.home}" property="local"/>
       </target>
   
       <!--
  @@ -111,23 +154,34 @@
       -->
       <target name="checkRequiredFileRemote" unless="local">
           <available type="file" file="${path}" property="requirement.satisfied"/>
  +        <antcall target="get_dependency"/>
  +        <available type="file" file="${path}" property="get.succeeded"/>
           <antcall target="checkRequiredFile.fail"/>
       </target>
   
  -     <!-- =================================================================== -->
  +    <!-- =================================================================== -->
       <!-- Script called to recursively call another depencency.xml file in    -->
       <!-- another project, and then run the 'dist.lite' target.               -->
       <!-- =================================================================== -->
       <target name="update_dependency" description="Update files for one dependency" unless="requirement.satisfied">
  -        <echo message="Updating files from dependency ${dependency}"/>
  +        <echo message="Updating files from dependency ${proj.home}"/>
           <!-- Set target if it wasn't previously set -->
  -        <property name="target" value="${default.target}"/>
  -        <ant dir="${dependency}" target="${target}" inheritAll="false">
  +        <property name="proj.target" value="${default.target}"/>
  +        <ant dir="${proj.home}" target="${proj.target}" inheritAll="false">
               <property name="skip.tests" value="${skip.tests}"/>
           </ant>
       </target>
   
  -   <target name="checkRequiredFile.fail" unless="requirement.satisfied">
  +    <target name="get_dependency" description="Retrieve a jar via HTTP" if="url" unless="requirement.satisfied">
  +        <get
  +            src="${url}"
  +            dest="${path}"
  +            verbose="true"
  +            usetimestamp="true"/>
  +        <echo>Retrieved ${path}</echo>
  +    </target>
  +
  +    <target name="checkRequiredFile.fail" unless="get.succeeded">
           <echo>
               +----------------------------------------------------------------+
               | FILE NOT FOUND:                                                |
  @@ -170,7 +224,7 @@
               +-----------------------------------------------------------------+
               |                                                                 |
               | The dependency-checking system tried to build the project:      |
  -            |   ${dependency}
  +            |   ${proj.home}
               | which should have provided the property:                        |
               |   ${name} = ${path}
               | However, after the build, no such file exists.                  |
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.122.2.2 +4 -4      jakarta-avalon-excalibur/all/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/all/build.xml,v
  retrieving revision 1.122.2.1
  retrieving revision 1.122.2.2
  diff -u -r1.122.2.1 -r1.122.2.2
  --- build.xml	1 Apr 2002 05:46:10 -0000	1.122.2.1
  +++ build.xml	1 Apr 2002 07:35:50 -0000	1.122.2.2
  @@ -156,23 +156,23 @@
       <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
         <property name="name" value="excalibur-collections.jar"/>
         <property name="path" value="${excalibur-collections.jar}"/>
  -      <property name="dependency" value="${basedir}/../collections"/>
  +      <property name="proj.home" value="${basedir}/../collections"/>
        </ant>
       <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
         <property name="name" value="excalibur-concurrent.jar"/>
         <property name="path" value="${excalibur-concurrent.jar}"/>
  -      <property name="dependency" value="${basedir}/../concurrent"/>
  +      <property name="proj.home" value="${basedir}/../concurrent"/>
       </ant>
       <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
         <property name="name" value="excalibur-instrument.jar"/>
         <property name="path" value="${excalibur-instrument.jar}"/>
  -      <property name="dependency" value="${basedir}/../instrument"/>
  +      <property name="proj.home" value="${basedir}/../instrument"/>
       </ant>
       <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
         <property name="name" value="avalon-framework.jar"/>
         <property name="path" value="${avalon-framework.jar}"/>
         <!--
  -      <property name="dependency" value="${basedir}/../../jakarta-avalon"/>
  +      <property name="proj.home" value="${basedir}/../../jakarta-avalon"/>
         -->
       </ant>
     </target>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.2   +8 -8      jakarta-avalon-excalibur/command/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/command/build.xml,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- build.xml	1 Apr 2002 05:46:12 -0000	1.5.2.1
  +++ build.xml	1 Apr 2002 07:35:50 -0000	1.5.2.2
  @@ -36,34 +36,34 @@
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-event.jar"/>
               <property name="path" value="${excalibur-event.jar}"/>
  -            <property name="dependency" value="${basedir}/../event"/>
  +            <property name="proj.home" value="${basedir}/../event"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-collections.jar"/>
               <property name="path" value="${excalibur-collections.jar}"/>
  -            <property name="dependency" value="${basedir}/../collections"/>
  +            <property name="proj.home" value="${basedir}/../collections"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-concurrent.jar"/>
               <property name="path" value="${excalibur-concurrent.jar}"/>
  -            <property name="dependency" value="${basedir}/../concurrent"/>
  +            <property name="proj.home" value="${basedir}/../concurrent"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="avalon-framework.jar"/>
               <property name="path" value="${avalon-framework.jar}"/>
  -            <property name="dependency" value="${basedir}/../../jakarta-avalon"/>
  +            <property name="proj.home" value="${basedir}/../../jakarta-avalon"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-core.jar"/>
               <property name="path" value="${excalibur-core.jar}"/>
  -            <property name="dependency" value="${basedir}/../all"/>
  -            <property name="target" value="all"/>
  +            <property name="proj.home" value="${basedir}/../all"/>
  +            <property name="proj.target" value="all"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-scratchpad.jar"/>
               <property name="path" value="${excalibur-scratchpad.jar}"/>
  -            <property name="dependency" value="${basedir}/../all"/>
  -            <property name="target" value="compile"/>
  +            <property name="proj.home" value="${basedir}/../all"/>
  +            <property name="proj.target" value="compile"/>
           </ant>
       </target>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.2   +2 -2      jakarta-avalon-excalibur/event/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/event/build.xml,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- build.xml	1 Apr 2002 05:46:12 -0000	1.7.2.1
  +++ build.xml	1 Apr 2002 07:35:50 -0000	1.7.2.2
  @@ -29,12 +29,12 @@
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-collections.jar"/>
               <property name="path" value="${excalibur-collections.jar}"/>
  -            <property name="dependency" value="${basedir}/../collections"/>
  +            <property name="proj.home" value="${basedir}/../collections"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-concurrent.jar"/>
               <property name="path" value="${excalibur-concurrent.jar}"/>
  -            <property name="dependency" value="${basedir}/../concurrent"/>
  +            <property name="proj.home" value="${basedir}/../concurrent"/>
          </ant>
       </target>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.2   +2 -2      jakarta-avalon-excalibur/instrument-client/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument-client/build.xml,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- build.xml	1 Apr 2002 05:46:12 -0000	1.9.2.1
  +++ build.xml	1 Apr 2002 07:35:50 -0000	1.9.2.2
  @@ -39,12 +39,12 @@
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-instrument-manager-interfaces.jar"/>
               <property name="path" value="${excalibur-instrument-manager-interfaces.jar}"/>
  -            <property name="dependency" value="${basedir}/../instrument-manager"/>
  +            <property name="proj.home" value="${basedir}/../instrument-manager"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="avalon-framework.jar"/>
               <property name="path" value="${avalon-framework.jar}"/>
  -            <property name="dependency" value="${basedir}/../../jakarta-avalon"/>
  +            <property name="proj.home" value="${basedir}/../../jakarta-avalon"/>
          </ant>
          <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="commons-altrmi-client-impl.jar"/>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.2  +7 -7      jakarta-avalon-excalibur/instrument-manager/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument-manager/build.xml,v
  retrieving revision 1.10.2.1
  retrieving revision 1.10.2.2
  diff -u -r1.10.2.1 -r1.10.2.2
  --- build.xml	1 Apr 2002 05:46:12 -0000	1.10.2.1
  +++ build.xml	1 Apr 2002 07:35:50 -0000	1.10.2.2
  @@ -35,29 +35,29 @@
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-collections.jar"/>
               <property name="path" value="${excalibur-collections.jar}"/>
  -            <property name="dependency" value="${basedir}/../collections"/>
  +            <property name="proj.home" value="${basedir}/../collections"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-instrument.jar"/>
               <property name="path" value="${excalibur-instrument.jar}"/>
  -            <property name="dependency" value="${basedir}/../instrument"/>
  +            <property name="proj.home" value="${basedir}/../instrument"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="avalon-framework.jar"/>
               <property name="path" value="${avalon-framework.jar}"/>
  -            <property name="dependency" value="${basedir}/../../jakarta-avalon"/>
  +            <property name="proj.home" value="${basedir}/../../jakarta-avalon"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="excalibur-core.jar"/>
               <property name="path" value="${excalibur-core.jar}"/>
  -            <property name="dependency" value="${basedir}/../all"/>
  -            <property name="target" value="all"/>
  +            <property name="proj.home" value="${basedir}/../all"/>
  +            <property name="proj.target" value="all"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="logkit.jar"/>
               <property name="path" value="${logkit.jar}"/>
  -            <property name="dependency" value="${basedir}/../../jakarta-avalon-logkit"/>
  -            <property name="target" value="compile"/>
  +            <property name="proj.home" value="${basedir}/../../jakarta-avalon-logkit"/>
  +            <property name="proj.target" value="compile"/>
           </ant>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredFile">
               <property name="name" value="commons-altrmi-common.jar"/>
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message