Presentation is loading. Please wait.

Presentation is loading. Please wait.

NAnt Build Tool CSE784 : ProjectCentralNet Prof : Dr. Jim Fawcett

Similar presentations


Presentation on theme: "NAnt Build Tool CSE784 : ProjectCentralNet Prof : Dr. Jim Fawcett"— Presentation transcript:

1 NAnt Build Tool CSE784 : ProjectCentralNet Prof : Dr. Jim Fawcett
Presented By : Dipesh Khakhkhar Team : Open source tools

2 About NAnt NAnt is a free .NET build tool.
In theory it is kind of like make without make's wrinkles. In practice it's a lot like Ant. Ant is Java Build tool. For more information about Ant see NAnt name is derived from the fact that it is not Ant.

3 Interface Command line interface only.
Instead of a model where it is extended with shell-based commands, NAnt is extended using task classes. Instead of writing shell commands, the configuration files are XML-based, calling out a target tree where various tasks get executed. Each task is run by an object that implements a particular Task interface.

4 System Requirements To use NAnt you need Microsoft .NET Framework SDK.
This includes the runtime and the tools required to build programs. NAnt has been tested with version

5 Dependencies As mentioned in the earlier slide you need to have .NET framework installed. NAnt uses a number of open source third party libaries. Recent versions are included with the NAnt distribution and no extra work is required to install them. Libraries for the following are included: NUnit - Required for unit testing NDoc - Required for documentation generation SharpZipLib - Required for the zip and unzip tasks

6 Conceptual flow for NAnt

7 Running NAnt Path of the NAnt.exe is set up in the PATH variable.
When nothing is specified, NAnt looks for a file ending with .build, e.g., NAnt.build, in the current directory. If found, it uses that file as the build file.  If more than one file is found you need to specify the build file using the –buildfile option.

8 Running NAnt (continue)
Examples NAnt Runs NAnt using the file ending in *.build.xml file in the current directory, on the default target. NAnt -buildfile:..\ProjectName.build Runs NAnt using the ProjectName.build file in the parent directory, on the default target. NAnt clean Runs NAnt using the default build file in the current directory, on a target called clean.

9 Example build file Here is a simple build file that compiles a C# HelloWorld project. <project> <?xml version="1.0"?> <project name="Hello World" default="build" basedir="."> <description>The Hello World of build files.</description> <property name="debug" value="true" overwrite="false" /> <target name="clean" description="remove all generated files"> <delete file="HelloWorld.exe" failonerror="false" /> <delete file="HelloWorld.pdb" failonerror="false" /> </target> <target name="build" description="compiles the source code"> <csc target="exe" output="HelloWorld.exe" debug="${debug}"> <sources> <includes name="HelloWorld.cs" /> </sources> </csc> </project>

10 Build file (continue) In the above example there are two targets, "clean" and "build".  By default the "build" target will be called. Each project defines one or more targets. A target is a set of tasks to be executed. A target can depend on other targets.  You might have a target for compiling, for example, and a target for creating a distributable. A task is a piece of code that can be executed. A task can have multiple attributes. Tasks have a common structure: <name attribute1="value1" attribute2="value2" ... /> where name is the name of the task, attribute# is the attribute name, and value# is the value for this attribute.

11 Interaction with third party tools
Can interact with CVS for source control and configuration management. Possible to interact with NUnit to perform unit test on the functions. Can execute system command using <exec> task.

12 Areas of improvement/enhancement
The tool provides vast capability which can be utilized by providing interactive GUI. Still in the exploration phase more work is on progress.

13 Any Questions ??? Thanks !!


Download ppt "NAnt Build Tool CSE784 : ProjectCentralNet Prof : Dr. Jim Fawcett"

Similar presentations


Ads by Google