@@ -775,6 +775,7 @@ 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 ) ;
778
779
}
779
780
780
781
}
@@ -788,6 +789,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
788
789
789
790
// src folder should not be copied as the pbxproject will have references to its files
790
791
this . $fs . deleteDirectory ( path . join ( appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , constants . NATIVE_SOURCE_FOLDER ) ) ;
792
+ this . $fs . deleteDirectory ( path . join ( appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , constants . NATIVE_EXTENSION_FOLDER ) ) ;
791
793
792
794
this . $fs . deleteDirectory ( this . getAppResourcesDestinationDirectoryPath ( projectData ) ) ;
793
795
}
@@ -949,6 +951,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
949
951
await this . prepareResources ( pluginPlatformsFolderPath , pluginData , projectData ) ;
950
952
await this . prepareFrameworks ( pluginPlatformsFolderPath , pluginData , projectData ) ;
951
953
await this . prepareStaticLibs ( pluginPlatformsFolderPath , pluginData , projectData ) ;
954
+ //await this.prepareApplicationExtensions(pluginPlatformsFolderPath, pluginData, projectData);
952
955
953
956
const projectRoot = this . getPlatformData ( projectData ) . projectRoot ;
954
957
await this . $cocoapodsService . applyPodfileToProject ( pluginData . name , this . $cocoapodsService . getPluginPodfilePath ( pluginData ) , projectData , projectRoot ) ;
@@ -1093,6 +1096,51 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1093
1096
this . savePbxProj ( project , projectData ) ;
1094
1097
}
1095
1098
1099
+ private async prepareExtensionsCode ( groupName : string , extensionsFolderPath : string , projectData : IProjectData ) : Promise < void > {
1100
+ const project = this . createPbxProj ( projectData ) ;
1101
+
1102
+ this . $fs . readDirectory ( extensionsFolderPath ) . forEach ( extensionFolder => {
1103
+ const group = this . getRootGroup ( extensionFolder , path . join ( extensionsFolderPath , extensionFolder ) ) ;
1104
+
1105
+ const target = project . addTarget (
1106
+ extensionFolder ,
1107
+ 'app_extension'
1108
+ ) ;
1109
+ const sourcesBuildPhase = project . addBuildPhase (
1110
+ [ ] ,
1111
+ 'PBXSourcesBuildPhase' ,
1112
+ 'Sources' ,
1113
+ target . uuid
1114
+ ) ;
1115
+ const frameworksBuildPhase = project . addBuildPhase (
1116
+ [ ] ,
1117
+ 'PBXFrameworksBuildPhase' ,
1118
+ 'Frameworks' ,
1119
+ target . uuid
1120
+ ) ;
1121
+
1122
+ const extensionJson = this . $fs . readJson ( path . join ( extensionsFolderPath , extensionFolder , "extension.json" ) ) ;
1123
+ _ . forEach ( extensionJson . frameworks , framework => {
1124
+ project . addFramework (
1125
+ framework ,
1126
+ { target : target . uuid }
1127
+ ) ;
1128
+ } ) ;
1129
+ var resourcesBuildPhase = project . addBuildPhase (
1130
+ [ ] ,
1131
+ 'PBXResourcesBuildPhase' ,
1132
+ 'Resources' ,
1133
+ target . uuid
1134
+ ) ;
1135
+
1136
+
1137
+ project . addPbxGroup ( group . files , group . name , group . path , null , { isMain : true , target : target . uuid } ) ;
1138
+
1139
+ } ) ;
1140
+
1141
+ this . savePbxProj ( project , projectData ) ;
1142
+ }
1143
+
1096
1144
private getRootGroup ( name : string , rootPath : string ) {
1097
1145
const filePathsArr : string [ ] = [ ] ;
1098
1146
const rootGroup : INativeSourceCodeGroup = { name : name , files : filePathsArr , path : rootPath } ;
@@ -1131,6 +1179,10 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1131
1179
}
1132
1180
}
1133
1181
1182
+ // private prepareApplicationExtensions(pluginPlatformsFolderPath: string, pluginData: IPluginData, projectData: IProjectData): Promise<void> {
1183
+
1184
+ // }
1185
+
1134
1186
private removeNativeSourceCode ( pluginPlatformsFolderPath : string , pluginData : IPluginData , projectData : IProjectData ) : void {
1135
1187
const project = this . createPbxProj ( projectData ) ;
1136
1188
const group = this . getRootGroup ( pluginData . name , pluginPlatformsFolderPath ) ;
0 commit comments