Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
fix: synth.py clean up for multiple version (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored Jun 1, 2020
1 parent db30953 commit c799604
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
// 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 DataCatalogClient = v1.DataCatalogClient;
const PolicyTagManagerClient = v1beta1.PolicyTagManagerClient;
const PolicyTagManagerSerializationClient =
v1beta1.PolicyTagManagerSerializationClient;

export {
v1,
v1beta1,
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-datacatalog.git",
"sha": "d1196ce9747dc34bc3cbac28c371e2e82feb8303"
"remote": "git@github.com:googleapis/nodejs-datacatalog.git",
"sha": "db30953897d8e8f28080014be8cee116242eb0ed"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "684dfea7decfeca7a7526ea96a8e9256694dd5d8",
"internalRef": "310415142"
"sha": "c4e37010d74071851ff24121f522e802231ac86e",
"internalRef": "313460921"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4"
"sha": "470789cee75ce93c41348ad6aa4c49363a80399b"
}
}
],
Expand Down
13 changes: 11 additions & 2 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,20 @@
},
extra_proto_files=['google/cloud/common_resources.proto'],
)
s.copy(library, excludes=['README.md', 'linkinator.config.json', '.mocharc.json', 'package.json', 'src/index.ts'])
s.copy(library, excludes=[
'README.md', 'linkinator.config.json', '.mocharc.json', '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='v1')
s.copy(templates, excludes=[])

# TODO: Remove the following replace once Datacatalog is ready to release a break change
# Users should use beta Client with explicitly specify the beta version
# Add beta version PolicyTagManagerClient, PolicyTagManagerSerializationClient to export
s.replace('src/index.ts',
'\nexport \{v1\, v1beta1\, DataCatalogClient\}\;\nexport default \{v1\, v1beta1\, DataCatalogClient\}\;',
'const PolicyTagManagerClient = v1beta1.PolicyTagManagerClient;\nconst PolicyTagManagerSerializationClient = v1beta1.PolicyTagManagerSerializationClient\n\nexport {v1, v1beta1, DataCatalogClient, PolicyTagManagerClient, PolicyTagManagerSerializationClient};\nexport default {v1, v1beta1, DataCatalogClient, PolicyTagManagerClient, PolicyTagManagerSerializationClient};')

node.postprocess_gapic_library()

0 comments on commit c799604

Please sign in to comment.