@@ -92,7 +92,9 @@ const getConfigurationName = (release: boolean): string => {
9292 return release ? Configurations . Release : Configurations . Debug ;
9393} ;
9494
95- export class IOSProjectService extends projectServiceBaseLib . PlatformProjectServiceBase {
95+ export class IOSProjectService
96+ extends projectServiceBaseLib . PlatformProjectServiceBase
97+ {
9698 private static IOS_PROJECT_NAME_PLACEHOLDER = "__PROJECT_NAME__" ;
9799 private static IOS_PLATFORM_NAME = "ios" ;
98100
@@ -1164,6 +1166,52 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
11641166 ) ;
11651167 }
11661168
1169+ public shouldRepreparePlugin (
1170+ pluginData : IPluginData ,
1171+ projectData : IProjectData ,
1172+ ) : boolean {
1173+ const pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath (
1174+ IOSProjectService . IOS_PLATFORM_NAME ,
1175+ ) ;
1176+
1177+ for ( const fileName of this . getAllLibsForPluginWithFileExtension (
1178+ pluginData ,
1179+ ".a" ,
1180+ ) ) {
1181+ const staticLibPath = path . join ( pluginPlatformsFolderPath , fileName ) ;
1182+ const libraryName = path . basename ( staticLibPath , ".a" ) ;
1183+ const headersSubpath = path . join (
1184+ path . dirname ( staticLibPath ) ,
1185+ "include" ,
1186+ libraryName ,
1187+ ) ;
1188+
1189+ if ( ! this . $fs . exists ( headersSubpath ) ) {
1190+ continue ;
1191+ }
1192+
1193+ const headerFiles = this . $fs
1194+ . readDirectory ( headersSubpath )
1195+ . filter (
1196+ ( f ) =>
1197+ path . extname ( f ) === ".h" &&
1198+ this . $fs . getFsStats ( path . join ( headersSubpath , f ) ) . isFile ( ) ,
1199+ ) ;
1200+
1201+ if (
1202+ headerFiles . length > 0 &&
1203+ ! this . $fs . exists ( path . join ( headersSubpath , "module.modulemap" ) )
1204+ ) {
1205+ this . $logger . trace (
1206+ `Plugin ${ pluginData . name } : modulemap missing at ${ headersSubpath } , will re-prepare` ,
1207+ ) ;
1208+ return true ;
1209+ }
1210+ }
1211+
1212+ return false ;
1213+ }
1214+
11671215 public async removePluginNativeCode (
11681216 pluginData : IPluginData ,
11691217 projectData : IProjectData ,
0 commit comments