From 1ea22324e17edc282af44c0274f5aef090ce4016 Mon Sep 17 00:00:00 2001 From: maciej simka Date: Mon, 8 Jul 2019 15:21:25 +0200 Subject: [PATCH 1/2] feat: use relative paths in podfile lock (#488) --- packages/platform-ios/native_modules.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/platform-ios/native_modules.rb b/packages/platform-ios/native_modules.rb index d0c91b60d..b8e328b33 100644 --- a/packages/platform-ios/native_modules.rb +++ b/packages/platform-ios/native_modules.rb @@ -42,7 +42,11 @@ def use_native_modules!(root = "..", packages = nil) existing_dep.name.split('/').first == spec.name end - pod spec.name, :path => File.dirname(podspec_path) + # Use relative path + absolute_path = File.dirname(podspec_path) + relative_path = '../' + absolute_path.partition('node_modules').last(2).join() + + pod spec.name, :path => relative_path if package_config["scriptPhases"] # Can be either an object, or an array of objects @@ -174,7 +178,7 @@ def pluralize(count) @podfile.use_native_modules('..', @config) @activated_pods.must_equal [{ name: "ios-dep", - options: { path: @ios_package["root"] } + options: { path: "../node_modules/react" } }] end From fb2496948749efb7207e7d68c4c42e007f46b70f Mon Sep 17 00:00:00 2001 From: maciej simka Date: Tue, 9 Jul 2019 08:48:11 +0200 Subject: [PATCH 2/2] fix: take into account other directory structures --- packages/platform-ios/native_modules.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/platform-ios/native_modules.rb b/packages/platform-ios/native_modules.rb index b8e328b33..e5243c211 100644 --- a/packages/platform-ios/native_modules.rb +++ b/packages/platform-ios/native_modules.rb @@ -43,10 +43,10 @@ def use_native_modules!(root = "..", packages = nil) end # Use relative path - absolute_path = File.dirname(podspec_path) - relative_path = '../' + absolute_path.partition('node_modules').last(2).join() + absolute_podspec_path = File.dirname(podspec_path) + relative_podspec_path = File.join(root, absolute_podspec_path.partition('node_modules').last(2).join()) - pod spec.name, :path => relative_path + pod spec.name, :path => relative_podspec_path if package_config["scriptPhases"] # Can be either an object, or an array of objects