Skip to content

Commit

Permalink
RNGP: Read enableWarningsAsErrors property correctly (#46657)
Browse files Browse the repository at this point in the history
Summary:
I've noticed that some users are reporting build failures due to warnings inside RNGP.
We do have `allWarningsAsErrors` set to true for everyone (also for users).
That's too aggressive, and can cause build failures which are not necessary. Let's keep it enabled only on our CI (when the `enableWarningsAsErrors` property is set).

## Changelog:

[INTERNAL] - RNGP: Read `enableWarningsAsErrors` property correctly

Pull Request resolved: #46657

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D63459601

Pulled By: cortinico

fbshipit-source-id: 0307e8d6771518038a5abe27ca5a993cb0a9f8c0
  • Loading branch information
cortinico authored and blakef committed Sep 30, 2024
1 parent 97913a8 commit 1e611fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ tasks.withType<KotlinCompile>().configureEach {
apiVersion = "1.6"
// See comment above on JDK 11 support
jvmTarget = "11"
allWarningsAsErrors = true
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ tasks.withType<KotlinCompile>().configureEach {
apiVersion = "1.6"
// See comment above on JDK 11 support
jvmTarget = "11"
allWarningsAsErrors = true
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
jvmTarget = "11"
allWarningsAsErrors = true
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-gradle-plugin/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
jvmTarget = "11"
allWarningsAsErrors = true
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
}

Expand Down

0 comments on commit 1e611fd

Please sign in to comment.