ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Gentle <j.kenneth.gen...@acm.org>
Subject SOLUTION: Modifying a DirSet (or any AbstractFileSet) from within a <script>
Date Thu, 11 Sep 2003 12:03:44 GMT
At 01:57 AM 9/11/2003, you wrote:

>By default only the "java" package is imported. So you have
>to import that special class or the whole package with
>     importClass(Package.org.apache.tools.ant.DirectoryScanner);

I caught this right before I left last night.  Importing the class resolved 
that problem, just as you've described.

>I will update the doc about this error message.

Cool...


>Where I can get more infos about the adapter?

I found the only documentation to JavaAdapter in the 
netscape.public.mozilla.jseng forum 
(http://groups.google.com/groups?q=JavaAdapter+group:netscape.public.mozilla.jseng+group:netscape.public.mozilla.jseng&hl=en&lr=&ie=UTF-8&oe=UTF-8&newwindow=1&group=netscape.public.mozilla.jseng&selm=391EEC3C.5236D929%40yahoo.com&rnum=1)


My current solution looks like this:

     <script language="javascript">
       <![CDATA[
         importPackage(Packages.java.lang);
       prj = self.getProject();
       dirset = prj.getReference("dirset.qa.releases");

       scanner = dirset.getDirectoryScanner(prj);
       fromDir = dirset.getDir(prj);
       srcDirs = scanner.getIncludedDirectories();

       obj = { getIncludedDirectories:
         function(){
           importPackage(Packages.java.util);
           incDirs = super$getIncludedDirectories();
           Arrays.sort(incDirs);
           return incDirs;
         }
       };

       importClass(Packages.org.apache.tools.ant.DirectoryScanner);
       sordidScanner = new JavaAdapter (DirectoryScanner,obj);
       dirset.setupDirectoryScanner (sordidScanner, prj);
       ]]>
     </script>


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


Mime
View raw message