xref: /aosp_15_r20/external/sdk-platform-java/java-common-protos/owlbot.py (revision 882aa7c72c3cd3b66e72a261bdd69b93f7de7670)
1# 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 os
16import os.path
17import synthtool as s
18from synthtool.languages import java
19
20
21for library in s.get_staging_dirs():
22  # put any special-case replacements here
23  # TODO: remove this for the next major version bump
24  if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java"):
25    os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java")
26  if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java"):
27    os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java")
28  if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java"):
29    os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java")
30  if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto"):
31    os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto")
32  if os.path.exists("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto"):
33    os.remove("owl-bot-staging/v1/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto")
34  s.move(library)
35
36s.remove_staging_dirs()
37java.common_templates(monorepo=True,excludes=[
38  ".github/*",
39  ".kokoro/*",
40  "CODE_OF_CONDUCT.md",
41  "CONTRIBUTING.md",
42  "LICENSE",
43  "SECURITY.md",
44  "java.header",
45  "license-checks.xml",
46  "README.md",
47  "samples/*",
48  "renovate.json",
49  ".gitignore"
50])
51