• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# Copyright 2018 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# Generates C# API docs using docfx inside docker.
17set -ex
18cd $(dirname $0)
19
20# cleanup temporary files
21rm -rf html obj grpc-gh-pages
22
23# generate into src/csharp/docfx/html directory
24cd ..
25docker run --rm -v "$(pwd)":/work -w /work/docfx --user "$(id -u):$(id -g)" -it tsgkadot/docker-docfx:latest docfx
26cd docfx
27
28# prepare a clone of "gh-pages" branch where the generated docs are stored
29GITHUB_USER="${USER}"
30git clone -b gh-pages -o upstream git@github.com:grpc/grpc.git grpc-gh-pages
31cd grpc-gh-pages
32git remote add origin "git@github.com:${GITHUB_USER}/grpc.git"
33
34# replace old generated docs by the ones we just generated
35rm -r csharp
36cp -r ../html csharp
37
38echo "Done. Go to src/csharp/docfx/grpc-gh-pages git repository and create a pull request to update the generated docs."
39