pod-builder 4.4.1 → 4.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3b61237b9ba9ce8a64c815e9802ded560720e61fd602cbcba5a0e527350940c
4
- data.tar.gz: 738482aa4ba2c93fd51f7461b3fdbd12527877249eb9f5f3537fbc4f32a5a12b
3
+ metadata.gz: f7a2abe8fcb659b07c1a6819579093c791eca94d882888098e65c75c7ea9b260
4
+ data.tar.gz: f709a74f3bceee3acc9e57817706165c32693fbdc32b777b403c2257f9712889
5
5
  SHA512:
6
- metadata.gz: 92de40ca5a513bf4c7d4f9cbdd36f3fe4550bef9ee400473f567377c2f9f7041f90afddf98cad2c7aabe64e62eb95ba953024a1c7c93f09f5d965e4adb6f173e
7
- data.tar.gz: 4470fbee9ac31820c71a8892a027151474dc358b9c5a5b02ca25ac8def663ddc248284c6281b6271b83e40f42256f0648bc100ebb4153ca5a14a4530579e808a
6
+ metadata.gz: cc2172d216372bf012494106b70f93a6aaee0001e493a890067b7206020cb4340015766575f90b5e91ef736e1884dc16f93cd22749ae0cb6e82dce51a8d4fb53
7
+ data.tar.gz: baea42573bb858669fb0e91b1fc798301e88fee53808baab62247e89e89bdd068f2d11c65d8a5f8f6a64fbd029649fb9c6e93661618ea911851165d4155f0d66
@@ -65,6 +65,10 @@ module PodBuilder
65
65
  source_path_rel_path,
66
66
  development_pods_config_rel_path]
67
67
 
68
+ if Configuration.react_native_project
69
+ git_ignores.push("build/")
70
+ end
71
+
68
72
  File.write("#{OPTIONS[:prebuild_path]}/.gitignore", git_ignores.join("\n"))
69
73
  end
70
74
 
@@ -141,7 +145,7 @@ module PodBuilder
141
145
  expected_header_search_path_prefix = "\"HEADER_SEARCH_PATHS\" => \""
142
146
  raise "\n\nExpected header search path entry not found\n".red unless content.include?(expected_header_search_path_prefix)
143
147
 
144
- content.sub!(expected_header_search_path_prefix, "#{expected_header_search_path_prefix}\\\"$(PODS_ROOT)/Headers/Public/Flipper-Folly\\\" ")
148
+ content.sub!(expected_header_search_path_prefix, "#{expected_header_search_path_prefix}\\\"$(PODS_ROOT)/Headers/Public/Flipper-Folly\\\" \\\"$(PODS_ROOT)/../build/generated/ios\\\" ")
145
149
  File.write(paths[0], content)
146
150
  end
147
151
  end
@@ -176,6 +176,9 @@ module PodBuilder
176
176
  end
177
177
 
178
178
  PodBuilder::safe_rm_rf(basepath("Pods"))
179
+ if Configuration.react_native_project
180
+ PodBuilder::safe_rm_rf(basepath("build"))
181
+ end
179
182
  end
180
183
 
181
184
  def self.system_swift_version
@@ -198,8 +198,6 @@ module PodBuilder
198
198
  gitignored_files = PodBuilder::gitignoredfiles
199
199
 
200
200
  swift_version = PodBuilder::system_swift_version
201
-
202
- write_prebuilt_info_filename_gitattributes
203
201
 
204
202
  ret = Hash.new
205
203
  root_names = podfile_items.reject(&:is_prebuilt).map(&:root_name).uniq
@@ -441,14 +439,6 @@ module PodBuilder
441
439
  FileUtils.cp_r(PodBuilder::buildpath_dsympath, PodBuilder::basepath)
442
440
  end
443
441
  end
444
-
445
- def self.write_prebuilt_info_filename_gitattributes
446
- gitattributes_path = PodBuilder::basepath(".gitattributes")
447
- expected_attributes = ["#{Configuration.configuration_filename} binary"].join
448
- unless File.exists?(gitattributes_path) && File.read(gitattributes_path).include?(expected_attributes)
449
- File.write(gitattributes_path, expected_attributes, mode: 'a')
450
- end
451
- end
452
442
 
