@@ -1123,21 +1123,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1123
1123
private async prepareNativeSourceCode ( pluginName : string , pluginPlatformsFolderPath : string , projectData : IProjectData ) : Promise < void > {
1124
1124
1125
1125
const project = this . createPbxProj ( projectData ) ;
1126
-
1127
- let groupsArr :NativeSourceCodeGroup [ ] = [ ] ;
1128
- let arrObj = { arr : groupsArr } ;
1129
- this . createSourceArray ( pluginName , pluginPlatformsFolderPath , arrObj ) ;
1130
- //iterate backwards as the root level directory is added first
1131
- for ( let i = groupsArr . length - 1 ; i >= 0 ; i -- ) {
1132
- const el = groupsArr [ i ] ;
1133
- project . addPbxGroup ( el . files . map ( f => f . path ) , el . name , el . path )
1134
- project . addToHeaderSearchPaths ( el . path ) ;
1135
- }
1136
-
1126
+ var group = this . getRootGroup ( pluginName , pluginPlatformsFolderPath ) ;
1127
+ project . addPbxGroup ( group . files . map ( f => f . path ) , group . name , group . path , null , { isMain :true } ) ;
1128
+ project . addToHeaderSearchPaths ( group . path ) ;
1137
1129
this . savePbxProj ( project , projectData ) ;
1138
1130
}
1139
1131
1140
- private createSourceArray ( name : string , rootPath : string , groupsArr : any ) {
1132
+ private getRootGroup ( name : string , rootPath : string ) {
1141
1133
let filesArr : NativeSourceCodeDescription [ ] = [ ] ;
1142
1134
let rootGroup : NativeSourceCodeGroup = { name : name , files : filesArr , path : rootPath } ;
1143
1135
@@ -1146,13 +1138,10 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1146
1138
let filePath = path . join ( rootGroup . path , fileName ) ;
1147
1139
let file : NativeSourceCodeDescription = { name : fileName , path : filePath } ;
1148
1140
filesArr . push ( file ) ;
1149
- if ( this . $fs . getFsStats ( filePath ) . isDirectory ( ) ) {
1150
- this . createSourceArray ( file . name , file . path , groupsArr ) ;
1151
- }
1152
1141
} ) ;
1153
1142
}
1154
1143
1155
- groupsArr . arr . push ( rootGroup ) ;
1144
+ return rootGroup ;
1156
1145
}
1157
1146
1158
1147
private async prepareFrameworks ( pluginPlatformsFolderPath : string , pluginData : IPluginData , projectData : IProjectData ) : Promise < void > {
0 commit comments