From f0fc259a2c1c4d9e0847e449ce17fcfa391157b7 Mon Sep 17 00:00:00 2001 From: Fatme Havaluova Date: Mon, 27 Jul 2015 08:58:16 +0300 Subject: [PATCH] Add library with relative path to .xcodeproj file Fixes https://github.com/NativeScript/nativescript-cli/issues/679 --- lib/services/ios-project-service.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 23da49da7b..429f8bb263 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -181,14 +181,15 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase this.validateDynamicFramework(libraryPath).wait(); var umbrellaHeader = this.getUmbrellaHeaderFromDynamicFramework(libraryPath).wait(); - var frameworkName = path.basename(libraryPath, path.extname(libraryPath)); - var targetPath = path.join(this.$projectData.projectDir, "lib", this.platformData.normalizedPlatformName, frameworkName); - this.$fs.ensureDirectoryExists(targetPath).wait(); - shell.cp("-R", libraryPath, targetPath); + let frameworkName = path.basename(libraryPath, path.extname(libraryPath)); + let targetPath = path.join("lib", this.platformData.normalizedPlatformName, frameworkName); + let fullTargetPath = path.join(this.$projectData.projectDir, targetPath); + this.$fs.ensureDirectoryExists(fullTargetPath).wait(); + shell.cp("-R", libraryPath, fullTargetPath); let project = this.createPbxProj(); - - project.addFramework(path.join(targetPath, frameworkName + ".framework"), { customFramework: true, embed: true }); + let frameworkPath = path.relative("platforms/ios", path.join(targetPath, frameworkName + ".framework")); + project.addFramework(frameworkPath, { customFramework: true, embed: true }); project.updateBuildProperty("IPHONEOS_DEPLOYMENT_TARGET", "8.0"); this.savePbxProj(project).wait(); this.$logger.info("The iOS Deployment Target is now 8.0 in order to support Cocoa Touch Frameworks.");