Skip to content

Commit

Permalink
feat(spm): add support for local SPM packages (#5748)
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 authored Jul 19, 2023
1 parent fdcc98e commit c40e217
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/services/ios/spm-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
IosSPMPackageDefinition,
} from "@rigor789/trapezedev-project";
import { IPlatformData } from "../../definitions/platform";
import path = require("path");

export class SPMService implements ISPMService {
constructor(
Expand Down Expand Up @@ -54,6 +55,11 @@ export class SPMService implements ISPMService {

// todo: handle removing packages? Or just warn and require a clean?
for (const pkg of spmPackages) {
if ("path" in pkg) {
// resolve the path relative to the project root
this.$logger.trace("SPM: resolving path for package: ", pkg.path);
pkg.path = path.resolve(projectData.projectDir, pkg.path);
}
this.$logger.trace(`SPM: adding package ${pkg.name} to project.`, pkg);
await project.ios.addSPMPackage(projectData.projectName, pkg);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@nativescript/schematics-executor": "0.0.2",
"@npmcli/move-file": "^2.0.0",
"@rigor789/resolve-package-path": "1.0.5",
"@rigor789/trapezedev-project": "^7.1.0",
"@rigor789/trapezedev-project": "7.1.1",
"archiver": "^5.3.1",
"axios": "1.3.5",
"byline": "5.0.0",
Expand Down

0 comments on commit c40e217

Please sign in to comment.