I get the following error when trying to using ruby as a script language.
"unable to load a script engine manager (org.apache.bsf.BSFManager or
javax.script.ScriptEngineManager)"
Do i need to import something else?
The resource count is not working for me. It always returns 1 irrespective
of number of files in the directory.
<resourcecount property="uninstall-files">
<filelist dir="${installDir}/uninstall" files="*.jar" />
</resourcecount>
<echo message="count of files ${uninstall-files}" />
Any idea what is the error.
Thanks
Rebhan, Gilbert wrote:
>
>
>
> -----Original Message-----
> From: Sujie [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 26, 2007 10:42 AM
> To: [email protected]
> Subject: Ant task to Count number of files in a directory
>
> /*
> Hi
>
> I would like to count the number of jar files in a directory.
> I am using ANT 1.7.
> */
>
> with ant < 1.7
>
> <script language="ruby">
> <![CDATA[
> $project.setProperty "yourproperty", Dir["C:/your/path/**/*.jar"].length
> ]]>
> </script>
>
> use your/path/**/*.jar if you want to search recursive,
> otherwise use /*.jar
>
> ${yourproperty} contains number of jars
>
>
> with ant => 1.7
> see manual coretasks / resourcecount
>
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Ant-task-to-Count-number-of-files-in-a-directory-tf4695926.html#a13424198
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]