|
14 | 14 |
|
15 | 15 | """This script is used to synthesize generated parts of this library.""" |
16 | 16 |
|
17 | | -import synthtool as s |
18 | | -import synthtool.gcp as gcp |
19 | 17 | import logging |
| 18 | +from pathlib import Path |
| 19 | +import subprocess |
20 | 20 |
|
21 | | -logging.basicConfig(level=logging.DEBUG) |
| 21 | +import synthtool as s |
| 22 | +from synthtool.languages import php |
22 | 23 |
|
23 | | -gapic = gcp.GAPICBazel() |
24 | | -common = gcp.CommonTemplates() |
| 24 | +logging.basicConfig(level=logging.DEBUG) |
25 | 25 |
|
26 | | -library = gapic.php_library( |
27 | | - service='analytics-admin', |
28 | | - version='v1alpha', |
29 | | - bazel_target='//google/analytics/admin/v1alpha:google-analytics-admin-v1alpha-php', |
30 | | -) |
| 26 | +src = Path(f"../{php.STAGING_DIR}/AnalyticsAdmin").resolve() |
| 27 | +dest = Path().resolve() |
31 | 28 |
|
32 | | -# copy all src including partial veneer classes |
33 | | -s.move(library / 'src') |
| 29 | +php.owlbot_main(src=src, dest=dest) |
34 | 30 |
|
35 | | -# copy proto files to src also |
36 | | -s.move(library / 'proto/src/Google/Analytics/Admin', 'src/') |
37 | | -s.move(library / 'tests/') |
38 | 31 |
|
39 | | -# copy GPBMetadata file to metadata |
40 | | -s.move(library / 'proto/src/GPBMetadata/Google/Analytics/Admin', 'metadata/') |
41 | 32 |
|
42 | 33 | # document and utilize apiEndpoint instead of serviceAddress |
43 | 34 | s.replace( |
|
57 | 48 | r"\$transportConfig, and any \$serviceAddress", |
58 | 49 | r"$transportConfig, and any `$apiEndpoint`") |
59 | 50 |
|
60 | | -# fix year |
61 | | -s.replace( |
62 | | - '**/Gapic/*GapicClient.php', |
63 | | - r'Copyright \d{4}', |
64 | | - 'Copyright 2020') |
65 | | -s.replace( |
66 | | - '**/V1alpha/*Client.php', |
67 | | - r'Copyright \d{4}', |
68 | | - 'Copyright 2020') |
69 | | -s.replace( |
70 | | - 'tests/**/V1alpha/*Test.php', |
71 | | - r'Copyright \d{4}', |
72 | | - 'Copyright 2020') |
73 | | - |
74 | 51 | # Change the wording for the deprecation warning. |
75 | 52 | s.replace( |
76 | 53 | 'src/*/*_*.php', |
|
0 commit comments