@@ -1116,57 +1116,47 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
11161116
11171117 const project = this . createPbxProj ( projectData ) ;
11181118
1119- this . $fs . readDirectory ( extensionsFolderPath ) . forEach ( extensionFolder => {
1120- const extensionPath = path . join ( extensionsFolderPath , extensionFolder ) ;
1121- const group = this . getRootGroup ( extensionFolder , extensionPath ) ;
1122-
1123- const target = project . addTarget (
1124- extensionFolder ,
1125- 'app_extension' ,
1126- path . relative ( this . getPlatformData ( projectData ) . projectRoot , extensionPath )
1127-
1128- ) ;
1129- project . addBuildPhase (
1130- [ ] ,
1131- 'PBXSourcesBuildPhase' ,
1132- 'Sources' ,
1133- target . uuid
1134- ) ;
1135-
1136- project . addBuildPhase (
1137- [ ] ,
1138- 'PBXResourcesBuildPhase' ,
1139- 'Resources' ,
1140- target . uuid
1141- ) ;
1142-
1143- project . addBuildPhase (
1144- [ ] ,
1145- 'PBXFrameworksBuildPhase' ,
1146- 'Frameworks' ,
1147- target . uuid
1148- ) ;
1149-
1150- const extJsonPath = path . join ( extensionsFolderPath , extensionFolder , "extension.json" ) ;
1151- if ( this . $fs . exists ( extJsonPath ) ) {
1152- const extensionJson = this . $fs . readJson ( extJsonPath ) ;
1153- _ . forEach ( extensionJson . frameworks , framework => {
1154- project . addFramework (
1155- framework ,
1156- { target : target . uuid }
1157- ) ;
1158- } ) ;
1159- }
1160-
1119+ this . $fs . readDirectory ( extensionsFolderPath )
1120+ . filter ( fileName => {
1121+ const filePath = path . join ( extensionsFolderPath , fileName ) ;
1122+ const stats = this . $fs . getFsStats ( filePath ) ;
1123+ return stats . isDirectory ( ) && ! fileName . startsWith ( "." ) ;
1124+ } )
1125+ . forEach ( extensionFolder => {
1126+ const extensionPath = path . join ( extensionsFolderPath , extensionFolder ) ;
1127+ const extensionRelativePath = path . relative ( this . getPlatformData ( projectData ) . projectRoot , extensionPath ) ;
1128+ const group = this . getRootGroup ( extensionFolder , extensionPath ) ;
1129+ const target = project . addTarget ( extensionFolder , 'app_extension' , extensionRelativePath ) ;
1130+ project . addBuildPhase ( [ ] , 'PBXSourcesBuildPhase' , 'Sources' , target . uuid ) ;
1131+ project . addBuildPhase ( [ ] , 'PBXResourcesBuildPhase' , 'Resources' , target . uuid ) ;
1132+ project . addBuildPhase ( [ ] , 'PBXFrameworksBuildPhase' , 'Frameworks' , target . uuid ) ;
1133+
1134+ const extJsonPath = path . join ( extensionsFolderPath , extensionFolder , "extension.json" ) ;
1135+ if ( this . $fs . exists ( extJsonPath ) ) {
1136+ const extensionJson = this . $fs . readJson ( extJsonPath ) ;
1137+ _ . forEach ( extensionJson . frameworks , framework => {
1138+ project . addFramework (
1139+ framework ,
1140+ { target : target . uuid }
1141+ ) ;
1142+ } ) ;
1143+ if ( extensionJson . assetcatalogCompilerAppiconName ) {
1144+ project . addToBuildSettings ( "ASSETCATALOG_COMPILER_APPICON_NAME" , extensionJson . assetcatalogCompilerAppiconName , target . uuid ) ;
1145+ }
1146+ }
11611147
1162- project . addPbxGroup ( group . files , group . name , group . path , null , { isMain : true , target : target . uuid , filesRelativeToProject : true } ) ;
1163- project . addBuildProperty ( "PRODUCT_BUNDLE_IDENTIFIER" , `${ projectData . projectIdentifiers . ios } .${ extensionFolder } ` , "Debug" , extensionFolder ) ;
1164- project . addBuildProperty ( "PRODUCT_BUNDLE_IDENTIFIER" , `${ projectData . projectIdentifiers . ios } .${ extensionFolder } ` , "Release" , extensionFolder ) ;
1165- targetUuids . push ( target . uuid ) ;
1166- } ) ;
1148+ project . addPbxGroup ( group . files , group . name , group . path , null , { isMain : true , target : target . uuid , filesRelativeToProject : true } ) ;
1149+ project . addBuildProperty ( "PRODUCT_BUNDLE_IDENTIFIER" , `${ projectData . projectIdentifiers . ios } .${ extensionFolder } ` , "Debug" , extensionFolder ) ;
1150+ project . addBuildProperty ( "PRODUCT_BUNDLE_IDENTIFIER" , `${ projectData . projectIdentifiers . ios } .${ extensionFolder } ` , "Release" , extensionFolder ) ;
1151+ targetUuids . push ( target . uuid ) ;
1152+ project . addToHeaderSearchPaths ( group . path , target . pbxNativeTarget . productName ) ;
1153+ } ) ;
11671154
11681155 this . savePbxProj ( project , projectData , true ) ;
1156+ this . prepareExtensionSigning ( targetUuids , projectData ) ;
1157+ }
11691158
1159+ private prepareExtensionSigning ( targetUuids : string [ ] , projectData :IProjectData ) {
11701160 const xcode = this . $pbxprojDomXcode . Xcode . open ( this . getPbxProjPath ( projectData ) ) ;
11711161 const signing = xcode . getSigning ( projectData . projectName ) ;
11721162 if ( signing !== undefined ) {
@@ -1189,11 +1179,14 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
11891179 const filePathsArr : string [ ] = [ ] ;
11901180 const rootGroup : INativeSourceCodeGroup = { name : name , files : filePathsArr , path : rootPath } ;
11911181
1192- if ( this . $fs . exists ( rootPath ) && ! this . $fs . isEmptyDir ( rootPath ) ) {
1193- this . $fs . readDirectory ( rootPath ) . forEach ( fileName => {
1194- const filePath = path . join ( rootGroup . path , fileName ) ;
1195- filePathsArr . push ( filePath ) ;
1196- } ) ;
1182+ if ( this . $fs . exists ( rootPath ) ) {
1183+ const stats = this . $fs . getFsStats ( rootPath ) ;
1184+ if ( stats . isDirectory ( ) && ! this . $fs . isEmptyDir ( rootPath ) ) {
1185+ this . $fs . readDirectory ( rootPath ) . forEach ( fileName => {
1186+ const filePath = path . join ( rootGroup . path , fileName ) ;
1187+ filePathsArr . push ( filePath ) ;
1188+ } ) ;
1189+ }
11971190 }
11981191
11991192 return rootGroup ;
0 commit comments