Hi, Attached is the source for my VFS proposal for Ant 2. I've done it up as a patch to Myrmidon, but it's not dependent on anything from myrmidon (yet). Nor is it integrated into myrmidon at all.
Some of the providers won't be built unless the appropriate jar is in lib/: * FTP provider needs netcomponents.jar http://www.oroinc.com/oro/software/NetComponents.html * SMB provider needs jcifs.jar http://jcifs.samba.org/ The providers end up in myrmidon-api.jar, which isn't ideal, but good enough for now. Next on the list is to get <path> and <fileset> using the VFS. Adam
Index: proposal/myrmidon/build.xml
===================================================================
RCS file: /home/cvspublic/jakarta-ant/proposal/myrmidon/build.xml,v
retrieving revision 1.41
diff -u -r1.41 build.xml
--- proposal/myrmidon/build.xml 22 Jan 2002 11:16:43 -0000 1.41
+++ proposal/myrmidon/build.xml 24 Jan 2002 04:55:06 -0000
@@ -59,7 +59,9 @@
<property name="dist.lib" value="${dist.dir}/lib"/>
<property name="dist.ext" value="${dist.dir}/ext"/>
- <property name="test.classes" value="${build.dir}/test/classes"/>
+ <property name="test.dir" value="${build.dir}/test"/>
+ <property name="test.working.dir" value="${test.dir}/testcases"/>
+ <property name="test.classes" value="${test.dir}/classes"/>
<property name="constants.file" value="org/apache/myrmidon/Constants.java"/>
@@ -112,6 +114,9 @@
<available property="netcomp.present"
classname="com.oroinc.net.ftp.FTPClient"
classpathref="project.class.path" />
+ <available property="jcifs.present"
+ classname="jcifs.smb.SmbFile"
+ classpathref="project.class.path" />
<available property="starteam.present"
classname="com.starbase.util.Platform"
classpathref="project.class.path" />
@@ -187,6 +192,7 @@
<property name="ant.package" value="org/apache/tools/ant"/>
<property name="antlib.package" value="org/apache/antlib"/>
+ <property name="vfs.package" value="org/apache/aut/vfs"/>
<property name="optional.package"
value="${ant.package}/taskdefs/optional"/>
<property name="optional.type.package"
value="${ant.package}/types/optional"/>
<property name="util.package" value="${ant.package}/util"/>
@@ -221,6 +227,8 @@
unless="jdk1.2+" />
<exclude name="${ant.package}/listener/Log4jListener.java"
unless="log4j.present" />
+ <exclude name="${vfs.package}/provider/ftp/**" unless="netcomp.present"/>
+ <exclude name="${vfs.package}/provider/smb/**" unless="jcifs.present"/>
<exclude name="${optional.package}/IContract.java"
unless="icontract.present" />
<exclude name="${optional.package}/Script.java" unless="bsf.present" />
@@ -278,7 +286,6 @@
unless="jdk1.2+" />
</javac>
-
<copy todir="${build.classes}">
<fileset dir="${java.dir}">
<include name="**/*.properties"/>
@@ -437,13 +444,38 @@
deprecation="${deprecation}">
<classpath refid="project.class.path"/>
</javac>
+
+ <property name="test.local.dir" location="${test.working.dir}/localfs"/>
+ <property name="test.zip.file"
location="${test.working.dir}/zipfs/test.zip"/>
+
+ <!-- Prepare test files -->
+ <delete dir="${test.working.dir}"/>
+ <copy todir="${test.local.dir}/read-tests">
+ <fileset dir="etc/testcases/basedir"/>
+ </copy>
+ <mkdir dir="${test.local.dir}/read-tests/emptydir"/>
+ <mkdir dir="${test.working.dir}/zipfs"/>
+ <zip zipfile="${test.zip.file}">
+ <zipfileset dir="${test.local.dir}/read-tests" prefix="/basedir"/>
+ </zip>
+
<junit printsummary="on"
fork="false">
<formatter type="brief" usefile="false"/>
<classpath refid="project.class.path"/>
<classpath location="${test.classes}"/>
+
+ <!-- Pass config to the tests -->
+ <sysproperty key="test.local.dir" value="${test.local.dir}"/>
+ <sysproperty key="test.zip.file" value="${test.zip.file}"/>
+ <sysproperty key="test.smb.uri" value="smb://${user}:[EMAIL
PROTECTED]/${user}/vfs"/>
+ <sysproperty key="test.ftp.uri" value="ftp://${user}:[EMAIL
PROTECTED]/home/${user}/vfs"/>
+
<batchtest>
- <fileset dir="${test.classes}" includes="**/*Test.class"/>
+ <fileset dir="${test.classes}" includes="**/*Test.class">
+ <exclude name="**/SmbFileSystemTest.class" unless="jcifs.present"/>
+ <exclude name="**/FtpFileSystemTest.class" unless="netcomp.present"/>
+ </fileset>
</batchtest>
</junit>
</target>
<<attachment: newfiles.zip>>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
