|
25 | 25 |
|
26 | 26 | Other predefined targets are:
|
27 | 27 |
|
28 |
| - - common.compile-tests |
29 |
| - compile NUnit tests and copy App.config file to the output directory, |
30 |
| - if it exists. |
31 |
| -
|
32 |
| - - common.compile-dll |
33 |
| - compile a DLL, generating the documentation file (.xml) |
| 28 | + - common.compile-all |
| 29 | + compile a solution, generating the documentation file (.xml) |
34 | 30 |
|
35 | 31 | - common.generate-assemblyinfo
|
36 | 32 | generate an AssemblyInfo.cs file from assembly.* NAnt properties.
|
|
48 | 44 |
|
49 | 45 | <include buildfile="common.xml" />
|
50 | 46 |
|
51 |
| - <target name="common.compile-tests" |
52 |
| - description="Compile NUnit tests and copy App.config file to the output directory, if it exists."> |
53 |
| - |
54 |
| - <csc |
55 |
| - target="library" |
56 |
| - define="${current.build.defines}" |
57 |
| - debug="${build.debug}" |
58 |
| - keyfile="${key.file}" |
59 |
| - nostdlib="true" |
60 |
| - noconfig="true" |
61 |
| - output="${bin.dir}/${project::get-name()}.dll" |
62 |
| - if="${sign}" |
63 |
| - > |
64 |
| - <sources refid="project.sources" /> |
65 |
| - <references refid="project.references" /> |
66 |
| - <resources refid="project.resources" /> |
67 |
| - </csc> |
68 |
| - |
69 |
| - <csc |
70 |
| - target="library" |
71 |
| - define="${current.build.defines}" |
72 |
| - debug="${build.debug}" |
73 |
| - nostdlib="true" |
74 |
| - noconfig="true" |
75 |
| - output="${bin.dir}/${project::get-name()}.dll" |
76 |
| - unless="${sign}" |
77 |
| - > |
78 |
| - <sources refid="project.sources" /> |
79 |
| - <references refid="project.references" /> |
80 |
| - <resources refid="project.resources" /> |
81 |
| - </csc> |
82 |
| - |
83 |
| - |
84 |
| - <copy |
85 |
| - file="App.config" |
86 |
| - tofile="${bin.dir}/${project::get-name()}.dll.config" |
87 |
| - if="${file::exists('App.config')}" |
88 |
| - /> |
89 |
| - |
90 |
| - </target> |
91 |
| - |
92 |
| - <target name="common.compile-tests-vb" description="Compile NUnit tests and copy App.config file to the output directory, if it exists."> |
93 |
| - |
94 |
| - <vbc |
95 |
| - target="library" |
96 |
| - define="${current.build.defines}" |
97 |
| - debug="${build.debug}" |
98 |
| - keyfile="${key.file}" |
99 |
| - output="${bin.dir}/${project::get-name()}.dll" |
100 |
| - rootnamespace="${project::get-name()}" |
101 |
| - if="${sign}" |
102 |
| - > |
103 |
| - <sources refid="project.sources" /> |
104 |
| - <references refid="project.references" /> |
105 |
| - <resources refid="project.resources" /> |
106 |
| - <imports refid="project.imports" /> |
107 |
| - <arg line="/sdkpath:"${referenceassemblies.dir}""/> |
108 |
| - </vbc> |
109 |
| - |
110 |
| - <vbc |
111 |
| - target="library" |
112 |
| - define="${current.build.defines}" |
113 |
| - debug="${build.debug}" |
114 |
| - output="${bin.dir}/${project::get-name()}.dll" |
115 |
| - rootnamespace="${project::get-name()}" |
116 |
| - unless="${sign}" |
117 |
| - > |
118 |
| - <sources refid="project.sources" /> |
119 |
| - <references refid="project.references" /> |
120 |
| - <resources refid="project.resources" /> |
121 |
| - <imports refid="project.imports" /> |
122 |
| - <arg line="/sdkpath:"${referenceassemblies.dir}""/> |
123 |
| - </vbc> |
124 |
| - |
125 |
| - <copy |
126 |
| - file="App.config" |
127 |
| - tofile="${bin.dir}/${project::get-name()}.dll.config" |
128 |
| - if="${file::exists('App.config')}" |
129 |
| - /> |
130 |
| - |
131 |
| - </target> |
132 |
| - |
133 |
| - <target name="common.compile-dll" description="Compile sources into a DLL"> |
134 |
| - |
135 |
| - <property name="project.output" value="${bin.dir}/${project::get-name()}.dll" unless="${property::exists('project.output')}"/> |
136 |
| - |
137 |
| - <csc |
138 |
| - target="library" |
139 |
| - define="${current.build.defines}" |
140 |
| - debug="${build.debug}" |
141 |
| - keyfile="${key.file}" |
142 |
| - nostdlib="true" |
143 |
| - noconfig="true" |
144 |
| - output="${project.output}" |
145 |
| - doc="${bin.dir}/${project::get-name()}.xml" |
146 |
| - if="${sign}" |
147 |
| - optimize="${build.release}" |
148 |
| - > |
149 |
| - <nowarn> |
150 |
| - <warning number="1591" /> <!-- No XML comment for publicly visible member --> |
151 |
| - </nowarn> |
152 |
| - <sources refid="project.sources" /> |
153 |
| - <references refid="project.references" /> |
154 |
| - <resources refid="project.resources" /> |
155 |
| - </csc> |
156 |
| - |
157 |
| - <csc |
158 |
| - target="library" |
159 |
| - define="${current.build.defines}" |
160 |
| - debug="${build.debug}" |
161 |
| - nostdlib="true" |
162 |
| - noconfig="true" |
163 |
| - output="${project.output}" |
164 |
| - doc="${bin.dir}/${project::get-name()}.xml" |
165 |
| - unless="${sign}" |
166 |
| - optimize="${build.release}" |
167 |
| - > |
168 |
| - <nowarn> |
169 |
| - <warning number="1591" /> <!-- No XML comment for publicly visible member --> |
170 |
| - </nowarn> |
171 |
| - <sources refid="project.sources" /> |
172 |
| - <references refid="project.references" /> |
173 |
| - <resources refid="project.resources" /> |
174 |
| - </csc> |
175 |
| - |
176 |
| - </target> |
177 |
| - |
178 |
| - <target name="common.compile-exe" description="Compile sources into a console executable"> |
179 |
| - |
180 |
| - <csc |
181 |
| - target="exe" |
182 |
| - keyfile="${key.file}" |
183 |
| - define="${current.build.defines}" |
184 |
| - debug="${build.debug}" |
185 |
| - output="${bin.dir}/${project::get-name()}.exe" |
186 |
| - if="${sign}" |
187 |
| - optimize="${build.release}" |
188 |
| - > |
189 |
| - <nowarn> |
190 |
| - <warning number="1591" /> <!-- No XML comment for publicly visible member --> |
191 |
| - </nowarn> |
192 |
| - <sources refid="project.sources" /> |
193 |
| - <references refid="project.references" /> |
194 |
| - <resources refid="project.resources" /> |
195 |
| - </csc> |
196 |
| - |
197 |
| - <csc |
198 |
| - target="exe" |
199 |
| - define="${current.build.defines}" |
200 |
| - debug="${build.debug}" |
201 |
| - output="${bin.dir}/${project::get-name()}.exe" |
202 |
| - unless="${sign}" |
203 |
| - optimize="${build.release}" |
204 |
| - > |
205 |
| - <nowarn> |
206 |
| - <warning number="1591" /> <!-- No XML comment for publicly visible member --> |
207 |
| - </nowarn> |
208 |
| - <sources refid="project.sources" /> |
209 |
| - <references refid="project.references" /> |
210 |
| - <resources refid="project.resources" /> |
211 |
| - </csc> |
| 47 | + <target name="common.compile-all" depends="common.generate-assemblyinfo"> |
| 48 | + <!--property name="msbuild.cmd" value="${cmd.sln} ${cmd.out} ${cmd.platform} ${cmd.debug} ${cmd.optimize} ${cmd.doc} /t:Rebuild /v:q /m" /--> |
| 49 | + |
| 50 | + <exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe" verbose="true"> |
| 51 | + <arg value="${root.dir}/src/NHibernate.sln" /> |
| 52 | + <arg value="/p:OutputPath="${path::get-full-path(bin.dir)}"" /> |
| 53 | + <arg value="/p:Platform="Any CPU"" /> |
| 54 | + <arg value="/p:Configuration="Debug"" if="${build.debug == 'true'}" /> |
| 55 | + <arg value="/p:Configuration="Release"" if="${build.release == 'true'}" /> |
| 56 | + <arg value="/t:Rebuild" /> |
| 57 | + <arg value="/v:q" /> |
| 58 | + <arg value="/m" /> |
| 59 | + </exec> |
212 | 60 | </target>
|
213 |
| - |
| 61 | + |
214 | 62 | <target name="common.set-assembly-attribute-values">
|
215 |
| - <property overwrite="false" name="assembly.is-cls-compliant" value="true" /> |
216 |
| - <property overwrite="false" name="assembly.allow-partially-trusted-callers" value="false" /> |
217 |
| - <property overwrite="false" name="assembly.description" value="" /> |
218 |
| - <property overwrite="false" name="assembly.product" value="${project::get-name()}" /> |
219 |
| - <property overwrite="false" name="assembly.company" value="${project.company}" /> |
220 |
| - <property overwrite="false" name="assembly.title" value="${project::get-name()}" /> |
221 | 63 | <property overwrite="false" name="assembly.version" value="${project.default-assembly-version}" />
|
222 | 64 | <property overwrite="false" name="assembly.version.informational" value="${project.version}" />
|
223 | 65 | <property overwrite="false" name="assembly.version.file" value="${project.version.numeric}" />
|
224 |
| - <property overwrite="false" name="assembly.copyright" value="Licensed under LGPL." /> |
225 |
| - <property overwrite="false" name="assembly.sign" value="${sign}" /> |
226 | 66 | </target>
|
227 | 67 |
|
228 | 68 | <target name="common.generate-assemblyinfo"
|
229 | 69 | depends="common.init common.set-assembly-attribute-values"
|
230 |
| - description="Generate AssemblyInfo.cs using assembly.* properties." |
| 70 | + description="Generate SharedAssemblyInfo.* using assembly.* properties." |
231 | 71 | >
|
232 |
| - <asminfo output="AssemblyInfo.cs" language="CSharp"> |
| 72 | + <asminfo output="${root.dir}/src/SharedAssemblyInfo.cs" language="CSharp"> |
| 73 | + <imports> |
| 74 | + <import namespace="System" /> |
| 75 | + <import namespace="System.Reflection" /> |
| 76 | + <import namespace="System.Runtime.CompilerServices" /> |
| 77 | + </imports> |
| 78 | + <attributes> |
| 79 | + <attribute type="AssemblyVersionAttribute" value="${assembly.version}" /> |
| 80 | + <attribute type="AssemblyInformationalVersionAttribute" value="${assembly.version.informational}" /> |
| 81 | + <attribute type="AssemblyFileVersionAttribute" value="${assembly.version.file}" /> |
| 82 | + </attributes> |
| 83 | + </asminfo> |
| 84 | + <asminfo output="${root.dir}/src/SharedAssemblyInfo.vb" language="VB"> |
233 | 85 | <imports>
|
234 | 86 | <import namespace="System" />
|
235 | 87 | <import namespace="System.Reflection" />
|
236 | 88 | <import namespace="System.Runtime.CompilerServices" />
|
237 |
| - <import namespace="System.Security" if="${assembly.allow-partially-trusted-callers}" /> |
238 | 89 | </imports>
|
239 | 90 | <attributes>
|
240 |
| - <attribute type="CLSCompliantAttribute" value="${assembly.is-cls-compliant}" /> |
241 |
| - <attribute type="AssemblyTitleAttribute" value="${assembly.title}" /> |
242 |
| - <attribute type="AssemblyDescriptionAttribute" value="${assembly.description}" /> |
243 |
| - <attribute type="AssemblyCompanyAttribute" value="${assembly.company}" /> |
244 |
| - <attribute type="AssemblyProductAttribute" value="${assembly.product}" /> |
245 |
| - <attribute type="AssemblyCopyrightAttribute" value="${assembly.copyright}" /> |
246 | 91 | <attribute type="AssemblyVersionAttribute" value="${assembly.version}" />
|
247 | 92 | <attribute type="AssemblyInformationalVersionAttribute" value="${assembly.version.informational}" />
|
248 | 93 | <attribute type="AssemblyFileVersionAttribute" value="${assembly.version.file}" />
|
249 |
| - <attribute type="AssemblyDelaySignAttribute" value="false" /> |
250 |
| - |
251 |
| - <!-- For some reason, NAnt doesn't detect that APTCA has a public no-argument constructor --> |
252 |
| - <attribute asis="true" type="AllowPartiallyTrustedCallersAttribute" if="${assembly.allow-partially-trusted-callers}" /> |
253 |
| - <attribute asis="true" type="SecurityRulesAttribute" value="SecurityRuleSet.Level1" if="${assembly.allow-partially-trusted-callers}" /> |
254 | 94 | </attributes>
|
255 | 95 | </asminfo>
|
256 | 96 | </target>
|
|
260 | 100 | <call target="common.find-nunit" unless="${property::exists('nunit.found')}" />
|
261 | 101 | <property name="common.run-tests.failonerror" value="${not property::exists(project::get-name() + '.IgnoreFail')}"/>
|
262 | 102 | <exec program="${nunit-console}" failonerror="${common.run-tests.failonerror}">
|
263 |
| - <arg line="${bin.dir}/${project::get-name()}.dll /xml:${testresults.dir}/${project::get-name()}.dll-results.xml /framework:${framework::get-target-framework()}" /> |
| 103 | + <arg line="${bin.dir}/${test.file}.dll /xml:${testresults.dir}/${test.file}.dll-results.xml /framework:${framework::get-target-framework()}" /> |
264 | 104 | </exec>
|
265 | 105 |
|
266 | 106 | <!--<nunit2>
|
|
271 | 111 | outputdir="${bin.dir}"
|
272 | 112 | />
|
273 | 113 | <test
|
274 |
| - assemblyname="${bin.dir}/${project::get-name()}.dll" |
275 |
| - appconfig="${bin.dir}/${project::get-name()}.dll.config" /> |
| 114 | + assemblyname="${bin.dir}/${test.file}.dll" |
| 115 | + appconfig="${bin.dir}/${test.file}.dll.config" /> |
276 | 116 | </nunit2>-->
|
277 | 117 |
|
278 | 118 | </target>
|
|
281 | 121 | depends="common.put-connection-settings-into-app-config common.run-tests common.remove-connection-settings-from-app-config" />
|
282 | 122 |
|
283 | 123 | <target name="common.put-connection-settings-into-app-config">
|
284 |
| - <property name="app.config" value="${bin.dir}/${project::get-name()}.dll.config" /> |
| 124 | + <property name="app.config" value="${bin.dir}/${test.file}.dll.config" /> |
285 | 125 | <call target="common.put-connection-settings-into-defined-app-config" />
|
286 | 126 | </target>
|
287 | 127 |
|
|
326 | 166 | </target>
|
327 | 167 |
|
328 | 168 | <target name="common.remove-connection-settings-from-app-config">
|
329 |
| - <property name="app.config" value="${bin.dir}/${project::get-name()}.dll.config" /> |
| 169 | + <property name="app.config" value="${bin.dir}/${test.file}.dll.config" /> |
330 | 170 |
|
331 | 171 | <xmlpoke
|
332 | 172 | file="${app.config}"
|
|
0 commit comments