README 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. Prebuild Instructions
  2. Prebuild 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 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, SharpDevelop2, MonoDevelop, and NAnt.
  3. _______________________________________________________________________________
  4. Overview
  5. Prebuild can be either be run from the command line to generate the
  6. project and make files or you can execute the included batch (*.bat)
  7. and Unix Shell script (*.sh) files.
  8. _______________________________________________________________________________
  9. The currently supported developement tools and their associated batch
  10. and shell script files.
  11. Visual Studio .NET 2005 (VS2005.bat)
  12. Visual Studio .NET 2003 (VS2003.bat)
  13. Visual Studio .NET 2002 (VS2002.bat)
  14. SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
  15. SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/
  16. MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/
  17. NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/
  18. Autotools (autotools.bat and autotools.sh) - http://en.wikipedia.org/wiki/GNU_build_system
  19. Notes:
  20. A Unix Shell script is provided for MonoDevelop, as it does not run on
  21. Windows at this time.
  22. Visual Studio .NET 2005 and the Visual Express IDE's can import
  23. solutions from older versions of Visual Studio .NET.
  24. Makefiles are not currently supported.
  25. _______________________________________________________________________________
  26. Command Line Syntax:
  27. Example:
  28. > Prebuild /target vs2003
  29. This will generate the project files for Visual Studio.NET 2003 and
  30. place the redirect the log to a file named PrebuildLog.txt in the
  31. parent directory
  32. The syntax structure is as below, where commandParameter is optional
  33. depending on the command and you can provide several option-value
  34. pairs.
  35. Note: The '> ' signifies the command prompt, do not enter this literally
  36. > Prebuild /<option> <commandParameter>
  37. > Prebuild /target vs2003 /pause
  38. > Prebuild /target vs2003 /log ../Log.txt /pause /ppo /file ProjectConfig.xml
  39. > Prebuild /target sharpdev /log
  40. > Prebuild /removedir obj|bin
  41. > Prebuild /target vs2003 /allowedgroups Group1|Group2
  42. > Prebuild /clean
  43. > Prebuild /clean /yes
  44. > Prebuild /clean vs2003
  45. _______________________________________________________________________________
  46. Command Line Options:
  47. /usage - Shows the help information on how to use Prebuild and what
  48. the different options are and what they do
  49. /clean - The project files generated for the target type specified as
  50. a parameter for this option will be deleted. If no value is specified
  51. or if 'all' is specified, then project files for all the target types
  52. will be deleted.
  53. /target - Specified the name of the development tool for which project
  54. or make files will be generated. Possible parameter values include:
  55. vs2003, vs2002, sharpdev
  56. /file - Specifies the name of the XML which defines what files are to
  57. be referenced by the generated project files as well as configures the
  58. options for them. If not specified, prebuild.xml in the current
  59. directory will be used as the default.
  60. /log - Specified the log file that should be written to for build
  61. errors. If this option is not specified, no log file is generated,
  62. but if just no value is specified, then the defaul filename will be
  63. used for the log (Prebuild.log).
  64. /ppo - Preprocesses the xml file to test for syntax errors or problems
  65. but doesn't generate the files
  66. /pause - Shows the console until you press a key so that you can view
  67. the messages written while performing the specified actions.
  68. This allows you to check if an errors occurred and - if so - what it
  69. was.
  70. /showtargets - Shows a list of all the targets that can be specified
  71. as values for the /clean and /target commands.
  72. /allowedgroups - This is followed by a pipe-delimited list of project
  73. group filter flags (eg. Group1|Group2) allow optional filtering of all
  74. projects that dont have at least one of these flags
  75. /removedir - This is followed by a pipe-delimited list of directory
  76. names that will be deleted while recursivly searching the directory of
  77. the prebuild application and its child directories (eg. use obj|bin to
  78. delete all output and temporary directories before file releases)
  79. /yes - Answer yes to any warnings (e.g. when cleaning all projects).
  80. _______________________________________________________________________________
  81. Example Batch Files and Shell Scripts
  82. NOTE: Common batch and shell script files are included with Prebuild source and file releases.
  83. ______________________________
  84. MonoDevelop
  85. #!/bin/sh
  86. # Generates a solution (.mds) and a set of project files (.mdp)
  87. # for MonoDevelop, a Mono port of SharpDevelop
  88. # (http://icsharpcode.net/OpenSource/SD/Default.aspx)
  89. ./Prebuild /target monodev /pause
  90. ______________________________
  91. Visual Studio .NET 2003
  92. @rem Generates a solution (.sln) and a set of project files (.csproj)
  93. @rem for Microsoft Visual Studio .NET 2002
  94. Prebuild /target vs2003 /pause
  95. Notes:
  96. Text after lines that start with @rem are comments and are not evaluated
  97. You can also place pause on the last line instead of specifing the /pause command.
  98. _______________________________________________________________________________
  99. Example XML Configuration File
  100. Note:
  101. XML Comments (<!-- Comment -->) are used to markup the prebuild.xml
  102. file with notes
  103. The below file may be out-of-date, however the RealmForge Prebuild
  104. file serves as an up-to-date and extensive example.
  105. It can be viewed using Tigris.org's WebSVN
  106. (http://realmforge.tigris.org/source/browse/realmforge/trunk/src/prebuild.xml)
  107. by just clicking on the "view file" link for the latest revision.
  108. _________________________________
  109. <?xml version="1.0" encoding="utf-8"?>
  110. <!--The version of the XML schema specified in the version and xmlns attributes should match the one for which the version of Prebuild.exe used was compiled for. In this example it is the version 1.3 schema, you can find the XSD schema file at the url specified in the xmlns attribute. -->
  111. <Prebuild version="1.6" xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.6.xsd">
  112. <Solution name="RealmForge"> <!--The title and file name for the solution, combine, workspace, or project group (depending on what development tool you are using)-->
  113. <!--Configurations found as children of Solution are used as templates for the configurations found in the project, this allows you to avoid writing the same options in each project (and maintaining each of these). You can provide defaults and then override them in the configurations defined for each project. All options are optional.-->
  114. <Configuration name="Debug">
  115. <Options>
  116. <!-- simple logically expressions can be evaluated, if, else, elseif, and endif are valid statements. Note that it is not neccisary to define POSIX or WIN32 -->
  117. <?if OS = "Win32" ?>
  118. <CompilerDefines>DEBUG;TRACE;WIN32</CompilerDefines>
  119. <?else ?>
  120. <CompilerDefines>DEBUG;TRACE;POSIX</CompilerDefines>
  121. <?endif ?>
  122. <OptimizeCode>false</OptimizeCode>
  123. <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
  124. <AllowUnsafe>false</AllowUnsafe>
  125. <WarningLevel>4</WarningLevel>
  126. <!-The filter for the number of warnings or errors shown and the tolerance level as to what is an error. This is value from 0 to 4 where 4 is the most strict (least tolerent).-->
  127. <WarningsAsErrors>false</WarningsAsErrors>
  128. <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
  129. <!-- A semicolon ';' delimited list of the warnings that are filtered and not shown in the output window during compiling a project. Only include the number portion of the warning codes that are shown in output during compilation (eg CS1591, should be entered as 1591)-->
  130. <OutputPath>..\bin</OutputPath>
  131. <DebugInformation>true</DebugInformation>
  132. <RegisterComInterop>false</RegisterComInterop>
  133. <IncrementalBuild>true</IncrementalBuild>
  134. <BaseAddress>285212672</BaseAddress>
  135. <FileAlignment>4096</FileAlignment>
  136. <NoStdLib>false</NoStdLib>
  137. <XmlDocFile>Docs.xml</XmlDocFile>
  138. </Options>
  139. </Configuration>
  140. <Configuration name="Release"> <!-- You can define multple configurations that projects can have, but there is no way to define which one is selected by default as this is a part of the user preferences for a project, not the solution or project files -->
  141. <Options>
  142. <CompilerDefines>TRACE</CompilerDefines>
  143. <OptimizeCode>true</OptimizeCode>
  144. <CheckUnderflowOverflow>false</CheckUnderflowOverflow>
  145. <AllowUnsafe>false</AllowUnsafe>
  146. <WarningLevel>4</WarningLevel>
  147. <WarningsAsErrors>false</WarningsAsErrors>
  148. <SuppressWarnings>1591;219;1573;1572;168</SuppressWarnings>
  149. <OutputPath>..\bin</OutputPath>
  150. <DebugInformation>false</DebugInformation>
  151. <RegisterComInterop>false</RegisterComInterop>
  152. <IncrementalBuild>true</IncrementalBuild>
  153. <BaseAddress>285212672</BaseAddress>
  154. <FileAlignment>4096</FileAlignment>
  155. <NoStdLib>false</NoStdLib>
  156. <GenerateXmlDocFile>true</GenerateXmlDocFile>
  157. <XmlDocFile>Docs.xml</XmlDocFile>
  158. </Options>
  159. </Configuration>
  160. <!-- One of the projects that is included in the Solution -->
  161. <Project name="RealmForge.Utility" Language="VisualBasic" path="Utility" type="Library" assemblyName="RealmForge.Utility" rootNamespace="RealmForge">
  162. <Configuration name="Debug">
  163. <Options>
  164. <OutputPath>..\bin\lib\Utility</OutputPath>
  165. <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
  166. </Options>
  167. </Configuration>
  168. <Configuration name="Release">
  169. <Options>
  170. <OutputPath>..\bin\lib\Utility</OutputPath>
  171. <XmlDocFile>RealmForge.Utility.xml</XmlDocFile>
  172. </Options>
  173. </Configuration>
  174. <ReferencePath>../bin</ReferencePath>
  175. <Reference name="System"/>
  176. <Reference name="System.Data"/>
  177. <Reference name="System.Drawing"/>
  178. <Reference name="System.Xml"/>
  179. <Reference name="System.Runtime.Serialization.Formatters.Soap"/>
  180. <Reference name="ICSharpCode.SharpZipLib"/>
  181. <Files>
  182. <Match path="." pattern="*.vb" recurse="true"/>
  183. </Files>
  184. </Project>
  185. <!-- Another projects that is included in the Solution -->
  186. <Project name="DemoGame" Language="C#" path="DemoGame" type="WinExe" icon="..\bin\RealmForge.ico" assemblyName="DemoGame" rootNamespace="RealmForge">
  187. <!-- icon is used to define the location of the .ico file that is embeeded in the assembly when the project is compiled. This is relative to the project path -->
  188. <!--type defines the type of project, valid types are Library (.dll), WinExe (.exe), and Exe (.exe). WinExe is not windows specific, it just defines that it is a GUI application and that no Console or Command window will show when it is started-->
  189. <Configuration name="Debug">
  190. <Options>
  191. <OutputPath>..\bin</OutputPath>
  192. <XmlDocFile>DemoGame.xml</XmlDocFile>
  193. </Options>
  194. </Configuration>
  195. <Configuration name="Release">
  196. <Options>
  197. <OutputPath>..\bin</OutputPath>
  198. <XmlDocFile>DemoGame.xml</XmlDocFile>
  199. </Options>
  200. </Configuration>
  201. <ReferencePath>../bin</ReferencePath>
  202. <Reference name="System"/> <!-- Assemblies that are located in the GAC (installed, global) can be referenced-->
  203. <Reference name="ode"/> <!-- Assemblies that are located in the output directory to which the file is built can be referenced -->
  204. <Reference name="RealmForge.Utility"/> <!-- When you reference the name of another project, then that project (and it's output) will be referenced instead of looking for a pre-built assembly-->
  205. <Files>
  206. <Match path="." pattern="*.cs" recurse="true"/>
  207. <Match path="." pattern="*.bmp" recurse="true" buildAction="EmbeddedResource"/>
  208. <Match path="." pattern="[^a]*\.(png|jpg)" useRegex="true" buildAction="EmbeddedResource"/>
  209. <!-- Uses a regex or regular expression to find all files that end with .png or .jpg but dont have the letter 'a' in their name and add them to the project as EmbeddedResource's. Because recurse enabled (default is false), only the values in the files in that are directly in the project directory (not child directories) are checked.-->
  210. <!--EmbeddedResource, Content, and Compile are valid buildAction's-->
  211. </Files>
  212. </Project>
  213. </Solution>
  214. </Prebuild>