Skip to content

Commit cc2105a

Browse files
authored
Remove legacy gradle plugin code (#1718)
1 parent 86e06f3 commit cc2105a

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

gradle.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
smithyVersion=1.62.0
2-
smithyGradleVersion=1.3.0
3-
smithyPluginVersion=0.7.0
2+
smithyGradleVersion=1.3.0
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import software.amazon.smithy.gradle.tasks.SmithyBuild
1+
import software.amazon.smithy.gradle.tasks.SmithyBuildTask
22

33
val smithyVersion: String by project
44

@@ -15,23 +15,26 @@ buildscript {
1515
}
1616

1717
plugins {
18-
val smithyPluginVersion: String by project
19-
id("software.amazon.smithy").version(smithyPluginVersion)
18+
`java-library`
19+
20+
val smithyGradleVersion: String by project
21+
id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion)
2022
}
2123

2224
dependencies {
2325
implementation("software.amazon.smithy:smithy-protocol-tests:$smithyVersion")
2426
implementation(project(":smithy-typescript-codegen"))
2527
}
2628

27-
// This project doesn't produce a JAR.
28-
tasks["jar"].enabled = false
29-
30-
tasks["smithyBuildJar"].enabled = false
31-
32-
tasks.register<SmithyBuild>("buildSdk") {
33-
addRuntimeClasspath = true
29+
val buildSdk = tasks.register<SmithyBuildTask>("buildSdk") {
30+
models.set(files("model/"))
31+
smithyBuildConfigs.set(files("smithy-build.json"))
3432
}
3533

3634
// Run the `buildSdk` automatically.
37-
tasks["build"].finalizedBy(tasks["buildSdk"])
35+
tasks["build"].finalizedBy(buildSdk)
36+
37+
tasks.register<Sync>("copyOutput") {
38+
into(layout.buildDirectory.dir("model"))
39+
from(buildSdk.map { it.getPluginProjectionDirectory("source", "model") })
40+
}

smithy-typescript-protocol-test-codegen/model/my-local-model/main.smithy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use smithy.protocols#rpcv2Cbor
77
@rpcv2Cbor
88
@documentation("xyz interfaces")
99
service XYZService {
10-
version: "1.0",
11-
operations : [
10+
version: "1.0"
11+
operations: [
1212
GetNumbers
1313
]
1414
}
@@ -18,9 +18,9 @@ operation GetNumbers {
1818
input: GetNumbersRequest
1919
output: GetNumbersResponse
2020
errors: [
21-
CodedThrottlingError,
22-
MysteryThrottlingError,
23-
RetryableError,
21+
CodedThrottlingError
22+
MysteryThrottlingError
23+
RetryableError
2424
HaltError
2525
]
2626
}
@@ -47,8 +47,8 @@ structure CodedThrottlingError {}
4747
structure MysteryThrottlingError {}
4848

4949
@error("client")
50-
@retryable()
50+
@retryable
5151
structure RetryableError {}
5252

5353
@error("client")
54-
structure HaltError {}
54+
structure HaltError {}

0 commit comments

Comments
 (0)