I'm trying to create/update a csproj file with nant, since I'm producing asmx(.cs) files from a tool.
First of I tried to use xmlpoke but adding references and files seems not possible with xmlpoke, since the parent node has to exist for xmlpoke to work.
The following is the code snippet I'm trying:
<foreach item="File" property="ref">
<in>
<items basedir="${sdkDir}/References">
<includes name="*.dll" />
</items>
</in>
<do>
<xmlpoke file="${sdkDir}/tmp.csproj"
xpath="/VisualStudioProject/CSHARP/Build/References/[EMAIL PROTECTED]'${ref}']/@AssemblyName"
value="${ref}" />
</do>
</foreach>
<foreach item="File" property="asmx">
<in>
<items basedir="${sdkDir}/Services">
<includes name="*.asmx" />
</items>
</in>
<do>
<xmlpoke file="${sdkDir}/tmp.csproj"
xpath="/VisualStudioProject/CSHARP/Files/Include/[EMAIL PROTECTED]'${asmx}']/@BuildAction"
value="Content" />
<xmlpoke file="${sdkDir}/tmp.csproj"
xpath="/VisualStudioProject/CSHARP/Files/Include/[EMAIL PROTECTED]'${asmx}.cs']/@SubType"
value="Component" />
<xmlpoke file="${sdkDir}/tmp.csproj"
xpath="/VisualStudioProject/CSHARP/Files/Include/[EMAIL PROTECTED]'${asmx}.cs']/@DependentUpon"
value="${asmx}" />
<xmlpoke file="${sdkDir}/tmp.csproj"
xpath="/VisualStudioProject/CSHARP/Files/Include/[EMAIL PROTECTED]'${asmx}.cs']/@BuildAction"
value="Compile" />
</do>
</foreach>
There are two problems with this code:
- First it is not creating the missing nodes; there should be an option in xmlpoke to add missing parent nodes
- Secondly the file names are not relative, they are full paths, but I just need relative file names.
Any help would be apprechiated.
- Urs C. Muff
Software Architect - Research Lab, Quark EIF
Quark Inc.
[EMAIL PROTECTED] - X6360
+1 (303) 894 3360
CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail messages appended or attached to it, may contain information that is confidential or legally privileged. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that you must not read this transmission and that any disclosure, copying, printing, distribution, or use of the information contained or attached to this transmission is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify the sender by telephone +1 (303) 894-3360 or return e-mail message [EMAIL PROTECTED] and delete the original transmission, its attachments, and any copies without reading or saving in any manner. Thank you.