Direct Dynamic Value

This will replace the value of a property with the value from a parameter. If the user does not enter a parameter value, then the default will be used (when set).

warning

This dynamic value does not perform any formatting, it just directly puts the value into the property.

Version

Available from version 1.5

Examples

Basic example

1<nant>
2  <!-- Omitted for brevity -->
3  <dynamicValues>
4    <buildArgs>Help</buildArgs>
5    <directValue property="buildArgs" parameter="CommandToRun" default="Help" />
6  </dynamicValues>
7</nant>

Shorthand example

1<nant>
2  <!-- Omitted for brevity -->
3  <dynamicValues>
4    <buildArgs>$[CommandToRun|Help]</buildArgs>
5  </dynamicValues>
6</nant>

Example in context

 1<project name="Test Project">
 2  <sourcecontrol type="svn">
 3    <!-- Omitted for brevity -->
 4  </sourcecontrol>
 5  <triggers>
 6    <intervalTrigger />
 7  </triggers>
 8  <tasks>
 9    <nant>
10      <!-- Omitted for brevity -->
11      <buildArgs>Help</buildArgs>
12      <dynamicValues>
13        <directValue property="buildArgs" parameter="CommandToRun" default="Help" />
14      </dynamicValues>
15    </nant>
16    <!-- Omitted for brevity -->
17  </tasks>
18  <publishers>
19    <!-- Omitted for brevity -->
20  </publishers>
21  <parameters>
22    <!-- Omitted for brevity -->
23  </parameters>
24</project>

Configuration Elements

Element Description Type Required Default Version
default The default value to use if nothing is set in the parameters. String No n/a 1.5
parameter The name of the parameter to use. This must be the same name as what is in the parameters configuration. String Yes n/a 1.5
property The name of the property to set. This must be the same name as what is in the task/publisher/trigger configuration. String Yes n/a 1.5

Automatically Generated

Documentation generated on Monday, 26 May 2014 at 7:18:03 AM