blob: 5799074cb787ed98f5090d2032148f3c6fc96011 [file] [log] [blame]
Bu Sun Kimf706cfd2020-04-20 14:05:05 -07001# Copyright 2020 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import synthtool as s
16from synthtool import gcp
Anthonios Partheniouaf918e82020-11-25 19:58:04 -050017from synthtool.sources import git
18
19DISCOVERY_ARTIFACT_MANAGER_REPO = "googleapis/discovery-artifact-manager"
Bu Sun Kimf706cfd2020-04-20 14:05:05 -070020
21common = gcp.CommonTemplates()
22
23# ----------------------------------------------------------------------------
24# Add templated files
25# ----------------------------------------------------------------------------
26templated_files = common.py_library()
27
28# Copy kokoro configs.
29# Docs are excluded as repo docs cannot currently be generated using sphinx.
30s.move(templated_files / '.kokoro', excludes=['**/docs/*', 'publish-docs.sh'])
31
32# Also move issue templates
Bu Sun Kim673ec5c2020-11-16 11:05:03 -070033s.move(templated_files / '.github')
34
Anthonios Partheniouaf918e82020-11-25 19:58:04 -050035# ----------------------------------------------------------------------------
36# Copy discoveries folder from discovery-artifact-manager repo
37# ----------------------------------------------------------------------------
38
39discovery_artifact_manager_url = git.make_repo_clone_url(DISCOVERY_ARTIFACT_MANAGER_REPO)
40discovery_artifacts = git.clone(discovery_artifact_manager_url) / "discoveries"
41
42excludes = [
43 "**/BUILD.bazel",
44]
45s.copy(discovery_artifacts,
46 "googleapiclient/discovery_cache/documents", excludes=excludes)
47
48# ----------------------------------------------------------------------------
49# Generate docs
50# ----------------------------------------------------------------------------
51s.shell.run(["nox", "-s", "docs"], hide_output=False)