forked from cuyahogaproject/cuyahoga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.xml
194 lines (167 loc) · 9.82 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
<?xml version="1.0" encoding="utf-8"?>
<project name="Cuyahoga" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<!-- Controls whether tests are run. Setting this is as input to the build disables *all* tests. -->
<property name="common.run-tests" value="true" overwrite="false" />
<property name="common.testrunner.enabled" value="${common.run-tests}" overwrite="false" />
<property name="common.testrunner.failonerror" value="true" overwrite="false" />
<!--
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" />
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" />
<!-- Versioning -->
<property name="project.version" value="2.0.0.0" overwrite="false" />
<property name="project.major" value="${version::get-major(version::parse(project.version))}" dynamic="true" />
<property name="project.minor" value="${version::get-minor(version::parse(project.version))}" dynamic="true" />
<property name="project.build" value="${version::get-build(version::parse(project.version))}" dynamic="true" />
<property name="project.revision" value="${version::get-revision(version::parse(project.version))}" dynamic="true" />
<property name="assembly.major" value="${version::get-major(version::parse(assembly.version))}" dynamic="true" />
<property name="assembly.minor" value="${version::get-minor(version::parse(assembly.version))}" dynamic="true" />
<property name="assembly.build" value="${version::get-build(version::parse(assembly.version))}" dynamic="true" />
<property name="assembly.revision" value="${version::get-revision(version::parse(assembly.version))}" dynamic="true" />
<property name="svn.revision" value="0" overwrite="false" />
<!--
These are used to set the correct attributes in AssemblyInfo.cs.
-->
<property name="project.company" value="Cuyahoga Project" />
<property name="project.productname" value="Cuyahoga" />
<!-- Default build defines -->
<property name="build.defines" value="TRACE" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- named project configurations -->
<target name="set-debug-project-configuration" description="Perform a 'debug' build">
<property name="build.debug" value="true" />
<property name="build.optimize" value="false" overwrite="false" />
</target>
<target name="set-release-project-configuration" description="Perform a 'release' build">
<property name="build.debug" value="false" />
<property name="build.optimize" value="true" overwrite="false" />
</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="src.dir" value="${path::get-full-path(project::get-base-directory())}" />
<property name="build.base.dir" value="${root.dir}/build" />
<property name="build.family.dir" value="${build.base.dir}/${nant.settings.currentframework}" />
<property name="build.dir" value="${path::get-full-path(path::combine(build.family.dir,project.config))}" dynamic="true" />
<property name="build.bin.dir" value="${build.dir}/bin" dynamic="true" />
<property name="build.web.dir" value="${build.dir}/web" dynamic="true" />
<property name="testresults.dir" value="${build.dir}/test-results" dynamic="true" />
<property name="build.rebuild" value="false" overwrite="false" />
</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 Cuyahoga." />
</if>
<call target="set-${framework::get-target-framework()}-framework-configuration" />
<property name="common.testrunner.args" value="" overwrite="false" />
</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,DOTNET35" />
<property name="link.sdkdoc.version" value="SDK_v3_5" />
<property name="merge.targetplatform" value="v3" />
</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},MONO,MONO2,DOTNET35" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="gacutil.file" value="gacutil" />
<property name="build.warnaserrors" value="false" />
</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="common.find-tools set-framework-configuration set-project-configuration"
description="Initializes build properties">
<fileset id="project.sources" failonempty="true">
<include name="${src.dir}/**/*.cs" />
</fileset>
<!--
Include the .resx files as embedded resource by default. Override in the project when incuding other files
such as NHibernate mapping files.
Only include Strings.resx when building on Mono because the Mono al.exe is not able to handle satellite
assemblies.
-->
<resourcefileset id="project.resources" basedir="${project::get-base-directory()}" prefix="${project::get-name()}" dynamicprefix="true">
<include name="${src.dir}/**/*.resx" if="${framework::get-family(framework::get-target-framework()) != 'mono'}" />
<include name="${src.dir}/**/Strings.resx" if="${framework::get-family(framework::get-target-framework()) != 'mono'}" />
<exclude name="${src.dir}/App_GlobalResources/**" />
</resourcefileset>
</target>
<target name="common.find-svninfo">
<!-- For adding SVN revision to builds -->
<property name="svn.revision" value="0" overwrite="false" />
<!-- try to update the revision -->
<exec
program="svn"
commandline='info "${project::get-base-directory()}" --xml'
output="_revision.xml"
failonerror="false"/>
<xmlpeek
file="_revision.xml"
xpath="/info/entry/commit/@revision"
property="svn.revision"
failonerror="false"/>
<delete file="_revision.xml" failonerror="false" />
<echo message="INFO: Using Subversion revision number: ${svn.revision}"/>
</target>
<target name="common.find-nunit">
<if test="${not property::exists('nunit.found')}">
<property name="nunit.found" value="-1" />
<if test="${(framework::get-family(framework::get-runtime-framework()) == 'mono')}">
<exec
program="${nunit-console2}"
resultproperty="nunit.found"
output="_nunit.txt"
failonerror="false" />
<property name="nunit-console" value="${nunit-console2}" if="${nunit.found == '0'}" />
</if>
<exec unless="${nunit.found == '0'}"
program="${nunit-console}"
commandline="/help"
resultproperty="nunit.found"
output='_nunit.txt'
failonerror="false" />
<property name="nunit.found" value="${nunit.found == '0'}" readonly="true" />
<fail message="ERROR: NUnit not found, cannot continue." unless="${nunit.found}"/>
<if test="${nunit.found}">
<!-- Determine if we can use this version of NUnit -->
<loadfile file="_nunit.txt" property="nunit_txt" />
<delete file="_nunit.txt" failonerror="false" />
<property name="nunit_findtxt" value="NUnit version " />
<property name="nunit_version" value="" />
<if test="${string::index-of( nunit_txt, nunit_findtxt) >= 0}">
<property name="nunit_version" value="${string::trim(string::substring(nunit_txt, string::index-of( nunit_txt, nunit_findtxt) + string::get-length(nunit_findtxt),6 ))}" />
</if>
<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>
<echo if="${string::get-length(nunit_version) > 0}">INFO: Found NUnit ${nunit_version} in ${nunit-console}</echo>
</if>
</if>
</target>
<target name="common.find-tools">
<!-- Where is nunit-console executable(win/mono) ? -->
<property name="nunit-console2" value="nunit-console2" overwrite="false" />
<property name="nunit-console" value="${root.dir}/tools/NUnit/bin/nunit-console.exe" overwrite="false" />
</target>
</project>