fixed nh build scripts
automated build of Spring.Messaging.Ems and Spring.Testing.Microsoft if dlls are available
This commit is contained in:
124
Spring.build
124
Spring.build
@@ -22,10 +22,15 @@ Build properties that may be set:
|
||||
signs all assemblies. Requires the key file $/Spring.Net.snk to be in place
|
||||
"package.version":
|
||||
set the package version
|
||||
"build-testing-ems":
|
||||
set to true if you want to build Tibco EMS support (you need to copy tibco.ems.dll and tibco.ems.admin.dll into /lib/net/2.0 first)
|
||||
"build-testing-microsoft":
|
||||
set to true if local machine has VS.NET 2008 MSTest installed (you need to copy Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll to /lib/net/2.0 first)
|
||||
|
||||
Additional Remarks:
|
||||
===================
|
||||
|
||||
*) Building Spring.Messaging.Ems
|
||||
if you want to build Spring.Messaging.Ems (Tibco EMS support), you need to copy tibco.ems.dll and tibco.ems.admin.dll into '/lib/net/2.0'
|
||||
|
||||
*) Building Spring.Testing.Microsoft
|
||||
if you want to build Spring.Testing.Microsoft (MSTest Support), you need to copy Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll to '/lib/net/2.0'
|
||||
-->
|
||||
|
||||
<!-- global project settings -->
|
||||
@@ -229,7 +234,8 @@ Build properties that may be set:
|
||||
<call target="compile-build-1.0"/>
|
||||
<call target="compile-build-1.1"/>
|
||||
<call target="compile-build-2.0"/>
|
||||
|
||||
<call target="compile-build-3.0"/>
|
||||
<call target="compile-build-3.5"/>
|
||||
|
||||
<!-- Ignore Compact Framework 1.0 for now -->
|
||||
<!-- call target="compile-build-netcf-1.0"/ -->
|
||||
@@ -377,8 +383,8 @@ Build properties that may be set:
|
||||
<nant buildfile="src/Spring/Spring.Data.NHibernate12/Spring.Data.NHibernate12.build" target="build" if="${build-data and (nant.settings.currentframework == 'net-1.1' or nant.settings.currentframework == 'net-2.0' or nant.settings.currentframework == 'mono-2.0') and not net-3.0}"/>
|
||||
<nant buildfile="src/Spring/Spring.Data.NHibernate20/Spring.Data.NHibernate20.build" target="build" if="${build-data and (nant.settings.currentframework == 'net-2.0' or nant.settings.currentframework == 'mono-2.0') and not net-3.0}"/>
|
||||
<nant buildfile="src/Spring/Spring.Data.NHibernate21/Spring.Data.NHibernate21.build" target="build" if="${build-data and (nant.settings.currentframework == 'net-2.0' or nant.settings.currentframework == 'mono-2.0') and not net-3.0}"/>
|
||||
<nant buildfile="src/Spring/Spring.Data.NHibernate30/Spring.Data.NHibernate30.build" target="build" if="${build-data and (nant.settings.currentframework == 'net-3.5' or nant.settings.currentframework == 'mono-2.0') and not net-3.0}"/>
|
||||
<nant buildfile="src/Spring/Spring.Services/Spring.Services.build" target="build" if="${build-services}"/>
|
||||
<nant buildfile="src/Spring/Spring.Data.NHibernate30/Spring.Data.NHibernate30.build" target="build" if="${build-data and (nant.settings.currentframework == 'net-3.5' or nant.settings.currentframework == 'mono-2.0')}"/>
|
||||
<nant buildfile="src/Spring/Spring.Services/Spring.Services.build" target="build" if="${build-services and not net-3.5}"/>
|
||||
<nant buildfile="src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.build" target="build" if="${build-testing-nunit and not net-3.0}"/>
|
||||
<nant buildfile="src/Spring/Spring.Testing.Microsoft/Spring.Testing.Microsoft.build" target="build" if="${build-testing-microsoft and (nant.settings.currentframework == 'net-2.0') and not net-3.0}"/>
|
||||
<nant buildfile="src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.build" target="build" if="${build-ems and not net-3.0}"/>
|
||||
@@ -403,10 +409,10 @@ Build properties that may be set:
|
||||
<nant buildfile="test/Spring/Spring.Data.NHibernate21.Integration.Tests/Spring.Data.NHibernate21.Integration.Tests.build" target="test"
|
||||
if="${build-data and nant.settings.currentframework == 'net-2.0' and not net-3.0}"/>
|
||||
<nant buildfile="test/Spring/Spring.Data.NHibernate30.Tests/Spring.Data.NHibernate30.Tests.build" target="test"
|
||||
if="${build-data and nant.settings.currentframework == 'net-3.5' and not net-3.0}"/>
|
||||
if="${build-data and nant.settings.currentframework == 'net-3.5'}"/>
|
||||
<nant buildfile="test/Spring/Spring.Data.NHibernate30.Integration.Tests/Spring.Data.NHibernate30.Integration.Tests.build" target="test"
|
||||
if="${build-data and nant.settings.currentframework == 'net-3.5' and not net-3.0}"/>
|
||||
<nant buildfile="test/Spring/Spring.Services.Tests/Spring.Services.Tests.build" target="test" if="${build-services}"/>
|
||||
<nant buildfile="test/Spring/Spring.Services.Tests/Spring.Services.Tests.build" target="test" if="${build-services and not net-3.5}"/>
|
||||
<nant buildfile="test/Spring/Spring.Web.Tests/Spring.Web.Tests.build" target="test" if="${build-web and not net-3.0}"/>
|
||||
<nant buildfile="test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.build" target="test" if="${build-testing-nunit and not net-3.0}"/>
|
||||
<nant buildfile="test/Spring/Spring.Testing.Microsoft.Tests/Spring.Testing.Microsoft.Tests.build" target="test" if="${build-testing-microsoft and (nant.settings.currentframework == 'net-2.0') and not net-3.0}"/>
|
||||
@@ -427,13 +433,13 @@ Build properties that may be set:
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
<!-- disable namespaces not supported in net-1.0 -->
|
||||
<property name="build-web" value="false" />
|
||||
<property name="build-nms" value="false" />
|
||||
<property name="build-ems" value="false" />
|
||||
<property name="build-quartz" value="false" />
|
||||
<property name="build-msmq" value="false" />
|
||||
<property name="build-msmq-tests" value="false" />
|
||||
<property name="build-velocity" value="false" />
|
||||
<property name="build-web" value="false" overwrite="true" />
|
||||
<property name="build-nms" value="false" overwrite="true" />
|
||||
<property name="build-ems" value="false" overwrite="true" />
|
||||
<property name="build-quartz" value="false" overwrite="true" />
|
||||
<property name="build-msmq" value="false" overwrite="true" />
|
||||
<property name="build-msmq-tests" value="false" overwrite="true" />
|
||||
<property name="build-velocity" value="false" overwrite="true" />
|
||||
<call target="compile-test" />
|
||||
</target>
|
||||
|
||||
@@ -441,11 +447,11 @@ Build properties that may be set:
|
||||
depends="set-net-1.1-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit">
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
<property name="build-ems" value="false" />
|
||||
<property name="build-nms" value="false" />
|
||||
<property name="build-msmq" value="false" />
|
||||
<property name="build-msmq-tests" value="false" />
|
||||
<property name="build-velocity" value="false" />
|
||||
<property name="build-ems" value="false" overwrite="true" />
|
||||
<property name="build-nms" value="false" overwrite="true" />
|
||||
<property name="build-msmq" value="false" overwrite="true" />
|
||||
<property name="build-msmq-tests" value="false" overwrite="true" />
|
||||
<property name="build-velocity" value="false" overwrite="true" />
|
||||
<call target="compile-test" />
|
||||
</target>
|
||||
|
||||
@@ -453,7 +459,6 @@ Build properties that may be set:
|
||||
depends="set-net-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit">
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
<property name="build-ems" value="false" />
|
||||
<call target="compile-test" />
|
||||
</target>
|
||||
|
||||
@@ -461,12 +466,12 @@ Build properties that may be set:
|
||||
depends="set-net-3.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit">
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
<property name="build-ems" value="false" />
|
||||
<property name="build-nms" value="false" />
|
||||
<property name="build-quartz" value="false" />
|
||||
<property name="build-msmq" value="false" />
|
||||
<property name="build-msmq-tests" value="false" />
|
||||
<property name="build-velocity" value="false" />
|
||||
<property name="build-ems" value="false" overwrite="true" />
|
||||
<property name="build-nms" value="false" overwrite="true" />
|
||||
<property name="build-quartz" value="false" overwrite="true" />
|
||||
<property name="build-msmq" value="false" overwrite="true" />
|
||||
<property name="build-msmq-tests" value="false" overwrite="true" />
|
||||
<property name="build-velocity" value="false" overwrite="true" />
|
||||
<call target="compile-test" />
|
||||
</target>
|
||||
|
||||
@@ -474,12 +479,12 @@ Build properties that may be set:
|
||||
depends="set-net-3.5-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit">
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
<property name="build-ems" value="false" />
|
||||
<property name="build-nms" value="false" />
|
||||
<property name="build-quartz" value="false" />
|
||||
<property name="build-msmq" value="false" />
|
||||
<property name="build-msmq-tests" value="false" />
|
||||
<property name="build-velocity" value="false" />
|
||||
<property name="build-ems" value="false" overwrite="true" />
|
||||
<property name="build-nms" value="false" overwrite="true" />
|
||||
<property name="build-quartz" value="false" overwrite="true" />
|
||||
<property name="build-msmq" value="false" overwrite="true" />
|
||||
<property name="build-msmq-tests" value="false" overwrite="true" />
|
||||
<property name="build-velocity" value="false" overwrite="true" />
|
||||
<call target="compile-test" />
|
||||
</target>
|
||||
|
||||
@@ -487,9 +492,9 @@ Build properties that may be set:
|
||||
depends="set-mono-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit">
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
<property name="build-ems" value="false" />
|
||||
<property name="build-msmq" value="false" />
|
||||
<property name="build-msmq-tests" value="false" />
|
||||
<property name="build-ems" value="false" overwrite="true" />
|
||||
<property name="build-msmq" value="false" overwrite="true" />
|
||||
<property name="build-msmq-tests" value="false" overwrite="true" />
|
||||
<call target="compile-test" />
|
||||
</target>
|
||||
|
||||
@@ -772,16 +777,16 @@ Build properties that may be set:
|
||||
|
||||
|
||||
<target name="package" depends="set-package-configuration" description="Build and Package distribution">
|
||||
|
||||
<property name="project.build.sign" value="true"/>
|
||||
<!--
|
||||
<property name="project.build.sign" value="true" override="false" />
|
||||
<property name="project.build.package" value="true"/>
|
||||
|
||||
-->
|
||||
<call target="clean-current-package-dir"/>
|
||||
|
||||
<property name="nant.target.root.name" value="build"/>
|
||||
|
||||
<call target="set-build-namespaces-release"/>
|
||||
<property name="project.build.sign" value="true"/>
|
||||
<property name="project.build.sign" value="true" overwrite="false" />
|
||||
<property name="project.build.package" value="true"/>
|
||||
|
||||
<call target="build-all-function"/>
|
||||
@@ -808,8 +813,6 @@ Build properties that may be set:
|
||||
<delete dir="./doc/sdk/target" failonerror="false" />
|
||||
|
||||
<exec workingdir="." program="./build-support/tools/ndoc3/NDoc3Console.exe">
|
||||
<!-- arg value="-verbose" /-->
|
||||
<!-- arg value="-documenter=MSDN" /-->
|
||||
<arg value="-project=./doc/sdk/Spring.NET-net-2.0.ndoc" />
|
||||
</exec>
|
||||
|
||||
@@ -836,7 +839,7 @@ Build properties that may be set:
|
||||
|
||||
</target>
|
||||
|
||||
<target name="releasepkg">
|
||||
<target name="package-release">
|
||||
<call target="set-release-build-configuration"/>
|
||||
<call target="package-release-files"/>
|
||||
</target>
|
||||
@@ -869,11 +872,13 @@ Build properties that may be set:
|
||||
|
||||
<target name="build-all-function" description="Build what is in cvs taking into account approrpiate clr versions and root target name">
|
||||
|
||||
|
||||
<!-- net-1.0 dropped since 1.3.0 -->
|
||||
<!-- call target="${nant.target.root.name}-1.0" / -->
|
||||
<call target="${nant.target.root.name}-1.1" />
|
||||
<call target="${nant.target.root.name}-2.0" />
|
||||
<call target="${nant.target.root.name}-3.0" />
|
||||
<call target="${nant.target.root.name}-3.5" />
|
||||
<!-- ignore .NET 3.5 for now -->
|
||||
<!-- call target="${nant.target.root.name}-3.5" / -->
|
||||
|
||||
<!-- ignore Mono 2.0 for now -->
|
||||
<!-- <call target="${nant.target.root.name}-mono-2.0" /> -->
|
||||
@@ -1423,17 +1428,18 @@ Build properties that may be set:
|
||||
</target>
|
||||
<target name="set-build-namespaces-all">
|
||||
<property name="build.allnamespaces" value="true"/>
|
||||
<property name="build-aop" value="true" overwrite="false" />
|
||||
<property name="build-data" value="true" overwrite="false"/>
|
||||
<property name="build-services" value="true" overwrite="false" />
|
||||
<property name="build-testing-nunit" value="true" overwrite="false" />
|
||||
<property name="build-testing-microsoft" value="false" overwrite="false"/>
|
||||
<property name="build-web" value="true" overwrite="false" />
|
||||
<property name="build-nms" value="true" overwrite="false" />
|
||||
<property name="build-ems" value="false" overwrite="false" />
|
||||
<property name="build-quartz" value="true" overwrite="false" />
|
||||
<property name="build-msmq" value="true" overwrite="false" />
|
||||
<property name="build-velocity" value="true" overwrite="false" />
|
||||
<property name="build-aop" value="true" />
|
||||
<property name="build-data" value="true" />
|
||||
<property name="build-services" value="true" />
|
||||
<property name="build-testing-nunit" value="true" />
|
||||
<property name="build-testing-microsoft" value="false" />
|
||||
<property name="build-testing-microsoft" value="${file::exists('lib/net/2.0/Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll')}" />
|
||||
<property name="build-web" value="true" />
|
||||
<property name="build-nms" value="true" />
|
||||
<property name="build-ems" value="${file::exists('lib/net/2.0/tibco.ems.dll')}" />
|
||||
<property name="build-quartz" value="true" />
|
||||
<property name="build-msmq" value="true" />
|
||||
<property name="build-velocity" value="true" />
|
||||
<property name="solution.file" value="Spring.Net.sln"/>
|
||||
<fileset id="src.to.copy">
|
||||
<include name="src/**"/>
|
||||
@@ -1464,11 +1470,11 @@ Build properties that may be set:
|
||||
<property name="build-data" value="true"/>
|
||||
<property name="build-services" value="true"/>
|
||||
<property name="build-testing-nunit" value="true"/>
|
||||
<property name="build-testing-microsoft" value="false" overwrite="false"/>
|
||||
<property name="build-testing-microsoft" value="${file::exists('lib/net/2.0/Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll')}" />
|
||||
<property name="build-web" value="true"/>
|
||||
<property name="build-examples" value="true"/>
|
||||
<property name="build-nms" value="true" />
|
||||
<property name="build-ems" value="false" overwrite="false" />
|
||||
<property name="build-ems" value="${file::exists('lib/net/2.0/tibco.ems.dll')}" />
|
||||
<property name="build-quartz" value="true" />
|
||||
<property name="build-msmq" value="true" />
|
||||
<property name="build-velocity" value="true" />
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
hive="LocalMachine"
|
||||
unless="${property::exists('registry.net-3.0.installed')}"
|
||||
failonerror="false" />
|
||||
|
||||
|
||||
<property name="net-3.0.installed" value="${registry.net-3.0.installed == '1'}" />
|
||||
|
||||
<if test="${net-3.0.installed}">
|
||||
@@ -207,7 +207,7 @@
|
||||
</imports>
|
||||
|
||||
<code>
|
||||
<!-- format for assembly revision is RRXXX where RR = framework number (1.0=10; 1.1=11; 2.0=20, 3.0=30, 3.5=35, etc.) and
|
||||
<!-- format for assembly revision is RRXXX where RR = framework number (1.0=10; 1.1=11; 2.0=20, 3.0=30, 3.5=35, etc.) and
|
||||
XXX is the number of days from the year the project 'started', property project.year. -->
|
||||
<![CDATA[
|
||||
public static void ScriptMain(Project project) {
|
||||
@@ -218,7 +218,7 @@
|
||||
DateTime start = new DateTime(startYear, 1, 1);
|
||||
TimeSpan ts = DateTime.Now - start;
|
||||
int days = ts.Days;
|
||||
string version = project.Properties["package.version"].ToString() + "." + frameworkRevisionNumber + days.ToString();
|
||||
string version = project.Properties["package.version"].ToString() + "." + frameworkRevisionNumber + days.ToString();
|
||||
project.Properties["project.version.numeric"] = version.ToString();
|
||||
|
||||
}
|
||||
@@ -274,8 +274,8 @@
|
||||
|
||||
<attribute type="AssemblyDelaySignAttribute" value="false"/>
|
||||
<attribute type="AssemblyKeyFileAttribute" value="${assembly.keyfile}" if="${(nant.settings.currentframework == 'net-1.0' or nant.settings.currentframework == 'net-1.1') and project.build.sign}" />
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<attribute type="AssemblyTitleAttribute" value="${assembly.title}" />
|
||||
<attribute type="AssemblyDescriptionAttribute" value="${assembly.description}" />
|
||||
@@ -285,7 +285,7 @@
|
||||
</attributes>
|
||||
</asminfo>
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
<target name="set-debug-build-configuration">
|
||||
<property name="compiler.args" value=""/>
|
||||
@@ -402,8 +402,8 @@
|
||||
</target>
|
||||
<target name="set-net-3.5-runtime-configuration"
|
||||
depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
|
||||
<property name="nant.settings.currentframework" value="net-2.0"/>
|
||||
<property name="nant.settings.currentframework.number" value="2.0"/>
|
||||
<property name="nant.settings.currentframework" value="net-3.5"/>
|
||||
<property name="nant.settings.currentframework.number" value="3.5"/>
|
||||
<!-- revision number used when generating assembly info -->
|
||||
<property name="nant.settings.currentframework.revisionnumber" value="35"/>
|
||||
<property name="net-2.0" value="true"/>
|
||||
@@ -418,7 +418,7 @@
|
||||
value="${sdkdoc.dir}/${framework::get-family(framework::get-target-framework())}/3.5"/>
|
||||
<property name="current.sdkdoc.debug" value="${sdkdoc.debug}" dynamic="true"/>
|
||||
<property name="nowarn.numbers.test" value="${nowarn.numbers.test.default},1701"/>
|
||||
</target>
|
||||
</target>
|
||||
<target name="set-netcf-1.0-runtime-configuration"
|
||||
depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
|
||||
<property name="nant.settings.currentframework" value="netcf-1.0"/>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<![CDATA[
|
||||
Credits for this shared build script go to the NHibernate Team
|
||||
|
||||
This file contains common tasks tailored specifically for the NDoc3
|
||||
This file contains common tasks tailored specifically for the Spring
|
||||
build process. The goal was to define all the actions in this file, so
|
||||
that actual project build files only have to configure a few variables
|
||||
and call tasks in this file.
|
||||
@@ -253,6 +253,8 @@ ${tool.dir} : dir for tools
|
||||
<target name="common.run-tests.ncover" description="Run NUnit tests">
|
||||
|
||||
<property name="test.assemblyname" value="${project::get-name()}" overwrite="false" />
|
||||
<property name="test.assemblyfile" value="${test.assemblyname}.dll" overwrite="false" />
|
||||
<property name="test.assemblyname.tocover" value="${string::substring(test.assemblyname,0,string::last-index-of(test.assemblyname, '.Tests') )}" overwrite="false" />
|
||||
<property name="test.bin.dir" value="${current.bin.dir}" if="${not property::exists('test.bin.dir')}" />
|
||||
|
||||
<echo message="Coverage Testing ${test.assemblyname} in ${test.bin.dir}" />
|
||||
@@ -265,12 +267,12 @@ ${tool.dir} : dir for tools
|
||||
<arg value="//x" />
|
||||
<arg path="${test.bin.dir}/${test.assemblyname}.dll-TestCoverage.xml" />
|
||||
<arg value="//a" />
|
||||
<arg value="${string::substring(test.assemblyname,0,string::last-index-of(test.assemblyname, '.Tests') )}" />
|
||||
<arg value="${test.assemblyname.tocover}" />
|
||||
<arg value="//ea" />
|
||||
<arg value="CoverageExcludeAttribute" />
|
||||
<arg value="//q" />
|
||||
<arg path="${tool.dir}/nunit/net-2.0/nunit-console-x86.exe" />
|
||||
<arg path="${test.bin.dir}/${test.assemblyname}.dll" />
|
||||
<arg path="${test.bin.dir}/${test.assemblyfile}" />
|
||||
<arg value="/xml:${test.assemblyname}.dll-TestResults.xml" />
|
||||
<arg value="/nologo" />
|
||||
<arg value="/framework:${nant.settings.currentframework}" />
|
||||
|
||||
@@ -7,7 +7,15 @@
|
||||
* current.build.defines.csc - framework-specific build defines for C# compiler
|
||||
-->
|
||||
<target name="build">
|
||||
<echo message="nh.lib.dir=${nh.lib.dir}"/>
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- build Spring.Data.NHibernate -->
|
||||
<csc target="library" define="${current.build.defines.csc}"
|
||||
warnaserror="true"
|
||||
@@ -24,17 +32,13 @@
|
||||
<include name="../GenCommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<lib>
|
||||
<include name="${nh.lib.dir}"/>
|
||||
</lib>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.Web.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.*.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
-->
|
||||
<target name="build">
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh12.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh12.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- build Spring.Data.NHibernate12 -->
|
||||
<csc target="library" define="${current.build.defines.csc}"
|
||||
warnaserror="true"
|
||||
@@ -32,17 +40,13 @@
|
||||
<include name="../GenCommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<lib>
|
||||
<include name="${nh12.lib.dir}"/>
|
||||
</lib>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.Web.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.*.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
@@ -34,7 +34,7 @@ using NHibernate.Dialect;
|
||||
using NHibernate.Engine;
|
||||
using NHibernate.Event;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
|
||||
using Spring.Context;
|
||||
using Spring.Core.IO;
|
||||
using Spring.Dao;
|
||||
using Spring.Dao.Attributes;
|
||||
@@ -73,8 +73,8 @@ namespace Spring.Data.NHibernate
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <author>Mark Pollack (.NET)</author>
|
||||
/// <version>$Id: LocalSessionFactoryObject.cs,v 1.2 2008/05/01 12:50:34 lahma Exp $</version>
|
||||
public class LocalSessionFactoryObject : IFactoryObject, IInitializingObject, IPersistenceExceptionTranslator, IDisposable
|
||||
, IApplicationContextAware
|
||||
{
|
||||
#region Fields
|
||||
|
||||
@@ -112,6 +112,8 @@ namespace Spring.Data.NHibernate
|
||||
|
||||
private IAdoExceptionTranslator adoExceptionTranslator;
|
||||
|
||||
private IResourceLoader resourceLoader;
|
||||
|
||||
// Configuration time DB provider.
|
||||
// This will not be available after configuration has been done.
|
||||
private static IDbProvider configTimeDbProvider;
|
||||
@@ -142,6 +144,33 @@ namespace Spring.Data.NHibernate
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Setting the Application Context determines were resources are loaded from
|
||||
/// </summary>
|
||||
IApplicationContext IApplicationContextAware.ApplicationContext
|
||||
{
|
||||
set
|
||||
{
|
||||
this.ResourceLoader = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IResourceLoader"/> to use for loading mapping assemblies etc.
|
||||
/// </summary>
|
||||
public IResourceLoader ResourceLoader
|
||||
{
|
||||
get
|
||||
{
|
||||
if (resourceLoader == null)
|
||||
{
|
||||
resourceLoader = new ConfigurableResourceLoader();
|
||||
}
|
||||
return resourceLoader;
|
||||
}
|
||||
set { resourceLoader = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the assemblies to load that contain mapping files.
|
||||
/// </summary>
|
||||
/// <value>The mapping assemblies.</value>
|
||||
@@ -387,6 +416,7 @@ namespace Spring.Data.NHibernate
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
@@ -540,13 +570,11 @@ namespace Spring.Data.NHibernate
|
||||
}
|
||||
}
|
||||
|
||||
IResourceLoader resourceLoader = new ConfigurableResourceLoader();
|
||||
|
||||
if (this.mappingResources != null)
|
||||
{
|
||||
foreach (string resourceName in mappingResources)
|
||||
{
|
||||
config.AddInputStream(resourceLoader.GetResource(resourceName).InputStream);
|
||||
config.AddInputStream(this.ResourceLoader.GetResource(resourceName).InputStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{71368632-B8B7-4A6A-8C65-8DA848120C82}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
@@ -153,6 +153,9 @@
|
||||
<Name>Spring.Data.2008</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Spring.Data.NHibernate20.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -8,9 +8,15 @@
|
||||
-->
|
||||
<target name="build">
|
||||
|
||||
<echo message="${nh20.lib.dir}" />
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh20.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh20.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- build Spring.Data.NHibernate20 -->
|
||||
<!-- build Spring.Data.NHibernate20 -->
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
@@ -33,22 +39,18 @@
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateAccessor.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateObjectRetrievalFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateOptimisticLockingFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/SessionFactoryUtils.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate12/Data/**/HibernateOptimisticLockingFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/SessionFactoryUtils.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate12/Data/**/HibernateOptimisticLockingFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate12/Data/**/LocalSessionFactoryObject.cs" />
|
||||
<include name="../GenCommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<include name="${nh20.lib.dir}/NHibernate.dll"/>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.Web.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="*NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.*.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#if NH_2_1
|
||||
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright <20> 2002-2005 the original author or authors.
|
||||
* Copyright <20> 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,22 +20,16 @@
|
||||
|
||||
#endregion
|
||||
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
|
||||
using NHibernate.Bytecode;
|
||||
using NHibernate.Properties;
|
||||
using NHibernate.Type;
|
||||
|
||||
using Spring.Objects.Factory;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
/// <summary>
|
||||
/// Bytecode provider using Spring Proxy
|
||||
/// The Spring for .NET-backed ByteCodeprovider for NHibernate
|
||||
/// </summary>
|
||||
/// <author>Fabio Maulo</author>
|
||||
public class BytecodeProvider : IBytecodeProvider
|
||||
@@ -41,15 +37,18 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
private readonly IListableObjectFactory listableObjectFactory;
|
||||
private readonly IObjectsFactory objectsFactory;
|
||||
private readonly DefaultCollectionTypeFactory collectionTypefactory;
|
||||
private readonly IProxyFactoryFactory proxyFactoryFactory;
|
||||
|
||||
///<summary>
|
||||
/// Creates a new bytecode Provider instance using the specified object factory
|
||||
///</summary>
|
||||
///<param name="listableObjectFactory"></param>
|
||||
public BytecodeProvider(IListableObjectFactory listableObjectFactory)
|
||||
{
|
||||
this.listableObjectFactory = listableObjectFactory;
|
||||
objectsFactory = new ObjectsFactory(listableObjectFactory);
|
||||
collectionTypefactory = new DefaultCollectionTypeFactory();
|
||||
this.objectsFactory = new ObjectsFactory(listableObjectFactory);
|
||||
this.collectionTypefactory = new DefaultCollectionTypeFactory();
|
||||
this.proxyFactoryFactory = new ProxyFactoryFactory();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,7 +68,7 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
/// </summary>
|
||||
public IProxyFactoryFactory ProxyFactoryFactory
|
||||
{
|
||||
get { return new ProxyFactoryFactory(); }
|
||||
get { return this.proxyFactoryFactory; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -80,7 +79,7 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
/// </remarks>
|
||||
public IObjectsFactory ObjectsFactory
|
||||
{
|
||||
get { return objectsFactory; }
|
||||
get { return this.objectsFactory; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -88,8 +87,10 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
/// </summary>
|
||||
public ICollectionTypeFactory CollectionTypeFactory
|
||||
{
|
||||
get { return collectionTypefactory; }
|
||||
get { return this.collectionTypefactory; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright <20> 2002-2005 the original author or authors.
|
||||
* Copyright <20> 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,21 +19,15 @@
|
||||
|
||||
#endregion
|
||||
|
||||
#region Imports
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
using AopAlliance.Intercept;
|
||||
|
||||
using NHibernate.Engine;
|
||||
using NHibernate.Proxy.Poco;
|
||||
using NHibernate.Type;
|
||||
|
||||
using Spring.Aop;
|
||||
using Spring.Reflection.Dynamic;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
/// <summary>
|
||||
@@ -43,8 +37,12 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
[Serializable]
|
||||
public class LazyInitializer : BasicLazyInitializer, IMethodInterceptor, ITargetSource
|
||||
{
|
||||
private static readonly MethodInfo exceptionInternalPreserveStackTrace =
|
||||
typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
private static readonly MethodInfo exceptionInternalPreserveStackTrace;
|
||||
|
||||
static LazyInitializer()
|
||||
{
|
||||
exceptionInternalPreserveStackTrace = typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///</summary>
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
|
||||
SerializableProxyFactory proxyFactory = new SerializableProxyFactory();
|
||||
proxyFactory.Interfaces = Interfaces;
|
||||
proxyFactory.TargetSource = initializer;
|
||||
// proxyFactory.TargetSource = initializer;
|
||||
proxyFactory.ProxyTargetType = IsClassProxy;
|
||||
proxyFactory.AddAdvice(initializer);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DefineConstants>TRACE;DEBUG;NET_2_0,NH_2_1</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>Spring.Data.NHibernate21.xml</DocumentationFile>
|
||||
<DocumentationFile>..\..\..\build\VS.Net.2008\Spring.Data.NHibernate21\Debug\Spring.Data.NHibernate21.xml</DocumentationFile>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
@@ -41,7 +41,7 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\NHibernate21\net\2.0\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=2.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<Reference Include="NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\NHibernate21\net\2.0\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -169,6 +169,9 @@
|
||||
<Name>Spring.Data.2008</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Spring.Data.NHibernate21.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -8,9 +8,15 @@
|
||||
-->
|
||||
<target name="build">
|
||||
|
||||
<echo message="${nh21.lib.dir}" />
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh21.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh21.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- build Spring.Data.NHibernate21 -->
|
||||
<!-- build Spring.Data.NHibernate21 -->
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0,NH_2_1"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
@@ -27,31 +33,26 @@
|
||||
<include name="../Spring.Data.NHibernate/Support/**/*.cs" />
|
||||
<include name="../Spring.Data.NHibernate12/Data/**/*.cs" />
|
||||
<include name="../Spring.Data.NHibernate12/Support/**/*.cs" />
|
||||
<include name="../Spring.Data.NHibernate20/Data/**/*.cs" />
|
||||
<include name="../Spring.Data.NHibernate20/Data/**/*.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateAccessor.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/SpringSessionSynchronization.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/LocalSessionFactoryObject.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateAccessor.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateObjectRetrievalFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/HibernateOptimisticLockingFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/SessionFactoryUtils.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate12/Data/**/HibernateOptimisticLockingFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate/Data/**/SessionFactoryUtils.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate12/Data/**/HibernateOptimisticLockingFailureException.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate12/Data/**/LocalSessionFactoryObject.cs" />
|
||||
<include name="../GenCommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<include name="${nh21.lib.dir}/NHibernate.dll"/>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.Web.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="*NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="Spring.Data.NHibernate20.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
</references>
|
||||
<exclude name="Spring.Data.NHibernate*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.*.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -59,6 +59,11 @@ namespace Spring.Data.NHibernate
|
||||
properties.Add(Environment.ConnectionDriver, typeof(SqlClientDriver).AssemblyQualifiedName);
|
||||
properties.Add(Environment.ConnectionProvider, typeof(DriverConnectionProvider).AssemblyQualifiedName);
|
||||
|
||||
#if NH_2_1
|
||||
// since 2.1. "hbm2ddl.keywords = 'keywords'" is the default which causes the SessionFactory to connect to the db upon creation
|
||||
// we don't want this in this unit test
|
||||
properties.Add(Environment.Hbm2ddlKeyWords, "none");
|
||||
#endif
|
||||
sfo.HibernateProperties = properties;
|
||||
sfo.AfterPropertiesSet();
|
||||
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
* current.build.defines.csc - framework-specific build defines
|
||||
-->
|
||||
<target name="build">
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<csc target="library" define="${current.build.defines.csc}"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
@@ -20,21 +29,16 @@
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<include name="**/*.cs" />
|
||||
<include name="../CommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<lib>
|
||||
<include name="${nh.lib.dir}"/>
|
||||
</lib>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="NHibernate.dll" />
|
||||
<include name="Spring.Data.NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="Spring.Data.NHibernate20.dll" />
|
||||
<exclude name="Spring.Data.NHibernate21.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate20*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate21*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
|
||||
</references>
|
||||
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
|
||||
<include name="**/*.xml" />
|
||||
@@ -44,13 +48,6 @@
|
||||
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
|
||||
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Spring.Data.NHibernate20.Tests.build" />
|
||||
<None Include="Spring.Data.NHibernate20.Tests.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -10,7 +10,16 @@
|
||||
* current.build.defines.csc - framework-specific build defines
|
||||
-->
|
||||
<target name="build">
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0"
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh20.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh20.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
output="${current.bin.dir}/${project::get-name()}.dll"
|
||||
@@ -19,22 +28,21 @@
|
||||
<warning number="${nowarn.numbers.test}" />
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<include name="**/*.cs" />
|
||||
<include name="../CommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<include name="../Spring.Data.NHibernate.Tests/**/*.cs" />
|
||||
<include name="../Spring.Data.NHibernate12.Tests/**/*.cs" />
|
||||
<include name="**/*.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs" />
|
||||
<exclude name="AssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<lib>
|
||||
<include name="${nh20.lib.dir}"/>
|
||||
</lib>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<include name="Spring.Data.NHibernate20.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="Spring.Data.NHibernate21.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate21*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
|
||||
</references>
|
||||
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
|
||||
<include name="**/*.xml" />
|
||||
@@ -44,13 +52,6 @@
|
||||
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
|
||||
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
|
||||
@@ -116,9 +116,18 @@
|
||||
<None Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\creditdebit.sql">
|
||||
<Link>Data\NHibernate\creditdebit.sql</Link>
|
||||
</None>
|
||||
<None Include="Spring.Data.NHibernate21.Integration.Tests.build" />
|
||||
<None Include="Spring.Data.NHibernate21.Integration.Tests.dll.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\..\..\projects\nhibernate\trunk\nhibernate\src\NHibernate.DomainModel\NHibernate.DomainModel.csproj">
|
||||
<Project>{5C649B55-1B3F-4C38-9998-1B043E94A244}</Project>
|
||||
<Name>NHibernate.DomainModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\..\..\projects\nhibernate\trunk\nhibernate\src\NHibernate.Test\NHibernate.Test.csproj">
|
||||
<Project>{7AEE5B37-C552-4E59-9B6F-88755BCB5070}</Project>
|
||||
<Name>NHibernate.Test</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.2008.csproj">
|
||||
<Project>{3A3A4E65-45A6-4B20-B460-0BEDC302C02C}</Project>
|
||||
<Name>Spring.Aop.2008</Name>
|
||||
|
||||
@@ -25,17 +25,15 @@
|
||||
<lib>
|
||||
<include name="${nh21.lib.dir}"/>
|
||||
</lib>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="log4net.dll" />
|
||||
<include name="NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.Tests.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="Spring.Data.NHibernate20.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<include name="${nh21.lib.dir}/NHibernate.dll" />
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="log4net.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="NHibernate.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.dll" />
|
||||
<include name="Spring.Data.NHibernate21.dll" />
|
||||
</references>
|
||||
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
|
||||
<include name="**/*.xml" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#if NH_2_1XX
|
||||
#if NH_2_1
|
||||
using log4net.Config;
|
||||
|
||||
using NHibernate;
|
||||
using NHibernate.Bytecode;
|
||||
using NHibernate.Cfg;
|
||||
using NHibernate.Engine;
|
||||
@@ -39,7 +39,7 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
public void CreateDb()
|
||||
{
|
||||
InitializeServiceLocator();
|
||||
var cfg = new Configuration();
|
||||
Configuration cfg = new Configuration();
|
||||
Environment.BytecodeProvider = GetBytecodeProvider();
|
||||
cfg.Configure();
|
||||
cfg.AddResource("uNhAddIns.Adapters.CommonTests.EnhancedBytecodeProvider.Foo.Spechbm.xml",
|
||||
@@ -64,18 +64,18 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
public void SaveObjectWithStringChangedToUpper()
|
||||
{
|
||||
object savedId;
|
||||
Foo f = new Foo { Description = "something" };
|
||||
Foo f = new Foo("something");
|
||||
|
||||
using (var s = sessions.OpenSession())
|
||||
using (var tx = s.BeginTransaction())
|
||||
using (ISession s = sessions.OpenSession())
|
||||
using (ITransaction tx = s.BeginTransaction())
|
||||
{
|
||||
savedId = s.Save(f);
|
||||
tx.Commit();
|
||||
}
|
||||
|
||||
using (var s = sessions.OpenSession())
|
||||
using (ISession s = sessions.OpenSession())
|
||||
{
|
||||
var upperFoo = s.Get<Foo>(savedId);
|
||||
Foo upperFoo = s.Get<Foo>(savedId);
|
||||
|
||||
Assert.AreEqual("[something]", upperFoo.Description);
|
||||
}
|
||||
@@ -86,18 +86,18 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
public void SaveNullPropertyAndGetItBack()
|
||||
{
|
||||
object savedId;
|
||||
var f = new Foo();
|
||||
Foo f = new Foo("");
|
||||
|
||||
using (var s = sessions.OpenSession())
|
||||
using (var tx = s.BeginTransaction())
|
||||
using (ISession s = sessions.OpenSession())
|
||||
using (ITransaction tx = s.BeginTransaction())
|
||||
{
|
||||
savedId = s.Save(f);
|
||||
tx.Commit();
|
||||
}
|
||||
|
||||
using (var s = sessions.OpenSession())
|
||||
using (ISession s = sessions.OpenSession())
|
||||
{
|
||||
var upperFoo = s.Get<Foo>(savedId);
|
||||
Foo upperFoo = s.Get<Foo>(savedId);
|
||||
|
||||
Assert.IsNull(upperFoo.Description);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
#if NH_2_1XX
|
||||
#if NH_2_1
|
||||
namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
public class Foo
|
||||
{
|
||||
public virtual string Description { get; set; }
|
||||
private string _description;
|
||||
|
||||
public Foo(string description)
|
||||
{
|
||||
_description = description;
|
||||
}
|
||||
|
||||
public virtual string Description
|
||||
{
|
||||
get { return _description; }
|
||||
set { _description = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NH_2_1XX
|
||||
#if NH_2_1
|
||||
namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
public interface IDelimiter
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NH_2_1XX
|
||||
#if NH_2_1
|
||||
using System.Data;
|
||||
using NHibernate;
|
||||
using NHibernate.SqlTypes;
|
||||
@@ -17,7 +17,7 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
|
||||
public object NullSafeGet(IDataReader rs, string[] names, object owner)
|
||||
{
|
||||
var resultString = (string)NHibernateUtil.String.NullSafeGet(rs, names[0]);
|
||||
string resultString = (string)NHibernateUtil.String.NullSafeGet(rs, names[0]);
|
||||
if (resultString != null)
|
||||
return delimiter.Delimit(resultString);
|
||||
return null;
|
||||
@@ -61,7 +61,7 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[] { new SqlType(DbType.String) };
|
||||
return new SqlType[] { new SqlType(DbType.String) };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NH_2_1XX
|
||||
#if NH_2_1
|
||||
using NHibernate.Bytecode;
|
||||
|
||||
using NUnit.Framework;
|
||||
@@ -10,7 +10,7 @@ using Spring.Objects.Factory.Support;
|
||||
|
||||
namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
//[TestFixture]
|
||||
[TestFixture, Explicit("requires database")]
|
||||
public class InjectableUserTypeFixture : AbstractInjectableUserTypeFixture
|
||||
{
|
||||
private IConfigurableListableObjectFactory objectFactory;
|
||||
@@ -32,14 +32,14 @@ namespace Spring.Data.NHibernate.Bytecode
|
||||
|
||||
private static void Register<TSerivice, TImplementation>(IConfigurableListableObjectFactory confObjFactory)
|
||||
{
|
||||
var odb = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof (TImplementation)).
|
||||
ObjectDefinitionBuilder odb = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(TImplementation)).
|
||||
SetAutowireMode(AutoWiringMode.Constructor);
|
||||
confObjFactory.RegisterObjectDefinition(typeof (TSerivice).FullName, odb.ObjectDefinition);
|
||||
}
|
||||
|
||||
private static void RegisterPrototype<TImplementation>(IConfigurableListableObjectFactory confObjFactory)
|
||||
{
|
||||
var odb = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(TImplementation))
|
||||
ObjectDefinitionBuilder odb = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(TImplementation))
|
||||
.SetSingleton(false).SetAutowireMode(AutoWiringMode.AutoDetect);
|
||||
confObjFactory.RegisterObjectDefinition(typeof(TImplementation).FullName, odb.ObjectDefinition);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,31 @@
|
||||
#if NH_2_1XX
|
||||
#if NH_2_1
|
||||
using System;
|
||||
|
||||
namespace Spring.Data.NHibernate.Bytecode
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
public virtual Guid Id { get; set; }
|
||||
public virtual string Description { get; set; }
|
||||
public virtual decimal Price { get; set; }
|
||||
private Guid _id;
|
||||
private string _description;
|
||||
private decimal _price;
|
||||
|
||||
public virtual Guid Id
|
||||
{
|
||||
get { return _id; }
|
||||
set { _id = value; }
|
||||
}
|
||||
|
||||
public virtual string Description
|
||||
{
|
||||
get { return _description; }
|
||||
set { _description = value; }
|
||||
}
|
||||
|
||||
public virtual decimal Price
|
||||
{
|
||||
get { return _price; }
|
||||
set { _price = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -27,8 +27,7 @@
|
||||
<entry key="connection.driver_class"
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
<entry key="proxyfactory.factory_class"
|
||||
value="NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu" />
|
||||
<entry key="hbm2ddl.keywords" value="none" />
|
||||
</dictionary>
|
||||
</property>
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
<entry key="hibernate.connection.driver_class"
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
<entry key="proxyfactory.factory_class"
|
||||
value="NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu" />
|
||||
<entry key="hbm2ddl.keywords" value="none" />
|
||||
|
||||
</dictionary>
|
||||
</property>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\NHibernate21\net\2.0\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=1.0.4.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc">
|
||||
<Reference Include="NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\NHibernate21\net\2.0\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -90,6 +90,7 @@
|
||||
<Compile Include="..\Spring.Data.NHibernate.Tests\Data\NHibernate\TestObject.cs">
|
||||
<Link>Data\NHibernate\TestObject.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Data\NHibernate\Bytecode\AbstractInjectableUserTypeFixture.cs" />
|
||||
<Compile Include="Data\NHibernate\Bytecode\Foo.cs" />
|
||||
<Compile Include="Data\NHibernate\Bytecode\IDelimiter.cs" />
|
||||
@@ -98,6 +99,7 @@
|
||||
<Compile Include="Data\NHibernate\Bytecode\Product.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Spring.Data.NHibernate21.Tests.build" />
|
||||
<None Include="Spring.Data.NHibernate21.Tests.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -10,7 +10,16 @@
|
||||
* current.build.defines.csc - framework-specific build defines
|
||||
-->
|
||||
<target name="build">
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0,NH_2_1"
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh21.lib.dir}" />
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh21.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0,NH_2_1"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
output="${current.bin.dir}/${project::get-name()}.dll"
|
||||
@@ -19,22 +28,21 @@
|
||||
<warning number="${nowarn.numbers.test}" />
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<include name="**/*.cs" />
|
||||
<include name="../CommonAssemblyInfo.cs" />
|
||||
<include name="../Spring.Data.NHibernate.Tests/**/*.cs" />
|
||||
<include name="../Spring.Data.NHibernate12.Tests/**/*.cs" />
|
||||
<include name="**/*.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs" />
|
||||
<exclude name="AssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<lib>
|
||||
<include name="${nh21.lib.dir}"/>
|
||||
</lib>
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="NHibernate.dll" />
|
||||
<include name="*.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12.dll" />
|
||||
<exclude name="Spring.Data.NHibernate20.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
<include name="Spring.Data.NHibernate21.dll" />
|
||||
<exclude name="Spring.Data.NHibernate.dll" />
|
||||
<exclude name="Spring.Data.NHibernate12*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate20*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
|
||||
</references>
|
||||
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
|
||||
<include name="**/*.xml" />
|
||||
@@ -44,13 +52,6 @@
|
||||
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
|
||||
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<copy todir="${current.bin.dir}" overwrite="true">
|
||||
<fileset basedir="${nh21.lib.dir}">
|
||||
<include name="**/*.dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
|
||||
Reference in New Issue
Block a user