forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.xml
258 lines (212 loc) · 11.5 KB
/
common.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<?xml version="1.0" ?>
<project xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
<!--
Use this to determine if the key file NHibernate.snk should be used to
sign the assemblies. Defaults to true since private key is present
in CVS.
-->
<property name="sign" value="true" overwrite="false" />
<property name="key.file" value="${root.dir}/src/NHibernate.snk" />
<!-- Generating AssemblyInfo files for Visual Studio -->
<property name="visual-studio" value="false" overwrite="false" />
<if test="${visual-studio}">
<property name="key.file" value="../../${key.file}" />
</if>
<!--
if Visual Studio Help Integration Kit has been installed
then change this to true or include -D:vshik.installed=true in the command line.
It generates Visual Studio.NET 2003 documentation.
-->
<property name="vshik.installed" value="false" overwrite="false" />
<property name="vshik.path" value="${environment::get-folder-path('ProgramFiles')}/Microsoft Help 2.0 SDK" />
<!--
if nunit2report tasks from http://nunit2report.sourceforge.net/ has been installed
then change this to true. It generates a nice looking html report for the test files
-->
<property name="nunit2report.installed" value="false" overwrite="false" />
<!--
Cenqua provided a license of Clover.NET for the NHibernate project to use.
-->
<property name="clover.enabled" value="false" overwrite="false" />
<property name="clover.src" value="src/CloverSrc" />
<property name="clover.db" value="${clover.src}/clover.cdb" />
<!-- NET 3.5 is using 2.0 runtime, should still work in 2.0 -->
<property name="clover.framework" value=".NET 2.0" if="${nant.settings.currentframework == 'net-3.5'}" />
<property name="clover.framework" value=".NET 2.0" if="${nant.settings.currentframework == 'net-2.0'}" />
<property name="clover.home" value="${environment::get-folder-path('ProgramFiles')}/Cenqua/Clover.NET 2.0 for ${clover.framework}" if="${property::exists('clover.framework')}"/>
<property name="clover.assembly" value="CloverNAnt-0.85.dll" />
<if test="${clover.enabled}">
<loadtasks assembly="${clover.home}/${clover.assembly}" />
</if>
<property name="nant-version.current" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" />
<property name="nant-version.required" value="0.85.2478.0" /> <!-- Nant 0.85 release version -->
<property name="nant-version.beta1_086" value="0.86.2898.0" /> <!-- Nant 0.86 Beta 1 -->
<!--
Path to the folder that contain the external assemblies. For net-2.0 the values will
be lib, lib/net, and lib/net/2.0 respectively.
-->
<property name="lib.dir" value="lib" dynamic="true" />
<property name="lib.family.dir" value="${path::combine(lib.dir, framework::get-family(framework::get-target-framework()))}" dynamic="true" />
<if test="${nant-version.current != nant-version.beta1_086 or framework::get-target-framework() != 'net-3.5'}">
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" />
</if>
<if test="${nant-version.current == nant-version.beta1_086 and framework::get-target-framework() == 'net-3.5'}">
<echo>Detected NAnt 0.86 Beta 1, consider upgrading to a newer version (a nightly build) when building for .NET 3.5</echo>
<echo>The latest NAnt nightly can be downloaded from http://nant.sourceforge.net/nightly/latest/nant-bin.zip</echo>
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, string::substring(framework::get-target-framework(), 4, 3))}" dynamic="true" />
</if>
<!--
These are used to set the correct attributes in AssemblyInfo.cs.
-->
<property name="project.company" value="NHibernate.org" />
<!--
Version number computation
JBoss product versioning guidelines (http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossProductVersioning)
say we are supposed to use version numbers formatted like major.minor.patch.qualifier, where
qualifier is alphanumeric (Alpha#, Beta#, CR#, GA, SP#), and the numeric part may be anything, e.g.
a time/date stamp, a SVN revision number and so on.
I'm only going to use simple sequential numbers for now and the script below is used to translate
the alphanumeric version into a numeric assembly version: x.y.z.qN is translated into x.y.z.(base+N)
where base is 1000 for Alpha, 2000 for Beta, 3000 for CR, and 4000 for both GA and SP (so GA is
effectively SP0).
-->
<property name="project.version" value="3.0.0.Alpha3" overwrite="false" />
<!-- Compute short project version (major.minor) using a regex -->
<regex input="${project.version}" pattern="^(?'shortversion'\d+\.\d+)" />
<property name="project.version.short" value="${shortversion}" />
<!-- Compute and set project.version.numeric from project.version if it hasn't been set already -->
<if test="${not property::exists('project.version.numeric')}">
<script language="C#">
<code><![CDATA[
public const int BaseAlpha = 1000;
public const int BaseBeta = 2000;
public const int BaseCR = 3000;
public const int BaseGA = 4000;
// SP is same as GA because GA has no number and SP's start with 1.
public const int BaseSP = 4000;
public static void ScriptMain(Project project)
{
project.Properties["project.version.numeric"] = ToNumericVersion(
project.Properties["project.version"]);
}
public static string ToNumericVersion(string version)
{
int qualifierStart = version.LastIndexOf('.') + 1;
int qualifierNumberStart = version.IndexOfAny(
"0123456789".ToCharArray(),
qualifierStart);
if (qualifierNumberStart < 0) qualifierNumberStart = version.Length;
string qualifier = version.Substring(qualifierStart, qualifierNumberStart - qualifierStart);
int qualifierNumber = qualifierNumberStart < version.Length
? int.Parse(version.Substring(qualifierNumberStart))
: 0;
int revisionBase;
switch (qualifier)
{
case "Alpha": revisionBase = BaseAlpha; break;
case "Beta": revisionBase = BaseBeta; break;
case "CR": revisionBase = BaseCR; break;
case "GA": revisionBase = BaseGA; break;
case "SP": revisionBase = BaseSP; break;
default: throw new BuildException("Unknown version qualifier " + qualifier);
}
string revisionNumber = (revisionBase + qualifierNumber).ToString();
return version.Substring(0, qualifierStart) + revisionNumber;
}
]]></code>
</script>
</if>
<!-- debug|release -->
<property name="build.defines" value="" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- properties used to connect to database for testing -->
<include buildfile="nhibernate-properties.xml" />
<!-- named project configurations -->
<target name="set-debug-project-configuration" description="Perform a 'debug' build">
<property name="build.release" value="false" />
<property name="build.debug" value="true" />
<property name="build.name" value="NHibernate-${project.version}-${project.config}" />
</target>
<target name="set-release-project-configuration" description="Perform a 'release' build">
<property name="build.release" value="true" />
<property name="build.debug" value="pdbonly" />
<property name="build.name" value="NHibernate-${project.version}" />
</target>
<target name="set-project-configuration">
<property name="project.config" value="debug" overwrite="false" />
<if test="${not(target::exists('set-' + project.config + '-project-configuration'))}">
<fail message="Unknown configuration: '${project.config}'" />
</if>
<call target="set-${project.config}-project-configuration" />
<property name="build.root.dir" value="${root.dir}/build/${build.name}" />
<property name="build.dir" value="${build.root.dir}" />
<property name="bin.dir" value="${build.dir}/bin/${nant.settings.currentframework}" />
<property name="testresults.dir" value="${bin.dir}/test-results" />
<property name="tools.dir" value="${root.dir}/Tools"/>
</target>
<target name="set-framework-configuration">
<if test="${not(target::exists('set-'+framework::get-target-framework()+'-framework-configuration'))}">
<fail message="The '${framework::get-target-framework()}' framework is not supported by this version of NHibernate." />
</if>
<call target="set-${framework::get-target-framework()}-framework-configuration" />
</target>
<target name="set-net-3.5-framework-configuration">
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="current.build.defines" value="${build.defines}NET,NET_2_0,NET_3_5" />
<!-- not using SDK_v2_0 because ndoc throws an exception -->
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<!-- merge should work with 2.0 when compiling for 3.5 -->
<property name="merge.targetplatform" value="v2" />
</target>
<target name="set-net-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="net-2.0" />
<property name="current.build.defines" value="${build.defines}NET,NET_2_0" />
<!-- not using SDK_v2_0 because ndoc throws an exception -->
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="merge.targetplatform" value="v2" />
</target>
<target name="set-mono-3.5-framework-configuration">
<property name="nant.settings.currentframework" value="mono-3.5" />
<property name="current.build.defines" value="${build.defines}NET,NET_2_0,NET_3_5,MONO" />
<!-- not using SDK_v2_0 because ndoc throws an exception -->
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<!-- merge should work with 2.0 when compiling for 3.5 -->
<property name="merge.targetplatform" value="v2" />
</target>
<target name="set-mono-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="mono-2.0" />
<property name="current.build.defines" value="${build.defines}NET,NET_2_0,MONO" />
<!-- not using SDK_v2_0 because ndoc throws an exception -->
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="merge.targetplatform" value="v2" />
</target>
<target name="display-current-runtime">
<echo message="" />
<echo message="----------------------------------------------------------" />
<echo message=" ${framework::get-description(framework::get-target-framework())}" />
<echo message="----------------------------------------------------------" />
<echo message="" />
<echo message="framework : ${framework::get-target-framework()}" />
<echo message="description : ${framework::get-description(framework::get-target-framework())}" />
<echo message="sdk directory : ${framework::get-sdk-directory(framework::get-target-framework())}" />
<echo message="framework directory : ${framework::get-framework-directory(framework::get-target-framework())}" />
<echo message="assembly directory : ${framework::get-assembly-directory(framework::get-target-framework())}" />
<echo message="runtime engine : ${framework::get-runtime-engine(framework::get-target-framework())}" />
<echo message="" />
</target>
<target name="common.init"
depends="set-framework-configuration set-project-configuration"
description="Initializes build properties">
<fileset id="project.sources" failonempty="true">
<include name="**/*.cs" />
</fileset>
<resourcefileset id="project.resources" />
</target>
<target name="common.find-nunit">
<property name="nunit-console" value="${tools.dir}/NUnit/nunit-console-x86.exe" />
</target>
<target name="common.find-ndoc">
<property name="ndoc-console" value="${tools.dir}/ndoc/NDocConsole.exe" />
</target>
</project>