Hello Cheney,

you can probably build your dirset using a scriptselector

see http://ant.apache.org/manual/CoreTypes/selectors.html#scriptselector about scriptselectors.

read the section about library dependencies, you will needs bsf.jar and js.jar on the classpath I think if you add some custom javascript to your build.

<dirset dir="webroot" id="containsjs">
<scriptselector language="javascript">
importClass(java.io.File)
     importClass(java.lang.String)
     selected = false;
     filesindir = file.list();
     for (i = 0; i< filesindir.length; i++) {
        if (filesindir[i].endsWith(".js") {
             selected=true;
         }
     }
     self.setSelected(selected);
   </scriptselector>
</dirset>

<echo>${toString:containsjs}</echo>

<copy todir="deploy" includeemptydirs="true">
  <dirset refid="containsjs"/>
</copy>

For the depends task, I do not know it out of heart.

Regards,

Antoine

張毓成 wrote:
Hi, everyone!
  I wanna ask two questions.

1. how to select folders and sub folders that contains the specific
filetype, and excludes all files.
e.g.  select all folders that contains js files.
i use the following script and it did not work.

<copy todir="deploy">
    <dirset dir="webroot" includes="**/*.js"/>
</copy>


2.how to use the depend task? I delele a java file in the source
folder and run the following script
and class file in the classes wont be deleted.
<depend srcdir="src" destdir="${classes.dir}" closure="on"/>

thanks in advanced.



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

Reply via email to