--- Sugandha Shah <[EMAIL PROTECTED]> wrote:
> Is it possible to do following task with Ant.
>
> jdbc.driver.properties=user=xyz;password=abc ;maxconn=10"
>
> Now in the build .xml I require them as separate parameters
>
> i.e user =xyz
>
> password=abc
>
> maxconn=10
>
> So is there any task which behaves like string tokenizer.
I don't know of any task currently available, but you could use the
<script> task.
You didn't say what you wanted to do with the params once you've separated
them, but here's a simple example that just echo's them out:
<property name="jdbc.driver.properties"
value="user=xyz;password=abc;maxconn=10"/>
<target name="doParams">
<antcall target="tokenize">
<param name="params" value="${jdbc.driver.properties}"/>
</antcall>
</target>
<target name="tokenize">
<script language="javascript"> <![CDATA[
importClass(java.util.StringTokenizer);
params = new StringTokenizer(projname.getProperty("params"), ";");
while (params.hasMoreTokens()) {
param = params.nextToken();
showit = projname.createTask("echo");
showit.setMessage(param);
showit.execute();
}
]]> </script>
</target>
Diane
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>