mcconnell    2003/02/09 06:49:06

  Modified:    .        default.properties build.xml
  Added:       .        check-targets.properties check-targets.ent
  Log:
  Addition of autochecking of jars plus some property checking.
  
  Revision  Changes    Path
  1.2       +20 -20    jakarta-james/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-james/default.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- default.properties        9 Feb 2003 02:54:42 -0000       1.1
  +++ default.properties        9 Feb 2003 14:49:06 -0000       1.2
  @@ -103,61 +103,61 @@
   xerces.jar = ${lib.dir}/xerces-1.4.3.jar
   
   # ----- Avalon Framework -----
  -avalon-framework.jar=${phoenix-lib}/avalon-framework-4.1.3.jar
  +avalon-framework.jar=${phoenix.lib.dir}/avalon-framework-4.1.3.jar
   
   # ----- Cornerstone threads, version 1.0 or later -----
  -cornerstone-threads.jar=${candidates}/cornerstone-threads-1.0.jar
  +cornerstone-threads.jar=${candidates.dir}/cornerstone-threads-1.0.jar
   
   # ----- Cornerstone connection, version 1.0 or later -----
  -cornerstone-connection.jar=${candidates}/cornerstone-connection-1.0.jar
  +cornerstone-connection.jar=${candidates.dir}/cornerstone-connection-1.0.jar
   
   # ----- Cornerstone masterstore, version 1.0 or later -----
  -cornerstone-store.jar=${candidates}/cornerstone-store-1.0.jar
  +cornerstone-store.jar=${candidates.dir}/cornerstone-store-1.0.jar
   
   # ----- Cornerstone sockets, version 1.0 or later -----
  -cornerstone-sockets.jar=${candidates}/cornerstone-sockets-1.0.jar
  +cornerstone-sockets.jar=${candidates.dir}/cornerstone-sockets-1.0.jar
   
   # ----- Cornerstone scheduler, version 1.0 or later -----
  -cornerstone-scheduler.jar=${candidates}/cornerstone-scheduler-1.0.jar
  +cornerstone-scheduler.jar=${candidates.dir}/cornerstone-scheduler-1.0.jar
   
   # ----- Cornerstone scheduler, version 1.0 or later -----
  -cornerstone-datasources.jar=${candidates}/cornerstone-datasources-1.0.jar
  +cornerstone-datasources.jar=${candidates.dir}/cornerstone-datasources-1.0.jar
   
   # ----- Excalibur collections, version 1.0 or later -----
  -excalibur-collections.jar=${phoenix-lib}/excalibur-collections-1.0.jar
  +excalibur-collections.jar=${phoenix.lib.dir}/excalibur-collections-1.0.jar
   
   # ----- Excalibur threadcontext, version 1.0 or later -----
  -excalibur-threadcontext.jar=${phoenix-lib}/excalibur-threadcontext-1.0.jar
  +excalibur-threadcontext.jar=${phoenix.lib.dir}/excalibur-threadcontext-1.0.jar
   
   # ----- Excalibur cli -----
  -excalibur-cli.jar=${phoenix-lib}/excalibur-cli-1.0.jar
  +excalibur-cli.jar=${phoenix.lib.dir}/excalibur-cli-1.0.jar
   
   # ----- Excalibur thread, version 1.0 or later -----
  -excalibur-thread.jar=${candidates}/excalibur-thread-1.1.jar
  +excalibur-thread.jar=${candidates.dir}/excalibur-thread-1.1.jar
   
   # ----- Excalibur pool -----
  -excalibur-pool.jar=${candidates}/excalibur-pool-1.2.jar
  +excalibur-pool.jar=${candidates.dir}/excalibur-pool-1.2.jar
   
   # ----- Excalibur datasource -----
  -excalibur-datasource.jar=${lib}/excalibur-datasource-1.0.jar
  +excalibur-datasource.jar=${lib.dir}/excalibur-datasource-1.0.jar
   
   # ----- Excalibur datasource -----
  -excalibur-io.jar=${phoenix-lib}/excalibur-io-1.1.jar
  +excalibur-io.jar=${phoenix.lib.dir}/excalibur-io-1.1.jar
   
   # ----- Javax mail -----
  -javax-mail.jar=${lib}/mail_1_3.jar
  +javax-mail.jar=${lib.dir}/mail_1_3.jar
   
   # ----- Activation -----
  -javax-activation.jar=${lib}/activation.jar
  +javax-activation.jar=${lib.dir}/activation.jar
   
   # ----- DNS -----
  -dns.jar=${lib}/dnsjava-1.3.2.jar
  +dns.jar=${lib.dir}/dnsjava-1.3.2.jar
   
   # ----- Commons Net -----
  -commons-net.jar=${lib}/commons-net-1.0.0-dev.jar
  +commons-net.jar=${lib.dir}/commons-net-1.0.0-dev.jar
   
   # ----- Jakarta ORO -----
  -jakarta-oro.jar=${lib}/jakarta-oro-2.0.1.jar
  +jakarta-oro.jar=${lib.dir}/jakarta-oro-2.0.1.jar
   
   # ----- Commons Collections -----
  -commons-collections.jar=${candidates}/commons-collections-2.1.jar
  +commons-collections.jar=${candidates.dir}/commons-collections-2.1.jar
  
  
  
  1.126     +14 -1     jakarta-james/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-james/build.xml,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- build.xml 9 Feb 2003 03:41:15 -0000       1.125
  +++ build.xml 9 Feb 2003 14:49:06 -0000       1.126
  @@ -1,4 +1,8 @@
   <?xml version="1.0"?>
  +  <!DOCTYPE project [
  +    <!ENTITY check-targets SYSTEM "file:check-targets.ent">
  +  ]>
  +
   <!-- ==========================================================================
   
    James build file $Revision$  Committed on $Date$ by: $Author$
  @@ -63,9 +67,18 @@
           </fileset>
           <pathelement path="${build.classes}"/>
       </path>
  +
       <taskdef name="sar" classname="org.apache.avalon.phoenix.tools.tasks.Sar">
           <classpath refid="project.class.path"/>
       </taskdef>
  +
  +    <!--
  +    ===================================================================
  +                                Dependency Check
  +    ===================================================================
  +    -->
  +    &check-targets;
  +    <target name="test" depends="javamail-check,activation-check,junit-check"/>
   
       <!--
       ===================================================================
  
  
  
  1.1                  jakarta-james/check-targets.properties
  
  Index: check-targets.properties
  ===================================================================
  # sets up properties for the dependency download mechanism
  
  jar.repository=http://www.ibiblio.org/maven
  
  ibm.license=IBM Public License
  ibm.license.url=http://www.opensource.org/licenses/ibmpl.php
  cpl.license=Common Public License
  cpl.license.url=http://www.opensource.org/licenses/cpl.php
  asl.license=Apache Software License
  asl.license.url=http://www.opensource.org/licenses/apachepl.php
  lgpl.license=GNU Lesser General Public License
  lgpl.license.url=http://www.opensource.org/licenses/lgpl-license.php
  sbcl.license=Sun Binary Code License
  
  # JavaMail
  javamail.version=1.2
  javamail.id=mail_1_3
  javamail.license=${sbcl.license}
  javamail.license.url=http://java.sun.com/products/javamail/
  javamail.dist.url=http://java.sun.com/products/javamail/
  
  # JavaBeans Activation Framework (JAF)
  activation.version=1.0.2
  activation.id=activation
  activation.license=${sbcl.license}
  activation.dist.url=http://java.sun.com/products/javabeans/glasgow/jaf.html
  activation.license.url=http://java.sun.com/products/javabeans/glasgow/jaf.html
  
  # JUnit
  junit.version=3.7
  junit.id=junit-3.7
  junit.license=${cpl.license}
  junit.license.url=${cpl.license.url}
  junit.dist.url=http://www.junit.org/
  
  
  
  
  
  1.1                  jakarta-james/check-targets.ent
  
  Index: check-targets.ent
  ===================================================================
  <!--
  This build.xml snippet contains targets for ant 1.5 that check whether
  a specific libary is present, and offers targets for downloading them
  if they're not.
  
  It's kinda of a replacement for some maven functionality until maven
  becomes stable.
  -->
  
      <!-- Set up properties -->
      <property file="check-targets.properties"/>
      <target name="setup-dependencies">
          <available property="javax.activation.present"
                 classname="javax.activation.URLDataSource"
                 classpathref="project.class.path" />
          <available property="javax.mail.present"
                 classname="javax.mail.Message"
                 classpathref="project.class.path" />
          <available property="junit.present"
                 classname="junit.framework.Test"
                 classpathref="project.class.path" />
      </target>
  
    <!-- called if a dependency is missing which has a BSD or ASL or
         similar license for which autodownload is okay. -->
    <target name="missing-dependency">
        <echo>
        *************************************************************************
        Classes needed for compiling ${Name} against the ${id} API
        are not available. The build may fail or some functionality may
        not be available.
  
        Resource: ${id}.jar
        
        Recovery:
        Run the build target import-${id} and it will download
        the needed jar - you should be online for that.
        
        If you have a fast connection you can also just run the build target
        import-all-auto-dependencies, which will download all external jars this
        buildfile knows about.
        Note this may download unused jars as well.
        *************************************************************************
        </echo>
        <echo/>
    </target>
  
    <!-- called if a dependency is missing which we cannot autodownload
         due to licensing-->
    <target name="missing-dependency-noauto">
        <echo>
        *************************************************************************
        Classes needed for compiling ${Name} against the ${id} API
        are not available. The build may fail or some functionality may
        not be available.
        
        Resource: ${id}.jar
  
        Recovery:
        Get the ${id} jar from the ${id} distribution at
        ${dist.url}
        and place it in ${lib.dir}.
        
        Please note that ${id} is licensed under the ${license}
        and that by downloading it you are agreeing to that license. You can read
        this license at
        ${license.url}
        *************************************************************************
        </echo>
        <echo/>
    </target>
    
    <!-- this target fetches a file from a maven repository -->
    <target name="import-dependency">
        <get src="${license.url}"
                dest="${lib.dir}/${id}.LICENSE.html"
                usetimestamp="true"/>
        <loadfile property="license.text" srcFile="${lib.dir}/${id}.LICENSE.html"/>
        <echo>
        *************************************************************************
        You have requested to download the ${id} jar, which is licensed under
        the ${license}. A copy of this license has been saved to
        ${lib.dir}/${id}.LICENSE.html
        
        Please view it now.
        *************************************************************************
        </echo>
        <input message="Do you agree to the terms of this license?"
                validargs="y,n"
                addproperty="do.download"/>
  
        <condition property="do.abort">
                <equals arg1="n" arg2="${do.download}"/>
        </condition>
        <fail if="do.abort">Download aborted.</fail>
        
        <get src="${jar.repository}/${id}/jars/${id}-${version}.jar"
                dest="${lib.dir}/${id}-${version}.jar"
                verbose="true"
                usetimestamp="true"/>
    </target>
  
  
    <!-- JavaMail -->
    <target name="javamail-check" unless="javax.mail.present" 
