Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add yarn codegen script calling Gradle script #545

Merged
merged 3 commits into from
Dec 11, 2019

Conversation

AllanZhengYP
Copy link
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

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

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
"bootstrap": "yarn",
"clean": "yarn clear-build-cache && yarn clear-build-info && lerna clean",
"clear-build-cache": "rimraf ./packages/*/build/* ./clients/*/*/build/*",
"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",
"build:smithy-client": "lerna run --scope '@aws-sdk/client-rds-data' --include-filtered-dependencies pretest",
Copy link
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
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
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
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
"bootstrap": "yarn",
"clean": "yarn clear-build-cache && yarn clear-build-info && lerna clean",
"clear-build-cache": "rimraf ./packages/*/build/* ./clients/*/*/build/*",
"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
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
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

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

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