Sha256: 04f82c4ac6d7a9a81abdc7ffb659ecb09c59452b95136413d3e99dc575a11990

Contents?: true

Size: 1.72 KB

Versions: 12

Compression:

Stored size: 1.72 KB

Contents

require 'cocoapods'
require 'cocoapods-fix-react-native/helpers/root_helper'

# Obtain the React Native root directory
$root = get_root

# Detect CocoaPods + Frameworks
$has_frameworks = File.exists?'Pods/Target Support Files/React/React-umbrella.h'

# Detect source file dependency in the generated Pods.xcodeproj workspace sub-project
def has_pods_project_source_file(source_filename)
  pods_project = 'Pods/Pods.xcodeproj/project.pbxproj'
  File.open(pods_project).grep(/#{source_filename}/).any?
end

# Detect dependent source file required for building when the given source file is present
def meets_pods_project_source_dependency(source_filename, dependent_source_filename)
  has_pods_project_source_file(source_filename) ? has_pods_project_source_file(dependent_source_filename) : true
end

def detect_missing_subspec_dependency(subspec_name, source_filename, dependent_source_filename)
  unless meets_pods_project_source_dependency(source_filename, dependent_source_filename)
    Pod::UI.warn "#{subspec_name} subspec may be required given your current dependencies"
  end
end

def detect_missing_subspecs
  return unless $has_frameworks

  # For CocoaPods + Frameworks, RCTNetwork and CxxBridge subspecs are necessary for DevSupport.
  # When the React pod is generated it must include all the required source, and see umbrella deps.
  detect_missing_subspec_dependency('RCTNetwork', 'RCTBlobManager.mm', 'RCTNetworking.mm')
  detect_missing_subspec_dependency('CxxBridge', 'RCTJavaScriptLoader.mm', 'RCTCxxBridge.mm')

  # RCTText itself shouldn't require DevSupport, but it depends on Core -> RCTDevSettings -> RCTPackagerClient
  detect_missing_subspec_dependency('DevSupport', 'RCTDevSettings.mm', 'RCTPackagerClient.m')
end

detect_missing_subspecs

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cocoapods-fix-react-native-2019.09.17.15 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2019.03.19.11 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2019.02.11.19 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2019.01.26.16 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2019.01.16.18 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.12.08.00 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.12.02.17 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.11.13.19 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.10.31.23 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.10.13.14 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.10.12.20 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb
cocoapods-fix-react-native-2018.09.18.17 lib/cocoapods-fix-react-native/versions/0_57_0-post.rb