Skip to content

Commit 7515d6b

Browse files
committed
NH-4008 - Get SqlServer.Compact native binaries to test.
Add .targets file to bring in native binaries from microsoft.sqlserver.compact.
1 parent 6858e67 commit 7515d6b

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

src/NHibernate.Driver.SQLite/NHibernate.Driver.SQLite.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.105.1" />
20+
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.105.1">
21+
<IncludeAssets>All</IncludeAssets>
22+
<ExcludeAssets>none</ExcludeAssets>
23+
<PrivateAssets>analyzers</PrivateAssets>
24+
</PackageReference>
2125
</ItemGroup>
2226

2327
<ItemGroup>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!build/

src/NHibernate.Driver.SqlServer.Compact/NHibernate.Driver.SqlServer.Compact.csproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,24 @@
2424
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
2525
</ItemGroup>
2626

27+
<!--
28+
Since Microsoft.SqlServer.Compact was using Install.ps1, and that doesn't work with the new .csproj,
29+
need include the binaries ourselves. We do that through .target files in a build\ directory.
30+
-->
31+
<ItemGroup>
32+
<Content Include="build\**\*.*">
33+
<Pack>true</Pack>
34+
<PackagePath>build\</PackagePath>
35+
</Content>
36+
</ItemGroup>
37+
38+
<!-- This next section is in addition to the .target file for project references. -->
39+
<ItemGroup>
40+
<Content Include="$(NuGetPackageRoot)microsoft.sqlserver.compact\4.0.8876.1\NativeBinaries\**\*.*">
41+
<Pack>false</Pack>
42+
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
43+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
44+
</Content>
45+
</ItemGroup>
46+
2747
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Since Microsoft.SqlServer.Compact was using Install.ps1, and that doesn't work with the new .csproj,
4+
this will help copy the binaries.
5+
Pre VS 2017 style projects will also run the Microsoft.SqlServer.Compact Install.ps1 and add that .target file.
6+
This file will still end up being imported, but will be a no-opp since $(NuGetPackageRoot) won't be set.
7+
-->
8+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
9+
<Target Name="InjectReference_eb5aa2e4-6c92-4a75-85b8-1348b65397d1" BeforeTargets="ResolveAssemblyReferences">
10+
<ItemGroup Condition=" '$(OS)' == 'Windows_NT' And '$(NuGetPackageRoot)' != '' ">
11+
<NativeBinaries Include="$(NuGetPackageRoot)microsoft.sqlserver.compact\4.0.8876.1\NativeBinaries\**\*.*" />
12+
<Content Include="@(NativeBinaries)">
13+
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
14+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
15+
<Pack>false</Pack>
16+
</Content>
17+
</ItemGroup>
18+
</Target>
19+
<PropertyGroup>
20+
<ResolveAssemblyReferencesDependsOn>$(ResolveAssemblyReferencesDependsOn);InjectReference_eb5aa2e4-6c92-4a75-85b8-1348b65397d1</ResolveAssemblyReferencesDependsOn>
21+
</PropertyGroup>
22+
</Project>

src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
<ItemGroup>
2727
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj" />
28+
<ProjectReference Include="..\NHibernate.Driver.SqlServer.Compact\NHibernate.Driver.SqlServer.Compact.csproj" />
2829
</ItemGroup>
2930

3031
<ItemGroup>

0 commit comments

Comments
 (0)