Skip to content

Commit

Permalink
fix: synth.py clean up for multiple version (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed May 6, 2020
1 parent 095f33b commit 2b844cd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
10 changes: 5 additions & 5 deletions packages/google-cloud-phishingprotection/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,16 +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 v1beta1 from './v1beta1';

const PhishingProtectionServiceV1Beta1Client =
v1beta1.PhishingProtectionServiceV1Beta1Client;

export {v1beta1, PhishingProtectionServiceV1Beta1Client};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {v1beta1, PhishingProtectionServiceV1Beta1Client};
import * as protos from '../protos/protos';
export {protos};
12 changes: 10 additions & 2 deletions packages/google-cloud-phishingprotection/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-phishing-protection.git",
"sha": "2eaf30eadd7e15701f9bfc1ddfb0049ae1a46867"
"sha": "04040e7ad95097e91239b16fca19be2ec8198dae"
}
},
{
"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
21 changes: 11 additions & 10 deletions packages/google-cloud-phishingprotection/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@
gapic = gcp.GAPICMicrogenerator()
versions = ['v1beta1']
for version in versions:
library = gapic.typescript_library(
'phishingprotection', version,
generator_args={
"grpc-service-config": f"google/cloud/phishingprotection/{version}/phishingprotection_grpc_service_config.json",
"package-name": "@google-cloud/phishing-protection",
},
proto_path=f'/google/cloud/phishingprotection/{version}',
extra_proto_files=['google/cloud/common_resources.proto'],
library = gapic.typescript_library(
'phishingprotection', version,
generator_args={
"grpc-service-config": f"google/cloud/phishingprotection/{version}/phishingprotection_grpc_service_config.json",
"package-name": "@google-cloud/phishing-protection",
},
proto_path=f'/google/cloud/phishingprotection/{version}',
extra_proto_files=['google/cloud/common_resources.proto'],
)
s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts'])
s.copy(library, excludes=['README.md', 'package.json'])

# Copy 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='v1beta1')
s.copy(templates)

node.postprocess_gapic_library()

0 comments on commit 2b844cd

Please sign in to comment.