[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] svn-ant : File Selectors (#384) - Resubmit

From: JP Fiset <jp_at_fiset.ca>
Date: 2005-09-21 02:52:24 CEST

I decided to do away with *.properties resources in svnant.jar to define
types, and instead use *.xml resource, which is a much better practice
anyway. SO, the difference between my last patch and this one:

1. Remove svntype.properties
2. Add svntypes.xml
3. Add documentation to all new *.java

Question: What license information should be included in each file? So
far, the files in svn-ant contains Apache's license 1.1. Is this
standard across the project?

JP

[[[

Add file selectors (normal, added, modified, conflicted, ignored,
replaced, locked, unversioned) to svnAnt.
For example, to copy a number of files with the status 'added' from
their location in workingcopy to a new directory called test, the
following ant task can be used:
<copy todir="test">
    <fileset dir="workingcopy">
        <svnAdded/>
    </fileset>
</copy>
                    
In ANT, it is possible to add file selectors that complement file sets.
Those are known as custom file
selectors. File sets are the basic types used to make up a list of files
for most tasks. Therefore, it
seemed necessary to be able to discriminate files, within file sets,
based on the Subversion status.
The file selectors presented do just that: extend file sets to select
files based on the Subversion status.

Fix: #384 This is an enhancement in response to feature request #384:
File Selectors in svn-ant

Patch by: Jean-Pierre Fiset (jpfiset)

Testing: All regression tests were passed using JavaHL bindings. Command
Line Interface client currently
         provided with svn-ant has a bug with querying a status for a
normal file. Latest version of
         svnClientAdapter seems to have fixed problem. JavaSVN does not
support tests for lack of file://
         protocol.

* build.xml: Added target 'docs' to build HTML documentation based on
XML document for file selectors. It is
             also used by target 'makeDistrib'.
             
* build.properties: Added directory definition 'src.doc.dir = src/doc',
which is where XML source
                    documentation is located.
                    
* src/main/svntypes.xml: New resource file that should be used instead
of svntask.properties.
                         The previous file is left for backward
compatibility, but to use
                         selectors, users will have to migrate to this
new file. Therfore, instead
                         of:
                          <taskdef resource="svntask.properties"
classpathref="svnant.classpath"/>
                         one shoud use:
                          <typedef resource="svntypes.xml"
classpathref="svnant.classpath"/>

* doc: Added selectors.html to svn:ignore, since it is dynamically
generated.

* doc/svn.html: Created a link to selectors.html, a dynamically
generated file that documents
                file selectors.

* src/doc/ant-types.xsd: XML schema used to define the structure of a
XML document where ANT type
                         extensions are described.
                    
* src/doc/ant-types.xsl: XSL stylesheet that transforms a XML document
conforming to ant-types.xsd
                         into a HTML document with a format similar
(although not exact) to the
                         documentation written by Cédric Chabanois for
the 'svn' task in svn.html
                         
* src/doc/selectors.xml: XML document conforming to ant-types.xsd and
used to document all new
                         file selectors submitted in this patch.
                         
* src/doc/selectors_params.txt: File used as an external entity by
selectors.xml.

* src/main/org/tigris/subversion/svnant/SvnTask.java:
         isJavahlAvailable() and isJavaSVNAvailable() were changed from
'private' to
         'static public' so that the logic could be shared with the
selector code. Ideally,
         this logic should find its way into a higher level class
(refactoring), but this is probably
         not within the mandate of this feature. Modified local variable
to 'static' to support this
         change.
         
* src/main/org/tigris/subversion/svnant/selectors/StatusBasedSelector.java:
         This is an abstract class that provides common functionality
between all file
         selectors that uses an item's subversion status as the basis
for selection.
         Retrieves the status, handles error and then pass control flow
to subclass.

* src/main/org/tigris/subversion/svnant/selectors/BaseSvnSelector.java:
         This is an abstract class that provides common funcitonality
between all file
         selectors. It handles the attributes ('javahl' and 'javasvn')
common to all
         selectors. It also retrieves the correct SVN client adapter and
passes it to
         the subclass. Here, design would benefit of caching the client
adapter,
         but it is not in the mandate of this feature.

* src/main/org/tigris/subversion/svnant/selectors/Conflicted.java:
         Class that implements 'svnConflicted' selector.
         
* src/main/org/tigris/subversion/svnant/selectors/Normal.java:
         Class that implements 'svnNormal' selector.

* src/main/org/tigris/subversion/svnant/selectors/Ignored.java:
         Class that implements 'svnIgnored' selector.

* src/main/org/tigris/subversion/svnant/selectors/Locked.java:
         Class that implements 'svnLocked' selector.

* src/main/org/tigris/subversion/svnant/selectors/Unversioned.java:
         Class that implements 'svnUnversioned' selector.

* src/main/org/tigris/subversion/svnant/selectors/Added.java:
         Class that implements 'svnAdded' selector.

* src/main/org/tigris/subversion/svnant/selectors/Modified.java:
         Class that implements 'svnModified' selector.

* src/main/org/tigris/subversion/svnant/selectors/Replaced.java:
         Class that implements 'svnReplaced' selector.

* src/testcases/org/tigris/subversion/svnant/SvnTest.java:
         Added a number of test cases to verify functionality of new
selectors:
         testNormalSelector(), testAddedSelector(),
testUnversionedSelector(), testModifiedSelector(),
         testIgnoredSelector(), testConflictedSelector(),
testReplacedSelector(),
         testEmbeddedSelector(). Can not test 'locked' selector
automatically since there is no
         task defined to 'lock'.

* test/svn/build.xml:
         Replaced <taskdef> by <typedef>. Added a number of tests to
support SvnTest class.
         Note that a new dependency "init-selectors" create a working
copy with many files
         in various 'subverison status'. This is onerous and repeated
for each selector
         test. However, it is thorough and necessary.
         
* test/svn/model/selectorTest/replaced1.txt: Test file for file
selectors
* test/svn/model/selectorTest/replaced2.txt: Test file for file
selectors
* test/svn/model/selectorTest/normal1.txt: Test file for file
selectors
* test/svn/model/selectorTest/normal2.txt: Test file for file
selectors
* test/svn/model/selectorTest/conflicted1.txt: Test file for file
selectors
* test/svn/model/selectorTest/conflicted2.txt: Test file for file
selectors
* test/svn/model/selectorTest/conflicted_v1.txt: Test file for file
selectors
* test/svn/model/selectorTest/conflicted_v2.txt: Test file for file
selectors
* test/svn/model/selectorTest/missing1.txt: Test file for file
selectors
* test/svn/model/selectorTest/missing2.txt: Test file for file
selectors
* test/svn/model/selectorTest/deleted1.txt: Test file for file
selectors
* test/svn/model/selectorTest/deleted2.txt: Test file for file
selectors
* test/svn/model/selectorTest/added1.txt: Test file for file
selectors
* test/svn/model/selectorTest/added2.txt: Test file for file
selectors
* test/svn/model/selectorTest/unversioned1.txt: Test file for file
selectors
* test/svn/model/selectorTest/unversioned2.txt: Test file for file
selectors
* test/svn/model/selectorTest/ignored1.txt: Test file for file
selectors
* test/svn/model/selectorTest/ignored2.txt: Test file for file
selectors
* test/svn/model/selectorTest/modified1.txt: Test file for file
selectors
* test/svn/model/selectorTest/modified2.txt: Test file for file
selectors

]]]

Index: test/svn/model/selectorTest/replaced2.txt
===================================================================
--- test/svn/model/selectorTest/replaced2.txt (revision 0)
+++ test/svn/model/selectorTest/replaced2.txt (revision 0)
@@ -0,0 +1 @@
+This file will be replaced
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\replaced2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/modified1.txt
===================================================================
--- test/svn/model/selectorTest/modified1.txt (revision 0)
+++ test/svn/model/selectorTest/modified1.txt (revision 0)
@@ -0,0 +1 @@
+This file will be modified
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\modified1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/modified2.txt
===================================================================
--- test/svn/model/selectorTest/modified2.txt (revision 0)
+++ test/svn/model/selectorTest/modified2.txt (revision 0)
@@ -0,0 +1 @@
+This file will be modified
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\modified2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/ignored1.txt
===================================================================
--- test/svn/model/selectorTest/ignored1.txt (revision 0)
+++ test/svn/model/selectorTest/ignored1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\ignored1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/ignored2.txt
===================================================================
--- test/svn/model/selectorTest/ignored2.txt (revision 0)
+++ test/svn/model/selectorTest/ignored2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\ignored2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/normal1.txt
===================================================================
--- test/svn/model/selectorTest/normal1.txt (revision 0)
+++ test/svn/model/selectorTest/normal1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\normal1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/normal2.txt
===================================================================
--- test/svn/model/selectorTest/normal2.txt (revision 0)
+++ test/svn/model/selectorTest/normal2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\normal2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/conflicted_v1.txt
===================================================================
--- test/svn/model/selectorTest/conflicted_v1.txt (revision 0)
+++ test/svn/model/selectorTest/conflicted_v1.txt (revision 0)
@@ -0,0 +1 @@
+First version of conflict
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\conflicted_v1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/conflicted_v2.txt
===================================================================
--- test/svn/model/selectorTest/conflicted_v2.txt (revision 0)
+++ test/svn/model/selectorTest/conflicted_v2.txt (revision 0)
@@ -0,0 +1 @@
+Second version of conflict
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\conflicted_v2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/unversioned1.txt
===================================================================
--- test/svn/model/selectorTest/unversioned1.txt (revision 0)
+++ test/svn/model/selectorTest/unversioned1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\unversioned1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/added1.txt
===================================================================
--- test/svn/model/selectorTest/added1.txt (revision 0)
+++ test/svn/model/selectorTest/added1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\added1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/unversioned2.txt
===================================================================
--- test/svn/model/selectorTest/unversioned2.txt (revision 0)
+++ test/svn/model/selectorTest/unversioned2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\unversioned2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/added2.txt
===================================================================
--- test/svn/model/selectorTest/added2.txt (revision 0)
+++ test/svn/model/selectorTest/added2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\added2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/deleted1.txt
===================================================================
--- test/svn/model/selectorTest/deleted1.txt (revision 0)
+++ test/svn/model/selectorTest/deleted1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\deleted1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/deleted2.txt
===================================================================
--- test/svn/model/selectorTest/deleted2.txt (revision 0)
+++ test/svn/model/selectorTest/deleted2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\deleted2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/missing1.txt
===================================================================
--- test/svn/model/selectorTest/missing1.txt (revision 0)
+++ test/svn/model/selectorTest/missing1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\missing1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/missing2.txt
===================================================================
--- test/svn/model/selectorTest/missing2.txt (revision 0)
+++ test/svn/model/selectorTest/missing2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\missing2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/conflicted1.txt
===================================================================
--- test/svn/model/selectorTest/conflicted1.txt (revision 0)
+++ test/svn/model/selectorTest/conflicted1.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\conflicted1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/conflicted2.txt
===================================================================
--- test/svn/model/selectorTest/conflicted2.txt (revision 0)
+++ test/svn/model/selectorTest/conflicted2.txt (revision 0)
@@ -0,0 +1 @@
+Just a test file
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\conflicted2.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/model/selectorTest/replaced1.txt
===================================================================
--- test/svn/model/selectorTest/replaced1.txt (revision 0)
+++ test/svn/model/selectorTest/replaced1.txt (revision 0)
@@ -0,0 +1 @@
+This file will be replaced
\ No newline at end of file

Property changes on: test\svn\model\selectorTest\replaced1.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: test/svn/build.xml
===================================================================
--- test/svn/build.xml (revision 1628)
+++ test/svn/build.xml (working copy)
@@ -17,7 +17,8 @@
     <pathelement location="${jsch.jar}"/>
   </path>
   
- <taskdef resource="svntask.properties" classpathref="project.classpath"/>
+<!-- <taskdef resource="svntask.properties" classpathref="project.classpath"/> -->
+ <typedef resource="svntypes.xml" classpathref="project.classpath"/>
 
 
   <target name="clean">
@@ -26,6 +27,7 @@
     <delete dir="coHEAD"/>
     <delete dir="co0"/>
     <delete dir="export1"/>
+ <delete dir="test"/>
   </target>
 
 
@@ -60,6 +62,106 @@
     </svn>
   </target>
 
+ <!-- init-selectors is run before each test for file selectors, since they all
+ share the same model of a working copy -->
+ <target name="init-selectors" depends="init">
+ <echo message="javahl = ${javahl} javasvn = ${javasvn}"/>
+ <copy todir="workingcopy">
+ <fileset dir="model/selectorTest"></fileset>
+ </copy>
+ <svn javahl="${javahl}" javasvn="${javasvn}">
+ <!-- Normal files -->
+ <add file="workingcopy/normal1.txt"/>
+ <add file="workingcopy/normal2.txt"/>
+ <commit file="workingcopy/normal1.txt" message="normal file"/>
+ <commit file="workingcopy/normal2.txt" message="normal file"/>
+
+ <!-- Added files -->
+ <add file="workingcopy/added1.txt"/>
+ <add file="workingcopy/added2.txt"/>
+
+ <!-- Deleted files -->
+ <add file="workingcopy/deleted1.txt"/>
+ <add file="workingcopy/deleted2.txt"/>
+ <commit file="workingcopy/deleted1.txt" message="deleted file"/>
+ <commit file="workingcopy/deleted2.txt" message="deleted file"/>
+ <delete file="workingcopy/deleted1.txt"/>
+ <delete file="workingcopy/deleted2.txt"/>
+
+ <!-- Missing files (part 1 of 2) -->
+ <add file="workingcopy/missing1.txt"/>
+ <add file="workingcopy/missing2.txt"/>
+ <commit file="workingcopy/missing1.txt" message="missing file"/>
+ <commit file="workingcopy/missing2.txt" message="missing file"/>
+
+ <!-- Modified files (part 1 of 2) -->
+ <add file="workingcopy/modified1.txt"/>
+ <add file="workingcopy/modified2.txt"/>
+ <commit file="workingcopy/modified1.txt" message="modified file"/>
+ <commit file="workingcopy/modified2.txt" message="modified file"/>
+
+ <!-- Ignored files -->
+ <ignore file="workingcopy/ignored1.txt"/>
+ <ignore file="workingcopy/ignored2.txt"/>
+
+ <!-- Conflicted files (part 1 of 2) -->
+ <add file="workingcopy/conflicted1.txt"/>
+ <add file="workingcopy/conflicted2.txt"/>
+ <commit file="workingcopy/conflicted1.txt" message="conflicted file"/>
+ <commit file="workingcopy/conflicted2.txt" message="conflicted file"/>
+
+ <!-- Replaced files (part 1 of 2) -->
+ <add file="workingcopy/replaced1.txt"/>
+ <add file="workingcopy/replaced2.txt"/>
+ <commit file="workingcopy/replaced1.txt" message="replaced file"/>
+ <commit file="workingcopy/replaced2.txt" message="replaced file"/>
+ <delete file="workingcopy/replaced1.txt"/>
+ <delete file="workingcopy/replaced2.txt"/>
+ </svn>
+
+ <!-- Checkout a second working copy -->
+ <mkdir dir="workingcopy2"/>
+ <svn javahl="${javahl}" javasvn="${javasvn}">
+ <checkout url="${urlRepos}" destPath="workingcopy2" />
+ </svn>
+
+ <!-- Conflicted files (part 2 of 2) -->
+ <copy file="workingcopy/conflicted_v1.txt" tofile="workingcopy/conflicted1.txt" overwrite="true"/>
+ <copy file="workingcopy/conflicted_v1.txt" tofile="workingcopy/conflicted2.txt" overwrite="true"/>
+ <copy file="workingcopy/conflicted_v2.txt" tofile="workingcopy2/conflicted1.txt" overwrite="true"/>
+ <copy file="workingcopy/conflicted_v2.txt" tofile="workingcopy2/conflicted2.txt" overwrite="true"/>
+ <svn javahl="${javahl}" javasvn="${javasvn}">
+ <commit message="conflicted file" file="workingcopy2/conflicted1.txt" />
+ <commit message="conflicted file" file="workingcopy2/conflicted2.txt" />
+ <update file="workingcopy/conflicted1.txt" />
+ <update file="workingcopy/conflicted2.txt" />
+ </svn>
+ <delete file="workingcopy/conflicted_v1.txt"/>
+ <delete file="workingcopy/conflicted_v2.txt"/>
+ <delete>
+ <fileset dir="workingcopy">
+ <include name="conflicted1.txt.*"/>
+ <include name="conflicted2.txt.*"/>
+ </fileset>
+ </delete>
+
+ <!-- Missing files (part 2 of 2) -->
+ <delete file="workingcopy/missing1.txt"/>
+ <delete file="workingcopy/missing2.txt"/>
+
+ <!-- Modified files (part 2 of 2) -->
+ <copy file="workingcopy/normal1.txt" tofile="workingcopy/modified1.txt" overwrite="true"/>
+ <copy file="workingcopy/normal2.txt" tofile="workingcopy/modified2.txt" overwrite="true"/>
+
+ <!-- Replaced files (part 2 of 2) -->
+ <copy file="workingcopy/normal1.txt" tofile="workingcopy/replaced1.txt" overwrite="true"/>
+ <copy file="workingcopy/normal2.txt" tofile="workingcopy/replaced2.txt" overwrite="true"/>
+ <svn javahl="${javahl}" javasvn="${javasvn}">
+ <add file="workingcopy/replaced1.txt"/>
+ <add file="workingcopy/replaced2.txt"/>
+ </svn>
+ </target>
+
   <!-- this test does not test svnant but svnClientAdapter -->
   <target name="testList" depends="init">
     <copy todir="workingcopy/listTest">
@@ -437,6 +539,85 @@
     </svn>
   </target>
         
+ <target name="testNormalSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnNormal javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testAddedSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnAdded javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testUnversionedSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnUnversioned javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testModifiedSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnModified javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testIgnoredSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnIgnored javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testConflictedSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnConflicted javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testReplacedSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnReplaced javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="testEmbeddedSelector" depends="init-selectors">
+ <mkdir dir="test"/>
+ <svn javahl="${javahl}" javasvn="${javasvn}">
+ <add>
+ <fileset dir="workingcopy">
+ <svnUnversioned javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </add>
+ </svn>
+ <copy todir="test">
+ <fileset dir="workingcopy">
+ <svnUnversioned javahl="${javahl}" javasvn="${javasvn}"/>
+ </fileset>
+ </copy>
+ </target>
+
   <target name="all" depends="init">
   </target>
         

Property changes on: doc
___________________________________________________________________
Name: svn:ignore
   +
selectors.html

Index: doc/svn.html
===================================================================
--- doc/svn.html (revision 1628)
+++ doc/svn.html (working copy)
@@ -65,6 +65,7 @@
         <li><A HREF="mailto:cchab@tigris.org">C&eacute;dric Chabanois</A>
 </ul>
 
+Selectors now available.
 
 <H2>Description</H2>
 <p>This task provide an interface to Subversion
@@ -1082,7 +1083,7 @@
 <FONT FACE="Courier New"><FONT SIZE=2><FONT COLOR="#000080">&lt;/svn&gt;</FONT></FONT></FONT>
 </div>
 add my_repos/propTest to repository and set two properties on file.png <br>
-subversion command line interface is used (javahl=”false”).
+subversion command line interface is used (javahl=�false�).
 </p>
 
 <HR>
Index: src/main/org/tigris/subversion/svnant/selectors/Replaced.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Replaced.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Replaced.java (revision 0)
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'replaced' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Replaced extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return status_.getTextStatus().equals(SVNStatusKind.REPLACED);
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Modified.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Modified.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Modified.java (revision 0)
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'modified' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Modified extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return status_.getTextStatus().equals(SVNStatusKind.MODIFIED);
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Added.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Added.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Added.java (revision 0)
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'added' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Added extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return status_.getTextStatus().equals(SVNStatusKind.ADDED);
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Unversioned.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Unversioned.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Unversioned.java (revision 0)
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'unversioned' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Unversioned extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return status_.getTextStatus().equals(SVNStatusKind.UNVERSIONED);
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Locked.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Locked.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Locked.java (revision 0)
@@ -0,0 +1,20 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'locked' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Locked extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return ( null != status_.getLockOwner() );
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/BaseSvnSelector.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/BaseSvnSelector.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/BaseSvnSelector.java (revision 0)
@@ -0,0 +1,107 @@
+package org.tigris.subversion.svnant.selectors;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.selectors.BaseExtendSelector;
+import org.tigris.subversion.svnant.SvnTask;
+import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
+import org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory;
+import org.tigris.subversion.svnclientadapter.commandline.CmdLineClientAdapterFactory;
+import org.tigris.subversion.svnclientadapter.javahl.JavaSvnClientAdapterFactory;
+import org.tigris.subversion.svnclientadapter.javahl.JhlClientAdapterFactory;
+
+/**
+ * This is an abstract class that implements all functionality shared
+ * between all file selectors in svn-ant. In particular, it implements
+ * the handling of the common parameters: javahl and javasvn. It provides
+ * the logic to select the approrpriate client adapter. Finally, it implements
+ * the method required by all Ant selectors (isSelected) and redirects
+ * the control flow to a subclass implementation while providing the
+ * appropriate client adapter.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public abstract class BaseSvnSelector extends BaseExtendSelector {
+
+
+
+ /**
+ * 'javahl' property for file selector. If set,
+ * JAVAHL bindings are used, if available. Preempts
+ * JavaSVN and command line.
+ */
+ private boolean javahl = true;
+
+ /**
+ * 'javasvn' property for file selector. If set,
+ * JavaSVN client is used, if available. Preempts
+ * command line, but not JAVAHL bindings.
+ */
+ private boolean javasvn = true;
+
+ /**
+ * Accessor method to 'javahl' property. If reset (false),
+ * JavaHL is not used.
+ * @param javahl_ New value for javahl property.
+ */
+ public void setJavahl(boolean javahl_) {
+ javahl = javahl_;
+ }
+
+ /**
+ * Accessor method to 'javasvn' property. If reset (false),
+ * JavaSVN is not used.
+ * @param javasvn_ New value for javasvn property.
+ */
+ public void setJavasvn(boolean javasvn_) {
+ javasvn = javasvn_;
+ }
+
+ @Override
+ final public boolean isSelected(File basedir_, String filename_, File file_) throws BuildException {
+ return isSelected(getClientAdapter(), basedir_, filename_, file_);
+ }
+
+ /**
+ * Method that needs to be reimplemented by each subclass. It is equivalent to 'isSelected',
+ * inherited from BaseExtendSelector, with the exception that a SVN client adaptor is provided.
+ * @param svnClient_ The SVN client that should be used to perform repository access
+ * @param basedir_ A java.io.File object for the base directory
+ * @param filename_ The name of the file to check
+ * @param file_ A File object for this filename
+ * @exception BuildException if an error occurs
+ * @return Returns true if the file should be selected. Otherwise, false.
+ */
+ abstract public boolean isSelected(ISVNClientAdapter svnClient_, File basedir_, String filename_, File file_) throws BuildException;
+
+ /**
+ * This method returns a SVN client adapter, based on the property set when the file selector
+ * was declared. More specifically, the 'javahl' and 'javasvn' flags are verified, as well as the
+ * availability of JAVAHL ad JavaSVN adapters, to decide what flavour to use.
+ * @return An instance of SVN client adapter that meets the specified constraints, if any.
+ * @throws BuildException Thrown in a situation where no adapter can fit the constraints.
+ */
+ private ISVNClientAdapter getClientAdapter() throws BuildException {
+ ISVNClientAdapter svnClient;
+
+ if( true == javahl && true == SvnTask.isJavahlAvailable() ) {
+ svnClient = SVNClientAdapterFactory.createSVNClient(JhlClientAdapterFactory.JAVAHL_CLIENT);
+ log("Using javahl");
+ }
+ else if( true == javasvn && true == SvnTask.isJavaSVNAvailable() ) {
+ svnClient = SVNClientAdapterFactory.createSVNClient(JavaSvnClientAdapterFactory.JAVASVN_CLIENT);
+ log("Using javasvn");
+ }
+ else if( true == SvnTask.isCommandLineAvailable() ) {
+ svnClient = SVNClientAdapterFactory.createSVNClient(CmdLineClientAdapterFactory.COMMANDLINE_CLIENT);
+ log("Using command line interface");
+ }
+ else {
+ throw new BuildException("Cannot use javahl, JavaSVN nor command line svn client");
+ }
+
+ return svnClient;
+ }
+}
Index: src/main/org/tigris/subversion/svnant/selectors/StatusBasedSelector.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/StatusBasedSelector.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/StatusBasedSelector.java (revision 0)
@@ -0,0 +1,41 @@
+package org.tigris.subversion.svnant.selectors;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNClientException;
+
+/**
+ * This is an abstract class that implements all functionality shared
+ * between all file selectors, within svn-ant, that depends on a file
+ * status. It implements the 'isSelected' method, and redirects the
+ * control flow to one of the subclasses by providing the svn status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public abstract class StatusBasedSelector extends BaseSvnSelector {
+
+ @Override
+ final public boolean isSelected(ISVNClientAdapter svnClient_, File basedir_, String filename_, File file_) throws BuildException {
+ ISVNStatus status;
+ try {
+ status = svnClient_.getSingleStatus(file_);
+ } catch (SVNClientException e) {
+ throw new BuildException("Error occurred while obtaining status of " + file_.getAbsolutePath(), e);
+ }
+
+ return isSelected(status);
+ }
+
+ /**
+ * This method must be reimplemented by all subclasses. A subclass must
+ * decide the selection criteria based on the given status.
+ * @param status_ Status of the file being selected.
+ * @return True if the file should be selected. Otherwise, false.
+ */
+ abstract public boolean isSelected(ISVNStatus status_);
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Ignored.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Ignored.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Ignored.java (revision 0)
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'ignored' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Ignored extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return status_.getTextStatus().equals(SVNStatusKind.IGNORED);
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Normal.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Normal.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Normal.java (revision 0)
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'normal' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Normal extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return status_.getTextStatus().equals(SVNStatusKind.NORMAL);
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/selectors/Conflicted.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Conflicted.java (revision 0)
+++ src/main/org/tigris/subversion/svnant/selectors/Conflicted.java (revision 0)
@@ -0,0 +1,20 @@
+package org.tigris.subversion.svnant.selectors;
+
+import org.tigris.subversion.svnclientadapter.ISVNStatus;
+
+/**
+ * This class implements an Ant custom file selector. Instances of this
+ * class selects a file based on the associated status in Subversion.
+ * This selector accepts files or directories with the 'conflicted' status.
+ *
+ * @author Jean-Pierre Fiset <a href="mailto:jp@fiset.ca">jp@fiset.ca</a>
+ *
+ */
+public class Conflicted extends StatusBasedSelector {
+
+ @Override
+ public boolean isSelected(ISVNStatus status_) {
+ return ( null != status_.getConflictWorking() );
+ }
+
+}
Index: src/main/org/tigris/subversion/svnant/SvnTask.java
===================================================================
--- src/main/org/tigris/subversion/svnant/SvnTask.java (revision 1628)
+++ src/main/org/tigris/subversion/svnant/SvnTask.java (working copy)
@@ -216,7 +216,7 @@
      * check if javahl is available
      * @return true if javahl is available
      */
