@@ -271,47 +271,68 @@ export function dependencyConfigWindows(
271
271
for ( const foundProject of foundProjects ) {
272
272
const projectFile = path . join ( sourceDir , foundProject ) ;
273
273
274
- const projectLang = configUtils . getProjectLanguage ( projectFile ) ;
275
-
276
274
const projectContents = configUtils . readProjectFile ( projectFile ) ;
277
275
278
- const projectName = configUtils . getProjectName (
279
- projectFile ,
276
+ const configurationType = configUtils . getConfigurationType (
280
277
projectContents ,
281
278
) ;
282
279
283
- const projectGuid = configUtils . getProjectGuid ( projectContents ) ;
280
+ if ( configurationType === 'DynamicLibrary' ) {
281
+ const projectLang = configUtils . getProjectLanguage ( projectFile ) ;
282
+
283
+ const projectName = configUtils . getProjectName (
284
+ projectFile ,
285
+ projectContents ,
286
+ ) ;
287
+
288
+ const projectGuid = configUtils . getProjectGuid ( projectContents ) ;
289
+
290
+ const projectNamespace = configUtils . getProjectNamespace (
291
+ projectContents ,
292
+ ) ;
284
293
285
- const projectNamespace = configUtils . getProjectNamespace ( projectContents ) ;
294
+ const directDependency = true ;
286
295
287
- const directDependency = true ;
296
+ const cppHeaders : string [ ] = [ ] ;
297
+ const cppPackageProviders : string [ ] = [ ] ;
298
+ const csNamespaces : string [ ] = [ ] ;
299
+ const csPackageProviders : string [ ] = [ ] ;
288
300
289
- const cppHeaders : string [ ] = [ ] ;
290
- const cppPackageProviders : string [ ] = [ ] ;
291
- const csNamespaces : string [ ] = [ ] ;
292
- const csPackageProviders : string [ ] = [ ] ;
301
+ if ( projectNamespace !== null ) {
302
+ const cppNamespace = projectNamespace . replace ( / \. / g, '::' ) ;
303
+ const csNamespace = projectNamespace . replace ( / : : / g, '.' ) ;
293
304
294
- if ( projectNamespace !== null ) {
295
- const cppNamespace = projectNamespace . replace ( / \. / g, '::' ) ;
296
- const csNamespace = projectNamespace . replace ( / : : / g, '.' ) ;
305
+ cppHeaders . push ( `winrt/${ csNamespace } .h` ) ;
306
+ cppPackageProviders . push ( `${ cppNamespace } ::ReactPackageProvider` ) ;
307
+ csNamespaces . push ( `${ csNamespace } ` ) ;
308
+ csPackageProviders . push ( `${ csNamespace } .ReactPackageProvider` ) ;
309
+ }
297
310
298
- cppHeaders . push ( `winrt/${ csNamespace } .h` ) ;
299
- cppPackageProviders . push ( `${ cppNamespace } ::ReactPackageProvider` ) ;
300
- csNamespaces . push ( `${ csNamespace } ` ) ;
301
- csPackageProviders . push ( `${ csNamespace } .ReactPackageProvider` ) ;
311
+ result . projects . push ( {
312
+ projectFile : path . relative ( sourceDir , projectFile ) ,
313
+ projectName,
314
+ projectLang,
315
+ projectGuid,
316
+ directDependency,
317
+ cppHeaders,
318
+ cppPackageProviders,
319
+ csNamespaces,
320
+ csPackageProviders,
321
+ } ) ;
322
+ } else {
323
+ const projectPath = path . relative ( sourceDir , projectFile ) ;
324
+ result . projects . push ( {
325
+ projectFile : `Error: ${ projectPath } has configuration type '${ configurationType } '` ,
326
+ directDependency : false ,
327
+ projectName : '' ,
328
+ projectLang : null ,
329
+ projectGuid : null ,
330
+ cppHeaders : [ ] ,
331
+ cppPackageProviders : [ ] ,
332
+ csNamespaces : [ ] ,
333
+ csPackageProviders : [ ] ,
334
+ } ) ;
302
335
}
303
-
304
- result . projects . push ( {
305
- projectFile : path . relative ( sourceDir , projectFile ) ,
306
- projectName,
307
- projectLang,
308
- projectGuid,
309
- directDependency,
310
- cppHeaders,
311
- cppPackageProviders,
312
- csNamespaces,
313
- csPackageProviders,
314
- } ) ;
315
336
}
316
337
}
317
338
0 commit comments