Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions codegen/generic-client-test-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

import software.amazon.smithy.gradle.tasks.SmithyBuild
import software.amazon.smithy.gradle.tasks.SmithyBuildTask

val smithyVersion: String by project

Expand All @@ -30,8 +30,10 @@ buildscript {
}

plugins {
val smithyPluginVersion: String by project
id("software.amazon.smithy").version(smithyPluginVersion)
`java-library`

val smithyGradleVersion: String by project
id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion)
}

dependencies {
Expand All @@ -45,11 +47,12 @@ tasks["jar"].enabled = false

// Run the SmithyBuild task manually since this project needs the built JAR
// from smithy-aws-typescript-codegen.
tasks["smithyBuildJar"].enabled = false
tasks["smithyBuild"].enabled = false

tasks.register<SmithyBuild>("buildSdk") {
addRuntimeClasspath = true
val buildSdk = tasks.register<SmithyBuildTask>("buildSdk") {
models.set(files("model/"))
smithyBuildConfigs.set(files("smithy-build.json"))
}

// Run the `buildSdk` automatically.
tasks["build"].finalizedBy(tasks["buildSdk"])
tasks["build"].finalizedBy(buildSdk)
35 changes: 21 additions & 14 deletions codegen/generic-client-test-codegen/model/echo.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,53 @@ use aws.protocols#restJson1

@restJson1
service EchoService {
version: "2018-05-10",
operations: [Echo, Length],
version: "2018-05-10"
operations: [
Echo
Length
]
}

@http(code: 200, method: "POST", uri: "/echo",)
@http(code: 200, method: "POST", uri: "/echo")
operation Echo {
input: EchoInput,
output: EchoOutput,
errors: [PalindromeException],
input: EchoInput
output: EchoOutput
errors: [
PalindromeException
]
}

@readonly
@http(code: 200, method: "GET", uri: "/length/{string}")
operation Length {
input: LengthInput,
output: LengthOutput,
errors: [PalindromeException],
input: LengthInput
output: LengthOutput
errors: [
PalindromeException
]
}

structure EchoInput {
string: String,
string: String
}

structure EchoOutput {
string: String,
string: String
}

structure LengthInput {
@required
@httpLabel
string: String,
string: String
}

structure LengthOutput {
length: Integer,
length: Integer
}

/// For some reason, this service does not like palindromes!
@httpError(400)
@error("client")
structure PalindromeException {
message: String,
message: String
}
6 changes: 3 additions & 3 deletions codegen/generic-client-test-codegen/model/weather.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ operation OnlyCustomAuthOptional {}
@readonly
@http(method: "GET", uri: "/SameAsService")
operation SameAsService {
output := {
service: String
}
output := {
service: String
}
}
1 change: 0 additions & 1 deletion codegen/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
smithyVersion=1.62.0
smithyGradleVersion=1.3.0
smithyPluginVersion=0.7.0
org.gradle.jvmargs=-Xmx4096M
17 changes: 10 additions & 7 deletions codegen/protocol-test-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* permissions and limitations under the License.
*/

import software.amazon.smithy.gradle.tasks.SmithyBuild
import software.amazon.smithy.gradle.tasks.SmithyBuildTask

val smithyVersion: String by project

Expand All @@ -30,8 +30,10 @@ buildscript {
}

plugins {
val smithyPluginVersion: String by project
id("software.amazon.smithy").version(smithyPluginVersion)
`java-library`

val smithyGradleVersion: String by project
id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion)
}

dependencies {
Expand All @@ -45,11 +47,12 @@ tasks["jar"].enabled = false

// Run the SmithyBuild task manually since this project needs the built JAR
// from smithy-aws-typescript-codegen.
tasks["smithyBuildJar"].enabled = false
tasks["smithyBuild"].enabled = false

tasks.register<SmithyBuild>("buildSdk") {
addRuntimeClasspath = true
val buildSdk = tasks.register<SmithyBuildTask>("buildSdk") {
models.set(files("model/"))
smithyBuildConfigs.set(files("smithy-build.json"))
}

// Run the `buildSdk` automatically.
tasks["build"].finalizedBy(tasks["buildSdk"])
tasks["build"].finalizedBy(buildSdk)
28 changes: 14 additions & 14 deletions codegen/sdk-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import software.amazon.smithy.model.Model
import software.amazon.smithy.model.shapes.ServiceShape
import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.model.node.Node
import software.amazon.smithy.gradle.tasks.SmithyBuild
import software.amazon.smithy.gradle.tasks.SmithyBuildTask
import software.amazon.smithy.aws.traits.ServiceTrait
import java.util.stream.Stream
import kotlin.streams.toList
Expand All @@ -38,8 +38,10 @@ buildscript {
}

plugins {
val smithyPluginVersion: String by project
id("software.amazon.smithy").version(smithyPluginVersion)
`java-library`

val smithyGradleVersion: String by project
id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion)
}

dependencies {
Expand All @@ -54,24 +56,22 @@ tasks["jar"].enabled = false

// Run the SmithyBuild task manually since this project needs the built JAR
// from smithy-aws-typescript-codegen.
tasks["smithyBuildJar"].enabled = false

tasks.register<SmithyBuild>("buildSdk") {
addRuntimeClasspath = true
}
tasks["smithyBuild"].enabled = false

configure<software.amazon.smithy.gradle.SmithyExtension> {
val buildSdk = tasks.register<SmithyBuildTask>("buildSdk") {
val clientNameProp: String? by project
if (!(clientNameProp?.isEmpty() ?: true)) {
smithyBuildConfigs = files("smithy-build-" + clientNameProp + ".json")
outputDirectory = file("build-single/" + clientNameProp)
smithyBuildConfigs.set(files("smithy-build-" + clientNameProp + ".json"))
outputDir.set(file("build-single/" + clientNameProp))
} else {
smithyBuildConfigs.set(files("smithy-build.json"))
}
}

// Generates a smithy-build.json file by creating a new projection for every
// JSON file found in aws-models/. The generated smithy-build.json file is
// not committed to git since it's rebuilt each time codegen is performed.
tasks.register("generate-smithy-build") {
val generateSmithyBuild = tasks.register("generate-smithy-build") {
doLast {
val projectionsBuilder = Node.objectNodeBuilder()
val modelsDirProp: String by project
Expand Down Expand Up @@ -150,5 +150,5 @@ tasks.register("generate-default-configs-provider", JavaExec::class) {

// Run the `buildSdk` automatically.
tasks["build"]
.dependsOn(tasks["generate-smithy-build"])
.finalizedBy(tasks["buildSdk"])
.dependsOn(generateSmithyBuild)
.finalizedBy(buildSdk)
2 changes: 1 addition & 1 deletion scripts/generate-clients/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Update this commit when taking up new changes from smithy-typescript.
module.exports = {
// Use full commit hash as we explicitly fetch it.
SMITHY_TS_COMMIT: "86e06f3df937bb1d1b642d6076ca531542698c2b",
SMITHY_TS_COMMIT: "cc2105a5dd5dfe01ace384034e863770080e6b08",
};

if (module.exports.SMITHY_TS_COMMIT.length < 40) {
Expand Down
Loading