forked from googleapis/nodejs-language
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsynth.py
More file actions
27 lines (22 loc) · 741 Bytes
/
synth.py
File metadata and controls
27 lines (22 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import synthtool as s
import synthtool.gcp as gcp
import logging
import subprocess
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICGenerator()
# tasks has two product names, and a poorly named artman yaml
for version in ['v1', 'v1beta2']:
library = gapic.node_library(
'language', version)
# skip index, protos, package.json, and README.md
s.copy(
library,
excludes=['package.json', 'README.md', 'src/index.js'])
# Update common templates
common_templates = gcp.CommonTemplates()
templates = common_templates.node_library()
s.copy(templates)
# Node.js specific cleanup
subprocess.run(['npm', 'install'])
subprocess.run(['npm', 'run', 'fix'])
subprocess.run(['npx', 'compileProtos', 'src'])