@@ -17,7 +17,7 @@ import software.amazon.smithy.model.Model
1717import software.amazon.smithy.model.shapes.ServiceShape
1818import software.amazon.smithy.model.shapes.ShapeId
1919import software.amazon.smithy.model.node.Node
20- import software.amazon.smithy.gradle.tasks.SmithyBuild
20+ import software.amazon.smithy.gradle.tasks.SmithyBuildTask
2121import software.amazon.smithy.aws.traits.ServiceTrait
2222import java.util.stream.Stream
2323import kotlin.streams.toList
@@ -38,8 +38,10 @@ buildscript {
3838}
3939
4040plugins {
41- val smithyPluginVersion: String by project
42- id(" software.amazon.smithy" ).version(smithyPluginVersion)
41+ `java- library`
42+
43+ val smithyGradleVersion: String by project
44+ id(" software.amazon.smithy.gradle.smithy-base" ).version(smithyGradleVersion)
4345}
4446
4547dependencies {
@@ -54,24 +56,22 @@ tasks["jar"].enabled = false
5456
5557// Run the SmithyBuild task manually since this project needs the built JAR
5658// from smithy-aws-typescript-codegen.
57- tasks[" smithyBuildJar" ].enabled = false
58-
59- tasks.register<SmithyBuild >(" buildSdk" ) {
60- addRuntimeClasspath = true
61- }
59+ tasks[" smithyBuild" ].enabled = false
6260
63- configure < software.amazon.smithy.gradle. SmithyExtension > {
61+ val buildSdk = tasks.register< SmithyBuildTask >( " buildSdk " ) {
6462 val clientNameProp: String? by project
6563 if (! (clientNameProp?.isEmpty() ? : true )) {
66- smithyBuildConfigs = files(" smithy-build-" + clientNameProp + " .json" )
67- outputDirectory = file(" build-single/" + clientNameProp)
64+ smithyBuildConfigs.set(files(" smithy-build-" + clientNameProp + " .json" ))
65+ outputDir.set(file(" build-single/" + clientNameProp))
66+ } else {
67+ smithyBuildConfigs.set(files(" smithy-build.json" ))
6868 }
6969}
7070
7171// Generates a smithy-build.json file by creating a new projection for every
7272// JSON file found in aws-models/. The generated smithy-build.json file is
7373// not committed to git since it's rebuilt each time codegen is performed.
74- tasks.register(" generate-smithy-build" ) {
74+ val generateSmithyBuild = tasks.register(" generate-smithy-build" ) {
7575 doLast {
7676 val projectionsBuilder = Node .objectNodeBuilder()
7777 val modelsDirProp: String by project
@@ -150,5 +150,5 @@ tasks.register("generate-default-configs-provider", JavaExec::class) {
150150
151151// Run the `buildSdk` automatically.
152152tasks[" build" ]
153- .dependsOn(tasks[ " generate-smithy-build " ] )
154- .finalizedBy(tasks[ " buildSdk" ] )
153+ .dependsOn(generateSmithyBuild )
154+ .finalizedBy(buildSdk)
0 commit comments