xref: /aosp_15_r20/external/grpc-grpc/src/csharp/nuget_helpers/create_fake_native_artifacts.sh (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
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
19set -ex
20
21cd "$(dirname "$0")/../../.."
22
23cd src/csharp
24
25# Create fake protoc artifacts
26mkdir -p protoc_plugins
27pushd protoc_plugins
28
29if [[ "$(uname)" != "Linux" ]]
30then
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
42fi
43
44if [[ "$(uname)" != "Darwin" ]]
45then
46    mkdir -p protoc_macos_x64
47    touch protoc_macos_x64/protoc
48    touch protoc_macos_x64/grpc_csharp_plugin
49fi
50
51if [[ "$(uname)" != "WindowsNT" ]]
52then
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
60fi
61
62popd
63