Debian Codegraph @

src/csharp/nuget_helpers/create_fake_native_artifacts.sh

raw
1 #!/bin/bash
2 # Copyright 2021 The gRPC Authors
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 # Create placeholders ("fake artifacts") for native binaries that
17 # can't be built locally on current platform.
18
19 set -ex
20
21 cd "$(dirname "$0")/../../.."
22
23 cd src/csharp
24
25 # Create fake protoc artifacts
26 mkdir -p protoc_plugins
27 pushd protoc_plugins
28
29 if [[ "$(uname)" != "Linux" ]]
30 then
31 mkdir -p protoc_linux_x64
32 touch protoc_linux_x64/protoc
33 touch protoc_linux_x64/grpc_csharp_plugin
34
35 mkdir -p protoc_linux_x86
36 touch protoc_linux_x86/protoc
37 touch protoc_linux_x86/grpc_csharp_plugin
38
39 mkdir -p protoc_linux_aarch64
40 touch protoc_linux_aarch64/protoc
41 touch protoc_linux_aarch64/grpc_csharp_plugin
42 fi
43
44 if [[ "$(uname)" != "Darwin" ]]
45 then
46 mkdir -p protoc_macos_x64
47 touch protoc_macos_x64/protoc
48 touch protoc_macos_x64/grpc_csharp_plugin
49 fi
50
51 if [[ "$(uname)" != "WindowsNT" ]]
52 then
53 mkdir -p protoc_windows_x86
54 touch protoc_windows_x86/protoc.exe
55 touch protoc_windows_x86/grpc_csharp_plugin.exe
56
57 mkdir -p protoc_windows_x64
58 touch protoc_windows_x64/protoc.exe
59 touch protoc_windows_x64/grpc_csharp_plugin.exe
60 fi
61
62 popd