File: script-sample.build

package info (click to toggle)
nant 0.85.dfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,364 kB
  • ctags: 6,756
  • sloc: cs: 50,420; sh: 1,014; makefile: 87; cpp: 70; xml: 40
file content (25 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?xml version="1.0"?>
<project name="Script Test" default="run">
    <target name="run">
        <property name="test.property" value="initial"/>
        <script language="C#" mainclass="Test">
            <code>
                <![CDATA[
                    class Test {
                        public static void ScriptMain(Project project) {
                            PropertyDictionary pd = project.Properties;
                            
                            foreach (DictionaryEntry property in pd) {
                                Console.WriteLine("{0} = {1}", property.Key, property.Value);
                            }

                            Console.WriteLine("Setting test.property to 'new value'");
                            pd["test.property"] = "new value";
                        }
                    }
                ]]>
            </code>
        </script>
        <echo message="test.property = ${test.property}"/>
    </target>
</project>