@@ -775,7 +775,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
775
775
) ;
776
776
777
777
await this . prepareNativeSourceCode ( constants . TNS_NATIVE_SOURCE_GROUP_NAME , resourcesNativeCodePath , projectData ) ;
778
- await this . prepareExtensionsCode ( constants . TNS_NATIVE_EXTENSIONS_GROUP_NAME , path . join ( projectData . getAppResourcesDirectoryPath ( ) , this . getPlatformData ( projectData ) . normalizedPlatformName , constants . NATIVE_EXTENSION_FOLDER ) , projectData ) ;
779
778
}
780
779
781
780
}
@@ -981,6 +980,17 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
981
980
// So the correct order is `pod install` to be executed before merging pod's xcconfig file.
982
981
await this . $cocoapodsService . mergePodXcconfigFile ( projectData , platformData , opts ) ;
983
982
}
983
+
984
+ this . removeExtensions ( projectData ) ;
985
+ await this . prepareExtensionsCode ( path . join ( projectData . getAppResourcesDirectoryPath ( ) , this . getPlatformData ( projectData ) . normalizedPlatformName , constants . NATIVE_EXTENSION_FOLDER ) , projectData ) ;
986
+ const plugins = await this . getAllInstalledPlugins ( projectData ) ;
987
+ for ( const pluginIndex in plugins ) {
988
+ const pluginData = plugins [ pluginIndex ] ;
989
+ const pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
990
+
991
+ const extensionPath = path . join ( pluginPlatformsFolderPath , constants . NATIVE_EXTENSION_FOLDER ) ;
992
+ await this . prepareExtensionsCode ( extensionPath , projectData ) ;
993
+ } ;
984
994
}
985
995
public beforePrepareAllPlugins ( ) : Promise < void > {
986
996
return Promise . resolve ( ) ;
@@ -1096,7 +1106,11 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1096
1106
this . savePbxProj ( project , projectData ) ;
1097
1107
}
1098
1108
1099
- private async prepareExtensionsCode ( groupName : string , extensionsFolderPath : string , projectData : IProjectData ) : Promise < void > {
1109
+ private async prepareExtensionsCode ( extensionsFolderPath : string , projectData : IProjectData ) : Promise < void > {
1110
+ if ( ! this . $fs . exists ( extensionsFolderPath ) ) {
1111
+ return ;
1112
+ }
1113
+
1100
1114
const project = this . createPbxProj ( projectData ) ;
1101
1115
1102
1116
this . $fs . readDirectory ( extensionsFolderPath ) . forEach ( extensionFolder => {
@@ -1109,35 +1123,40 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1109
1123
path . relative ( this . getPlatformData ( projectData ) . projectRoot , extensionPath )
1110
1124
1111
1125
) ;
1112
- const sourcesBuildPhase = project . addBuildPhase (
1126
+ project . addBuildPhase (
1113
1127
[ ] ,
1114
1128
'PBXSourcesBuildPhase' ,
1115
1129
'Sources' ,
1116
1130
target . uuid
1117
1131
) ;
1118
- const frameworksBuildPhase = project . addBuildPhase (
1132
+
1133
+ project . addBuildPhase (
1119
1134
[ ] ,
1120
- 'PBXFrameworksBuildPhase ' ,
1121
- 'Frameworks ' ,
1135
+ 'PBXResourcesBuildPhase ' ,
1136
+ 'Resources ' ,
1122
1137
target . uuid
1123
1138
) ;
1124
1139
1125
- const extensionJson = this . $fs . readJson ( path . join ( extensionsFolderPath , extensionFolder , "extension.json" ) ) ;
1126
- _ . forEach ( extensionJson . frameworks , framework => {
1127
- project . addFramework (
1128
- framework ,
1129
- { target : target . uuid }
1130
- ) ;
1131
- } ) ;
1132
- var resourcesBuildPhase = project . addBuildPhase (
1140
+ project . addBuildPhase (
1133
1141
[ ] ,
1134
- 'PBXResourcesBuildPhase ' ,
1135
- 'Resources ' ,
1142
+ 'PBXFrameworksBuildPhase ' ,
1143
+ 'Frameworks ' ,
1136
1144
target . uuid
1137
1145
) ;
1138
1146
1147
+ const extJsonPath = path . join ( extensionsFolderPath , extensionFolder , "extension.json" ) ;
1148
+ if ( this . $fs . exists ( extJsonPath ) ) {
1149
+ const extensionJson = this . $fs . readJson ( extJsonPath ) ;
1150
+ _ . forEach ( extensionJson . frameworks , framework => {
1151
+ project . addFramework (
1152
+ framework ,
1153
+ { target : target . uuid }
1154
+ ) ;
1155
+ } ) ;
1156
+ }
1139
1157
1140
- project . addPbxGroup ( group . files , group . name , group . path , null , { isMain : true , target : target . uuid } ) ;
1158
+
1159
+ project . addPbxGroup ( group . files , group . name , group . path , null , { isMain : true , target : target . uuid , filesRelativeToProject : true } ) ;
1141
1160
project . addBuildProperty ( "PRODUCT_BUNDLE_IDENTIFIER" , `${ projectData . projectIdentifiers . ios } .${ extensionFolder } ` , "Debug" , extensionFolder ) ;
1142
1161
project . addBuildProperty ( "PRODUCT_BUNDLE_IDENTIFIER" , `${ projectData . projectIdentifiers . ios } .${ extensionFolder } ` , "Release" , extensionFolder ) ;
1143
1162
} ) ;
@@ -1195,6 +1214,12 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1195
1214
this . savePbxProj ( project , projectData ) ;
1196
1215
}
1197
1216
1217
+ private removeExtensions ( projectData : IProjectData ) : void {
1218
+ const project = this . createPbxProj ( projectData ) ;
1219
+ project . removeTargetsByProductType ( "com.apple.product-type.app-extension" ) ;
1220
+ this . savePbxProj ( project , projectData ) ;
1221
+ }
1222
+
1198
1223
private removeFrameworks ( pluginPlatformsFolderPath : string , pluginData : IPluginData , projectData : IProjectData ) : void {
1199
1224
const project = this . createPbxProj ( projectData ) ;
1200
1225
_ . each ( this . getAllLibsForPluginWithFileExtension ( pluginData , ".framework" ) , fileName => {
0 commit comments