-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add templatest to synth.py * run synth.py to pick up kokoro
- Loading branch information
1 parent
b77b102
commit e74f187
Showing
1 changed file
with
14 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
import synthtool as s | ||
import synthtool.gcp as gcp | ||
import logging | ||
from pathlib import Path | ||
import subprocess | ||
|
||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
gapic = gcp.GAPICGenerator() | ||
common_templates = gcp.CommonTemplates() | ||
|
||
versions = ['v1', 'v1beta1', 'v1beta2', 'v1p1beta1'] | ||
versions = ["v1", "v1beta1", "v1beta2", "v1p1beta1"] | ||
|
||
for version in versions: | ||
library = gapic.node_library( | ||
'video-intelligence', version, | ||
"video-intelligence", | ||
version, | ||
config_path="/google/cloud/videointelligence/" | ||
f"artman_videointelligence_{version}.yaml") | ||
f"artman_videointelligence_{version}.yaml", | ||
) | ||
|
||
# skip index, protos, package.json, and README.md | ||
s.copy( | ||
library, | ||
excludes=['package.json', 'README.md', 'src/index.js'], | ||
) | ||
s.copy(library, excludes=["package.json", "README.md", "src/index.js"]) | ||
|
||
# | ||
# Generator emitted unused helper mockSimpleGrpcMethod, add a temporary | ||
# s.replace to remove that function. | ||
# ref: https://github.com/googleapis/gapic-generator/issues/2120 | ||
# | ||
s.replace( | ||
'test/gapic-*.js', | ||
'function mockSimpleGrpcMethod.*\n(.*\n)*?}\n', | ||
'', | ||
) | ||
s.replace("test/gapic-*.js", "function mockSimpleGrpcMethod.*\n(.*\n)*?}\n", "") | ||
|
||
templates = common_templates.node_library() | ||
s.copy(templates) | ||
|
||
# Node.js specific cleanup | ||
subprocess.run(['npm', 'install']) | ||
subprocess.run(['npm', 'run', 'prettier']) | ||
subprocess.run(['npm', 'run', 'lint']) | ||
subprocess.run(["npm", "install"]) | ||
subprocess.run(["npm", "run", "prettier"]) | ||
subprocess.run(["npm", "run", "lint"]) |