Skip to content

Commit 990939e

Browse files
committed
Extract Interop to PactNet.Interop package
1 parent 2738376 commit 990939e

File tree

11 files changed

+99
-77
lines changed

11 files changed

+99
-77
lines changed

PactNet.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrpcGreeterClient.Tests", "
4747
EndProject
4848
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrpcGreeter.Tests", "samples\Grpc\GrpcGreeter.Tests\GrpcGreeter.Tests.csproj", "{DC5371A0-7DE2-4CC5-D0E1-1DF6CB567FA6}"
4949
EndProject
50+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PactNet.Interop", "src\PactNet.Interop\PactNet.Interop.csproj", "{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}"
51+
EndProject
5052
Global
5153
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5254
Debug|Any CPU = Debug|Any CPU
@@ -213,6 +215,18 @@ Global
213215
{DC5371A0-7DE2-4CC5-D0E1-1DF6CB567FA6}.Release|x64.Build.0 = Release|Any CPU
214216
{DC5371A0-7DE2-4CC5-D0E1-1DF6CB567FA6}.Release|x86.ActiveCfg = Release|Any CPU
215217
{DC5371A0-7DE2-4CC5-D0E1-1DF6CB567FA6}.Release|x86.Build.0 = Release|Any CPU
218+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
219+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Debug|Any CPU.Build.0 = Debug|Any CPU
220+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Debug|x64.ActiveCfg = Debug|Any CPU
221+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Debug|x64.Build.0 = Debug|Any CPU
222+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Debug|x86.ActiveCfg = Debug|Any CPU
223+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Debug|x86.Build.0 = Debug|Any CPU
224+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Release|Any CPU.ActiveCfg = Release|Any CPU
225+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Release|Any CPU.Build.0 = Release|Any CPU
226+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Release|x64.ActiveCfg = Release|Any CPU
227+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Release|x64.Build.0 = Release|Any CPU
228+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Release|x86.ActiveCfg = Release|Any CPU
229+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B}.Release|x86.Build.0 = Release|Any CPU
216230
EndGlobalSection
217231
GlobalSection(SolutionProperties) = preSolution
218232
HideSolutionNode = FALSE
@@ -233,6 +247,7 @@ Global
233247
{917DAC61-55B4-D721-B1ED-B0E352E4CF1A} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
234248
{13756BC3-0750-E2AF-E1F0-565855A3E636} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
235249
{DC5371A0-7DE2-4CC5-D0E1-1DF6CB567FA6} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
250+
{D1D174A6-0027-49C4-AC6B-62CDF0F8511B} = {CF67D7A1-AE96-420B-9971-65E535B903E8}
236251
EndGlobalSection
237252
GlobalSection(ExtensibilityGlobals) = postSolution
238253
SolutionGuid = {C2CBC30C-92D4-4E3A-A5B8-1E5D4E938DFC}

samples/Grpc/GrpcGreeter.Tests/GrpcGreeter.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PackageReference>
1414
</ItemGroup>
1515
<ItemGroup>
16-
<ProjectReference Include="..\..\..\src\PactNet\PactNet.csproj" />
16+
<ProjectReference Include="..\..\..\src\PactNet.Interop\PactNet.Interop.csproj" />
1717
<ProjectReference Include="..\GrpcGreeter\GrpcGreeter.csproj" />
1818
</ItemGroup>
1919
<ItemGroup>

samples/Grpc/GrpcGreeterClient.Tests/GrpcGreeterClient.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PackageReference>
1414
</ItemGroup>
1515
<ItemGroup>
16-
<ProjectReference Include="..\..\..\src\PactNet\PactNet.csproj" />
16+
<ProjectReference Include="..\..\..\src\PactNet.Interop\PactNet.Interop.csproj" />
1717
<ProjectReference Include="..\GrpcGreeterClient\GrpcGreeterClient.csproj" />
1818
</ItemGroup>
1919
<ItemGroup>

src/PactNet/Interop/InteractionHandle.cs renamed to src/PactNet.Interop/InteractionHandle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace PactNet.Interop
44
{
55
[StructLayout(LayoutKind.Sequential)]
6-
internal readonly struct InteractionHandle
6+
public readonly struct InteractionHandle
77
{
88
public readonly uint InteractionRef;
99
}

src/PactNet/Interop/InteractionPart.cs renamed to src/PactNet.Interop/InteractionPart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace PactNet.Interop
22
{
3-
internal enum InteractionPart
3+
public enum InteractionPart
44
{
55
Request = 0,
66
Response = 1

src/PactNet/Interop/LevelFilter.cs renamed to src/PactNet.Interop/LevelFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace PactNet.Interop
22
{
3-
internal enum LevelFilter
3+
public enum LevelFilter
44
{
55
Off = 0,
66
Error = 1,

src/PactNet/Interop/NativeInterop.cs renamed to src/PactNet.Interop/NativeInterop.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace PactNet.Interop
66
/// <summary>
77
/// Interop definitions to the Pact FFI library
88
/// </summary>
9-
internal static class NativeInterop
9+
public static class NativeInterop
1010
{
1111
private const string DllName = "pact_ffi";
1212

src/PactNet/Interop/PactHandle.cs renamed to src/PactNet.Interop/PactHandle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace PactNet.Interop
44
{
55
[StructLayout(LayoutKind.Sequential)]
6-
internal readonly struct PactHandle
6+
public readonly struct PactHandle
77
{
88
public readonly ushort PactRef;
99
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7+
<NoWarn>CS1591;NU5105</NoWarn>
8+
<OutputType>Library</OutputType>
9+
</PropertyGroup>
10+
11+
<Import Project="../NuGet.targets" />
12+
13+
<PropertyGroup>
14+
<IsWindows>False</IsWindows>
15+
<IsLinux>False</IsLinux>
16+
<IsOSX>False</IsOSX>
17+
<IsArm64>False</IsArm64>
18+
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'True'">True</IsWindows>
19+
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'True'">True</IsLinux>
20+
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'True'">True</IsOSX>
21+
<IsArm64 Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">True</IsArm64>
22+
</PropertyGroup>
23+
24+
<ItemGroup>
25+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\windows\x86_64\pact_ffi.dll">
26+
<Link>pact_ffi.dll</Link>
27+
<PackagePath>runtimes/win-x64/native</PackagePath>
28+
<Pack>true</Pack>
29+
<CopyToOutputDirectory Condition="'$(IsWindows)'">PreserveNewest</CopyToOutputDirectory>
30+
<Visible>false</Visible>
31+
</Content>
32+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\linux\x86_64\libpact_ffi.so">
33+
<Link>libpact_ffi.so</Link>
34+
<PackagePath>runtimes/linux-x64/native</PackagePath>
35+
<Pack>true</Pack>
36+
<CopyToOutputDirectory Condition="'$(IsLinux)' And '$(IsArm64)' == 'False'">PreserveNewest</CopyToOutputDirectory>
37+
<Visible>false</Visible>
38+
</Content>
39+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\linux\aarch64\libpact_ffi.so">
40+
<Link>libpact_ffi.so</Link>
41+
<PackagePath>runtimes/linux-arm64/native</PackagePath>
42+
<Pack>true</Pack>
43+
<CopyToOutputDirectory Condition="'$(IsLinux)' And '$(IsArm64)' == 'True'">PreserveNewest</CopyToOutputDirectory>
44+
<Visible>false</Visible>
45+
</Content>
46+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\macos\x86_64\libpact_ffi.dylib">
47+
<Link>libpact_ffi.dylib</Link>
48+
<PackagePath>runtimes/osx-x64/native</PackagePath>
49+
<Pack>true</Pack>
50+
<CopyToOutputDirectory Condition="'$(IsOSX)' == 'True' And '$(IsArm64)' == 'False'">PreserveNewest</CopyToOutputDirectory>
51+
<Visible>false</Visible>
52+
</Content>
53+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\macos\aarch64\libpact_ffi.dylib">
54+
<Link>libpact_ffi.dylib</Link>
55+
<PackagePath>runtimes/osx-arm64/native</PackagePath>
56+
<Pack>true</Pack>
57+
<CopyToOutputDirectory Condition="'$(IsOSX)' == 'True' And '$(IsArm64)' == 'True'">PreserveNewest</CopyToOutputDirectory>
58+
<Visible>false</Visible>
59+
</Content>
60+
</ItemGroup>
61+
62+
<ItemGroup>
63+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\PactNet.targets">
64+
<PackagePath>build/net462/</PackagePath>
65+
<Pack>true</Pack>
66+
<Visible>false</Visible>
67+
</Content>
68+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\PactNet.targets">
69+
<PackagePath>buildTransitive/net462/</PackagePath>
70+
<Pack>true</Pack>
71+
<Visible>false</Visible>
72+
</Content>
73+
</ItemGroup>
74+
</Project>

src/PactNet/Interop/PactSpecification.cs renamed to src/PactNet.Interop/PactSpecification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace PactNet.Interop
22
{
3-
internal enum PactSpecification
3+
public enum PactSpecification
44
{
55
Unknown = 0,
66
V1 = 1,

0 commit comments

Comments
 (0)