mirror of https://github.com/smithy-lang/smithy-rs
[chore] Move AWS codegeneration into its own folder (#166)
This allows us to deliniate AWS runtime vs. Smithy runtime and will make a future separation easier
This commit is contained in:
parent
9b40b38dd9
commit
88ca4fedd8
|
@ -143,10 +143,10 @@ jobs:
|
|||
with:
|
||||
java-version: ${{ env.java_version }}
|
||||
- name: Generate the SDK
|
||||
run: ./gradlew :aws-sdk:assemble
|
||||
run: ./gradlew :aws:sdk:assemble
|
||||
# docs are not included in the artifact; this step validates that they can be generated
|
||||
- name: Generate docs
|
||||
run: ./gradlew :aws-sdk:cargoDocs
|
||||
run: ./gradlew :aws:sdk:cargoDocs
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "name=${GITHUB_REF##*/}-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
@ -157,5 +157,5 @@ jobs:
|
|||
with:
|
||||
name: aws-sdk-${{ env.name }}-${{ github.sha }}
|
||||
path: |
|
||||
aws-sdk/build/aws-sdk/
|
||||
!aws-sdk/build/aws-sdk/target
|
||||
aws/sdk/build/aws-sdk/
|
||||
!aws/sdk/build/aws-sdk/target
|
||||
|
|
|
@ -17,3 +17,8 @@ For development, pre-commit hooks may be useful. Setup:
|
|||
brew install pre-commit # (or appropriate for your platform: https://pre-commit.com/)
|
||||
pre-commit install
|
||||
```
|
||||
|
||||
### Project Layout
|
||||
* `aws`: AWS specific codegen & Rust code (signing, endpoints, customizations, etc.)
|
||||
* `codegen`: Whitelabel Smithy code generation
|
||||
* `codegen-test`: Smithy protocol test generation & integration tests for Smithy whitelabel code
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# 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.
|
||||
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`
|
||||
`./gradlew :aws:sdk:assemble`
|
||||
|
||||
Generate, compile, and test an SDK:
|
||||
`./gradlew :aws-sdk:build`
|
||||
`./gradlew :aws:sdk:build`
|
|
@ -31,7 +31,7 @@ buildscript {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":aws-sdk-codegen"))
|
||||
implementation(project(":aws:sdk-codegen"))
|
||||
implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
|
||||
implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
|
||||
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
|
||||
|
@ -96,7 +96,7 @@ task("relocateServices") {
|
|||
doLast {
|
||||
awsServices.forEach {
|
||||
copy {
|
||||
from("$buildDir/smithyprojections/aws-sdk/${it.module}/rust-codegen")
|
||||
from("$buildDir/smithyprojections/sdk/${it.module}/rust-codegen")
|
||||
into(sdkOutputDir.resolve(it.module))
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ tasks.register<Copy>("relocateRuntime") {
|
|||
include("$it/**")
|
||||
}
|
||||
exclude("**/target")
|
||||
exclude("**/Cargo.lock")
|
||||
}
|
||||
into(sdkOutputDir)
|
||||
}
|
||||
|
@ -139,7 +140,7 @@ tasks["assemble"].finalizedBy("finalizeSdk")
|
|||
|
||||
|
||||
tasks.register<Exec>("cargoCheck") {
|
||||
workingDir(buildDir.resolve("aws-sdk"))
|
||||
workingDir(sdkOutputDir)
|
||||
// disallow warnings
|
||||
environment("RUSTFLAGS", "-D warnings")
|
||||
commandLine("cargo", "check")
|
||||
|
@ -147,7 +148,7 @@ tasks.register<Exec>("cargoCheck") {
|
|||
}
|
||||
|
||||
tasks.register<Exec>("cargoTest") {
|
||||
workingDir(buildDir.resolve("aws-sdk"))
|
||||
workingDir(sdkOutputDir)
|
||||
// disallow warnings
|
||||
environment("RUSTFLAGS", "-D warnings")
|
||||
commandLine("cargo", "test")
|
||||
|
@ -155,7 +156,7 @@ tasks.register<Exec>("cargoTest") {
|
|||
}
|
||||
|
||||
tasks.register<Exec>("cargoDocs") {
|
||||
workingDir(buildDir.resolve("aws-sdk"))
|
||||
workingDir(sdkOutputDir)
|
||||
// disallow warnings
|
||||
environment("RUSTFLAGS", "-D warnings")
|
||||
commandLine("cargo", "doc", "--no-deps")
|
||||
|
@ -163,7 +164,7 @@ tasks.register<Exec>("cargoDocs") {
|
|||
}
|
||||
|
||||
tasks.register<Exec>("cargoClippy") {
|
||||
workingDir(buildDir.resolve("aws-sdk"))
|
||||
workingDir(sdkOutputDir)
|
||||
// disallow warnings
|
||||
environment("RUSTFLAGS", "-D warnings")
|
||||
commandLine("cargo", "clippy")
|
|
@ -20,5 +20,5 @@ enableFeaturePreview("GRADLE_METADATA")
|
|||
include(":codegen")
|
||||
include(":codegen-test")
|
||||
include(":rust-runtime")
|
||||
include(":aws-sdk-codegen")
|
||||
include(":aws-sdk")
|
||||
include(":aws:sdk-codegen")
|
||||
include(":aws:sdk")
|
||||
|
|
Loading…
Reference in New Issue