Skip to content

Commit

Permalink
fix: synth.py clean up for multiple version (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored May 6, 2020
1 parent 58d5758 commit 28eb2e7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
11 changes: 5 additions & 6 deletions packages/google-cloud-language/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,17 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** This file is automatically generated by synthtool. **
// ** https://github.com/googleapis/synthtool **
// ** All changes to this file may be overwritten. **

import * as v1beta2 from './v1beta2';
import * as v1 from './v1';
import * as v1beta2 from './v1beta2';

const LanguageServiceClient = v1.LanguageServiceClient;

export {v1, v1beta2, LanguageServiceClient};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {v1, v1beta2, LanguageServiceClient};
import * as protos from '../protos/protos';
export {protos};
12 changes: 10 additions & 2 deletions packages/google-cloud-language/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@
"git": {
"name": ".",
"remote": "git@github.com:googleapis/nodejs-language.git",
"sha": "51a2004bb353d2222a9783a0a9908cd86f200f9e"
"sha": "84b62fdebba9b81746d0bceb993ff0e967c9ce5e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "6dfd72d028a0d0a43764e060f7b15e004385c3a1",
"internalRef": "310168181"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "ab883569eb0257bbf16a6d825fd018b3adde3912"
"sha": "756bc4dfc24e8bc4c5dd4116daa41a0440ebf5a0"
}
}
],
Expand Down
12 changes: 7 additions & 5 deletions packages/google-cloud-language/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,27 @@


gapic = gcp.GAPICMicrogenerator()
versions = ['v1', 'v1beta2']
# tasks has two product names, and a poorly named artman yaml
for version in ['v1', 'v1beta2']:
for version in versions:
library = gapic.typescript_library(
'language',
generator_args={
"grpc-service-config": f"google/cloud/language/{version}/language_grpc_service_config.json",
"package-name":f"@google-cloud/language"
},
"package-name": f"@google-cloud/language"
},
proto_path=f'/google/cloud/language/{version}',
version=version)

# skip index, protos, package.json, and README.md
s.copy(
library,
excludes=['package.json', 'README.md', 'src/index.ts'])
excludes=['package.json', 'README.md'])

# Update common templates
common_templates = gcp.CommonTemplates()
templates = common_templates.node_library(source_location='build/src')
templates = common_templates.node_library(
source_location='build/src', versions=versions, default_version='v1')
s.copy(templates)

node.postprocess_gapic_library()

0 comments on commit 28eb2e7

Please sign in to comment.