Skip to content

Commit 8f10833

Browse files
committed
feat(visionos): allow platform specific SPM Packages
1 parent e36d0ab commit 8f10833

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

lib/services/ios/spm-service.ts

+16-7
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,31 @@ export class SPMService implements ISPMService {
1515
private $xcodebuildArgsService: IXcodebuildArgsService
1616
) {}
1717

18-
public getSPMPackages(projectData: IProjectData): IosSPMPackageDefinition[] {
18+
public getSPMPackages(
19+
projectData: IProjectData,
20+
platform: string
21+
): IosSPMPackageDefinition[] {
1922
const spmPackages = this.$projectConfigService.getValue(
20-
"ios.SPMPackages",
23+
`${platform}.SPMPackages`,
2124
[]
2225
);
2326

2427
return spmPackages;
2528
}
2629

27-
public hasSPMPackages(projectData: IProjectData): boolean {
28-
return this.getSPMPackages(projectData).length > 0;
29-
}
30+
// public hasSPMPackages(projectData: IProjectData): boolean {
31+
// return this.getSPMPackages(projectData).length > 0;
32+
// }
3033

3134
public async applySPMPackages(
3235
platformData: IPlatformData,
3336
projectData: IProjectData
3437
) {
3538
try {
36-
const spmPackages = this.getSPMPackages(projectData);
39+
const spmPackages = this.getSPMPackages(
40+
projectData,
41+
platformData.platformNameLowerCase
42+
);
3743

3844
if (!spmPackages.length) {
3945
this.$logger.trace("SPM: no SPM packages to apply.");
@@ -44,11 +50,14 @@ export class SPMService implements ISPMService {
4450
ios: {
4551
path: ".",
4652
},
53+
visionos: {
54+
path: ".",
55+
},
4756
enableAndroid: false,
4857
});
4958
await project.load();
5059

51-
if (!project.ios) {
60+
if (platformData.platformNameLowerCase === "ios" && !project.ios) {
5261
this.$logger.trace("SPM: no iOS project found via trapeze.");
5362
return;
5463
}

0 commit comments

Comments
 (0)