Grokbase Groups Ant user May 2015
FAQ
I am trying to extract individual tokens in ANT after using stringtokenizer to separate the tokens out. Is it possible? How do I do it without using any other external ant libraries like ant-contrib?

I attempted to do below, but am stuck at extracting individual tokens

<property name="dirlist" value="./src:./.apt_generated:abc" />
<loadresource property="dirseplist">
       <string value="${dirlist}" />
       <filterchain>
             <tokenfilter>
             <stringtokenizer delims=":" id="dirliststr"/>
             <replaceregex pattern="(.+)" replace="[\1]" />
             </tokenfilter>
       </filterchain>
</loadresource>
<echo level="info" message="dirlist: '${dirlist}'" />
<echo level="info" message="dirseplist : '${dirseplist}'" />

And the output is
      [echo] dirlist: './src:./.apt_generated:abc'
      [echo] dirseplist : '[./src]:[./.apt_generated]:[abc]'

Thanks





This email transmission and any accompanying attachments may contain CSX privileged and confidential information intended only for the use of the intended addressee. Any dissemination, distribution, copying or action taken in reliance on the contents of this email by anyone other than the intended recipient is strictly prohibited. If you have received this email in error please immediately delete it and notify sender at the above CSX email address. Sender and CSX accept no liability for any damage caused directly or indirectly by receipt of this email.

Search Discussions

  • Peter West at May 25, 2015 at 1:29 pm
    Have a look at this and see if it helps.

    http://codepulsive.blogspot.com.au/2013/05/ant-process-elements-in-list.html

    Peter
    “…we hear them telling in our own tongues the might works of God."

    On 25 May 2015, at 9:58 pm, WebServices Development wrote:

    I am trying to extract individual tokens in ANT after using stringtokenizer to separate the tokens out. Is it possible? How do I do it without using any other external ant libraries like ant-contrib?

    I attempted to do below, but am stuck at extracting individual tokens

    <property name="dirlist" value="./src:./.apt_generated:abc" />
    <loadresource property="dirseplist">
    <string value="${dirlist}" />
    <filterchain>
    <tokenfilter>
    <stringtokenizer delims=":" id="dirliststr"/>
    <replaceregex pattern="(.+)" replace="[\1]" />
    </tokenfilter>
    </filterchain>
    </loadresource>
    <echo level="info" message="dirlist: '${dirlist}'" />
    <echo level="info" message="dirseplist : '${dirseplist}'" />

    And the output is
    [echo] dirlist: './src:./.apt_generated:abc'
    [echo] dirseplist : '[./src]:[./.apt_generated]:[abc]'

    Thanks

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • WebServices Development at May 25, 2015 at 6:48 pm
    Thanks. I had seen that link before, but it seems to be overly complicated for getting individual tokens out when I am able to separate them using stringtokenizer. Isn't there any other simplere way to do what I am after?


    -----Original Message-----
    From: Peter West
    Sent: Monday, May 25, 2015 9:28 AM
    To: Ant Users List
    Subject: Re: Extracting individual tokens after using stringtokenizer

    Have a look at this and see if it helps.

    http://codepulsive.blogspot.com.au/2013/05/ant-process-elements-in-list.html

    Peter
    “…we hear them telling in our own tongues the might works of God."

    On 25 May 2015, at 9:58 pm, WebServices Development wrote:

    I am trying to extract individual tokens in ANT after using stringtokenizer to separate the tokens out. Is it possible? How do I do it without using any other external ant libraries like ant-contrib?

    I attempted to do below, but am stuck at extracting individual tokens

    <property name="dirlist" value="./src:./.apt_generated:abc" />
    <loadresource property="dirseplist">
    <string value="${dirlist}" />
    <filterchain>
    <tokenfilter>
    <stringtokenizer delims=":" id="dirliststr"/>
    <replaceregex pattern="(.+)" replace="[\1]" />
    </tokenfilter>
    </filterchain>
    </loadresource>
    <echo level="info" message="dirlist: '${dirlist}'" /> <echo
    level="info" message="dirseplist : '${dirseplist}'" />

    And the output is
    [echo] dirlist: './src:./.apt_generated:abc'
    [echo] dirseplist : '[./src]:[./.apt_generated]:[abc]'

    Thanks

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




    This email transmission and any accompanying attachments may contain CSX privileged and confidential information intended only for the use of the intended addressee. Any dissemination, distribution, copying or action taken in reliance on the contents of this email by anyone other than the intended recipient is strictly prohibited. If you have received this email in error please immediately delete it and notify sender at the above CSX email address. Sender and CSX accept no liability for any damage caused directly or indirectly by receipt of this email.
  • Al Le at May 25, 2015 at 9:25 pm

    but it seems to be overly complicated for getting individual tokens
    out when I am able to separate them using stringtokenizer. Isn't
    there any other simplere way to do what I am after?
    I have not fully understood your case, but I generally use the 'script'
    task (with JavaScript) when I have to do something not quite trivial.
    With that task, you have a powerfull language in your hands and can
    access the whole Ant project structure.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesant
postedMay 25, '15 at 12:00p
activeMay 25, '15 at 9:25p
posts4
users3
websiteant.apache.org

People

Translate

site design / logo © 2018 Grokbase