Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ tasks.register<JavaExec>("ktlint") {
description = "Check Kotlin code style."
group = "Verification"
classpath = configurations.getByName("ktlint")
main = "com.pinterest.ktlint.Main"
mainClass.set("com.pinterest.ktlint.Main")
args = lintPaths
}

tasks.register<JavaExec>("ktlintFormat") {
description = "Auto fix Kotlin code style violations"
group = "formatting"
classpath = configurations.getByName("ktlint")
main = "com.pinterest.ktlint.Main"
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("-F") + lintPaths
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kotlin.code.style=official

# codegen
smithyVersion=1.69.0
smithyGradleVersion=0.6.0
smithyGradleVersion=1.4.0

# kotlin
kotlinVersion=1.9.24
Expand Down
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pluginManagement {
id("org.jetbrains.dokka") version dokkaVersion
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlinx.benchmark") version kotlinxBenchmarkVersion
id("software.amazon.smithy") version smithyGradleVersion
id("software.amazon.smithy.gradle.smithy-base") version smithyGradleVersion
}
}

Expand All @@ -29,4 +29,3 @@ rootProject.name = "smithy-swift"
include("test-sdks")
include("serde-benchmark")
include("smithy-swift-codegen")
include("smithy-swift-codegen-test")
14 changes: 8 additions & 6 deletions smithy-swift-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
implementation("software.amazon.smithy:smithy-protocol-traits:$smithyVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
implementation("software.amazon.smithy:smithy-rules-engine:$smithyVersion")
}
Expand Down Expand Up @@ -72,10 +73,10 @@ val licenseSpec = copySpec {
from("${project.rootDir}/NOTICE")
}

val sourcesJar by tasks.creating(Jar::class) {
val sourcesJar by tasks.registering(Jar::class) {
group = "publishing"
description = "Assembles Kotlin sources jar"
classifier = "sources"
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}

Expand All @@ -91,9 +92,10 @@ tasks.jar {
// Configure jacoco (code coverage) to generate an HTML report
tasks.jacocoTestReport {
reports {
xml.isEnabled = false
csv.isEnabled = false
html.destination = file("$buildDir/reports/jacoco")
xml.required.set(false)
csv.required.set(false)
html.required.set(true)
html.outputLocation.set(layout.buildDirectory.dir("reports/jacoco"))
}
}

Expand All @@ -109,7 +111,7 @@ publishing {
}
repositories {
maven {
url = uri("$buildDir/repository")
url = uri(layout.buildDirectory.dir("repository"))
}
}
}
27 changes: 8 additions & 19 deletions test-sdks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,13 @@
* SPDX-License-Identifier: Apache-2.0.
*/

import software.amazon.smithy.gradle.tasks.SmithyBuild
import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.model.node.Node

plugins {
id("software.amazon.smithy").version("0.5.3")
java
id("software.amazon.smithy.gradle.smithy-base")
}

val smithyVersion: String by project

buildscript {
val smithyVersion: String by project
dependencies {
classpath("software.amazon.smithy:smithy-cli:$smithyVersion")
}
}

dependencies {
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
implementation(project(":smithy-swift-codegen"))
Expand Down Expand Up @@ -128,20 +118,19 @@ fun generateSmithyBuild(): String {
"""
}

tasks.create<SmithyBuild>("buildSdk") {
addRuntimeClasspath = true
}

task("generateSmithyBuild") {
tasks.register("generateSmithyBuild") {
description = "generate smithy-build.json"
doFirst {
projectDir.resolve("smithy-build.json").writeText(generateSmithyBuild())
}
}

tasks.named("smithyBuild") {
dependsOn("generateSmithyBuild")
}

tasks["jar"].enabled = false
tasks["smithyBuildJar"].dependsOn("generateSmithyBuild")

tasks["clean"].doFirst {
delete("smithy-build.json")
}

6 changes: 4 additions & 2 deletions test-sdks/model/awsjson.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use aws.protocols#awsJson1_0

@awsJson1_0
service AWSJSONService {
version: "2022-11-30",
operations: [JSONName]
version: "2022-11-30"
operations: [
JSONName
]
}

operation JSONName {
Expand Down
6 changes: 3 additions & 3 deletions test-sdks/model/rpcv2cbor.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use smithy.protocols#rpcv2Cbor

@rpcv2Cbor
service RPCv2CBORService {
version: "2022-11-30",
version: "2022-11-30"
operations: [
GetWidget,
Recursive,
GetWidget
Recursive
]
}

Expand Down
44 changes: 17 additions & 27 deletions test-sdks/model/waiters.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ $version: "2.0"

namespace aws.protocoltests.waiters

use smithy.waiters#waitable
use aws.protocols#restJson1
use aws.api#service
use aws.protocols#restJson1
use smithy.waiters#waitable

// A service which has a GET operation with waiters defined upon it.
// The acceptor in each waiter serves as subject for unit testing,
Expand All @@ -13,8 +13,10 @@ use aws.api#service
@service(sdkId: "Waiters")
@restJson1
service Waiters {
version: "2022-11-30",
operations: [GetWidget]
version: "2022-11-30"
operations: [
GetWidget
]
}

@http(uri: "/widget", method: "POST")
Expand All @@ -24,9 +26,7 @@ service Waiters {
acceptors: [
{
state: "success"
matcher: {
success: true
}
matcher: { success: true }
}
]
}
Expand All @@ -35,9 +35,7 @@ service Waiters {
acceptors: [
{
state: "success"
matcher: {
success: false
}
matcher: { success: false }
}
]
}
Expand All @@ -46,9 +44,7 @@ service Waiters {
acceptors: [
{
state: "success"
matcher: {
errorType: "MyError"
}
matcher: { errorType: "MyError" }
}
]
}
Expand Down Expand Up @@ -103,11 +99,7 @@ service Waiters {
{
state: "success"
matcher: {
output: {
path: "booleanProperty"
expected: "false"
comparator: "booleanEquals"
}
output: { path: "booleanProperty", expected: "false", comparator: "booleanEquals" }
}
}
]
Expand Down Expand Up @@ -193,11 +185,7 @@ service Waiters {
{
state: "success"
matcher: {
output: {
path: "dataMap.*"
expected: "abc"
comparator: "allStringEquals"
}
output: { path: "dataMap.*", expected: "abc", comparator: "allStringEquals" }
}
}
]
Expand Down Expand Up @@ -249,9 +237,11 @@ service Waiters {
}
)
operation GetWidget {
input: WidgetInput,
input: WidgetInput
output: WidgetOutput
errors: [MyError]
errors: [
MyError
]
}

structure WidgetInput {
Expand All @@ -276,11 +266,11 @@ structure Grandchild {
number: Integer
}

list StringArray{
list StringArray {
member: String
}

list BooleanArray{
list BooleanArray {
member: Boolean
}

Expand Down
Loading