@@ -32,6 +32,7 @@ import {
3232 IIOSWatchAppService ,
3333 IIOSNativeTargetService ,
3434 IValidatePlatformOutput ,
35+ IProjectConfigService ,
3536} from "../definitions/project" ;
3637
3738import { IBuildData } from "../definitions/build" ;
@@ -121,7 +122,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
121122 private $sysInfo : ISysInfo ,
122123 private $tempService : ITempService ,
123124 private $spmService : ISPMService ,
124- private $mobileHelper : Mobile . IMobileHelper
125+ private $mobileHelper : Mobile . IMobileHelper ,
126+ private $projectConfigService : IProjectConfigService
125127 ) {
126128 super ( $fs , $projectDataService ) ;
127129 }
@@ -1175,7 +1177,30 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
11751177 ) ;
11761178 }
11771179
1178- await this . $spmService . applySPMPackages ( platformData , projectData ) ;
1180+ const pluginSpmPackages = [ ] ;
1181+ for ( const plugin of pluginsData ) {
1182+ const pluginConfigPath = path . join (
1183+ plugin . fullPath ,
1184+ constants . CONFIG_FILE_NAME_TS
1185+ ) ;
1186+ if ( this . $fs . exists ( pluginConfigPath ) ) {
1187+ const config = this . $projectConfigService . readConfig ( plugin . fullPath ) ;
1188+ const packages = _ . get (
1189+ config ,
1190+ `${ platformData . platformNameLowerCase } .SPMPackages` ,
1191+ [ ]
1192+ ) ;
1193+ if ( packages . length ) {
1194+ pluginSpmPackages . push ( ...packages ) ;
1195+ }
1196+ }
1197+ }
1198+
1199+ await this . $spmService . applySPMPackages (
1200+ platformData ,
1201+ projectData ,
1202+ pluginSpmPackages
1203+ ) ;
11791204 }
11801205
11811206 public beforePrepareAllPlugins (
0 commit comments