27 August 2006

Intellisense Nant Build Script on VSNET

From Serge van den Oever
1. Edit and save following build script to NAntGenerateSchema.build. This
script is used to generate the nant.xsd for the Intellisense trick
<?xml version="1.0" encoding="utf-8" ?> <project
name="GenerateNAntSchemaForVS.NET" default="genschema"> <property
name="myVsNetRoot" value="C:\Program Files\Microsoft Visual Studio .NET 2003"
/> <property name="nantSchema"
value="${myVsnetRoot}\Common7\Packages\schemas\xml\NAnt.xsd"/> <target
name="genschema"> <nantschema output="${nantSchema}" target-ns=" http://nant.sf.net/schemas/nant.xsd"/>
</target> </project>

1) update property myVsNetRoot to your VSNET install path.

2) save this script as NAntGenerateSchema.build

3) run "nant NAntGenerateSchema.build ' . This will download the latest nant schema from Source Forge to VSNET schema dir. Note: this script should be run when refreshing nant releases.

2. Suppose you are working on HelloWorld.sln with VSNET, create a HelloWorld.build, which is your nant build script. Open HelloWorld.build in the IDE ((RC) by open with - HTML/XML Editor (set to default unless you need encoding).

3. Open the properties window for HelloWorld.build, Select " http://nant.sf.net/schemas/nant.xsd" as TargetSchema.

Job done.

Technorati Tags: NANT VSNET

No comments: