Skip to content

Commit 6859ea1

Browse files
committed
NH-4008 - Add separate driver projects for NuGet dependencies.
1 parent fa04289 commit 6859ea1

40 files changed

+1050
-18
lines changed

default.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
<property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" />
224224
<property name="bin-pack.conf-template" value="${bin-pack.tmpdir}/Configuration_Templates" />
225225
<property name="bin-pack.required" value="${bin-pack.tmpdir}/Required_Bins" />
226+
<property name="bin-pack.drivers" value="${bin-pack.tmpdir}/Select_Single_Driver" />
226227
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
227228

228229
<copy file="releasenotes.txt" todir="${bin-pack.tmpdir}"/>
@@ -254,6 +255,11 @@
254255
<include name="Remotion.Linq.EagerFetching.???" />
255256
</fileset>
256257
</copy>
258+
<copy todir="${bin-pack.drivers}">
259+
<fileset basedir="${bin.dir}">
260+
<include name="NHibernate.Driver.*.???" />
261+
</fileset>
262+
</copy>
257263
<!-- Tests -->
258264
<copy file="${root.dir}/src/NHibernate.Test/TestEmbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
259265
<copy file="${root.dir}/src/NHibernate.DomainModel/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: 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 Firebird to be used with NHibernate 5.</Description>
6+
<PackageTags>NHibernate; Driver; firebird; firebirsql; firebirdclient; ADO.Net; Core</PackageTags>
7+
8+
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
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 Condition="'$(TargetFramework)' == 'net461'">
21+
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup>
25+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
26+
<RootNamespace>NHibernate</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<Compile Include="..\NHibernate\Driver\FirebirdClientDriver.cs" Link="Driver\FirebirdClientDriver.cs" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="5.12.1" />
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 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: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
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 Condition="'$(TargetFramework)' == 'net461'">
21+
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup>
25+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
26+
<RootNamespace>NHibernate</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<Compile Include="..\NHibernate\Driver\MySqlDataDriver.cs" Link="Driver\MySqlDataDriver.cs" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
35+
</ItemGroup>
36+
37+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
38+
<PackageReference Include="MySql.Data" Version="6.9.11" />
39+
</ItemGroup>
40+
41+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
42+
<PackageReference Include="MySql.Data" Version="6.10.6" />
43+
</ItemGroup>
44+
45+
<ItemGroup>
46+
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
47+
</ItemGroup>
48+
49+
<ItemGroup>
50+
<Content Include="../../LICENSE.txt">
51+
<PackagePath>NHibernate.license.txt</PackagePath>
52+
</Content>
53+
</ItemGroup>
54+
55+
</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: 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 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 Condition="'$(TargetFramework)' == 'net461'">
21+
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup>
25+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
26+
<RootNamespace>NHibernate</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<PackageReference Include="Oracle.ManagedDataAccess" Version="12.1.2400" />
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 ConnectionConfigurationExtensionPostrgeSql
7+
{
8+
public static IConnectionConfiguration ByPostgreSqlDriver(this IConnectionConfiguration cfg)
9+
{
10+
return cfg.By<PostgreSqlDriver>();
11+
}
12+
13+
public static void PostgreSqlDriver(this IDbIntegrationConfigurationProperties cfg)
14+
{
15+
cfg.Driver<PostgreSqlDriver>();
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 PostgreSQL to be used with NHibernate 5.</Description>
6+
<PackageTags>NHibernate; Driver; Npgsql; PostgreSQL; Postgres; ADO.Net; Core</PackageTags>
7+
8+
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
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 Condition="'$(TargetFramework)' == 'net461'">
21+
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup>
25+
<DefineConstants>$(DefineConstants);DRIVER_PACKAGE</DefineConstants>
26+
<RootNamespace>NHibernate</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<Compile Include="..\NHibernate\Driver\NpgsqlDriver.cs" Link="Driver\NpgsqlDriver.cs" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<PackageReference Include="Npgsql" Version="3.2.4.1" />
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 ConnectionConfigurationExtensionSQLite
7+
{
8+
public static IConnectionConfiguration BySQLiteDriver(this IConnectionConfiguration cfg)
9+
{
10+
return cfg.By<SQLiteDriver>();
11+
}
12+
13+
public static void SQLiteDriver(this IDbIntegrationConfigurationProperties cfg)
14+
{
15+
cfg.Driver<SQLiteDriver>();
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)