ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Help creating a MatchingTask
Date Wed, 21 Jan 2004 08:48:35 GMT
Means that there is no method with your signature. Provided method is:
    public DirectoryScanner getDirectoryScanner(Project p)

I recommend downloading the src-distro and looking into the sources while
programming
tasks.


Jan


> -----Original Message-----
> From: Mark McKay [mailto:mark@kitfox.com]
> Sent: Wednesday, January 21, 2004 9:45 AM
> To: dev@ant.apache.org
> Subject: Help creating a MatchingTask
> 
> 
> 
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message