Skip to content

Commit 59ac0f4

Browse files
committed
NH-4008 - Add separate driver projects for NuGet dependencies.
1 parent 21da886 commit 59ac0f4

36 files changed

+993
-11
lines changed

default.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
<property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" />
139139
<property name="bin-pack.conf-template" value="${bin-pack.tmpdir}/Configuration_Templates" />
140140
<property name="bin-pack.required" value="${bin-pack.tmpdir}/Required_Bins" />
141+
<property name="bin-pack.drivers" value="${bin-pack.tmpdir}/Select_Single_Driver" />
141142
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
142143

143144
<copy file="releasenotes.txt" todir="${bin-pack.tmpdir}"/>
@@ -169,7 +170,11 @@
169170
<include name="Remotion.Linq.EagerFetching.???" />
170171
</fileset>
171172
</copy>
172-
<!--Required Bins for lazy loading NHibernate.ByteCode.Castle.dll-->
173+
<copy todir="${bin-pack.drivers}">
174+
<fileset basedir="${bin.dir}">
175+
<include name="NHibernate.Driver.*.???" />
176+
</fileset>
177+
</copy>
173178
<!-- Tests -->
174179
<copy file="${bin.dir}/TestEmbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
175180
<copy file="${bin.dir}/ABC.hbm.xml" todir="${bin-pack.tests}"/>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using NHibernate.Cfg.Loquacious;
2+
using NHibernate.Driver;
3+
4+
namespace NHibernate.Cfg
5+
{
6+
public static class ConnectionConfigurationExtensionFirebird
7+
{
8+
public static IConnectionConfiguration ByFirebirdDriver(this IConnectionConfiguration cfg)
9+
{
10+
return cfg.By<FirebirdDriver>();
11+
}
12+
13+
public static void FirebirdDriver(this IDbIntegrationConfigurationProperties cfg)
14+
{
15+
cfg.Driver<FirebirdDriver>();
16+
}
17+
}
18+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="../../build-common/NHibernate.props" />
3+
4+
<PropertyGroup>
5+
<Description>Driver for Firebird to be used with NHibernate 5.</Description>
6+
<PackageTags>NHibernate; Driver; firebird; firebirsql; firebirdclient; ADO.Net; Core</PackageTags>
7+
8+
<TargetFramework>net461</TargetFramework>
9+
<NoWarn>$(NoWarn);3001;3002;3003;3005;1591</NoWarn>
10+
<SignAssembly>True</SignAssembly>
11+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
12+
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
13+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
15+
<TreatSpecificWarningsAsErrors />
16+
17+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
18+
</PropertyGroup>
19+
20+
<PropertyGroup>
21+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
22+
<RootNamespace>NHibernate</RootNamespace>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<Compile Include="..\NHibernate\Driver\FirebirdClientDriver.cs" Link="Driver\FirebirdClientDriver.cs" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="5.9.0.1" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
39+
</ItemGroup>
40+
41+
<ItemGroup>
42+
<Content Include="../../LICENSE.txt">
43+
<PackagePath>NHibernate.license.txt</PackagePath>
44+
</Content>
45+
</ItemGroup>
46+
47+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Security;
4+
5+
[assembly: CLSCompliantAttribute(true)]
6+
[assembly: AssemblyDelaySignAttribute(false)]
7+
[assembly: AllowPartiallyTrustedCallersAttribute()]
8+
[assembly: SecurityRulesAttribute(SecurityRuleSet.Level1)]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using NHibernate.Cfg.Loquacious;
2+
using NHibernate.Driver;
3+
4+
namespace NHibernate.Cfg
5+
{
6+
public static class ConnectionConfigurationExtensionMySql
7+
{
8+
public static IConnectionConfiguration ByMySqlDriver(this IConnectionConfiguration cfg)
9+
{
10+
return cfg.By<MySqlDriver>();
11+
}
12+
13+
public static void MySqlDriver(this IDbIntegrationConfigurationProperties cfg)
14+
{
15+
cfg.Driver<MySqlDriver>();
16+
}
17+
}
18+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="../../build-common/NHibernate.props" />
3+
4+
<PropertyGroup>
5+
<Description>Driver for MySql and MariaDB to be used with NHibernate 5.</Description>
6+
<PackageTags>NHibernate; Driver; MySql; MySql.Data; Connector/NET; C/Net; ADO.Net; Core</PackageTags>
7+
8+
<TargetFramework>net461</TargetFramework>
9+
<NoWarn>$(NoWarn);3001;3002;3003;3005;1591</NoWarn>
10+
<SignAssembly>True</SignAssembly>
11+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
12+
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
13+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
15+
<TreatSpecificWarningsAsErrors />
16+
17+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
18+
</PropertyGroup>
19+
20+
<PropertyGroup>
21+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
22+
<RootNamespace>NHibernate</RootNamespace>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<Compile Include="..\NHibernate\Driver\MySqlDataDriver.cs" Link="Driver\MySqlDataDriver.cs" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
31+
</ItemGroup>
32+
33+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
34+
<PackageReference Include="MySql.Data" Version="6.9.9" />
35+
</ItemGroup>
36+
37+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
38+
<PackageReference Include="MySql.Data" Version="6.10.3-rc" />
39+
</ItemGroup>
40+
41+
<ItemGroup>
42+
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
43+
</ItemGroup>
44+
45+
<ItemGroup>
46+
<Content Include="../../LICENSE.txt">
47+
<PackagePath>NHibernate.license.txt</PackagePath>
48+
</Content>
49+
</ItemGroup>
50+
51+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Security;
4+
5+
[assembly: CLSCompliantAttribute(true)]
6+
[assembly: AssemblyDelaySignAttribute(false)]
7+
[assembly: AllowPartiallyTrustedCallersAttribute()]
8+
[assembly: SecurityRulesAttribute(SecurityRuleSet.Level1)]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using NHibernate.Cfg.Loquacious;
2+
using NHibernate.Driver;
3+
4+
namespace NHibernate.Cfg
5+
{
6+
public static class ConnectionConfigurationExtensionOracleManaged
7+
{
8+
public static IConnectionConfiguration ByOracleManagedDriver(this IConnectionConfiguration cfg)
9+
{
10+
return cfg.By<OracleManagedDriver>();
11+
}
12+
13+
public static void OracleManagedDriver(this IDbIntegrationConfigurationProperties cfg)
14+
{
15+
cfg.Driver<OracleManagedDriver>();
16+
}
17+
}
18+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Data.Common;
2+
3+
namespace NHibernate.Driver
4+
{
5+
/// <summary>
6+
/// A NHibernate Driver for using the Oracle.ManagedDataAccess DataProvider
7+
/// </summary>
8+
public class OracleManagedDriver : OracleDataClientDriverBase
9+
{
10+
/// <summary>
11+
/// Initializes a new instance of <see cref="OracleManagedDriver"/>.
12+
/// </summary>
13+
/// <exception cref="HibernateException">
14+
/// Thrown when the <c>Oracle.ManagedDataAccess</c> assembly can not be loaded.
15+
/// </exception>
16+
public OracleManagedDriver()
17+
: base("Oracle.ManagedDataAccess")
18+
{
19+
}
20+
21+
public override bool HasDelayedDistributedTransactionCompletion => true;
22+
23+
public override DbConnection CreateConnection()
24+
{
25+
return new Oracle.ManagedDataAccess.Client.OracleConnection();
26+
}
27+
28+
public override DbCommand CreateCommand()
29+
{
30+
return new Oracle.ManagedDataAccess.Client.OracleCommand();
31+
}
32+
}
33+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="../../build-common/NHibernate.props" />
3+
4+
<PropertyGroup>
5+
<Description>Driver for Oracle databases to be used with NHibernate 5.</Description>
6+
<PackageTags>NHibernate; Driver; ODP.Net; Oracle; ADO.Net</PackageTags>
7+
8+
<TargetFramework>net461</TargetFramework>
9+
<NoWarn>$(NoWarn);3001;3002;3003;3005;1591</NoWarn>
10+
<SignAssembly>True</SignAssembly>
11+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
12+
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
13+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
15+
<TreatSpecificWarningsAsErrors />
16+
17+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
18+
</PropertyGroup>
19+
20+
<PropertyGroup>
21+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
22+
<RootNamespace>NHibernate</RootNamespace>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<PackageReference Include="Oracle.ManagedDataAccess" Version="12.1.2400" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<Content Include="../../LICENSE.txt">
39+
<PackagePath>NHibernate.license.txt</PackagePath>
40+
</Content>
41+
</ItemGroup>
42+
43+
</Project>

0 commit comments

Comments
 (0)