Skip to content

Commit

Permalink
add templates to synth.py (#91)
Browse files Browse the repository at this point in the history
* add templatest to synth.py

* run synth.py to pick up kokoro
  • Loading branch information
jkwlui authored and JustinBeckwith committed Aug 31, 2018
1 parent b77b102 commit e74f187
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions packages/google-cloud-videointelligence/synth.py
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"])

0 comments on commit e74f187

Please sign in to comment.