Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://marc.info/?l=ant-user&amp;m=108988637506114&amp;w=2" rel="noreferrer">From this thread</a>, use an Ant <code>&lt;script&gt;</code> task:</p> <pre><code>&lt;target name="capitalize"&gt; &lt;property name="foo" value="This is a normal line that doesn't say much"/&gt; &lt;!-- Using Javascript functions to convert the string --&gt; &lt;script language="javascript"&gt; &lt;![CDATA[ // getting the value sentence = project.getProperty("foo"); // convert to uppercase lowercaseValue = sentence.toLowerCase(); uppercaseValue = sentence.toUpperCase(); // store the result in a new property project.setProperty("allLowerCase",lowercaseValue); project.setProperty("allUpperCase",uppercaseValue); ]]&gt; &lt;/script&gt; &lt;!-- Display the values --&gt; &lt;echo&gt;allLowerCase=${allLowerCase}&lt;/echo&gt; &lt;echo&gt;allUpperCase=${allUpperCase}&lt;/echo&gt; &lt;/target&gt; </code></pre> <p>Output</p> <pre><code>D:\ant-1.8.0RC1\bin&gt;ant capitalize Buildfile: D:\ant-1.8.0RC1\bin\build.xml capitalize: [echo] allLowerCase=this is a normal line that doesn't say much [echo] allUpperCase=THIS IS A NORMAL LINE THAT DOESN'T SAY MUCH BUILD SUCCESSFUL </code></pre> <p><strong>Update</strong> for WarrenFaith's comment to separate the script into another target and pass a property from the <strong>called target</strong> <em>back to the calling target</em></p> <p>Use <a href="http://ant-contrib.sourceforge.net/tasks/tasks/antcallback_task.html" rel="noreferrer">antcallback</a> from the ant-contrib jar</p> <pre><code>&lt;target name="testCallback"&gt; &lt;antcallback target="capitalize" return="allUpperCase"&gt; &lt;param name="param1" value="This is a normal line that doesn't say much"/&gt; &lt;/antcallback&gt; &lt;echo&gt;a = ${allUpperCase}&lt;/echo&gt; &lt;/target&gt; </code></pre> <p>and <code>capitalise</code> task uses the passed in <code>param1</code> thus</p> <pre><code> &lt;target name="capitalize"&gt; &lt;property name="foo" value="${param1}"/&gt; </code></pre> <p>Final output </p> <pre><code> [echo] a = THIS IS A NORMAL LINE THAT DOESN'T SAY MUCH </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload