Skip to content

Commit 5ce89d5

Browse files
jsm174freezy
authored andcommitted
build: add ilrepack for Google.Protobuf.dll
1 parent 4486d48 commit 5ce89d5

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed
491 KB
Binary file not shown.
52.1 KB
Binary file not shown.
458 KB
Binary file not shown.
7.85 MB
Binary file not shown.

VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,64 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
22+
<PackageReference Include="Google.Protobuf" Version="3.14.0" />
2323
<PackageReference Include="Grpc.Core" Version="2.35.0-pre1" />
2424
<PackageReference Include="Grpc.Tools" Version="2.35.0-pre1">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
</PackageReference>
28+
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" />
2829
</ItemGroup>
2930
<ItemGroup>
3031
<Protobuf Include="**/*.proto" ProtoRoot="protos" />
3132
</ItemGroup>
33+
34+
<Target Name="ILRepack" AfterTargets="Build">
35+
<ItemGroup>
36+
<InputAssemblies Include="System.Memory.dll" />
37+
</ItemGroup>
38+
<ILRepack OutputType="$(OutputType)" MainAssembly="Google.Protobuf.dll" InputAssemblies="@(InputAssemblies)" OutputAssembly="Google.Protobuf.dll" WorkingDirectory="$(OutDir)" />
39+
</Target>
3240

3341
<ItemGroup Condition=" '$(RuntimeIdentifier)' == 'win-x86' ">
34-
<Content Include="$(NuGetPackageRoot)\grpc.core\2.32.0\runtimes\win\native\grpc_csharp_ext.x86.dll">
42+
<Content Include="$(NuGetPackageRoot)\grpc.core\2.35.0-pre1\runtimes\win-x86\native\grpc_csharp_ext.x86.dll">
3543
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3644
<Link>grpc_csharp_ext.x86.dll</Link>
3745
</Content>
3846
</ItemGroup>
3947

4048
<ItemGroup Condition=" '$(RuntimeIdentifier)' == 'win-x64' ">
41-
<Content Include="$(NuGetPackageRoot)\grpc.core\2.32.0\runtimes\win\native\grpc_csharp_ext.x64.dll">
49+
<Content Include="$(NuGetPackageRoot)\grpc.core\2.35.0-pre1\runtimes\win-x64\native\grpc_csharp_ext.x64.dll">
4250
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4351
<Link>grpc_csharp_ext.x64.dll</Link>
4452
</Content>
4553
</ItemGroup>
4654

4755
<ItemGroup Condition=" '$(RuntimeIdentifier)' == 'osx-x64' ">
48-
<Content Include="$(NuGetPackageRoot)\grpc.core\2.32.0\runtimes\osx\native\libgrpc_csharp_ext.x64.dylib">
56+
<Content Include="$(NuGetPackageRoot)\grpc.core\2.35.0-pre1\runtimes\osx-x64\native\libgrpc_csharp_ext.x64.dylib">
4957
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5058
<Link>libgrpc_csharp_ext.x64.dylib</Link>
5159
</Content>
5260
</ItemGroup>
5361

5462
<ItemGroup Condition=" '$(RuntimeIdentifier)' == 'linux-x64' ">
55-
<Content Include="$(NuGetPackageRoot)\grpc.core\2.32.0\runtimes\linux\native\libgrpc_csharp_ext.x64.so">
63+
<Content Include="$(NuGetPackageRoot)\grpc.core\2.35.0-pre1\runtimes\linux-x64\native\libgrpc_csharp_ext.x64.so">
5664
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5765
<Link>libgrpc_csharp_ext.x64.so</Link>
5866
</Content>
5967
</ItemGroup>
68+
69+
<Target Name="PluginsDeploy" AfterTargets="ILRepack">
70+
<ItemGroup>
71+
<NativePlugins Include="$(OutDir)Google.Protobuf.dll" />
72+
<NativePlugins Include="$(OutDir)Grpc.Core.dll" />
73+
<NativePlugins Include="$(OutDir)Grpc.Core.Api.dll" />
74+
75+
<NativePlugins Include="$(NuGetPackageRoot)\grpc.core\2.35.0-pre1\runtimes\$(RuntimeIdentifier)\native\*" />
76+
</ItemGroup>
77+
<Message Text="PluginsDeploy: @(Plugins)" />
78+
<Copy SourceFiles="@(Plugins)" DestinationFolder="..\VisualPinball.Engine.Mpf.Unity\Plugins\" SkipUnchangedFiles="true" />
79+
<Copy SourceFiles="@(NativePlugins)" DestinationFolder="..\VisualPinball.Engine.Mpf.Unity\Plugins\$(RuntimeIdentifier)\" SkipUnchangedFiles="true" />
80+
</Target>
6081

6182
</Project>

0 commit comments

Comments
 (0)