task to build your project.
What/where is Slingshot?
Slingshot is a project for converting Visual Studio .NET solutions to NAnt build files. It is currently part of the NAntContrib project.
Can I build C++ projects with NAnt?
Yes. See the Visual C++ tasks and John Lam's docs in NAntUsage.
Can NAnt access code that resides in SourceSafe?
Yes, there are Visual SourceSafe tasks (see NAntContrib) and hopefully there are CVS tasks in the main distribution. See SourceControl for an overview.
How do I execute a batch file from within NAnt?
To do this you must explicitly invoke the command processor (cmd.exe) passing your batch file in the command line.
commandline="/c test.bat" >
How do I contribute to NAnt or NAntContrib?
It's that easy. Or do the same for documentation -- lots of work is needed there too.
I want to get the source but I've never used CVS before -- what do I need?
See GettingAndBuilding
How do I create my own tasks?
Read the tutorial. Post to the list to see if someone is already working on a similar task. Use the Attrib task as reference, flesh it out, then post it to the developer list for review. Be sure you adhere to our coding guidelines.
Now that I've created my own tasks how do I get NAnt to find them?
Ensure that your assembly is named somthing like XXXTasks.dll and that it is placed in the same directory as NAnt, or in a subdirectory named 'tasks'.
How can I target multiple framework versions with NAnt?
See [http://nant.sourceforge.net/wiki/index.php/Specifying%20.NET%20Framework%20Versions]
Are there any guidelines or best practices for using NAnt?
Not right now, but hopefully soon. If you have any suggestions in this area, please feel free to post them to the NAnt-users list.
Is a feature to load properties from a file like in Ant ?
There sure is. Use the include task:
The included file must also be a build file format. Just put standard property definitions in it. somthing like:
Does NAnt work with Mono?
The Mono team currently uses an old version of NAnt to build their libraries. The NAnt team has the goal of providing a version of NAnt that is cross-platform (under the Microsoft .NET framework on Windows as well as Mono on Linux), but this needs some work and dedicated testing -- particularly on a Linux machine.
However you execute builds against the mono toolchain on windows right now. Either set the defaultFramework in NAnt.exe.config to a mono-{ver} or set the currentframework property in your buildfile to mono. .
See also MonoSupport.
How can I make .build files have syntax highlighting in Visual Studio .NET?
If you use the Visual Studio .NET File Open dialog to open the .build file, there is an arrow to the right of the Open button. Click the arrow and choose *Open With...* You will see a list of options. Choose *HTML/XML Editor*. Click *Set* as default. -ArildFines
You can also do the same thing within the Solution Explorer by right-clicking and choosing Add/Add Existing Item. Add the .build file to your solution. Then right-click the .build file and choose *Open With*. Now follow the previous directions. -ScottPascoe
_Here are more detailed instructions_ (from Duncan Goodwin email on nant-users)
The steps are:
- From inside Visual Studio.NET right click on the .build file, and from the context-menu select open with..
- Select html/xml editor, and click Set default (so next time you can skip the open with)
- Put an XML schema for NAnt in c:\Program Files\Microsoft Visual Studio.NET\Common7\Packages\schemas\xml\
which can be gottten from http://nant.sf.net/schema/ .
- In the build file, match the schema you put in the xml\ directory with the .build file, e.g.
- If you use the VS.Net properties window for the build file, you can use the dropdown to set the namespace automagically.
_Here's some updated info on the NAnt Schema:_
From: Scott Hernandez
Date: Wed, 03 Dec 2003 19:48:55 -0800
In the next nightly build there will be a new target called "deploy-schema"
that will copy the schema file to the vs.net (7.0 and 7.1) schema
directories. That should help a little :)
*Please note* that the targetNamespace is in the form of
="~http://nant.sf.net/schemas/${project.name}-${project.version}.${nant.platform.name}.${nant.settings.currentframework}.xsd"=
which for me became
=~"~http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd";=
on the latest cvs tree. The nightly build will replace the version with the date, I believe.
But the point is that there is _no one namespace; it is always changing_ as
the source code is changing...
_You should now have Intellisense and validation!_
Why aren't some files being compiled/copied/zipped, etc.?
If you're using a task that has a fileset , make sure the case of the file name matches the file system. Filenames in an are case-sensitive.
How do I check if a directory is empty?
One way to accomplish this:
Can I use the Windows Explorer to run .build files?
You could associate nant.exe with the .build extension. This will build the project's default target, if you double click the .build script in the Windows Explorer. Alternatively you could try the NAntMenu Shell Extension, which populates the .build file's context menu with it's main targets.
If I include a build file that exists in another directory (using the element), where is the path relative to for the included build file? Is the current path relative to where each build file exists or the main file that is including each build file?
If the path is relative to the location of each individual build file, is there a way to get the directory of the main build file?
I build a solution using the nant solution task. Why are the resources contained in the solution not built to satellite assemblies using the resource naming convention for the directories (as it is done by Visual Studio) ?
They should be now. There was a bug where this was not happening correctly.
Comments (0)
You don't have permission to comment on this page.