Skip to content

Commit 97cb2dd

Browse files
committed
Add only rootGroup from ios-project-service - the others will be handled recursively by addPbxGroup()
1 parent 9c796ac commit 97cb2dd

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

lib/services/ios-project-service.ts

+5-16
Original file line numberDiff line numberDiff line change
@@ -1123,21 +1123,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
11231123
private async prepareNativeSourceCode(pluginName: string, pluginPlatformsFolderPath: string, projectData: IProjectData): Promise<void> {
11241124

11251125
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);
11371129
this.savePbxProj(project, projectData);
11381130
}
11391131

1140-
private createSourceArray(name: string,rootPath: string, groupsArr: any) {
1132+
private getRootGroup(name: string,rootPath: string) {
11411133
let filesArr: NativeSourceCodeDescription[] = [];
11421134
let rootGroup: NativeSourceCodeGroup = { name: name, files: filesArr, path: rootPath };
11431135

@@ -1146,13 +1138,10 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
11461138
let filePath = path.join(rootGroup.path, fileName);
11471139
let file: NativeSourceCodeDescription = { name: fileName, path: filePath};
11481140
filesArr.push(file);
1149-
if (this.$fs.getFsStats(filePath).isDirectory()) {
1150-
this.createSourceArray(file.name, file.path, groupsArr);
1151-
}
11521141
});
11531142
}
11541143

1155-
groupsArr.arr.push(rootGroup);
1144+
return rootGroup;
11561145
}
11571146

11581147
private async prepareFrameworks(pluginPlatformsFolderPath: string, pluginData: IPluginData, projectData: IProjectData): Promise<void> {

0 commit comments

Comments
 (0)