Skip to content

Commit eef98a9

Browse files
author
Tuna Toksoz
committed
Improvements in Build files, now parameters for nh properties such as connection string is possible. Check sample build commands.txt for sample usages
SVN: trunk@4378
1 parent f368dd2 commit eef98a9

File tree

4 files changed

+31
-38
lines changed

4 files changed

+31
-38
lines changed

build-common/common-project.xml

+27-17
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,11 @@
222222

223223
<target name="common.run-tests"
224224
description="Run NUnit tests">
225+
<exec program="${root.dir}/Tools/nunit/nunit-console-x86.exe">
226+
<arg line="${bin.dir}/${project::get-name()}.dll /xml=${bin.dir}/${project::get-name()}.dll.result.xml" />
227+
</exec>
225228

226-
<nunit2>
229+
<!--<nunit2>
227230
<formatter
228231
type="Xml"
229232
usefile="true"
@@ -233,7 +236,7 @@
233236
<test
234237
assemblyname="${bin.dir}/${project::get-name()}.dll"
235238
appconfig="${bin.dir}/${project::get-name()}.dll.config" />
236-
</nunit2>
239+
</nunit2>-->
237240

238241
</target>
239242

@@ -250,21 +253,28 @@
250253
<!--
251254
Tell nhibernate how to connect to the test database.
252255
-->
253-
<xmlpoke
254-
file="${app.config}"
255-
xpath="/configuration/nhibernate/add[@key='hibernate.dialect']/@value"
256-
value="${nhibernate.dialect}"
257-
/>
258-
<xmlpoke
259-
file="${app.config}"
260-
xpath="/configuration/nhibernate/add[@key='hibernate.connection.driver_class']/@value"
261-
value="${nhibernate.connection.driver_class}"
262-
/>
263-
<xmlpoke
264-
file="${app.config}"
265-
xpath="/configuration/nhibernate/add[@key='hibernate.connection.connection_string']/@value"
266-
value="${nhibernate.connection.connection_string}"
267-
/>
256+
<xmlpoke file="${app.config}"
257+
xpath="//*/hbm:property[@name='dialect']"
258+
value="${nhibernate.dialect}">
259+
<namespaces>
260+
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
261+
</namespaces>
262+
</xmlpoke>
263+
264+
<xmlpoke file="${app.config}"
265+
xpath="//*/hbm:property[@name='connection.driver_class']"
266+
value="${nhibernate.connection.driver_class}">
267+
<namespaces>
268+
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
269+
</namespaces>
270+
</xmlpoke>
271+
<xmlpoke file="${app.config}"
272+
xpath="//*/hbm:property[@name='connection.connection_string']"
273+
value="${nhibernate.connection.connection_string}">
274+
<namespaces>
275+
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
276+
</namespaces>
277+
</xmlpoke>
268278
</target>
269279

270280
<target name="common.remove-connection-settings-from-app-config">
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" ?>
22
<project xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
3-
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
4-
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
5-
<property name="nhibernate.connection.connection_string" value="Server=(local);initial catalog=nhibernate;Integrated Security=SSPI" />
3+
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSql2005Dialect" overwrite="false"/>
4+
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" overwrite="false"/>
5+
<property name="nhibernate.connection.connection_string" value="Server=(local);initial catalog=nhibernate;Integrated Security=SSPI" overwrite="false"/>
66
</project>

default.build

-17
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,9 @@
123123
</target>
124124

125125
<target name="test" depends="init build" description="Runs all NHibernate tests for the current framework" unless="${skip.tests}">
126-
<!--
127126
<nant target="test">
128127
<buildfiles refid="buildfiles.tests" />
129128
</nant>
130-
-->
131-
<!-- -->
132-
<foreach item="File" property="buildfile">
133-
<in>
134-
<items refid="buildfiles.tests" />
135-
</in>
136-
<do>
137-
<exec program="nant.exe">
138-
<arg value="-f:${buildfile}" />
139-
<arg value="-t:${nant.settings.currentframework}" />
140-
<arg value="-D:project.config=${project.config}" />
141-
<arg value="test" />
142-
</exec>
143-
</do>
144-
</foreach>
145-
<!-- -->
146129
</target>
147130

148131
<target name="coverage-report" description="Builds the test coverage reports"

src/NHibernate.Test/NHibernate.Test.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
<copy file="TestEnbeddedConfig.cfg.xml" tofile="${bin.dir}/TestEnbeddedConfig.cfg.xml" />
3535
<copy file="${root.dir}/src/NHibernate.DomainModel/ABC.hbm.xml" tofile="${bin.dir}/ABC.hbm.xml" />
3636
</target>
37-
<target name="test" depends="init build common.run-tests" />
37+
<target name="test" depends="init build common.run-database-tests" />
3838
</project>

0 commit comments

Comments
 (0)