Entirely control Flipper being enabled through Podfile (#1086)
Summary: Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). Finally, this PR also includes a commit [to fix the current builds](https://github.com/facebook/flipper/pull/1086/files#r418526812). ## Changelog > Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/flipper/pull/1086 Test Plan: I have built and ran the Sample application, as well as used this version of Flipper with a new RN app built from `master`. Reviewed By: passy Differential Revision: D21381828 Pulled By: priteshrnandgaonkar fbshipit-source-id: edf6dae28eb02336a49e8230654d6186360ea8d6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
63a512a910
commit
c393ee9421
@@ -4,50 +4,22 @@ source 'https://github.com/CocoaPods/Specs'
|
||||
|
||||
target 'Sample' do
|
||||
platform :ios, '9.0'
|
||||
pod 'FlipperKit', :path => '../../FlipperKit.podspec'
|
||||
pod 'FlipperKit/FlipperKitLayoutComponentKitSupport', :path => '../../FlipperKit.podspec'
|
||||
pod 'FlipperKit/SKIOSNetworkPlugin', :path => '../../FlipperKit.podspec'
|
||||
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', :path => '../../FlipperKit.podspec'
|
||||
pod 'FlipperKit/FlipperKitExamplePlugin', :path => '../../FlipperKit.podspec'
|
||||
pod 'FlipperKit/FlipperKitReactPlugin', :path => '../../FlipperKit.podspec'
|
||||
pod 'Flipper', :path => '../../Flipper.podspec'
|
||||
|
||||
# If you use `use_frameworks!` in your Podfile,
|
||||
# uncomment the below $static_framework array and also
|
||||
# the pre_install section. This will cause Flipper and
|
||||
# it's dependencies to be built as a static library and all other pods to
|
||||
# be dynamic.
|
||||
# $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
|
||||
# 'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion',
|
||||
# 'glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
|
||||
# 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']
|
||||
#
|
||||
# pre_install do |installer|
|
||||
# Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
|
||||
# installer.pod_targets.each do |pod|
|
||||
# if $static_framework.include?(pod.name)
|
||||
# def pod.build_type;
|
||||
# Pod::Target::BuildType.static_library
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# It also adds -DFB_SONARKIT_ENABLED=1 flag to OTHER_CFLAGS, necessary to build expose Flipper classes in the header files
|
||||
post_install do |installer|
|
||||
file_name = Dir.glob("*.xcodeproj")[0]
|
||||
app_project = Xcodeproj::Project.open(file_name)
|
||||
app_project.native_targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
|
||||
unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
|
||||
puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
|
||||
cflags << '-DFB_SONARKIT_ENABLED=1'
|
||||
end
|
||||
config.build_settings['OTHER_CFLAGS'] = cflags
|
||||
end
|
||||
app_project.save
|
||||
end
|
||||
installer.pods_project.save
|
||||
end
|
||||
# See docs/getting-started/ios-native.mdx
|
||||
pod 'FlipperKit', :path => '../../FlipperKit.podspec', :configuration => 'Debug'
|
||||
pod 'FlipperKit/FlipperKitLayoutComponentKitSupport', :path => '../../FlipperKit.podspec', :configuration => 'Debug'
|
||||
pod 'FlipperKit/SKIOSNetworkPlugin', :path => '../../FlipperKit.podspec', :configuration => 'Debug'
|
||||
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', :path => '../../FlipperKit.podspec', :configuration => 'Debug'
|
||||
pod 'FlipperKit/FlipperKitExamplePlugin', :path => '../../FlipperKit.podspec', :configuration => 'Debug'
|
||||
pod 'FlipperKit/FlipperKitReactPlugin', :path => '../../FlipperKit.podspec', :configuration => 'Debug'
|
||||
pod 'Flipper', :path => '../../Flipper.podspec', :configuration => 'Debug'
|
||||
pod 'Flipper-DoubleConversion', :configuration => 'Debug'
|
||||
pod 'Flipper-Folly', :configuration => 'Debug'
|
||||
pod 'Flipper-Glog', :configuration => 'Debug'
|
||||
pod 'Flipper-PeerTalk', :configuration => 'Debug'
|
||||
pod 'CocoaLibEvent', :configuration => 'Debug'
|
||||
pod 'boost-for-react-native', :configuration => 'Debug'
|
||||
pod 'OpenSSL-Universal', :configuration => 'Debug'
|
||||
pod 'CocoaAsyncSocket', :configuration => 'Debug'
|
||||
pod 'ComponentKit', '~> 0.30'
|
||||
end
|
||||
|
||||
@@ -331,17 +331,12 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = BDF8FF7C018FDB3437209993 /* Pods-Sample.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
"COCOAPODS=1",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
@@ -368,41 +363,6 @@
|
||||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
|
||||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
|
||||
);
|
||||
OTHER_CFLAGS = (
|
||||
"$(inherited)",
|
||||
"-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/FlipperKit/FlipperKit.modulemap\"",
|
||||
"-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/yoga/Yoga.modulemap\"",
|
||||
"-fmodule-map-file=\"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit/YogaKit.modulemap\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/CocoaLibEvent\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/ComponentKit\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/Flipper\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/FlipperKit\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/Folly\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/OpenSSL-Static\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/PeerTalk\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/RSocket\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/Yoga\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/YogaKit\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/glog\"",
|
||||
"-DFB_SONARKIT_ENABLED=1",
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-Wno-implicit-retain-self",
|
||||
@@ -435,7 +395,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 081A9FC23643CD21C7D61AA1 /* Pods-Sample.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@@ -468,41 +427,6 @@
|
||||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
|
||||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
|
||||
);
|
||||
OTHER_CFLAGS = (
|
||||
"$(inherited)",
|
||||
"-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/FlipperKit/FlipperKit.modulemap\"",
|
||||
"-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/yoga/Yoga.modulemap\"",
|
||||
"-fmodule-map-file=\"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit/YogaKit.modulemap\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/CocoaLibEvent\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/ComponentKit\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/Flipper\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/FlipperKit\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/Folly\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/OpenSSL-Static\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/PeerTalk\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/RSocket\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/Yoga\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/YogaKit\"",
|
||||
"-isystem",
|
||||
"\"${PODS_ROOT}/Headers/Public/glog\"",
|
||||
"-DFB_SONARKIT_ENABLED=1",
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-Wno-implicit-retain-self",
|
||||
|
||||
Reference in New Issue
Block a user