donaldp 02/03/29 19:08:18
Modified: src/main/org/apache/tools/ant/taskdefs/cvslib
ChangeLogTask.java
Log:
Add support for nested filesets that allow selection of which files ou want
to perform cvs log on
Revision Changes Path
1.3 +37 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
Index: ChangeLogTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ChangeLogTask.java 28 Mar 2002 23:11:57 -0000 1.2
+++ ChangeLogTask.java 30 Mar 2002 03:08:18 -0000 1.3
@@ -68,8 +68,10 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
+import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.FileSet;
/**
* Change log task.
@@ -98,7 +100,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jeff Martin</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.2 $ $Date: 2002/03/28 23:11:57 $
+ * @version $Revision: 1.3 $ $Date: 2002/03/30 03:08:18 $
* @ant.task name="changelog"
*/
public class ChangeLogTask
@@ -127,6 +129,13 @@
private Date m_stop;
/**
+ * Filesets containting list of files against which the cvs log will be
+ * performed. If empty then all files will in the working directory will
+ * be checked.
+ */
+ private final Vector m_filesets = new Vector();
+
+ /**
* Set the base dir for cvs.
*/
public void setBasedir( final File basedir )
@@ -190,6 +199,16 @@
}
/**
+ * Adds a set of files about which cvs logs will be generated.
+ *
+ * @param fileSet a set of files about which cvs logs will be generated.
+ */
+ public void addFileset( final FileSet fileSet )
+ {
+ m_filesets.addElement( fileSet );
+ }
+
+ /**
* Execute task
*/
public void execute() throws BuildException
@@ -219,6 +238,23 @@
// We want something of the form: -d ">=YYYY-MM-dd"
final String dateRange = "-d >=" + outputDate.format( m_start );
command.createArgument().setValue( dateRange );
+ }
+
+
+ // Check if list of files to check has been specified
+ if( !m_filesets.isEmpty() )
+ {
+ final Enumeration e = m_filesets.elements();
+ while( e.hasMoreElements() )
+ {
+ final FileSet fileSet = (FileSet)e.nextElement();
+ final DirectoryScanner scanner =
fileSet.getDirectoryScanner( project );
+ final String[] files = scanner.getIncludedFiles();
+ for( int i = 0; i < files.length; i++ )
+ {
+ command.createArgument().setValue( files[ i ] );
+ }
+ }
}
final ChangeLogParser parser = new ChangeLogParser( userList );
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>