1 import System
.Xml
from "System.Xml"
3 class NAntScriptGenerator(GeneratorBase
):
4 [Property(ProjectFile
), Argument('Path to the .csproj file')]
6 [Property(Project
), Argument('Project name')]
9 [Property(References
)] _references
as (string
)
10 [Property(Sources
)] _sources
as (string
)
14 doc
.Load(_projectFile
)
16 root
= "//VisualStudioProject/CSHARP"
18 _references
= [node
.Attributes
['HintPath'].Value
for node
as XmlElement
in doc
.SelectNodes("${root}/Build/References/Reference")].ToArray(string
)
19 _sources
= [node
.Attributes
['RelPath'].Value
for node
as XmlElement
in doc
.SelectNodes("${root}//Files/Include/File")].ToArray(string
)
21 Process('default.build', "${Project}.build")
24 return 'Generates a NAnt build script from a Visual Studio 2005 project file (.csproj)'