Skip to content

Commit c40e217

Browse files
authored
feat(spm): add support for local SPM packages (#5748)
1 parent fdcc98e commit c40e217

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/services/ios/spm-service.ts

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
IosSPMPackageDefinition,
66
} from "@rigor789/trapezedev-project";
77
import { IPlatformData } from "../../definitions/platform";
8+
import path = require("path");
89

910
export class SPMService implements ISPMService {
1011
constructor(
@@ -54,6 +55,11 @@ export class SPMService implements ISPMService {
5455

5556
// todo: handle removing packages? Or just warn and require a clean?
5657
for (const pkg of spmPackages) {
58+
if ("path" in pkg) {
59+
// resolve the path relative to the project root
60+
this.$logger.trace("SPM: resolving path for package: ", pkg.path);
61+
pkg.path = path.resolve(projectData.projectDir, pkg.path);
62+
}
5763
this.$logger.trace(`SPM: adding package ${pkg.name} to project.`, pkg);
5864
await project.ios.addSPMPackage(projectData.projectName, pkg);
5965
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@nativescript/schematics-executor": "0.0.2",
6060
"@npmcli/move-file": "^2.0.0",
6161
"@rigor789/resolve-package-path": "1.0.5",
62-
"@rigor789/trapezedev-project": "^7.1.0",
62+
"@rigor789/trapezedev-project": "7.1.1",
6363
"archiver": "^5.3.1",
6464
"axios": "1.3.5",
6565
"byline": "5.0.0",

0 commit comments

Comments
 (0)