.NET Pre-Build Instructions
.NET Pre-Build is an XML-driven pre-build tool allowing developers to easily
generate project or make files for major IDE's and .NET development tools
including: Visual Studio 2003, Visual Studio 2002, SharpDevelop, MonoDevelop,
and NAnt.
Overview
.NET Prebuild can either be run from the command line to generate the project
and make files or you can execute the included batch (*.bat) and Unix Shell
script (*.sh) files. It uses an XML file (prebuild.xml by default) to define
what projects will be generated and what their configuration, references, and
files will be.
Currented Supported Development Tools
The development tools which .NET Prebuild is currently capable of targeting are
listed below with their associated batch and shell script files.
-
Visual Studio .NET 2003 (VS2003.bat)
-
Visual Studio .NET 2002 (VS2002.bat)
-
SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
-
MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/
MonoDevelop uses the same project files as SharpDevelop as it is a Unix port
for it using the open-source implementation of the .NET Framework, Mono. A Unix
Shell script is provided for it though, as this is far more appropriate. Visual
Studio .NET 2005 and the Visual Express IDE's can import Visual Studio .NET
2003 files, but native support for it will come later. NAnt and Makefiles are
currently not supported, but will are on the roadmap as well.
Command Line Syntax
Example:
>dnpb /target vs2003 /log ../PrebuildLog.txt
This will generate the project files for Visual Studio.NET 2003 and place the
redirect the log to a file named PrebuildLog.txt in the parent directory
The syntax structure is as below, where commandParameter is optional depending
on the command and you can provide several option-value pairs. Note: The
'<' signified the command line, do not actually enter this manually.
>dnpb /[option] [value]
>dnpb /target vs2003 /pause
>dnpb /target vs2003 /log ../Log.txt /pause /ppo /file ProjectConfig.xml
>dnpb /target sharpdev /log
>dnpb /clean
>dnpb /clean vs2003
Command Line Options
/usage - Shows the help information on how to use .NET Pre-Build and what the
different options are and what they do
/clean - The project files generated for the target type specified as a
parameter for this option will be deleted. If no value is specified or if 'all'
is specified, then project files for all the target types will be deleted.
/target - Specified the name of the development tool for which project or make
files will be generated. Possible parameter values include: vs2003, vs2002,
sharpdev
/file - Specifies the name of the XML which defines what files are to be
referenced by the generated project files as well as configures the options for
them. If not specified, prebuild.xml will be used as the default.
/log - Specified the log file that should be written to for build errors. If
this option is not specified, no log file is generated, but if just no value is
specified, then the defaul filename will be used for the log (DNPreBuild.log).
/ppo - Preprocesses the xml file to test for syntax errors or problems but
doesn't generate the files
/pause - Shows the console until you press a key so that you can view the
messages written while performing the specified actions. This allows you to
check if an errors occurred and - if so - what it was.
/showtargets - Shows a list of all the targets that can be specified as values
for the /clean and /target commands.
Example Batch Files and Shell Scripts
Common batch and shell script files are included with .NET Prebuild source and
file releases.
MonoDevelop
#!/bin/sh
# Generates a combine (.cmbx) and a set of project files (.prjx)
# for MonoDevelop, a Mono port of SharpDevelop (http://icsharpcode.net/OpenSource/SD/Default.aspx)
./dnpb /target sharpdev /pause
Visual Studio .NET 2003
@rem Generates a solution (.sln) and a set of project files (.csproj)
@rem for Microsoft Visual Studio .NET 2002
dnpb /target vs2003 /pause
Text after lines that start with @rem are comments and are not evaluated. You
can also place pause on the last line instead of specifing the /pause command.
Example XML Configuration File
XML Comments (<!-- Comment -->) are used to markup the prebuild.xml file
with notes.
DEBUG;TRACE;WIN32
DEBUG;TRACE;POSIX
false
false
false
4
false
1591;219;1573;1572;168
..\bin
true
false
true
285212672
4096
false
Docs.xml
TRACE
true
false
false
4
false
1591;219;1573;1572;168
..\bin
false
false
true
285212672
4096
false
Docs.xml
..\bin\lib\Utility
RealmForge.Utility.xml
..\bin\lib\Utility
RealmForge.Utility.xml
../bin
..\bin
DemoGame.xml
..\bin
DemoGame.xml
../bin