@@ -17,15 +17,10 @@ import * as mobileprovision from "ios-mobileprovision-finder";
17
17
import { SpawnOptions } from "child_process" ;
18
18
import { BUILD_XCCONFIG_FILE_NAME } from "../constants" ;
19
19
20
- interface INativeSourceCodeDescription {
21
- path : string ;
22
- name : string ;
23
- }
24
-
25
20
interface INativeSourceCodeGroup {
26
21
name : string ;
27
22
path : string ;
28
- files : INativeSourceCodeDescription [ ] ;
23
+ files : string [ ] ;
29
24
}
30
25
31
26
export class IOSProjectService extends projectServiceBaseLib . PlatformProjectServiceBase implements IPlatformProjectService {
@@ -949,6 +944,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
949
944
public async removePluginNativeCode ( pluginData : IPluginData , projectData : IProjectData ) : Promise < void > {
950
945
const pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
951
946
947
+ this . removeNativeSourceCode ( pluginPlatformsFolderPath , pluginData , projectData ) ;
952
948
this . removeFrameworks ( pluginPlatformsFolderPath , pluginData , projectData ) ;
953
949
this . removeStaticLibs ( pluginPlatformsFolderPath , pluginData , projectData ) ;
954
950
this . removeCocoapods ( pluginPlatformsFolderPath , projectData ) ;
@@ -1123,20 +1119,19 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1123
1119
private async prepareNativeSourceCode ( pluginName : string , pluginPlatformsFolderPath : string , projectData : IProjectData ) : Promise < void > {
1124
1120
const project = this . createPbxProj ( projectData ) ;
1125
1121
const group = this . getRootGroup ( pluginName , pluginPlatformsFolderPath ) ;
1126
- project . addPbxGroup ( group . files . map ( f => f . path ) , group . name , group . path , null , { isMain :true } ) ;
1122
+ project . addPbxGroup ( group . files , group . name , group . path , null , { isMain :true } ) ;
1127
1123
project . addToHeaderSearchPaths ( group . path ) ;
1128
1124
this . savePbxProj ( project , projectData ) ;
1129
1125
}
1130
1126
1131
1127
private getRootGroup ( name : string , rootPath : string ) {
1132
- const filesArr : INativeSourceCodeDescription [ ] = [ ] ;
1133
- const rootGroup : INativeSourceCodeGroup = { name : name , files : filesArr , path : rootPath } ;
1128
+ const filePathsArr : string [ ] = [ ] ;
1129
+ const rootGroup : INativeSourceCodeGroup = { name : name , files : filePathsArr , path : rootPath } ;
1134
1130
1135
1131
if ( this . $fs . exists ( rootPath ) && ! this . $fs . isEmptyDir ( rootPath ) ) {
1136
1132
this . $fs . readDirectory ( rootPath ) . forEach ( fileName => {
1137
1133
const filePath = path . join ( rootGroup . path , fileName ) ;
1138
- const file : INativeSourceCodeDescription = { name : fileName , path : filePath } ;
1139
- filesArr . push ( file ) ;
1134
+ filePathsArr . push ( filePath ) ;
1140
1135
} ) ;
1141
1136
}
1142
1137
@@ -1199,6 +1194,14 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1199
1194
}
1200
1195
}
1201
1196
1197
+ private removeNativeSourceCode ( pluginPlatformsFolderPath : string , pluginData : IPluginData , projectData : IProjectData ) : void {
1198
+ const project = this . createPbxProj ( projectData ) ;
1199
+ const group = this . getRootGroup ( pluginData . name , pluginPlatformsFolderPath ) ;
1200
+ project . removePbxGroup ( group . name , group . path ) ;
1201
+ project . removeFromHeaderSearchPaths ( group . path ) ;
1202
+ this . savePbxProj ( project , projectData ) ;
1203
+ }
1204
+
1202
1205
private removeFrameworks ( pluginPlatformsFolderPath : string , pluginData : IPluginData , projectData : IProjectData ) : void {
1203
1206
const project = this . createPbxProj ( projectData ) ;
1204
1207
_ . each ( this . getAllLibsForPluginWithFileExtension ( pluginData , ".framework" ) , fileName => {
0 commit comments