453
443
  def self.build_folder_hash_in_prebuilt_info_file(podfile_item)
454
444
  prebuilt_info_path = PodBuilder::prebuiltpath(File.join(podfile_item.root_name, Configuration.prebuilt_info_filename))
@@ -727,6 +727,15 @@ module PodBuilder
727
727
 
728
728
  def self.prepare_react_native_compilation_workarounds(podfile_content)
729
729
  return podfile_content + """
730
+
731
+ def prepare_rn_react_codegen
732
+ # Beginning with version 0.68.0 react native project compilation relies on some autogenerated files
733
+ # that are added to the React-Codegen target
734
+ source_path = \"#{PodBuilder::project_path}/build/generated/ios/.\"
735
+ destination_path = \"#{PodBuilder::basepath}/build/generated/ios\"
736
+ FileUtils.cp_r(source_path, destination_path)
737
+ end
738
+
730
739
  def prepare_rn_compilation_libevent
731
740
  path = \"Pods/libevent/include/event.h\"
732
741
  replace(path, \"#include <evutil.h>\", \"// #include <evutil.h>\")
@@ -745,11 +754,46 @@ def replace(path, find, replace)
745
754
  content = File.read(path).gsub(find, replace)
746
755
  File.write(path, content)
747
756
  end
748
- end
757
+ end
758
+
759
+ pre_install do |installer|
760
+ require 'json'
761
+
762
+ pods_path = \"#{PodBuilder::project_path}/Pods\"
763
+ j = JSON.parse(File.read(\"\#{pods_path}/Local Podspecs/FBReactNativeSpec.podspec.json\"))
764
+
765
+ output_files = j.dig(\"script_phases\", \"output_files\")
766
+
767
+ script_lines = j.dig(\"script_phases\", \"script\").split(\"\\n\")
768
+ script_lines.insert(0, \"export SCRIPT_OUTPUT_FILE_0=\\\"\#{output_files[0]}\\\"\")
769
+ script_lines.insert(0, \"export DERIVED_FILE_DIR=/tmp\")
770
+ script_lines.insert(0, \"export PODS_TARGET_SRCROOT=\\\"#{PodBuilder::project_path}/../node_modules/react-native/React/FBReactNativeSpec\\\"\")
771
+ script_lines.insert(0, \"export PODS_ROOT=\\\"\#{pods_path}\\\"\")
772
+
773
+ Dir.chdir(pods_path) do
774
+ cmd = script_lines.reject(&:blank?).join(\";\\n\")
775
+ system(cmd)
776
+ end
777
+ end
749
778
 
750
779
  post_install do |installer|
751
780
  prepare_rn_compilation_libevent()
752
781
  prepare_rn_flipper_module_redefinition()
782
+ prepare_rn_react_codegen()
783
+
784
+ installer.pods_project.targets.each do |target|
785
+ target.build_configurations.each do |config|
786
+ if target.name == 'React-Codegen'
787
+ config.build_settings['HEADER_SEARCH_PATHS'] = config.build_settings.fetch('HEADER_SEARCH_PATHS', []) + ['$(inherited)', '${PODS_ROOT}/Flipper-Folly', '${PODS_ROOT}/React-Core/ReactCommon', '$(PODS_ROOT)/React-Core/ReactCommon/react/renderer/graphics/platform/cxx', '$(PODS_ROOT)/React-Codegen/build/generated/ios']
788
+ end
789
+ if target.name == 'React-Core'
790
+ config.build_settings['HEADER_SEARCH_PATHS'] = config.build_settings.fetch('HEADER_SEARCH_PATHS', []) + ['$(inherited)', '${PODS_ROOT}/Flipper-Folly']
791
+ end
792
+ if target.name == 'React-CoreModules'
793
+ config.build_settings['HEADER_SEARCH_PATHS'] = config.build_settings.fetch('HEADER_SEARCH_PATHS', []) + ['$(inherited)', '${PODS_ROOT}/Flipper-Folly', '$(PODS_ROOT)/../build/generated/ios']
794
+ end
795
+ end
796
+ end
753
797
  end
754
798
  """
755
799
  end
@@ -1,3 +1,3 @@
1
1
  module PodBuilder
2
- VERSION = "4.4.1"
2
+ VERSION = "4.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
4
+ version: 4.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-31 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler