From f9b47d70356270b0d339163781ee910b10b37696 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Wed, 19 Jul 2023 17:30:38 +0200 Subject: [PATCH] feat(spm): add support for local SPM packages --- lib/services/ios/spm-service.ts | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/services/ios/spm-service.ts b/lib/services/ios/spm-service.ts index 7d6204f318..c5da44cd64 100644 --- a/lib/services/ios/spm-service.ts +++ b/lib/services/ios/spm-service.ts @@ -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( @@ -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); } diff --git a/package.json b/package.json index 55c34039a5..fabf991247 100644 --- a/package.json +++ b/package.json @@ -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",