From c2088e1267439fd60d9e6abc8992d9ca3c2d7018 Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Fri, 10 Jun 2022 02:09:13 -0700 Subject: [PATCH] revert #33381 changes (#33973) Summary: https://github.com/facebook/yoga/pull/1150 is better than the tricky https://github.com/facebook/react-native/issues/33381 and fix the build error on react-native 0.69 with swift clang module. as https://github.com/facebook/yoga/pull/1150 is landed as https://github.com/facebook/react-native/commit/43f831b23caf22e59af5c6d3fdd62fed3d20d4ec, i'm reverting the previous change, only leaving the necessary react_native_pods.rb change. ## Changelog [iOS] [Changed] - Better fix for yoga + swift clang module build error Pull Request resolved: https://github.com/facebook/react-native/pull/33973 Test Plan: ci passed Reviewed By: cortinico, cipolleschi Differential Revision: D36998007 Pulled By: dmitryrykun fbshipit-source-id: fa11bd950e2a1be6396f286086f4e7941ad2ff5b --- ReactCommon/yoga/Yoga-umbrella.h | 21 --------------------- ReactCommon/yoga/Yoga.modulemap | 6 ------ ReactCommon/yoga/Yoga.podspec | 24 +++++------------------- 3 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 ReactCommon/yoga/Yoga-umbrella.h delete mode 100644 ReactCommon/yoga/Yoga.modulemap diff --git a/ReactCommon/yoga/Yoga-umbrella.h b/ReactCommon/yoga/Yoga-umbrella.h deleted file mode 100644 index 2e62c472a22b3e..00000000000000 --- a/ReactCommon/yoga/Yoga-umbrella.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - -#import "yoga/YGEnums.h" -#import "yoga/YGMacros.h" -#import "yoga/YGNode.h" -#import "yoga/YGStyle.h" -#import "yoga/YGValue.h" -#import "yoga/Yoga.h" - -FOUNDATION_EXPORT double yogaVersionNumber; -FOUNDATION_EXPORT const unsigned char yogaVersionString[]; diff --git a/ReactCommon/yoga/Yoga.modulemap b/ReactCommon/yoga/Yoga.modulemap deleted file mode 100644 index 54ea79247e1e52..00000000000000 --- a/ReactCommon/yoga/Yoga.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module yoga { - umbrella header "Yoga-umbrella.h" - - export * - module * { export * } -} diff --git a/ReactCommon/yoga/Yoga.podspec b/ReactCommon/yoga/Yoga.podspec index 8b2ef89961b1b5..8ddf0bdcee93ec 100644 --- a/ReactCommon/yoga/Yoga.podspec +++ b/ReactCommon/yoga/Yoga.podspec @@ -47,25 +47,11 @@ Pod::Spec.new do |spec| # Set this environment variable when *not* using the `:path` option to install the pod. # E.g. when publishing this spec to a spec repo. - source_files = 'yoga/**/*.{cpp,h}', 'Yoga-umbrella.h' - source_files = source_files.map { |file| File.join('ReactCommon/yoga', file) } if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] + source_files = 'yoga/**/*.{cpp,h}' + source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] spec.source_files = source_files - spec.module_map = 'Yoga.modulemap' - - # CocoaPods custom `module_map` + `header_dir` doesn't put the umbrella header in right place. - # Ideally, modulemap should be placed with the umbrella header, that would work for both use_frameworks! mode and non use_frameworks! mode. - # This script copy the umbrella header back to right place. - spec.script_phase = { - :name => 'Copy umbrella header', - :input_files => ["$PODS_ROOT/Headers/Public/Yoga/yoga/Yoga-umbrella.h"], - :output_files => ["$PODS_ROOT/Headers/Private/Yoga/Yoga-umbrella.h"], - :execution_position => :before_compile, - :shell_path => '/bin/bash', - - # In use_frameworks! mode, the umbrella header will by copied to right place. - # This copy command will fail because "$PODS_ROOT/Headers/Public/Yoga/yoga/Yoga-umbrella.h" doesn't exist. - # The command is just a no-op in use_frameworks! mode. - :script => 'cp -f "$PODS_ROOT/Headers/Public/Yoga/yoga/Yoga-umbrella.h" "$PODS_ROOT/Headers/Private/Yoga/Yoga-umbrella.h" || true', - } + header_files = 'yoga/*.h' + header_files = File.join('ReactCommon/yoga', header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] + spec.public_header_files = header_files end