ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: NOT A SOLUTION: Modifying a DirSet (or any AbstractFileSet) f rom within a <script>
Date Mon, 15 Sep 2003 05:26:23 GMT
Quick solution: implement a task that do the sort
   <sort refid="" includes="" excludes="" .../>
   - refid:    the id of the fileset
   - includes: the name of the property which should hold the sorted
includes
   - excludes: the name of the property which should hold the sorted
excludes
   - ... more files from directory scanner ...

Design solution: <fileset>, <dirset>, <path>, ... supports ONE nested <sort>
element,
so the sorting can be done via plugin.


Jan


> -----Original Message-----
> From: Ken Gentle [mailto:j.kenneth.gentle@acm.org]
> Sent: Saturday, September 13, 2003 4:44 PM
> To: Ant Users List
> Subject: NOT A SOLUTION: Modifying a DirSet (or any AbstractFileSet)
> from within a <script>
> 
> 
> My apologies for posting something with insufficient testing. 
>  The code 
> below executes cleanly, but the JavaScript subclass of 
> DirectoryScanner 
> does not appear to actually replace the DirectoryScanner for 
> the FileSet.
> 
> On Windows, the fileset appears to always come out in alpha-numeric, 
> ascending order, so even though I munged the order within the 
> Javascript 
> before sorting, it always appeared sorted.  I mistakenly 
> thought that meant 
> it was working.
> 
> Dominique and I independently tried some variations (like 
> reverse order, or 
> sorting on file size), and none of these have worked.
> 
> I'm still pursuing an answer to this issue, working with a 
> Java extension 
> to the base fileset.
> 
> Arghh!  This seemed like such a simple problem, too.
> 
>          Ken
> 
> 
> At 08:03 2003-09-11, you wrote:
> >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.5236
D929%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

=============================================================
J. Kenneth Gentle (Ken)    | Phone: (610) 255-0361
Gentle Software, LLC       | Email: j.kenneth.gentle@acm.org
=============================================================


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message