Skip to content

Commit

Permalink
fix: clean up synth.py for multiple version (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored May 6, 2020
1 parent b4c6d12 commit a29d47e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions packages/google-cloud-automl/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,17 @@
// 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 v1 from './v1';
import * as v1beta1 from './v1beta1';

const AutoMlClient = v1.AutoMlClient;
const PredictionServiceClient = v1.PredictionServiceClient;

export {v1, v1beta1, AutoMlClient, PredictionServiceClient};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {v1, v1beta1, AutoMlClient, PredictionServiceClient};
import * as protos from '../protos/protos';
export {protos};
4 changes: 2 additions & 2 deletions packages/google-cloud-automl/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"client": {
"source": "googleapis",
"apiName": "automl",
"apiVersion": "v1beta1",
"apiVersion": "v1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -29,7 +29,7 @@
"client": {
"source": "googleapis",
"apiName": "automl",
"apiVersion": "v1",
"apiVersion": "v1beta1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand Down
9 changes: 5 additions & 4 deletions packages/google-cloud-automl/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@


gapic = gcp.GAPICMicrogenerator()
versions = ['v1beta1', 'v1']
versions = ['v1', 'v1beta1']
for version in versions:
library = gapic.typescript_library(
'automl', version,
generator_args={
"grpc-service-config": f"google/cloud/automl/{version}/automl_grpc_service_config.json",
"package-name": "@google-cloud/automl",
"main-service": "automl"
},
},
proto_path=f'/google/cloud/automl/{version}',
extra_proto_files=['google/cloud/common_resources.proto'],
)
s.copy(library, excludes=['src/index.ts', 'README.md', 'package.json'])
s.copy(library, excludes=['README.md', 'package.json'])

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 a29d47e

Please sign in to comment.