Fixed CORE-16. Adding proxy support for FactorySupportFacility. (Should be a FACILTI...
[castle.git] / common.xml
blobcf935143b05a35aa772823e80af16e035ff127c1
1 <?xml version="1.0"?>\r
2 <project name="Castle" xmlns="http://nant.sf.net/release/0.85/nant.xsd">\r
3         <!-- \r
4                 Use this to determine if the key file CastleKey.snk should be used to \r
5                 sign the assemblies. Defaults to true since private key is present\r
6                 in SVN.\r
7         -->\r
8         <property name="sign" value="true" overwrite="false" />\r
9         <property name="key.file" value="${path::get-full-path(root.dir)}/CastleKey.snk" />\r
11         <!-- Controls whether tests are run. Setting this is as input to the build disables *all* tests. -->\r
12         <property name="common.run-tests" value="true" overwrite="false" />\r
13         <property name="common.testrunner.enabled" value="${common.run-tests}" overwrite="false" />\r
14         <property name="common.testrunner.failonerror" value="true" overwrite="false" /> <!--  Whether to keep building when tests are failing -->\r
16         <!-- Check which nant version we're using - fail if it's not the minium  -->\r
17         <property name="current.nant-version" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" />\r
18         <property name="required.nant-version" value="0.85.2478.0" /> <!-- Nant 0.85 release version -->\r
20         <!-- properties used to connect to database for testing -->\r
21         <property name="ar.dialect" value="NHibernate.Dialect.MsSql2000Dialect" overwrite="false" />\r
22         <property name="ar.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" overwrite="false" />\r
23         <property name="ar.connection.connection_string.1" value="Server=(local);initial catalog=test;Integrated Security=SSPI" overwrite="false" />\r
24         <property name="ar.connection.connection_string.2" value="Server=(local);initial catalog=test2;Integrated Security=SSPI" overwrite="false" />\r
26         <!-- \r
27                 Path to the folder that contain the external assemblies.  For net-2.0 the values will\r
28                 be lib, lib/net, and lib/net/2.0 respectively.\r
29         -->\r
30         <property name="lib.dir" value="SharedLibs" dynamic="true" />\r
31         <property name="lib.family.dir" value="${path::combine(lib.dir, framework::get-family(framework::get-target-framework()))}" dynamic="true" />\r
32         <property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" />\r
34         <!-- \r
35                 Versioning\r
36         -->\r
37         <property name="project.version"        value="1.1.0.0" overwrite="false" />\r
38         <property name="project.major"          value="${version::get-major(version::parse(project.version))}"          dynamic="true" />\r
39         <property name="project.minor"          value="${version::get-minor(version::parse(project.version))}"          dynamic="true" />\r
40         <property name="project.build"          value="${version::get-build(version::parse(project.version))}"          dynamic="true" />\r
41         <property name="project.revision"       value="${svn.revision}"                                                                                         dynamic="true" />\r
43         <property name="assembly.major"         value="${version::get-major(version::parse(assembly.version))}"         dynamic="true" />\r
44         <property name="assembly.minor"         value="${version::get-minor(version::parse(assembly.version))}"         dynamic="true" />\r
45         <property name="assembly.build"         value="${version::get-build(version::parse(assembly.version))}"         dynamic="true" />\r
46         <property name="assembly.revision"      value="${version::get-revision(version::parse(assembly.version))}"      dynamic="true" />\r
47         \r
48         <property name="svn.revision" value="0" overwrite="false" />\r
50         <!-- \r
51                 These are used to set the correct attributes in AssemblyInfo.cs.  \r
52         -->\r
53         <property name="project.company" value="Castle Project" />\r
55         <!-- debug|release -->\r
56         <property name="build.defines" value="TRACE" />\r
57         <property name="build.defines" value="${build.defines},STRONG" if="${sign}" />\r
59         <!-- platform specific properties. These are the defaults -->\r
60         <property name="current.build.defines" value="${build.defines}" />\r
62         <!-- named project configurations -->\r
63         <target name="set-debug-project-configuration" description="Perform a 'debug' build">\r
64                 <property name="build.debug"    value="true" />\r
65                 <property name="build.optimize" value="false" overwrite="false" />\r
66         </target>\r
67         \r
68         <target name="set-release-project-configuration" description="Perform a 'release' build">\r
69                 <property name="build.debug"    value="false" />\r
70                 <property name="build.optimize" value="true" overwrite="false" />\r
71         </target>\r
73         <target name="set-project-configuration">\r
74                 <property name="project.config" value="debug" overwrite="false" />\r
75                 <if test="${not(target::exists('set-' + project.config + '-project-configuration'))}">\r
76                         <fail message="Unknown configuration: '${project.config}'" />\r
77                 </if>\r
78                 <property name="build.warnaserrors" value="true" overwrite="false" />\r
79                 <property name="build.warnmissingdocs" value="false" overwrite="false" />\r
80                 <call target="set-${project.config}-project-configuration" />\r
82                 <property name="src.dir"                        value="${path::get-full-path(project::get-base-directory())}" />\r
83                 <property name="build.base.dir"         value="${path::get-full-path(root.dir)}/build" />\r
84                 <property name="build.family.dir"       value="${build.base.dir}/${nant.settings.currentframework}" />\r
85                 <property name="build.dir"                      value="${path::get-full-path(path::combine(build.family.dir,project.config))}" dynamic="true" />\r
86                 <property name="testresults.dir"        value="${build.dir}/test-results" />\r
87                 <property name="releasenotes.dir"       value="${build.dir}/ReleaseNotes" />\r
88                 <property name="docs.dir"                       value="${build.base.dir}/docs" />\r
89                 <property name="build.rebuild"          value="false" overwrite="false" />\r
90         </target>\r
92         <target name="set-framework-configuration">\r
93                 <if test="${not(target::exists('set-'+framework::get-target-framework()+'-framework-configuration'))}">\r
94                         <fail message="The '${framework::get-target-framework()}' framework is not supported by this version of Castle." />\r
95                 </if>\r
96                 <property name="csc.keyfile"    value="" />\r
97                 <property name="csc.args"               value="" />\r
98                 <call target="set-${framework::get-target-framework()}-framework-configuration" />\r
100                 <property name="build.msbuild"  value="false" overwrite="false" />\r
102         </target>\r
104         <target name="set-net-2.0-framework-configuration">\r
105                 <property name="nant.settings.currentframework" value="net-2.0" />\r
106                 <property name="current.build.defines" value="${build.defines},NET,DOTNET2" />\r
107                 <property name="link.sdkdoc.version" value="SDK_v2_0" />\r
108                 <property name="merge.targetplatform" value="v2" />\r
109                 <property name="csc.keyfile" value="/keyfile:${key.file}" />\r
110                 <!-- If DevEnvDir exists, we grab it, otherwise we try if the default location (if it exists) -->\r
111                 <if test="${environment::variable-exists('DevEnvDir')}">\r
112                         <property name="dev.env.dir" value="${environment::get-variable('DevEnvDir')}" />\r
113                 </if>\r
114                 <if test="${not environment::variable-exists('DevEnvDir')}">\r
115                         <property name="default.dev.env.dir" value="%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE" />\r
116                         <if test="${directory::exists(default.dev.env.dir)}">\r
117                                 <property name="dev.env.dir" value="${default.dev.env.dir}" />\r
118                         </if>\r
119                 </if>\r
120                 <property name="build.msbuild"  value="false" overwrite="false" />\r
121                 <property name="project.vsproj" value="${project::get-name()}-vs2005.csproj" />\r
122         </target>\r
124         <target name="set-net-3.5-framework-configuration">\r
125                 <property name="nant.settings.currentframework" value="net-3.5" />\r
126                 <property name="current.build.defines" value="${build.defines},NET,DOTNET35" />\r
127                 <property name="link.sdkdoc.version" value="SDK_v3_5" />\r
128                 <property name="merge.targetplatform" value="v3" />\r
129                 <property name="csc.keyfile" value="/keyfile:${key.file}" />\r
130                 <!-- If DevEnvDir exists, we grab it, otherwise we try if the default location (if it exists) -->\r
131                 <if test="${environment::variable-exists('DevEnvDir')}">\r
132                         <property name="dev.env.dir" value="${environment::get-variable('DevEnvDir')}" />\r
133                 </if>\r
134                 <if test="${not environment::variable-exists('DevEnvDir')}">\r
135                         <property name="default.dev.env.dir" value="%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE" />\r
136                         <if test="${directory::exists(default.dev.env.dir)}">\r
137                                 <property name="dev.env.dir" value="${default.dev.env.dir}" />\r
138                         </if>\r
139                 </if>\r
140                 <property name="build.msbuild"  value="false" overwrite="false" />\r
141                 <property name="project.vsproj" value="${project::get-name()}-vs2008.csproj" />\r
142         </target>\r
144         <target name="set-mono-1.0-framework-configuration">\r
145                 <property name="nant.settings.currentframework" value="mono-1.0" />\r
146                 <property name="current.build.defines" value="${build.defines},MONO,MONO1" />\r
147                 <property name="link.sdkdoc.version" value="MsdnOnline" />\r
148                 <!-- mono puts gacutil on PATH -->\r
149                 <property name="gacutil.file" value="gacutil" />\r
150                 <property name="build.warnaserrors" value="false" />\r
151         </target>\r
152         \r
153         <target name="set-mono-2.0-framework-configuration">\r
154                 <property name="nant.settings.currentframework" value="mono-2.0" />\r
155                 <property name="current.build.defines" value="${build.defines},MONO,MONO2,DOTNET2" />\r
156                 <property name="link.sdkdoc.version" value="MsdnOnline" />\r
157                 <!-- mono puts gacutil on PATH -->\r
158                 <property name="gacutil.file" value="gacutil" />\r
159                 <property name="build.warnaserrors" value="false" />\r
160         </target>\r
162         <target name="display-current-runtime">\r
163                 <echo message="" />\r
164                 <echo message="----------------------------------------------------------" />\r
165                 <echo message=" ${framework::get-description(framework::get-target-framework())}" />\r
166                 <echo message="----------------------------------------------------------" />\r
167                 <echo message="" />\r
168                 <echo message="framework : ${framework::get-target-framework()}" />\r
169                 <echo message="description : ${framework::get-description(framework::get-target-framework())}" />\r
170                 <echo message="sdk directory : ${framework::get-sdk-directory(framework::get-target-framework())}" />\r
171                 <echo message="framework directory : ${framework::get-framework-directory(framework::get-target-framework())}" />\r
172                 <echo message="assembly directory : ${framework::get-assembly-directory(framework::get-target-framework())}" />\r
173                 <echo message="runtime engine : ${framework::get-runtime-engine(framework::get-target-framework())}" />\r
174                 <echo message="" />\r
175         </target>\r
177         <target name="common.init"\r
178                 depends="common.check-nant-version common.find-tools set-framework-configuration set-project-configuration"\r
179                 description="Initializes build properties">\r
181                 <fileset id="project.sources" failonempty="true">\r
182                         <include name="${src.dir}/**/*.cs" />\r
183                 </fileset>\r
184                 <resourcefileset id="project.resources" />\r
185         </target>\r
186         \r
187         <target name="common.find-svninfo">\r
188                 <!-- For adding SVN revision to builds -->\r
189                 <property name="svn.revision" value="0" overwrite="false" />\r
190                 <!-- try to update the revision -->\r
191                 <exec\r
192                         program="svn"\r
193                         commandline='info "${project::get-base-directory()}" --xml'\r
194                         output="_revision.xml"\r
195                         failonerror="false"/>\r
196                 <xmlpeek\r
197                         file="_revision.xml"\r
198                         xpath="/info/entry/@revision"\r
199                         property="svn.revision"\r
200                         failonerror="false"/>\r
201                 <delete file="_revision.xml" failonerror="false" />\r
202                 <echo message="INFO: Using Subversion revision number: ${svn.revision}"/>\r
203         </target>\r
205         <target name="common.find-nunit">\r
206                 <if test="${not property::exists('nunit.found')}">\r
207                         <exec \r
208                                 program="${mbunit-console}" \r
209                                 resultproperty="mbunit.found"\r
210                                 failonerror="false" />\r
212                         <property name="mbunit.found" value="${mbunit.found == '0' and string::to-lower(testrunner)=='mbunit'}" readonly="true" />\r
213                         \r
214                         <property name="nunit.found" value="-1" />\r
215                         <exec\r
216                                 unless="${mbunit.found}"\r
217                                 program="${nunit-console2}" \r
218                                 resultproperty="nunit.found"\r
219                                 failonerror="false" />\r
221                         <property name="nunit-console" value="${nunit-console2}" if="${nunit.found == '0'}" />\r
223                         <exec unless="${mbunit.found or nunit.found == '0'}"\r
224                                 program="${nunit-console}" \r
225                                 commandline="/help"\r
226                                 resultproperty="nunit.found"\r
227                                 output='_nunit.txt'\r
228                                 failonerror="false" />\r
230                         <property name="nunit.found" value="${nunit.found == '0'}" readonly="true" />\r
231                         \r
232                         <fail message="ERROR: NUnit or MBUnit not found, cannot continue." unless="${nunit.found or mbunit.found}"/>\r
234                         <echo message="INFO: Using MBUnit for running unit tests" if="${mbunit.found}"/>\r
235                         \r
236                         <if test="${nunit.found}"> <!-- Determine if we can use this version of NUnit -->\r
237                                 <loadfile file="_nunit.txt" property="nunit_txt" />\r
238                                 <delete file="_nunit.txt" failonerror="false" />\r
239                                 <property name="nunit_findtxt" value="NUnit version " />\r
240                                 <property name="nunit_version" value="" />\r
241                                 <if test="${string::index-of( nunit_txt, nunit_findtxt) >= 0}">\r
242                                         <property name="nunit_version" value="${string::trim(string::substring(nunit_txt, string::index-of( nunit_txt, nunit_findtxt) + string::get-length(nunit_findtxt),6 ))}" />\r
243                                 </if>\r
244                                 <echo if="${string::get-length(nunit_version) == 0}">WARNING: Unable to determine NUnit version, unit tests may fail unpredictably with your version of NUnit</echo>\r
245                                 <echo if="${string::get-length(nunit_version) > 0}">INFO: Found NUnit ${nunit_version}</echo>\r
246                         </if>\r
247                 </if>\r
248         </target>\r
250         <target name="common.check-nant-version">\r
251                 <fail if="${current.nant-version&lt;required.nant-version}" message="Not using minimum required Nant version: ${required.nant-version} (current version: ${current.nant-version}). Please upgrade your copy of nant." />\r
252         </target>\r
254         <target name="common.find-tools">\r
255                 <!-- Where is MbUnit.Cons.exe ? -->\r
256                 <property name="mbunit-console" value="MbUnit.Cons.exe" overwrite="false" />\r
258                 <!-- Where is nunit-console executable(win/mono) ? -->\r
259                 <property name="nunit-console2" value="nunit-console2" overwrite="false" />\r
260                 <property name="nunit-console" value="nunit-console" overwrite="false" />\r
262                 <property name="testrunner" value="NUnit" />\r
264                 <!-- Where is WiX? -->\r
265                 <property name="wix.dir" value="${environment::get-folder-path('ProgramFiles')}\Windows Installer XML v3\bin" overwrite="false" />\r
267                 <!-- Where is Sandcastle Help File Builder (SHFB)? -->\r
268                 <property name="shfb.dir" value="${environment::get-folder-path('ProgramFiles')}\EWSoftware\Sandcastle Help File Builder" overwrite="false" />\r
269                 \r
270                 <!-- Where is Sandcastle? -->\r
271                 <property name="sandcastle.dir" value="${environment::get-folder-path('ProgramFiles')}\Sandcastle" overwrite="false" />\r
273                 <!-- Where is HTML Help 1.0? -->\r
274                 <property name="htmlhelp1x.dir" value="${environment::get-folder-path('ProgramFiles')}\HTML Help Workshop" overwrite="false" />         \r
275         </target>\r
277 </project>\r