Skip to content

Commit c480c6b

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #694 from NativeScript/fatme/add-library-with-relative-path
Add library with relative path to .xcodeproj file
2 parents eb9284c + f0fc259 commit c480c6b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/services/ios-project-service.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,15 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
181181
this.validateDynamicFramework(libraryPath).wait();
182182
var umbrellaHeader = this.getUmbrellaHeaderFromDynamicFramework(libraryPath).wait();
183183

184-
var frameworkName = path.basename(libraryPath, path.extname(libraryPath));
185-
var targetPath = path.join(this.$projectData.projectDir, "lib", this.platformData.normalizedPlatformName, frameworkName);
186-
this.$fs.ensureDirectoryExists(targetPath).wait();
187-
shell.cp("-R", libraryPath, targetPath);
184+
let frameworkName = path.basename(libraryPath, path.extname(libraryPath));
185+
let targetPath = path.join("lib", this.platformData.normalizedPlatformName, frameworkName);
186+
let fullTargetPath = path.join(this.$projectData.projectDir, targetPath);
187+
this.$fs.ensureDirectoryExists(fullTargetPath).wait();
188+
shell.cp("-R", libraryPath, fullTargetPath);
188189

189190
let project = this.createPbxProj();
190-
191-
project.addFramework(path.join(targetPath, frameworkName + ".framework"), { customFramework: true, embed: true });
191+
let frameworkPath = path.relative("platforms/ios", path.join(targetPath, frameworkName + ".framework"));
192+
project.addFramework(frameworkPath, { customFramework: true, embed: true });
192193
project.updateBuildProperty("IPHONEOS_DEPLOYMENT_TARGET", "8.0");
193194
this.savePbxProj(project).wait();
194195
this.$logger.info("The iOS Deployment Target is now 8.0 in order to support Cocoa Touch Frameworks.");

0 commit comments

Comments
 (0)