- private boolean isJavahlAvailable() {
+ static public boolean isJavahlAvailable() {
             if (javahlAvailableInitialized == false) {
             // we don't initiliaze javahlAvailable in the static field because we
             // don't want the check to occur if javahl is set to false
@@ -237,7 +237,7 @@
      * check if JavaSVN is available
      * @return true if JavaSVN is available
      */
- private boolean isJavaSVNAvailable() {
+ static public boolean isJavaSVNAvailable() {
         if (javaSVNAvailableInitialized == false) {
             // we don't initiliaze javaSVNAvailable in the static field because we
             // don't want the check to occur if javaSVN is set to false
@@ -258,7 +258,7 @@
      * check if command line interface is available
      * @return true if command line interface is available
      */
- private boolean isCommandLineAvailable() {
+ static public boolean isCommandLineAvailable() {
         if (commandLineAvailableInitialized == false) {
             try {
                 CmdLineClientAdapterFactory.setup();
Index: src/main/svntypes.xml
===================================================================
--- src/main/svntypes.xml (revision 0)
+++ src/main/svntypes.xml (revision 0)
@@ -0,0 +1,23 @@
+<antlib>
+ <!-- Tasks -->
+ <taskdef name="svn"
+ classname="org.tigris.subversion.svnant.SvnTask" />
+
+ <!-- Selectors -->
+ <typedef name="svnNormal"
+ classname="org.tigris.subversion.svnant.selectors.Normal" />
+ <typedef name="svnAdded"
+ classname="org.tigris.subversion.svnant.selectors.Added" />
+ <typedef name="svnReplaced"
+ classname="org.tigris.subversion.svnant.selectors.Replaced" />
+ <typedef name="svnModified"
+ classname="org.tigris.subversion.svnant.selectors.Modified" />
+ <typedef name="svnConflicted"
+ classname="org.tigris.subversion.svnant.selectors.Conflicted" />
+ <typedef name="svnIgnored"
+ classname="org.tigris.subversion.svnant.selectors.Ignored" />
+ <typedef name="svnUnversioned"
+ classname="org.tigris.subversion.svnant.selectors.Unversioned" />
+ <typedef name="svnLocked"
+ classname="org.tigris.subversion.svnant.selectors.Locked" />
+</antlib>
\ No newline at end of file

Property changes on: src\main\svntypes.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml

Index: src/doc/ant-types.xsd
===================================================================
--- src/doc/ant-types.xsd (revision 0)
+++ src/doc/ant-types.xsd (revision 0)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
+ targetNamespace="http://www.fiset.ca/ant-docs/v1"
+ xmlns="http://www.fiset.ca/ant-docs/v1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+>
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ This schema should be used to document types used in ANT, an Apache project, which is a to
+ to define build processes. This schema defines the struture of an XML document that should be
+ used to capture information about extensions to the types offered by Ant, such as tasks,
+ selectors and the like. Tools, such as a stylesheet, can then interpret the XML document
+ and generate human-friendly documentation relating to your types.
+ </xs:documentation>
+ </xs:annotation>
+
+ <!-- Root node -->
+ <xs:element name="types">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ Root element for ant-types documents. It is made of a title, a preamble text and a set of
+ defined types.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <!-- Title -->
+ <xs:element name="title" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Title of this document</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <!-- Introduction text -->
+ <xs:element name="introduction">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ Introductory text to the set of types. HTML tags can be used within this field.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <!-- Type [0-n] -->
+ <xs:element name="type" type="type" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- **************************************** -->
+ <xs:complexType name="type">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">This element is used to describe a single ANT type</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <!-- Short description -->
+ <xs:element name="shortDescription" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">One line description of type, used for tables of content and similar indexing</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <!-- Full description -->
+ <xs:element name="fullDescription">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Full description of type. HTML tags can be used within this field.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <!-- Parameters -->
+ <xs:element name="parameter" type="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <!-- Name -->
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Specifies the usual name for a type. For example: copy, delete.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <!-- Class name -->
+ <xs:attribute name="className" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Specifies the name of the class that implement this type.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+
+ <!-- **************************************** -->
+ <xs:complexType name="parameter">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">This element is used to describe a single parameter within a type.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <!-- Description -->
+ <xs:element name="description">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Description of the parameter. HTML tags can be used within this field.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <!-- Required -->
+ <xs:element name="required">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Description of the parameter's requirements. HTML tags can be used within this field.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <!-- Name -->
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">The name of the attribute</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+
+ <!-- **************************************** -->
+ <xs:complexType name="example" mixed="true">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ This free form element can be used within fields where HTML is allowed. It
+ defines text that should be highlighted as an example.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Index: src/doc/selectors.xml
===================================================================
--- src/doc/selectors.xml (revision 0)
+++ src/doc/selectors.xml (revision 0)
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE types [
+ <!ENTITY common_params SYSTEM "selectors_params.txt">
+]>
+
+<ant:types
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ant="http://www.fiset.ca/ant-docs/v1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.fiset.ca/ant-docs/v1 ant-types.xsd"
+ >
+ <ant:title>Svn Selectors</ant:title>
+
+ <ant:introduction>
+ <p>
+ This document describes the file selectors offered in svnAnt. To use those selectors,
+ you must first obtain a copy of svnant.jar, add it to the classpath of your ant project
+ and define the types. Fortunately, there is a resource file, within the distributed JAR file,
+ and all those steps can be accomplished with the following code:
+ <ant:example>
+ <![CDATA[
+<path id="svnant.classpath">
+ <pathelement location="${svnant.dir}/lib/svnant.jar" />
+ <pathelement location="${svnant.dir}/lib/svnClientAdapter.jar" />
+</path>
+
+<typedef resource="svntypes.xml" classpathref="project.classpath"/>
+ ]]>
+ </ant:example>
+ </p>
+ <p>
+ If you are upgrading from an earlier version of svnAnt, and the following line was used
+ in your <i>build.xml</i> file, then replace it with the ones above.
+ <ant:example>
+ <![CDATA[
+<taskdef resource="svntask.properties" classpathref="svnant.classpath"/>
+ ]]>
+ </ant:example>
+ </p>
+ <h3><a name="bindings">Bindings</a></h3>
+ <p>
+ All file selectors offer two parameters: <b>javahl</b> and <b>javasvn</b>. Those parameters
+ are booleans, which means their values can be set to either <b>true</b> or <b>false</b>.
+ If not specified, those parameters are assumed to be set (true). These two parameters are used
+ to select which client is used to access Subversion.
+ </p>
+ <p>
+ There are three clients used by svnAnt to access Subversion:
+ <ul>
+ <li>JavaHL;</li>
+ <li>JavaSVN; and,</li>
+ <li>Command Line Interface.</li>
+ </ul>
+ To better understand the difference between those three clients, please refer to
+ documentation on <b>svnClientAdapter.jar</b>.
+ </p>
+ <p>
+ The property <b>javahl</b> is considered only if the javahl libraries are available. Similarly,
+ the property <b>javasvn</b> is considered only if JavaSVN is present. Finally, <b>javahl</b>
+ takes precedence over <b>javasvn</b>.
+ </p>
+ <p>
+ To better illustrate the previous paragraph, use the following steps:
+ <ol>
+ <li>If <b>javahl</b> is <i>true</i> and JavaHL bindings are available, then JavaHL is used.</li>
+ <li>If <b>javasvn</b> is <i>true</i> and JavaSVN is present, then JavaSVN is used.</li>
+ <li>If the two previous tests failed, for any reason, then the Command Line Interface is used.</li>
+ </ol>
+ </p>
+ </ant:introduction>
+
+ <!-- ***************************** -->
+ <ant:type name="svnAdded" className="org.tigris.subclipse.svnant.selectors.Added">
+ <ant:shortDescription>File selector that performs discrimination based on the 'added' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'added'.
+ </p>
+ <p>
+ An 'added' file or directory is one that has been added to the repository, but not yet
+ commited. In general, <b>svn status</b> displays those items with the letter <i>A</i>
+ preceeding the name.
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'added' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnAdded/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnModified" className="org.tigris.subclipse.svnant.selectors.Modified">
+ <ant:shortDescription>File selector that performs discrimination based on the 'modified' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'modified'.
+ </p>
+ <p>
+ A 'modified' file or directory is one that has been changed since the last update and where
+ the changes have not yet been commited to the repository. In general, <b>svn status</b>
+ display those items with the letter <i>M</i> preceeding the name. It is important to note
+ that other items can also be considered modified, such as conflicted ones.
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'modified' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnModified/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnUnversioned" className="org.tigris.subclipse.svnant.selectors.Unversioned">
+ <ant:shortDescription>File selector that performs discrimination based on the 'unversioned' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'unversioned'.
+ </p>
+ <p>
+ An 'unversioned' file or directory is one that is present in a working copy but is not yet
+ known to the repository. In general, <b>svn status</b>
+ display those items with a question mark (<i>?</i>) preceeding the name. Note that 'ignored'
+ items are not considered 'unversioned'.
+ </p>
+ <p>
+ Eexample: to copy a number of files with the status 'unversioned' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnUnversioned/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnConflicted" className="org.tigris.subclipse.svnant.selectors.Conflicted">
+ <ant:shortDescription>File selector that performs discrimination based on the 'conflicted' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'conflicted'.
+ </p>
+ <p>
+ When updating a subversion item (file or directory), it is possible to have two sets of
+ changes merged into the working item. This happens when the item was modified locally as
+ well as remotely during the period since the last update. If the two sets of changes conflict
+ (same lines of a file changes, same directory entries modified), then the item is marked
+ as 'conflicted'. In general, <b>svn status</b> displays 'conflicted' items with the letter
+ <i>C</i> preceeding the name. Note that 'conflicted' items are also considered 'modified'.
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'conflicted' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnConflicted/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnIgnored" className="org.tigris.subclipse.svnant.selectors.Ignored">
+ <ant:shortDescription>File selector that performs discrimination based on the 'ignored' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'ignored'.
+ </p>
+ <p>
+ An 'ignored' file or directory is one which name match the patterns found in the parent
+ directory's <b>svn:ignore</b> property. In general, <b>svn status --no-ignore</b>
+ display those items with the letter <i>I</i> preceeding the name.
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'ignored' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnIgnored/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnLocked" className="org.tigris.subclipse.svnant.selectors.Locked">
+ <ant:shortDescription>File selector that performs discrimination based on the 'locked' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'locked'.
+ </p>
+ <p>
+ A 'locked' file or directory is one where the repository has been informed of the
+ intent of a user to prevent others from modifying the file. For a working copy to
+ be aware of this fact, it must have been 'updated' since the lock status was changed.
+ In general, <b>svn status</b> displays those items with one of the letters <i>K</i>,
+ <i>O</i> or <i>B</i> in the sixth column. The 'lock' status is independent of most other
+ conditions such as 'modified', 'conflicted', etc.
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'locked' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnLocked/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnNormal" className="org.tigris.subclipse.svnant.selectors.Normal">
+ <ant:shortDescription>File selector that performs discrimination based on the 'normal' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'normal'.
+ </p>
+ <p>
+ A 'normal' file or directory is one that has not undergone any changes since the last
+ update. In general, this is the great majority of the files in a working copy. <b>svn status</b>
+ returns no special character for those items (a space in the first column).
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'normal' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnNormal/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+ <!-- ***************************** -->
+ <ant:type name="svnReplaced" className="org.tigris.subclipse.svnant.selectors.Replaced">
+ <ant:shortDescription>File selector that performs discrimination based on the 'replaced' subversion status. </ant:shortDescription>
+ <ant:fullDescription>
+ <p>
+ This file selector is used to discriminate files within a <b>fileset</b> based on a Subversion
+ status. In particular, this selector keeps files that are recognized as 'replaced'.
+ </p>
+ <p>
+ A 'replaced' file or directory is one that has been deleted, then created anew and finally
+ added back to the repository. Also, those changes must not have been comitted.
+ In general, <b>svn status</b> displays those items with the letter <i>R</i> preceeding
+ the name.
+ </p>
+ <p>
+ Example: to copy a number of files with the status 'replaced' from their location in
+ <b>workingcopy</b> to a new directory called <b>test</b>, the following ant task can
+ be used:
+ <ant:example>
+<![CDATA[
+<copy todir="test">
+ <fileset dir="workingcopy">
+ <svnReplaced/>
+ </fileset>
+</copy>
+]]>
+ </ant:example>
+ </p>
+ </ant:fullDescription>
+ &common_params;
+ </ant:type>
+
+</ant:types>
\ No newline at end of file

Property changes on: src\doc\selectors.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml

Index: src/doc/selectors_params.txt
===================================================================
--- src/doc/selectors_params.txt (revision 0)
+++ src/doc/selectors_params.txt (revision 0)
@@ -0,0 +1,20 @@
+<ant:parameter name="javahl">
+ <ant:description>
+ If set, instructs the use of JavaHL bindings, if available.
+ Set to <b>false</b> to use command line client interface to subversion.
+ Defaults to true. See note for more details.
+ </ant:description>
+ <ant:required>
+ No
+ </ant:required>
+</ant:parameter>
+<ant:parameter name="javasvn">
+ <ant:description>
+ If set, instructs the use of JavaSvn bindings, if available.
+ Set to <b>false</b> to use command line client interface to subversion.
+ Defaults to true. See note for more details.
+ </ant:description>
+ <ant:required>
+ No
+ </ant:required>
+</ant:parameter>

Property changes on: src\doc\selectors_params.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Index: src/doc/ant-types.xsl
===================================================================
--- src/doc/ant-types.xsl (revision 0)
+++ src/doc/ant-types.xsl (revision 0)
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="2.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:ant="http://www.fiset.ca/ant-docs/v1"
+>
+
+<xsl:output
+ method="xml"
+ encoding="UTF-8"
+ standalone="yes"
+ version="1.0"
+ doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+ indent="yes"/>
+
+<!-- =================================================== -->
+<xsl:template match="/ant:types">
+ <html>
+ <head>
+ <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"/>
+ <title>
+ <xsl:value-of select="ant:title"/>
+ </title>
+ <META HTTP-EQUIV="Content-Language" CONTENT="en-us"/>
+ <style type="text/css">
+ <![CDATA[
+ body {
+ font: 80% Verdana, Arial, Helvetica, sans-serif;
+ margin: 0; padding: 0;
+ /* background: rgb(95%,95%,80%); */
+ color: black;
+ }
+ h1 {
+ font-size: 200%; letter-spacing: 3px;
+ margin-bottom: 1em;
+ padding: 0.66em 0 0.33em 1em;
+ background: rgb(85%,85%,70%);
+ }
+ h2 {
+ background: rgb(85%,85%,70%);
+ }
+ h3 {
+ border:1px solid rgb(85%,85%,70%);
+ color: rgb(85%,85%,70%);
+ padding: 0.66em 0 0.33em 1em;
+ background-color: #f3f1f4;
+ }
+ .sample {
+ font-family: Courier, "Courier New", monospace;
+ background-color: #f3f1f4;
+ }
+ div.sample {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ padding-left: 3px;
+ padding-right: 3px;
+ border:1px dashed black;
+ width: 50%;
+ }
+ table.params {
+ width: 80%;
+ border: 1px solid gray;
+ margin-bottom:1em;
+ }
+ th.params, td.params {
+ padding: 0 0.5em;
+ border-left: 1px solid #DDD;
+ border-bottom: 1px solid #DDD;
+ font: 70%
+ }
+ th.params {
+
+ }
+ table.toc {
+ width: 80%;
+ border: 1px solid gray;
+ margin-bottom:1em;
+ }
+ td.toc {
+ padding: 0 0.5em;
+ border: none
+ font: 70%
+ }
+ table.type {
+ width: 80%;
+ border: none;
+ margin-bottom:1em;
+ }
+ th.type, td.type {
+ text-align: left;
+ padding: 0 0.5em;
+ border: none
+ font: 70%
+ }
+ th.type {
+ font-weight: bold;
+ }
+ ]]>
+ </style>
+ </head>
+ <body lang="en-US" dir="LTR">
+ <!-- Table of content -->
+ <h1>
+ <xsl:value-of select="ant:title"/>
+ </h1>
+
+ <h2>Table of Content</h2>
+ <table class="toc">
+ <tbody class="toc">
+ <xsl:for-each select="ant:type">
+ <tr class="toc">
+ <td class="toc">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td class="toc">
+ <xsl:value-of select="ant:shortDescription"/>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+
+ <h2>Introduction</h2>
+
+ <xsl:apply-templates select="ant:introduction"/>
+
+
+ <!-- Insert all defined types here -->
+ <xsl:apply-templates select="ant:type"/>
+
+ </body>
+ </html>
+</xsl:template>
+
+<!-- =================================================== -->
+<xsl:template match="ant:type">
+ <h1>
+ <a name="svn">
+ <xsl:attribute name="name" select="@name"/>
+ <xsl:value-of select="@name"/>
+ </a>
+ </h1>
+
+ <p>
+ <xsl:value-of select="ant:shortDescription"/>
+ </p>
+
+ <xsl:if test="@className">
+ <table class="type">
+ <tbody class="type">
+ <tr class="type">
+ <th class="type">Implementation:</th>
+ <td class="type">
+ <xsl:value-of select="@className"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:if>
+
+ <h2>Parameters</h2>
+ <xsl:choose>
+ <xsl:when test="count(./ant:parameter) = 0">
+ <xsl:text>No parameters defined for this type.</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <table class="params">
+ <tr class="params">
+ <th class="params">Attribute</th>
+ <th class="params">Description</th>
+ <th class="params">Required</th>
+ </tr>
+ <xsl:apply-templates select="ant:parameter"/>
+ </table>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Full description -->
+ <xsl:apply-templates select="ant:fullDescription"/>
+
+
+</xsl:template>
+
+<!-- =================================================== -->
+<xsl:template match="ant:parameter">
+ <tr class="params">
+ <td class="params">
+ <xsl:value-of select="@name"/>
+ </td>
+ <td class="params">
+ <xsl:apply-templates select="ant:description"/>
+ </td>
+ <td class="params">
+ <xsl:apply-templates select="ant:required"/>
+ </td>
+ </tr>
+</xsl:template>
+
+<!-- =================================================== -->
+<xsl:template match="ant:example">
+ <div class="sample">
+ <pre class="sample">
+ <xsl:apply-templates select="child::node()"/>
+ </pre>
+ </div>
+</xsl:template>
+
+<!-- =================================================== -->
+<xsl:template match="*|@*|text()|comment()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="child::node()"/>
+ </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: src\doc\ant-types.xsl
___________________________________________________________________
Name: svn:mime-type
   + text/xml

Index: src/testcases/org/tigris/subversion/svnant/SvnTest.java
===================================================================
--- src/testcases/org/tigris/subversion/svnant/SvnTest.java (revision 1628)
+++ src/testcases/org/tigris/subversion/svnant/SvnTest.java (working copy)
@@ -44,6 +44,8 @@
 
         protected ISVNClientAdapter svnClient;
         protected static final String WORKINGCOPY_DIR = "test/svn/workingcopy";
+ protected static final String WORKINGCOPY2_DIR = "test/svn/workingcopy2";
+ protected static final String TEST_DIR = "test/svn/test";
 
     public SvnTest(String name) {
         super(name);
@@ -452,6 +454,117 @@
             executeTarget("testSwitch");
     }
 
+ public void testNormalSelector() throws Exception {
+ executeTarget("testNormalSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(2, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "normal1.txt")).exists() );
+ assertTrue( (new File(dir2, "normal2.txt")).exists() );
+ }
+
+ public void testAddedSelector() throws Exception {
+ executeTarget("testAddedSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(2, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "added1.txt")).exists() );
+ assertTrue( (new File(dir2, "added2.txt")).exists() );
+ }
+
+ public void testUnversionedSelector() throws Exception {
+ executeTarget("testUnversionedSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(2, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "unversioned1.txt")).exists() );
+ assertTrue( (new File(dir2, "unversioned2.txt")).exists() );
+ }
+
+ public void testModifiedSelector() throws Exception {
+ executeTarget("testModifiedSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(4, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "modified1.txt")).exists() );
+ assertTrue( (new File(dir2, "modified2.txt")).exists() );
+ assertTrue( (new File(dir2, "conflicted1.txt")).exists() );
+ assertTrue( (new File(dir2, "conflicted2.txt")).exists() );
+ }
+
+ public void testIgnoredSelector() throws Exception {
+ executeTarget("testIgnoredSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(2, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "ignored1.txt")).exists() );
+ assertTrue( (new File(dir2, "ignored2.txt")).exists() );
+ }
+
+ public void testConflictedSelector() throws Exception {
+ executeTarget("testConflictedSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(2, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "conflicted1.txt")).exists() );
+ assertTrue( (new File(dir2, "conflicted2.txt")).exists() );
+ }
+
+ public void testReplacedSelector() throws Exception {
+ executeTarget("testReplacedSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(2, dir2.listFiles().length);
+
+ // Verify that the expected files are present
+ assertTrue( (new File(dir2, "replaced1.txt")).exists() );
+ assertTrue( (new File(dir2, "replaced2.txt")).exists() );
+ }
+
+ public void testEmbeddedSelector() throws Exception {
+ executeTarget("testEmbeddedSelector");
+
+ // Count number of files in test directory
+ File dir2 = new File(TEST_DIR);
+ assertTrue( dir2.exists() );
+ assertTrue( dir2.isDirectory() );
+ assertEquals(0, dir2.listFiles().length);
+
+ }
+
     public void testCleanupAfterTests() throws Exception {
             executeTarget("clean");
     }
Index: build.properties
===================================================================
--- build.properties (revision 1628)
+++ build.properties (working copy)
@@ -16,6 +16,7 @@
 # -----------------------------------------------------------------------------
 src.main.dir = src/main
 src.testcases.dir = src/testcases
+src.doc.dir = src/doc
 build.dir = build
 build.distrib.dir = ${build.dir}/distrib
 build.classes.dir = ${build.dir}/classes
Index: build.xml
===================================================================
--- build.xml (revision 1628)
+++ build.xml (working copy)
@@ -53,6 +53,21 @@
   </target>
 
   <!-- ================================================================= -->
+ <!-- compile docs -->
+ <!-- ================================================================= -->
+ <target name="docs" depends="" description="generate documentation">
+ <mkdir dir="${build.distrib.dir}/doc"/>
+ <style
+ basedir="${src.doc.dir}"
+ destdir="doc"
+ extension=".html"
+ style="${src.doc.dir}/ant-types.xsl"
+ processor="trax"
+ includes="*.xml"
+ />
+ </target>
+
+ <!-- ================================================================= -->
   <!-- compile junit test classes -->
   <!-- ================================================================= -->
   <target name="compileTests" description="compile junit sources files">
@@ -85,7 +100,7 @@
   <!-- ================================================================= -->
   <!-- make distribution -->
   <!-- ================================================================= -->
- <target name="makeDistrib" depends="clean,svnant.jar" description="make binary distribution">
+ <target name="makeDistrib" depends="clean,svnant.jar,docs" description="make binary distribution">
           <mkdir dir="${build.distrib.dir}"/>
                 <mkdir dir="${build.distrib.dir}/lib"/>
                 <mkdir dir="${build.distrib.dir}/doc"/>
@@ -100,7 +115,9 @@
                 <copy file="${jsch.jar}" todir="${build.distrib.dir}/lib"/>
                 <copy file="${jakarta-regexp.jar}" todir="${build.distrib.dir}/lib"/>
                 <copy file="${build.lib.dir}/svnant.jar" todir="${build.distrib.dir}/lib"/>
- <copy file="doc/svn.html" todir="${build.distrib.dir}/doc"/>
+ <copy todir="${build.distrib.dir}/doc">
+ <fileset dir="doc"/>
+ </copy>
                 <copy file="${distribfiles.dir}/build.xml" todir="${build.distrib.dir}"/>
     <copy file="${distribfiles.dir}/build.xml" todir="${build.distrib.dir}">
       <filterset>
Received on Wed Sep 21 10:52:24 2005

This is an archived mail posted to the Subclipse Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.