smithy-lang / smithy-dafny

Apache License 2.0
7 stars 8 forks source link

feat: Optionally generate (mostly) complete projects #390

Closed robin-aws closed 3 weeks ago

robin-aws commented 1 month ago

Description of changes:

Adds a new --generate option that accepts a "generation aspect" argument, and can be specified multiple times. The available aspects are:

These options make it much quicker to create new libraries, especially new TestModels. The last option is intended to be used once to get started on files that do have to be manually edited, but the other two can be left on more permanently.

I set up a templated file mechanism for all these kinds of assets, since they are mostly static content with just a few pieces that depend on the service name/sdkID and other parameters. It uses the shared AbstractCodeWriter templating mechanism from the core Smithy implementation.

Also used this to generate the missing files to make Timestamp work for .NET (it doesn't work yet for Java because of some apparent confusion over Date vs. Instant)

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