File tree Expand file tree Collapse file tree
examples/SampleApp/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,17 +30,6 @@ ext.REACT_NATIVE_NODE_MODULES_DIR = file("$rootDir/../node_modules/react-native"
3030ext. REACT_NATIVE_WORKLETS_NODE_MODULES_DIR =
3131 file(" $rootDir /../node_modules/react-native-worklets" ). absolutePath
3232
33- subprojects { subproject ->
34- if (subproject. path != " :app" ) {
35- evaluationDependsOn(" :app" )
36- project(" :app" ). tasks. matching { task ->
37- task. name. startsWith(" configureCMake" )
38- }. configureEach {
39- dependsOn(subproject. tasks. matching { it. name == " preBuild" })
40- }
41- }
42- }
43-
4433allprojects {
4534 repositories {
4635 maven {
@@ -53,10 +42,4 @@ allprojects {
5342 }
5443}
5544
56- project(' :app' ) {
57- tasks. matching { it. name == " preBuild" || it. name. startsWith(" configureCMake" ) }. configureEach {
58- dependsOn(" generateCodegenArtifactsFromSchema" )
59- }
60- }
61-
6245apply plugin : " com.facebook.react.rootproject"
Original file line number Diff line number Diff line change @@ -137,3 +137,33 @@ if (isNewArchitectureEnabled()) {
137137 codegenJavaPackageName = " com.streamchatexpo"
138138 }
139139}
140+
141+ if (isNewArchitectureEnabled()) {
142+ gradle. projectsEvaluated {
143+ if (rootProject. ext. has(" streamChatReactNativeCodegenHookInstalled" )) {
144+ return
145+ }
146+
147+ def androidAppProject = rootProject. subprojects. find { it. plugins. hasPlugin(" com.android.application" ) }
148+ if (androidAppProject == null ) {
149+ return
150+ }
151+
152+ def dependencyCodegenTasks = rootProject. subprojects
153+ .findAll { it != androidAppProject }
154+ .collect { it. tasks. findByName(" generateCodegenArtifactsFromSchema" ) }
155+ .findAll { it != null }
156+
157+ if (dependencyCodegenTasks. isEmpty()) {
158+ return
159+ }
160+
161+ rootProject. ext. set(" streamChatReactNativeCodegenHookInstalled" , true )
162+
163+ androidAppProject. tasks. matching { task ->
164+ task. name. startsWith(" configureCMake" )
165+ }. configureEach {
166+ dependsOn(dependencyCodegenTasks)
167+ }
168+ }
169+ }
Original file line number Diff line number Diff line change 9393 "name" : " StreamChatExpoSpec" ,
9494 "type" : " all" ,
9595 "jsSrcsDir" : " src/native" ,
96+ "android" : {
97+ "javaPackageName" : " com.streamchatexpo"
98+ },
9699 "ios" : {
97100 "modulesProvider" : {
98101 "StreamVideoThumbnail" : " StreamVideoThumbnail"
Original file line number Diff line number Diff line change @@ -155,3 +155,33 @@ if (isNewArchitectureEnabled()) {
155155 codegenJavaPackageName = " com.streamchatreactnative"
156156 }
157157}
158+
159+ if (isNewArchitectureEnabled()) {
160+ gradle. projectsEvaluated {
161+ if (rootProject. ext. has(" streamChatReactNativeCodegenHookInstalled" )) {
162+ return
163+ }
164+
165+ def androidAppProject = rootProject. subprojects. find { it. plugins. hasPlugin(" com.android.application" ) }
166+ if (androidAppProject == null ) {
167+ return
168+ }
169+
170+ def dependencyCodegenTasks = rootProject. subprojects
171+ .findAll { it != androidAppProject }
172+ .collect { it. tasks. findByName(" generateCodegenArtifactsFromSchema" ) }
173+ .findAll { it != null }
174+
175+ if (dependencyCodegenTasks. isEmpty()) {
176+ return
177+ }
178+
179+ rootProject. ext. set(" streamChatReactNativeCodegenHookInstalled" , true )
180+
181+ androidAppProject. tasks. matching { task ->
182+ task. name. startsWith(" configureCMake" )
183+ }. configureEach {
184+ dependsOn(dependencyCodegenTasks)
185+ }
186+ }
187+ }
Original file line number Diff line number Diff line change 2121 " android/gradle" ,
2222 " ios" ,
2323 " *.podspec" ,
24+ " react-native.config.js" ,
2425 " package.json"
2526 ],
2627 "license" : " SEE LICENSE IN LICENSE" ,
9293 "name" : " StreamChatReactNativeSpec" ,
9394 "type" : " all" ,
9495 "jsSrcsDir" : " src/native" ,
96+ "android" : {
97+ "javaPackageName" : " com.streamchatreactnative"
98+ },
9599 "ios" : {
96100 "modulesProvider" : {
97101 "StreamChatReactNative" : " StreamChatReactNative" ,
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ dependency : {
3+ platforms : {
4+ android : {
5+ packageImportPath : 'import com.streamchatreactnative.StreamChatReactNativePackage;' ,
6+ packageInstance : 'new StreamChatReactNativePackage()' ,
7+ } ,
8+ ios : {
9+ podspecPath : 'stream-chat-react-native.podspec' ,
10+ } ,
11+ } ,
12+ } ,
13+ } ;
You canβt perform that action at this time.
0 commit comments