Last active
December 29, 2015 00:59
-
-
Save benerdin/7589819 to your computer and use it in GitHub Desktop.
Example of how to use nAnt's <foreach> and <xmlpoke> tasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| Given the following files in C:\ | |
| * app.1.config | |
| * app.2.config | |
| * app.3.config | |
| * file.txt | |
| This task will perform 3 iterations and set ${filename} to the following: | |
| * C:\app.1.config | |
| * C:\app.2.config | |
| * C:\app.3.config | |
| --> | |
| <foreach item="File" property="filename"> | |
| <in> | |
| <items> | |
| <include name="C:\*.config" /> | |
| </items> | |
| </in> | |
| <do> | |
| <xmlpoke file="${filename}" | |
| xpath="/configuration/appSettings/add[@key='AppSettingKey']/@value" | |
| value="My Value" /> | |
| </do> | |
| </foreach> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Compare value of variables --> | |
| <if test="${variable1 == variable2}"> | |
| </if> | |
| <if test="${property::exists('variableName')}"> | |
| </if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment