@@ -257,11 +257,11 @@ class ReactNativeModules {
257
257
258
258
if (packages. size() > 0 ) {
259
259
libraryIncludes = packages. collect {
260
- " include ${ it.androidMkPath} "
261
- }. join(' \n ' )
260
+ it . androidMkPath ? " include ${ it.androidMkPath} " : null
261
+ }. minus( null ) . join(' \n ' )
262
262
libraryModules = packages. collect {
263
- " ${ codegenLibPrefix}${ it.libraryName} "
264
- }. join(" \\\n " )
263
+ it . libraryName ? " ${ codegenLibPrefix}${ it.libraryName} " : null
264
+ }. minus( null ) . join(" \\\n " )
265
265
}
266
266
267
267
String generatedFileContents = generatedFileContentsTemplate
@@ -285,21 +285,24 @@ class ReactNativeModules {
285
285
286
286
if (packages. size() > 0 ) {
287
287
rncliCppIncludes = packages. collect {
288
+ if (! it. libraryName) {
289
+ return null
290
+ }
288
291
def result = " #include <${ it.libraryName} .h>"
289
- if (it. componentDescriptors. size() > 0 ) {
292
+ if (it. componentDescriptors && it . componentDescriptors . size() > 0 ) {
290
293
result + = " \n #include <${ codegenReactComponentsDir} /${ it.libraryName} /${ codegenComponentDescriptorsHeaderFile} >"
291
294
}
292
295
result
293
- }. join(' \n ' )
296
+ }. minus( null ) . join(' \n ' )
294
297
rncliCppModuleProviders = packages. collect {
295
- """ auto module_${ it.libraryName} = ${ it.libraryName} _ModuleProvider(moduleName, params);
298
+ it . libraryName ? """ auto module_${ it.libraryName} = ${ it.libraryName} _ModuleProvider(moduleName, params);
296
299
if (module_${ it.libraryName} != nullptr) {
297
300
return module_${ it.libraryName} ;
298
- }"""
299
- }. join(" \n " )
301
+ }""" : null
302
+ }. minus( null ) . join(" \n " )
300
303
rncliCppComponentDescriptors = packages. collect {
301
304
def result = " "
302
- if (it. componentDescriptors. size() > 0 ) {
305
+ if (it. componentDescriptors && it . componentDescriptors . size() > 0 ) {
303
306
result + = it. componentDescriptors. collect {
304
307
" providerRegistry->add(concreteComponentDescriptorProvider<${ it} >());"
305
308
}. join(' \n ' )
0 commit comments