Skip to content

Commit

Permalink
fix: synth.py clean up for multiple version (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed May 6, 2020
1 parent ae266b6 commit 54aa223
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
15 changes: 7 additions & 8 deletions packages/google-cloud-oslogin/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 v1beta from './v1beta';
import * as v1 from './v1';
import * as v1beta from './v1beta';

const OsLoginServiceClient = v1.OsLoginServiceClient;
export {v1beta, v1, OsLoginServiceClient};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {v1beta, v1, OsLoginServiceClient};

export {v1, v1beta, OsLoginServiceClient};
export default {v1, v1beta, OsLoginServiceClient};
import * as protos from '../protos/protos';
export {protos};
16 changes: 12 additions & 4 deletions packages/google-cloud-oslogin/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-os-login.git",
"sha": "59a874f2ad586f54b994e0ee8ed3c7920eb15126"
"sha": "579f1e48ef2a3f0fd1460b07592d5dc499cf8043"
}
},
{
"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 All @@ -20,7 +28,7 @@
"client": {
"source": "googleapis",
"apiName": "os-login",
"apiVersion": "v1beta",
"apiVersion": "v1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -29,7 +37,7 @@
"client": {
"source": "googleapis",
"apiName": "os-login",
"apiVersion": "v1",
"apiVersion": "v1beta",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand Down
9 changes: 5 additions & 4 deletions packages/google-cloud-oslogin/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,28 @@


gapic = gcp.GAPICMicrogenerator()
versions = ['v1beta', 'v1']
versions = ['v1', 'v1beta']
for version in versions:
library = gapic.typescript_library(
'os-login',
generator_args={
"grpc-service-config": f"google/cloud/oslogin/{version}/oslogin_grpc_service_config.json",
"package-name": f"@google-cloud/os-login"
},
},
proto_path=f'/google/cloud/oslogin/{version}',
extra_proto_files=['google/cloud/oslogin/common/common.proto'],
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'],
)

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

node.postprocess_gapic_library()

0 comments on commit 54aa223

Please sign in to comment.