Skip to content

Commit ed2195b

Browse files
authored
fix: correct codegen tests' build config to correctly pull in smithy-cli (#794)
1 parent 6476063 commit ed2195b

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

tests/codegen/paginator-tests/build.gradle.kts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,13 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import software.amazon.smithy.gradle.tasks.SmithyBuild
6+
import software.amazon.smithy.gradle.tasks.Validate as SmithyValidate
67

78
plugins {
89
kotlin("jvm")
910
id("software.amazon.smithy")
1011
}
1112

12-
buildscript {
13-
dependencies {
14-
val smithyVersion: String by project
15-
val smithyCliConfig = configurations.maybeCreate("smithyCli")
16-
17-
classpath("software.amazon.smithy:smithy-cli:$smithyVersion")
18-
smithyCliConfig("software.amazon.smithy:smithy-cli:$smithyVersion")
19-
}
20-
}
21-
2213
extra.set("skipPublish", true)
2314

2415
val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
@@ -33,16 +24,22 @@ kotlin.sourceSets.getByName("main") {
3324

3425
tasks["smithyBuildJar"].enabled = false
3526

27+
val smithyVersion: String by project
3628
val codegen by configurations.creating
3729
dependencies {
3830
codegen(project(":codegen:smithy-kotlin-codegen"))
31+
codegen("software.amazon.smithy:smithy-cli:$smithyVersion")
3932
}
4033

4134
val generateSdk = tasks.register<SmithyBuild>("generateSdk") {
4235
group = "codegen"
43-
classpath = configurations.getByName("codegen")
36+
classpath = codegen
4437
inputs.file(projectDir.resolve("smithy-build.json"))
45-
inputs.files(configurations.getByName("codegen"))
38+
inputs.files(codegen)
39+
}
40+
41+
tasks.named<SmithyValidate>("smithyValidate") {
42+
classpath = codegen
4643
}
4744

4845
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>{

tests/codegen/waiter-tests/build.gradle.kts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,13 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import software.amazon.smithy.gradle.tasks.SmithyBuild
6+
import software.amazon.smithy.gradle.tasks.Validate as SmithyValidate
67

78
plugins {
89
kotlin("jvm")
910
id("software.amazon.smithy")
1011
}
1112

12-
buildscript {
13-
dependencies {
14-
val smithyVersion: String by project
15-
val smithyCliConfig = configurations.maybeCreate("smithyCli")
16-
17-
classpath("software.amazon.smithy:smithy-cli:$smithyVersion")
18-
smithyCliConfig("software.amazon.smithy:smithy-cli:$smithyVersion")
19-
}
20-
}
21-
2213
extra.set("skipPublish", true)
2314

2415
val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
@@ -32,16 +23,22 @@ kotlin.sourceSets.getByName("main") {
3223

3324
tasks["smithyBuildJar"].enabled = false
3425

26+
val smithyVersion: String by project
3527
val codegen by configurations.creating
3628
dependencies {
3729
codegen(project(":codegen:smithy-kotlin-codegen"))
30+
codegen("software.amazon.smithy:smithy-cli:$smithyVersion")
3831
}
3932

4033
val generateSdk = tasks.register<SmithyBuild>("generateSdk") {
4134
group = "codegen"
42-
classpath = configurations.getByName("codegen")
35+
classpath = codegen
4336
inputs.file(projectDir.resolve("smithy-build.json"))
44-
inputs.files(configurations.getByName("codegen"))
37+
inputs.files(codegen)
38+
}
39+
40+
tasks.named<SmithyValidate>("smithyValidate") {
41+
classpath = codegen
4542
}
4643

4744
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>{

0 commit comments

Comments
 (0)