From 0daf8b64093d7c317bbc136ff027882f68f09221 Mon Sep 17 00:00:00 2001 From: Jason Zhekov Date: Tue, 22 Nov 2016 11:53:34 +0200 Subject: [PATCH] Fix native framework relative path calculation --- lib/services/ios-project-service.ts | 2 +- test/ios-project-service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index d098b6debb..71e5316285 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -674,7 +674,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f } private getLibSubpathRelativeToProjectPath(targetPath: string): string { - let frameworkPath = path.relative("platforms/ios", targetPath); + let frameworkPath = path.relative(this.platformData.projectRoot, targetPath); return frameworkPath; } diff --git a/test/ios-project-service.ts b/test/ios-project-service.ts index 9e3878aec3..b9adef3fc8 100644 --- a/test/ios-project-service.ts +++ b/test/ios-project-service.ts @@ -469,13 +469,13 @@ describe("Relative paths", () => { it("checks for correct calculation of relative paths", () => { let projectName = "projectDirectory"; let projectPath = temp.mkdirSync(projectName); - let subpath = "sub/path"; + let subpath = path.join(projectPath, "sub/path"); let testInjector = createTestInjector(projectPath, projectName); createPackageJson(testInjector, projectPath, projectName); let iOSProjectService = testInjector.resolve("iOSProjectService"); let result = iOSProjectService.getLibSubpathRelativeToProjectPath(subpath); - assert.equal(result, path.join("../../", subpath)); + assert.equal(result, "../../sub/path"); }); });