Skip to content

Commit ae0a41c

Browse files
authored
misc: enable allWarningsAsErrors (#1395)
1 parent 5ba0d30 commit ae0a41c

File tree

7 files changed

+7
-10
lines changed

7 files changed

+7
-10
lines changed

build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import aws.sdk.kotlin.gradle.dsl.configureJReleaser
66
import aws.sdk.kotlin.gradle.dsl.configureLinting
77
import aws.sdk.kotlin.gradle.util.typedProp
8+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
89

910
buildscript {
1011
// NOTE: buildscript classpath for the root project is the parent classloader for the subprojects, we
@@ -46,9 +47,9 @@ val testJavaVersion = typedProp<String>("test.java.version")?.let {
4647
}
4748

4849
allprojects {
49-
if (rootProject.typedProp<Boolean>("kotlinWarningsAsErrors") == true) {
50-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
51-
compilerOptions.allWarningsAsErrors = true
50+
tasks.withType<KotlinCompile> {
51+
compilerOptions {
52+
allWarningsAsErrors = true
5253
}
5354
}
5455

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/waiters/KotlinJmespathExpressionVisitor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class KotlinJmespathExpressionVisitor(
164164

165165
val codegen = buildString {
166166
val nullables = buildList {
167+
// FIXME In some cases we are unnecessarily handling nulls here, leading to compiler warnings. SDK-KT-786
167168
if (left.shape?.isNullable == true || left.nullable) add("${left.identifier} == null")
168169
if (right.shape?.isNullable == true || right.nullable) add("${right.identifier} == null")
169170
}

dokka-smithy/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
3535
compilerOptions {
3636
jvmTarget.set(JvmTarget.JVM_1_8)
3737
freeCompilerArgs.add("-Xjdk-release=1.8")
38-
allWarningsAsErrors.set(false) // FIXME Dokka bundles stdlib into the classpath, causing an unfixable warning
3938
}
4039
}
4140

runtime/runtime-core/jvm/test/aws/smithy/kotlin/runtime/io/SdkByteChannelStressTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class SdkByteChannelStressTest {
9595
}
9696

9797
@Test
98-
fun testReadAllFromFailedChannel() = runBlocking {
98+
fun testReadAllFromFailedChannel(): Unit = runBlocking {
9999
val ch = SdkByteChannel(true)
100100
ch.cancel(TestException())
101101
assertFailsWith<TestException> {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ kotlin.sourceSets.getByName("main") {
4545

4646
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
4747
dependsOn(tasks.generateSmithyProjections)
48-
// FIXME - generated code has warnings unfortunately, see https://github.com/awslabs/aws-sdk-kotlin/issues/1169
49-
compilerOptions.allWarningsAsErrors = false
5048
}
5149

5250
tasks.test {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ kotlin.sourceSets.getByName("main") {
9696

9797
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
9898
dependsOn(stageGeneratedSources)
99-
// generated code has warnings unfortunately, see https://github.com/awslabs/aws-sdk-kotlin/issues/1169
100-
compilerOptions.allWarningsAsErrors = false
10199
}
102100

103101
tasks.clean.configure {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ kotlin.sourceSets.getByName("main") {
3838

3939
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
4040
dependsOn(tasks.generateSmithyProjections)
41+
// FIXME Re-enable warnings as errors SDK-KT-785
4142
compilerOptions {
42-
// generated code has warnings unfortunately
4343
allWarningsAsErrors = false
4444
}
4545
}

0 commit comments

Comments
 (0)