|
7 | 7 | <GenerateDocumentationFile>true</GenerateDocumentationFile> |
8 | 8 | <Title>cas-dotnet-sdk</Title> |
9 | 9 | <PackageIcon>icon.jpeg</PackageIcon> |
10 | | - <Version>1.8.3</Version> |
| 10 | + <Version>1.8.5</Version> |
11 | 11 | <Authors>Mike Mulchrone</Authors> |
12 | 12 | <Description>A Nuget package that provides a implementation of the RustCrypto suite of cryptographic algorithms.</Description> |
13 | 13 | <RepositoryUrl>https://github.com/Cryptographic-API-Services/cas-dotnet-sdk</RepositoryUrl> |
14 | 14 | <PackageReadmeFile>README.md</PackageReadmeFile> |
15 | 15 | <Platforms>AnyCPU;x64</Platforms> |
| 16 | + <!-- Paths --> |
| 17 | + <RustProjectDir>../cas-core-lib</RustProjectDir> |
| 18 | + <CasSdkDir>$(MSBuildProjectDirectory)</CasSdkDir> |
| 19 | + <NativeArtifactsDir>$(MSBuildProjectDirectory)\artifacts\native</NativeArtifactsDir> |
16 | 20 | </PropertyGroup> |
17 | 21 |
|
| 22 | + <PropertyGroup> |
| 23 | + <BuildNativeRust Condition="'$(BuildNativeRust)'==''">true</BuildNativeRust> |
| 24 | + </PropertyGroup> |
| 25 | + |
| 26 | + <Target Name="BuildRust" BeforeTargets="Build" |
| 27 | + Condition="'$(BuildNativeRust)'=='true'"> |
| 28 | + <Exec Command="cargo build --release" WorkingDirectory="$(RustProjectDir)" /> |
| 29 | + </Target> |
| 30 | + |
| 31 | + <Target Name="StageRustArtifacts" AfterTargets="BuildRust" |
| 32 | + Condition="'$(BuildNativeRust)'=='true'"> |
| 33 | + <ItemGroup Condition="'$(OS)' == 'Windows_NT'"> |
| 34 | + <_RustOut Include="$(RustProjectDir)\target\release\cas_core_lib.dll" /> |
| 35 | + <_DestDir Include="$(NativeArtifactsDir)\win-x64\" /> |
| 36 | + </ItemGroup> |
| 37 | + |
| 38 | + <ItemGroup Condition="'$(OS)' != 'Windows_NT'"> |
| 39 | + <_RustOut Include="$(RustProjectDir)/target/release/libcas_core_lib.so" /> |
| 40 | + <_DestDir Include="$(NativeArtifactsDir)\linux-x64\" /> |
| 41 | + </ItemGroup> |
| 42 | + |
| 43 | + <MakeDir Directories="@(_DestDir)" /> |
| 44 | + <Copy SourceFiles="@(_RustOut)" DestinationFolder="@(_DestDir)" SkipUnchangedFiles="true" /> |
| 45 | + </Target> |
| 46 | + |
| 47 | + <!-- Pack staged native artifacts into runtimes/<rid>/native --> |
| 48 | + <ItemGroup> |
| 49 | + <None Include="$(NativeArtifactsDir)\win-x64\cas_core_lib.dll" |
| 50 | + Condition="Exists('$(NativeArtifactsDir)\win-x64\cas_core_lib.dll')"> |
| 51 | + <Pack>true</Pack> |
| 52 | + <PackagePath>runtimes/win-x64/native</PackagePath> |
| 53 | + <Link>cas_core_lib.dll</Link> |
| 54 | + <!-- Optional: helps for projects that reference this library directly --> |
| 55 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 56 | + </None> |
| 57 | + |
| 58 | + <None Include="$(NativeArtifactsDir)\linux-x64\libcas_core_lib.so" |
| 59 | + Condition="Exists('$(NativeArtifactsDir)\linux-x64\libcas_core_lib.so')"> |
| 60 | + <Pack>true</Pack> |
| 61 | + <PackagePath>runtimes/linux-x64/native</PackagePath> |
| 62 | + <Link>libcas_core_lib.so</Link> |
| 63 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 64 | + </None> |
| 65 | + </ItemGroup> |
| 66 | + |
18 | 67 | <ItemGroup> |
19 | 68 | <Content Include="..\icon.jpeg"> |
20 | 69 | <Pack>True</Pack> |
|
37 | 86 | <PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.2.0" /> |
38 | 87 | <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.2.0" /> |
39 | 88 | </ItemGroup> |
40 | | - |
41 | | - <!-- Native assets packaged to runtimes/<rid>/native so runtime probing works correctly --> |
42 | | - <ItemGroup> |
43 | | - <Content Include="cas_core_lib.dll"> |
44 | | - <PackagePath>runtimes/win-x64/native</PackagePath> |
45 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
46 | | - </Content> |
47 | | - <Content Include="libcas_core_lib.so"> |
48 | | - <PackagePath>runtimes/linux-x64/native</PackagePath> |
49 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
50 | | - </Content> |
51 | | - </ItemGroup> |
52 | 89 | </Project> |
0 commit comments