Skip to content

Commit 4d6c0d4

Browse files
authored
Merge pull request #2247 from NativeScript/jasssonpet/fix-path-ios-build
Fix native framework relative path calculation
2 parents f11cc4f + 0daf8b6 commit 4d6c0d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/services/ios-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
674674
}
675675

676676
private getLibSubpathRelativeToProjectPath(targetPath: string): string {
677-
let frameworkPath = path.relative("platforms/ios", targetPath);
677+
let frameworkPath = path.relative(this.platformData.projectRoot, targetPath);
678678
return frameworkPath;
679679
}
680680

test/ios-project-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,13 @@ describe("Relative paths", () => {
469469
it("checks for correct calculation of relative paths", () => {
470470
let projectName = "projectDirectory";
471471
let projectPath = temp.mkdirSync(projectName);
472-
let subpath = "sub/path";
472+
let subpath = path.join(projectPath, "sub/path");
473473

474474
let testInjector = createTestInjector(projectPath, projectName);
475475
createPackageJson(testInjector, projectPath, projectName);
476476
let iOSProjectService = testInjector.resolve("iOSProjectService");
477477

478478
let result = iOSProjectService.getLibSubpathRelativeToProjectPath(subpath);
479-
assert.equal(result, path.join("../../", subpath));
479+
assert.equal(result, "../../sub/path");
480480
});
481481
});

0 commit comments

Comments
 (0)