|
1 | | -# Copyright 2021 Google LLC |
| 1 | +# Copyright 2022 Google LLC |
2 | 2 | # |
3 | | -# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# Licensed under the Apache License, Version 2.0 (the License); |
4 | 4 | # you may not use this file except in compliance with the License. |
5 | 5 | # You may obtain a copy of the License at |
6 | 6 | # |
|
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | | - |
15 | | -import synthtool as s |
16 | | -import synthtool.gcp as gcp |
17 | 14 | import synthtool.languages.node as node |
18 | | -import logging |
19 | | -from pathlib import Path |
20 | | -from synthtool import _tracked_paths |
21 | | -from synthtool import shell |
22 | | -import shutil |
23 | | - |
24 | | -logging.basicConfig(level=logging.DEBUG) |
25 | | - |
26 | | -staging = Path("owl-bot-staging") |
27 | | - |
28 | | -if staging.is_dir(): |
29 | | - logging.info(f"Copying files from staging directory ${staging}.") |
30 | | - |
31 | | - # Copy the datastore library. |
32 | | - for version in ['v1']: |
33 | | - library = staging / version |
34 | | - _tracked_paths.add(library) |
35 | | - s.copy([library],excludes=[ |
36 | | - 'package.json', 'README.md', 'src/index.ts', 'src/v1/index.ts']) |
37 | | - |
38 | | - # Copy the admin library. |
39 | | - for version in ['v1']: |
40 | | - library = staging / 'admin' / version |
41 | | - _tracked_paths.add(library) |
42 | | - s.copy([library],excludes=[ |
43 | | - 'package.json', 'README.md', 'src/index.ts', 'src/v1/index.ts', 'tsconfig.json', 'tslint.json', |
44 | | - 'system-test/fixtures/sample/src/index.ts', 'system-test/fixtures/sample/src/index.js', |
45 | | - '.jsdoc.js', 'webpack.config.js']) |
46 | | - |
47 | | - # Patch the code. |
48 | | - system_test_files = ['system-test/fixtures/sample/src/index.ts', 'system-test/fixtures/sample/src/index.js'] |
49 | | - for file in system_test_files: |
50 | | - s.replace(file, 'DatastoreClient', 'Datastore') |
51 | | - s.replace(file, 'client.close', '// client.close'); # does not work with the manual layer |
52 | | - |
53 | | - # The staging directory should never be merged into the main branch. |
54 | | - shutil.rmtree(staging) |
55 | | - |
56 | | -common_templates = gcp.CommonTemplates() |
57 | | -templates = common_templates.node_library(source_location="build/src") |
58 | | -s.copy(templates) |
59 | | - |
60 | | -node.postprocess_gapic_library_hermetic() |
| 15 | +node.owlbot_main(templates_excludes=[ |
| 16 | +'README.md' |
| 17 | +]) |
0 commit comments