Skip to content

chore: add yarn codegen script calling Gradle script#545

Merged
AllanZhengYP merged 3 commits intoaws:smithy-codegenfrom
AllanZhengYP:client-generator
Dec 11, 2019
Merged

chore: add yarn codegen script calling Gradle script#545
AllanZhengYP merged 3 commits intoaws:smithy-codegenfrom
AllanZhengYP:client-generator

Conversation

@AllanZhengYP
Copy link
Copy Markdown
Contributor

@AllanZhengYP AllanZhengYP commented Dec 10, 2019

Now you can generate smithy-sourced clients from Smithy models by running

yarn run generate-clients -m /path/to/smithy/models

This scripts will:

  1. copy models to codegen input directory
  2. call gradle script ./gradlew :sdk-codegen:clean", ":sdk-codegen:build
  3. copy each generated client's subfolders to repos client folder(not override the whole client folder under clients)
  4. clean the codegen input and output directory

Prerequisites: You need to publish smithy-typescript packages to local maven before running this: https://github.com/awslabs/smithy-typescript

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AllanZhengYP AllanZhengYP requested a review from srchase December 10, 2019 19:12
@aws-sdk-js-automation
Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-sdk-js-automation
Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

package.json Outdated
"copy-models": "node ./scripts/copyModels.js",
"update-clients": "node ./packages/package-generator/build/cli.js import-all --matching './models/*/*/service-2.json'",
"build:crypto-dependencies": "lerna run --scope '@aws-sdk/types' --scope '@aws-sdk/util-utf8-browser' --scope '@aws-sdk/util-locate-window' --scope '@aws-sdk/hash-node' --include-filtered-dependencies pretest",
"build:smithy-client": "lerna run --scope '@aws-sdk/client-rds-data' --include-filtered-dependencies pretest",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can build:smithy-client get dropped now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still needed if we want to test the build of our only client -- client-rds-data

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We may want to cut-over to using the new script so it gets exercised. Codegen for a single model should be pretty quick.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build:smithy-client is for compiling the client and its dependencies from TS to JS. It basically has nothing todo with the codegen script

package.json Outdated
"clear-build-info": "rimraf ./packages/*/*.tsbuildinfo ./clients/*/*/*.tsbuildinfo",
"copy-models": "node ./scripts/copyModels.js",
"update-clients": "node ./packages/package-generator/build/cli.js import-all --matching './models/*/*/service-2.json'",
"build:crypto-dependencies": "lerna run --scope '@aws-sdk/types' --scope '@aws-sdk/util-utf8-browser' --scope '@aws-sdk/util-locate-window' --scope '@aws-sdk/hash-node' --include-filtered-dependencies pretest",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lerna complains about --include-filtered-dependencies being deprecated. This could change this to --include-dependencies if we want to bump lerna.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

use use '--include-dependencies' in replace of '--include-filtered-dependencies'
@srchase srchase added the smithy-codegen Changes regarding supporting smithy model. Will be merged to smithy-codegen branch label Dec 11, 2019
@aws-sdk-js-automation
Copy link
Copy Markdown

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@AllanZhengYP AllanZhengYP merged commit 2066ae1 into aws:smithy-codegen Dec 11, 2019
@lock
Copy link
Copy Markdown

lock bot commented Dec 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

smithy-codegen Changes regarding supporting smithy model. Will be merged to smithy-codegen branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants