smithy-rs/aws/sdk
Russell Cohen a0b60ed5e0
Add clippy.toml with forbidden methods & fix SystemTime usages (#2882)
## Motivation and Context
- #2087 

## Description
- remove lingering usages of SystemTime::now()
- ensure they don't return by adding a clippy.toml

## Testing
- CI
- Ran the webassembly example

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

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

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-07-28 17:16:44 +00:00
..
aws-models Update SDK models for release (#2790) 2023-06-23 02:35:47 +00:00
benchmarks Merge `sra-test` into the SDK integration tests and fix its tests (#2883) 2023-07-28 17:09:18 +00:00
integration-tests Merge `sra-test` into the SDK integration tests and fix its tests (#2883) 2023-07-28 17:09:18 +00:00
.gitignore [chore] Move AWS codegeneration into its own folder (#166) 2021-01-19 15:23:07 -05:00
README.md Test the orchestrator against the SDK in CI (#2715) 2023-05-19 17:28:37 +00:00
build.gradle.kts Add clippy.toml with forbidden methods & fix SystemTime usages (#2882) 2023-07-28 17:16:44 +00:00
gradle.properties Add support for TimeStreamWrite and TimeStreamQuery (#2707) 2023-05-31 18:08:51 +00:00
sdk-external-types.toml Change the default runtime mode to orchestrator (#2847) 2023-07-20 15:49:53 +00:00
sync-models.py Fix `SPDX-License-Identifier` in header comments (#1377) 2022-05-09 09:50:46 -05:00
test-services.py Fix `SPDX-License-Identifier` in header comments (#1377) 2022-05-09 09:50:46 -05:00

README.md

AWS SDK Generator

This directory contains a gradle project to generate an AWS SDK. It uses the Smithy Build Plugin combined with the customizations specified in aws/sdk-codegen to generate an AWS SDK from Smithy models.

build.gradle.kts will generate a smithy-build.json dynamically from all models in the models directory.

Usage

Generate an SDK: ./gradlew :aws:sdk:assemble

Generate, compile, and test an SDK: ./gradlew :aws:sdk:check

Run an SDK example: ./gradlew :aws:sdk:runExample --example dynamo-helloworld

Controlling service generation

You can use gradle properties to opt/out of generating specific services:

# Generate only s3,ec2,sts
./gradlew -Paws.services=+s3,+ec2,+sts :aws:sdk:assemble

# Generate all AWS services using models from the aws-sdk-rust repo
./gradlew \
  -Paws.sdk.models.path=../aws-sdk-rust/aws-models \
  :aws:sdk:assemble

# Generate only S3 from using the model from the aws-sdk-rust repo
./gradlew \
  -Paws.sdk.models.path=../aws-sdk-rust/aws-models \
  -Paws.services=+s3 \
  :aws:sdk:assemble

The generation logic is as follows:

  1. If aws.sdk.models.path is specified, take models from that path. Otherwise take them from the local aws-models directory.
  2. Reference the aws.services property to determine which models to include/exclude, based on the service module names.

Debugging with IntelliJ

The easiest way to debug codegen is to attach a remote debugger to the Gradle daemon and then run aws:sdk:assemble. To do this:

  1. Temporarily modify the root gradle.properties file to have the following:
org.gradle.jvmargs=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:5006
  1. Run ./gradlew --stop to kill any Gradle daemons that are running without that property.
  2. Configure IntelliJ to remote debug on port 5006 (or whichever port was configured above).
  3. Run ./gradlew aws:sdk:assemble (with any additional properties to limit the services generated)
  4. It will hang on "Starting Daemon". This is because the Gradle daemon is waiting for a remote debugger to start up. Attaching IntelliJ's debugger will make the build proceed, but now you can stop execution on breakpoints and examine values.