depends="setup-dependencies">
      <antcall target="missing-dependency-noauto">
        <param name="id" value="${javamail.id}"/>
        <param name="version" value="${javamail.version}"/>
        <param name="license" value="${javamail.license}"/>
        <param name="license.url" value="${javamail.license.url}"/>
        <param name="dist.url" value="${javamail.dist.url}"/>
      </antcall>
    </target>
  
    <!-- JAF -->
    <target name="activation-check" unless="javax.activation.present" 
depends="setup-dependencies">
      <antcall target="missing-dependency-noauto">
        <param name="id" value="${activation.id}"/>
        <param name="version" value="${activation.version}"/>
        <param name="license" value="${activation.license}"/>
        <param name="license.url" value="${activation.license.url}"/>
        <param name="dist.url" value="${activation.dist.url}"/>
      </antcall>
    </target>
  
    <!-- JUnit -->
    <target name="junit-check" unless="junit.present" depends="setup-dependencies">
      <antcall target="missing-dependency">
        <param name="id" value="${junit.id}"/>
        <param name="version" value="${junit.version}"/>
        <param name="license" value="${junit.license}"/>
        <param name="license.url" value="${junit.license.url}"/>
      </antcall>
    </target>
  
    <target name="import-junit" depends="setup-dependencies">
      <antcall target="import-dependency">
        <param name="id" value="${junit.id}"/>
        <param name="version" value="${junit.version}"/>
        <param name="license" value="${junit.license}"/>
        <param name="license.url" value="${junit.license.url}"/>
      </antcall>
    </target>
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to