File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,17 @@ if(!found) {
5454
5555def nodeModulesPath = nodeModulesDir. toString(). replace(" \\ " , " /" )
5656def reactNativePath = reactNativeDir. toString(). replace(" \\ " , " /" )
57-
57+ def buildType () {
58+ def buildType = " debug"
59+
60+ tasks. all({ task ->
61+ if (task. name == " buildCMakeRelease" ) {
62+ buildType = " release"
63+ }
64+ })
65+
66+ return buildType
67+ }
5868
5969android {
6070 compileSdkVersion getExtOrDefault(' compileSdkVersion' , 28 )
@@ -108,11 +118,19 @@ repositories {
108118 }
109119}
110120
121+ def reactProperties = new Properties ()
122+ file(" $nodeModulesPath /react-native/ReactAndroid/gradle.properties" ). withInputStream { reactProperties. load(it) }
123+
124+ def reactNativeVersion = reactProperties. getProperty(" VERSION_NAME" ). split(" \\ ." )[1 ]. toInteger()
125+
111126dependencies {
112127 // noinspection GradleDynamicVersion
113128 implementation ' com.facebook.react:react-native:+'
129+ def rnMatcher = reactNativeVersion < 69
130+ ? " **/**/*.aar"
131+ : " **/react-native/**/*${ buildType()} .aar"
114132
115- def rnAAR = fileTree(reactNativePath). matching({ it. include " **/**/*.aar " }). singleFile
133+ def rnAAR = fileTree(reactNativePath). matching({ it. include rnMatcher }). singleFile
116134 extractJNI(files(rnAAR))
117135}
118136
@@ -136,4 +154,4 @@ task extractJNIFiles {
136154// Extract JNI files as soon as first task is added
137155tasks. whenTaskAdded { task ->
138156 task. dependsOn(extractJNIFiles);
139- }
157+ }
You can’t perform that action at this time.
0 commit comments