mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Allow configuration of 'allWarningsAsErrors' in gradle (#38930)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38930 As we migrate java to kotlin I noticed that we've introduced few warnings here and there. I'm introducing a way to configure allWarningsAsErrors in gradle changelog: [internal] internal Reviewed By: NickGerleman Differential Revision: D48238321 fbshipit-source-id: 745847bc6e6df94decc54afa8c9041552d91dfee
This commit is contained in:
committed by
Facebook GitHub Bot
parent
450e00e5ce
commit
75c1422286
@@ -441,6 +441,11 @@ def reactNativeArchitectures() {
|
||||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
||||
}
|
||||
|
||||
def enableWarningsAsErrors() {
|
||||
def value = project.getProperties().get("enableWarningsAsErrors")
|
||||
return value != null ? value : false
|
||||
}
|
||||
|
||||
task packageReactNdkLibsForBuck(type: Copy) {
|
||||
dependsOn("mergeDebugNativeLibs")
|
||||
// Shared libraries (.so) are copied from the merged_native_libs folder instead
|
||||
@@ -484,6 +489,8 @@ android {
|
||||
kotlinOptions {
|
||||
// Using '-Xjvm-default=all' to generate default java methods for interfaces
|
||||
freeCompilerArgs = ['-Xjvm-default=all']
|
||||
// Using -PenableWarningsAsErrors=true prop to enable allWarningsAsErrors
|
||||
kotlinOptions.allWarningsAsErrors = enableWarningsAsErrors()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
||||
Reference in New Issue
Block a user