ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark McKay <m...@kitfox.com>
Subject Help creating a MatchingTask
Date Wed, 21 Jan 2004 08:44:32 GMT

I'm trying to create a custom ant task that I can call from my build 
scripts.  Right now I'm just trying to figure out how to write a task 
that can accept a fileset and iterate through all valid files.  My best 
guess so far is below.

Unfortunately, this is giving me errors that I have not encountered in 
Java before.  What does 'cannot be applied to ()' mean?  Could anyone 
suggest what I could do to fix my program?

Thanks.

Mark McKay


=========================

Error:

com/kitfox/anttask/MyAntTask.java [26:1] 
getDirectoryScanner(org.apache.tools.ant.Project) in 
org.apache.tools.ant.types.AbstractFileSet cannot be applied to ()
        DirectoryScanner scanner = fs.getDirectoryScanner();
                                     ^
1 error
Errors compiling MyAntTask.


=========================


package com.kitfox.anttask;

import org.apache.tools.ant.*;
import org.apache.tools.ant.taskdefs.*;
import org.apache.tools.ant.types.*;

/**
 *
 * @author  kitfox
 */
public class MyAntTask extends MatchingTask {
   
    /** Creates a new instance of MyAntTask */
    public MyAntTask() {
    }
   
    public void execute() throws BuildException
    {
        FileSet fs = getImplicitFileSet();
        DirectoryScanner scanner = fs.getDirectoryScanner();
       
        scanner.scan();
       
        String[] files = scanner.getIncludedFiles();
        for (int i = 0; i < files.length; i++) {
            System.out.println(files[i]);
        }
    }
   
}



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message