fix paths, also build main library automatically for C# binding

This commit is contained in:
Vinzenz Schroeter 2024-05-13 21:39:16 +02:00
parent 18aa87da92
commit 51685f038c
4 changed files with 21 additions and 10 deletions

View file

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\servicepoint2-binding-cs\ServicePoint2\ServicePoint2.csproj"/> <ProjectReference Include="..\..\servicepoint2-binding-cs\src\ServicePoint2.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -1,8 +1,8 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServicePoint2", "ServicePoint2.csproj", "{70EFFA3F-012A-4518-9627-466BEAE4252E}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServicePoint2", "src/ServicePoint2.csproj", "{70EFFA3F-012A-4518-9627-466BEAE4252E}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lang-cs", "..\..\examples\lang_cs\lang_cs.csproj", "{DA3B8B6E-993A-47DA-844B-F92AF520FF59}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lang-cs", "../examples/lang_cs/lang_cs.csproj", "{DA3B8B6E-993A-47DA-844B-F92AF520FF59}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -12,6 +12,6 @@ fn main() {
.csharp_namespace("ServicePoint2.BindGen") .csharp_namespace("ServicePoint2.BindGen")
.csharp_use_nint_types(true) .csharp_use_nint_types(true)
.csharp_class_accessibility("public") .csharp_class_accessibility("public")
.generate_csharp_file("ServicePoint2/BindGen/ServicePoint2.g.cs") .generate_csharp_file("src/BindGen/ServicePoint2.g.cs")
.unwrap(); .unwrap();
} }

View file

@ -2,7 +2,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifiers>linux-x64;linux-x64-musl;win-x64;</RuntimeIdentifiers>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@ -27,9 +26,13 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl> <PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <Target Name="BuildLibrary" Condition="'$(Configuration)'=='Release'" BeforeTargets="PrepareForBuild">
<None Include="../../README.md" Pack="true" PackagePath="\"/> <Exec Command="cargo build --manifest-path ../../servicepoint2/Cargo.toml --all-features --release"/>
</ItemGroup> </Target>
<Target Name="BuildLibrary" Condition="'$(Configuration)'=='Debug'" BeforeTargets="PrepareForBuild">
<Exec Command="cargo build --manifest-path ../../servicepoint2/Cargo.toml --all-features"/>
</Target>
<Target Name="BuildBindings" Condition="'$(Configuration)'=='Release'" BeforeTargets="PrepareForBuild"> <Target Name="BuildBindings" Condition="'$(Configuration)'=='Release'" BeforeTargets="PrepareForBuild">
<Exec Command="cargo build --release"/> <Exec Command="cargo build --release"/>
@ -51,9 +54,17 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<!-- include link to source code at revision -->
<ItemGroup> <ItemGroup>
<!-- include link to source code at revision -->
<None Include="../../README.md" Pack="true" PackagePath="\"/>
<!-- add README.md to package -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="..\build.rs">
<Link>build.rs</Link>
</Content>
</ItemGroup>
</Project> </Project>