sanders 01/04/20 08:37:23 Modified: cjan build.xml cjan/src/java/org/apache/tools/ant/taskdefs/optional/cjan CJANGet.java Added: cjan PROPOSAL.html STATUS.html test-cjan.xml cjan/repository xml-xerces.xml Log: - Added proposal and status html files - Updated source to remove some logging - Created test build file that is called from build.xml via 'ant test' - added install target in build.xml which copies commons-cjan.jar to {ant.home/lib - added a repository sample file to start work on making cjan a little more intelligent Revision Changes Path 1.2 +12 -38 jakarta-commons-sandbox/cjan/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/cjan/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build.xml 2001/04/17 06:49:18 1.1 +++ build.xml 2001/04/20 15:37:15 1.2 @@ -1,9 +1,8 @@ <project name="CJAN" default="compile" basedir="."> - <!-- "CJAN" component of the Jakarta Commons Subproject - $Id: build.xml,v 1.1 2001/04/17 06:49:18 sanders Exp $ + $Id: build.xml,v 1.2 2001/04/20 15:37:15 sanders Exp $ Author: Scott Sanders <[EMAIL PROTECTED]> --> @@ -217,49 +216,24 @@ </copy> </target> - -<!-- ========== Unit Test Targets ========================================= --> - - <target name="test" depends="compile.tests, - test.property, - test.bean - " - description="Run all unit test cases"> + <target name="install" depends="dist" + description="Install CJAN into $ANT_HOME/lib"> + <copy todir="${ant.home}/lib" + file="${dist.home}/commons-${component.name}.jar"/> </target> - <target name="test.property"> - <echo message="Running PropertyUtils tests ..."/> - <java classname="${test.runner}" fork="yes" - failonerror="${test.failonerror}"> - <arg value="org.apache.commons.beanutils.PropertyUtilsTestCase"/> - <classpath refid="test.classpath"/> - </java> - </target> +<!-- ========== Unit Test Targets ========================================= --> - <target name="test.bean"> - <echo message="Running BeanUtils tests ..."/> - <java classname="${test.runner}" fork="yes" - failonerror="${test.failonerror}"> - <arg value="org.apache.commons.beanutils.BeanUtilsTestCase"/> - <classpath refid="test.classpath"/> - </java> + + <target name="test" depends="test.cjan" + description="Run all unit test cases"> </target> - <target name="test-cjan"> - <echo message="Testing cjan..."/> -<!-- <cjan localRepository="${cjan.repository.local}" remoteRepository="test-remote"> - both of the repository values are assumed to be set in some properties file --> - <cjan> - <get jar="xerces-1.3.1.jar" property="xerces.jar"/> - <get jar="xalan-2.0.1.jar" property="xalan.jar"/> - <get jar="junit-3.5.jar" property="junit.jar"/> - </cjan> - <echo message="property 'xerces.jar' is ${xerces.jar}"/> - <echo message="property 'xalan.jar' is ${xalan.jar}"/> - <echo message="property 'junit.jar' is ${junit.jar}"/> - <echo message="Finished testing cjan."/> + <target name="test.cjan"> + <echo message="Testing CJAN Get using test-cjan.xml..."/> + <ant antfile="test-cjan.xml" target="test.cjan.get"/> </target> </project> 1.1 jakarta-commons-sandbox/cjan/PROPOSAL.html Index: PROPOSAL.html =================================================================== <html> <head> <title>Proposal for CJAN</title> </head> <body bgcolor="white"> <div align="center"> <h1>Proposal for <em>CJAN</em></h1> </div> <h3>(0) Rationale</h3> <p>Managing the classpath can be a nightmare, especially so for large projects that have many dependencies upon other projects. CJAN intends to alleviate some of those problems by maintaining a repository of .jar files by which a project can download these as necessary to cover any necessary dependencies. </p> <p>The intent is to make CJAN into an Ant task that can be used within any build file. By doing this, the implementation is available to a maximum number of people. </p> <p>A Commons package would give committers an opportunity to coordinate their efforts to create and maintain a efficient, feature-rich package under the ASF license. </p> <h3>(1) Scope of the Package</h3> <p>The <em>CJAN</em> project shall create and maintain:</p> <ul> <li>A repository for the convenient retreival of all released Jakarta jar files by project and version number.</li> <li>An Ant task to allow access to said jar files.</li> <h3>(1.5) Interaction With Other Packages</h3> <p><em>CJAN</em> relies on: </p> <ul> <li>Ant and any other dependencies that Ant has (JDK, JAXP, etc)</li> </ul> <h3>(2) Initial Source of the Package</h3> <p>The initial codebase sits now in jakarta-commons-sandbox/cjan.</p> <p>The proposed package name for the new component is org.apache.tools.ant.taskdefs.optional.cjan. </p> <h3>(3) Required Jakarta-Commons Resources</h3> <ul> <li>CVS Repository - New directory <code>cjan</code> in the <code>jakarta-commons</code> CVS repository.</li> <li>Initial Committers - Most of the initial commiters are already committers on jakarta-commons,so the only addition is for user id sanders.</li> <li>Mailing List - Discussions will take place on the general <em>[EMAIL PROTECTED]</em> mailing list. To help list subscribers identify messages of interest, it is suggested that the message subject of messages about this component be prefixed with [CJAN].</li> <li>Bugzilla - New component "CJAN" under the "Commons" product category, with appropriate version identifiers as needed.</li> <li>Jyve FAQ - New category "commons-cjan" (when available).</li> </ul> <h3>(4) Initial Committers</h3> <p>The initial committers on the Digester component shall be:</p> <ul> <li>Geir Magnusson Jr.</li> <li>Scott Sanders</li> </ul> </body> </html> 1.1 jakarta-commons-sandbox/cjan/STATUS.html Index: STATUS.html =================================================================== <html> <head> <title>Status File for CJAN</title> <head> <body bgcolor="white"> <div align="center"> <h1>The Jakarta Commons <em>CJAN</em> Component</h1> $Id: STATUS.html,v 1.1 2001/04/20 15:37:14 sanders Exp $<br> <a href="#Introduction">[Introduction]</a> <a href="#Dependencies">[Dependencies]</a> <a href="#Release Info">[Release Info]</a> <a href="#Committers">[Committers]</a> <br><br> </div> <a name="Introduction"></a> <h3>1. INTRODUCTION</h3> <p> This scope of the <em>CJAN</em> component is primarily oriented to convenient downloading of dependent jar files. </p> <p> The original source was authored by Scott Sanders for the ASF. </p> <a name="Dependencies"></a> <h3>2. DEPENDENCIES</h3> <p>The <em>CJAN</em> component is dependent upon the following external components for development and use:</p> <ul> <li><a href="http://jakarta.apache.org/ant/">Ant</a>. Also any dependencies Ant itself may have (JDK, JAXP, etc.)</li> </ul> <a name="Release Info"></a> <h3>3. RELEASE INFO</h3> <p>Current Release: <strong>Unreleased, CVS Repository Only</strong></p> <p>Planned Next Release: N/A</p> <a name="Committers"></a> <h3>4. COMMITTERS</h3> <p>The following individuals are the primary developers and maintainers of this component. Developers who plan to use <em>CJAN</em> in their own projects are encouraged to collaborate on the future development of this component to ensure that it continues to meet a variety of needs.</p> <ul> <li><a href="mailto:[EMAIL PROTECTED]">Scott Sanders</a></li> <li><a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a></li> </ul> </body> </html> 1.1 jakarta-commons-sandbox/cjan/test-cjan.xml Index: test-cjan.xml =================================================================== <project name="CJAN Test" default="main" basedir="."> <taskdef name="cjan" classname="org.apache.tools.ant.taskdefs.optional.cjan.CJANTask"/> <target name="main"> <echo message="Use the command line 'ant test' from this directory."/> <echo message="This file is not meant to be executed standalone."/> <fail/> </target> <target name="test.cjan.get"> <echo message="Testing cjan get ..."/> <cjan> <get jar="xerces-1.3.1.jar" property="xerces.jar"/> <get jar="xalan-2.0.1.jar" property="xalan.jar"/> <get jar="junit-3.5.jar" property="junit.jar"/> </cjan> <echo message="property 'xerces.jar' is ${xerces.jar}"/> <echo message="property 'xalan.jar' is ${xalan.jar}"/> <echo message="property 'junit.jar' is ${junit.jar}"/> <echo message="Finished testing cjan."/> </target> <!-- Note that the <cjan> tag can also look like this. The default values are shown, so just override them to point somewhere else. Both of the repository values are assumed to be set in some properties file, typically in ${user.home}/build.properties <cjan localRepository="${cjan.repository.local}" remoteRepository="${cjan.repository.remote"> --> </project> 1.1 jakarta-commons-sandbox/cjan/repository/xml-xerces.xml Index: xml-xerces.xml =================================================================== <?xml version="1.0" encoding="utf-8"?> <project name="xml-xerces"> <component name="xerces"> <revision version="1.2"> <test class="org.apache.xerces.xml.foo"/> <jar url="http://xml.apache.org/bin/xml-xerces/xerces-1.2.jar"/> </revision> </component> </project> 1.2 +5 -8 jakarta-commons-sandbox/cjan/src/java/org/apache/tools/ant/taskdefs/optional/cjan/CJANGet.java Index: CJANGet.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/cjan/src/java/org/apache/tools/ant/taskdefs/optional/cjan/CJANGet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CJANGet.java 2001/04/17 06:49:22 1.1 +++ CJANGet.java 2001/04/20 15:37:20 1.2 @@ -68,7 +68,7 @@ * Class to provide get functionality for CJAN. * * @author <a href="mailto:[EMAIL PROTECTED]">Scott Sanders</a> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class CJANGet extends Object implements CJANSubTask { @@ -87,22 +87,19 @@ task = t; String localFileName = localRepo + "/" + jar; - project.log(task, "Checking for local file: " + - localFileName, Project.MSG_ERR); - File localFile = new File(localFileName); if (localFile.canRead()) { project.log(task, "File: " + localFileName + - " already exists. No need to download.", - Project.MSG_ERR); + " already exists. No action taken.", + Project.MSG_INFO); } else { try { URL remoteFile = new URL(remoteRepo + "/" + jar); project.log(task, "Attempting to download " + remoteFile.toString() + - " to local repository.", Project.MSG_ERR); + " -> " + localFileName, Project.MSG_INFO); FileOutputStream out = new FileOutputStream(localFileName); InputStream in = remoteFile.openStream(); @@ -124,7 +121,7 @@ if (project.getProperty(property) == null) { project.log(task, "Setting property " + property + - " to " + localFileName, Project.MSG_ERR); + " to " + localFileName, Project.MSG_DEBUG); project.setProperty(property, localFileName); } }