Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spannerlib/wrappers/spannerlib-dotnet/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ obj
bin
*DotSettings.user
binaries
runtimes
6 changes: 3 additions & 3 deletions spannerlib/wrappers/spannerlib-dotnet/build-grpc-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ copy_binary() {
local platform=$1 # e.g., osx-arm64
local ext=${2:-}
local src_dir="../../grpc-server/binaries/${platform}"
local dest_dir="spannerlib-dotnet-grpc-server/binaries/${platform}"
local dest_dir="spannerlib-dotnet-grpc-server/runtimes/${platform}/native"
local filename="spannerlib_grpc_server${ext}"

mkdir -p "${dest_dir}"
cp "${src_dir}/${filename}" "${dest_dir}/${filename}"
}

mkdir -p spannerlib-dotnet-grpc-server/binaries/any
rm spannerlib-dotnet-grpc-server/binaries/any/spannerlib_grpc_server 2> /dev/null
mkdir -p spannerlib-dotnet-grpc-server/runtimes/any/native
rm spannerlib-dotnet-grpc-server/runtimes/any/native/spannerlib_grpc_server 2> /dev/null

copy_binary "osx-arm64"
copy_binary "linux-x64"
Expand Down
2 changes: 2 additions & 0 deletions spannerlib/wrappers/spannerlib-dotnet/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ echo "Skip windows: $SKIP_WINDOWS"
# Remove existing builds
rm -r ./spannerlib-dotnet-native/libraries 2> /dev/null
rm -r ./spannerlib-dotnet-grpc-server/binaries 2> /dev/null
rm -r ./spannerlib-dotnet-native/runtimes 2> /dev/null
rm -r ./spannerlib-dotnet-grpc-server/runtimes 2> /dev/null
rm -r ./*/bin 2> /dev/null
rm -r ./*/obj 2> /dev/null
# Remove all local nuget packages to force the use of the new ones that will be built in this script.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

<ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" PrivateAssets="All" Version="5.0.0.1" />
<PackageReference Include="Alpha.Google.Cloud.SpannerLib.GrpcServer" Version="1.0.0-alpha.20260119112406" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\spannerlib-dotnet-grpc-server\spannerlib-dotnet-grpc-server.csproj" PrivateAssets="All" />
<ProjectReference Include="..\spannerlib-dotnet-grpc-v1\spannerlib-dotnet-grpc-v1.csproj" />
<ProjectReference Include="..\spannerlib-dotnet\spannerlib-dotnet.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</ItemGroup>

<ItemGroup>
<None Include="binaries/any/*" Pack="true" PackagePath="runtimes/any/native/" />
<None Include="binaries/linux-x64/*" Pack="true" PackagePath="runtimes/linux-x64/native/" />
<None Include="binaries/linux-arm64/*" Pack="true" PackagePath="runtimes/linux-arm64/native/" />
<None Include="binaries/osx-arm64/*" Pack="true" PackagePath="runtimes/osx-arm64/native/" />
<None Include="binaries/win-x64/*" Pack="true" PackagePath="runtimes/win-x64/native/" />
<None Include="runtimes/any/native/*" Pack="true" PackagePath="runtimes/any/native/" CopyToOutputDirectory="PreserveNewest" />
<None Include="runtimes/linux-x64/native/*" Pack="true" PackagePath="runtimes/linux-x64/native/" CopyToOutputDirectory="PreserveNewest" />
<None Include="runtimes/linux-arm64/native/*" Pack="true" PackagePath="runtimes/linux-arm64/native/" CopyToOutputDirectory="PreserveNewest" />
<None Include="runtimes/osx-arm64/native/*" Pack="true" PackagePath="runtimes/osx-arm64/native/" CopyToOutputDirectory="PreserveNewest" />
<None Include="runtimes/win-x64/native/*" Pack="true" PackagePath="runtimes/win-x64/native/" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Comment on lines 18 to 24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and reduce repetition, you can define the list of runtimes as a separate item group and then use it to generate the <None> items. This makes it easier to add or remove runtimes in the future.

  <ItemGroup>
    <Runtimes Include="any" />
    <Runtimes Include="linux-x64" />
    <Runtimes Include="linux-arm64" />
    <Runtimes Include="osx-arm64" />
    <Runtimes Include="win-x64" />
    <None Include="runtimes/%(Runtimes.Identity)/native/*" Pack="true" PackagePath="runtimes/%(Runtimes.Identity)/native/" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

<ItemGroup>
<ProjectReference Include="..\spannerlib-dotnet-grpc-impl\spannerlib-dotnet-grpc-impl.csproj" />
<ProjectReference Include="..\spannerlib-dotnet-grpc-server\spannerlib-dotnet-grpc-server.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

<ItemGroup>
<ProjectReference Include="..\spannerlib-dotnet-grpc-impl\spannerlib-dotnet-grpc-impl.csproj" />
<ProjectReference Include="..\spannerlib-dotnet-grpc-server\spannerlib-dotnet-grpc-server.csproj" />
<ProjectReference Include="..\spannerlib-dotnet-mockserver\spannerlib-dotnet-mockserver.csproj" />
<ProjectReference Include="..\spannerlib-dotnet-native-impl\spannerlib-dotnet-native-impl.csproj" />
</ItemGroup>
Expand Down
Loading