-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
cocoapods_helpers.rb
99 lines (86 loc) · 2.64 KB
/
cocoapods_helpers.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# frozen_string_literal: true
# Helpers and configurations for integrating Gutenberg in Jetpack and WordPress via CocoaPods.
require_relative './version'
DEFAULT_GUTENBERG_LOCATION = File.join(__dir__, '..', '..', 'gutenberg-mobile')
# Note that the pods in this array might seem unused if you look for
# `import` statements in this codebase. However, make sure to also check
# whether they are used in the gutenberg-mobile and Gutenberg projects.
#
# See https://github.com/wordpress-mobile/gutenberg-mobile/issues/5025
DEPENDENCIES = %w[
FBLazyVector
React
ReactCommon
RCTRequired
RCTTypeSafety
React-Core
React-CoreModules
React-RCTActionSheet
React-RCTAnimation
React-RCTBlob
React-RCTImage
React-RCTLinking
React-RCTNetwork
React-RCTSettings
React-RCTText
React-RCTVibration
React-callinvoker
React-cxxreact
React-jsinspector
React-jsi
React-jsiexecutor
React-logger
React-perflogger
React-runtimeexecutor
boost
Yoga
RCT-Folly
glog
react-native-safe-area
react-native-safe-area-context
react-native-video
react-native-webview
RNSVG
react-native-slider
BVLinearGradient
react-native-get-random-values
react-native-blur
RNScreens
RNReanimated
RNGestureHandler
RNCMaskedView
RNCClipboard
RNFastImage
React-Codegen
React-bridging
].freeze
def gutenberg_pod(config: GUTENBERG_CONFIG)
options = config
local_gutenberg_key = 'LOCAL_GUTENBERG'
local_gutenberg = ENV.fetch(local_gutenberg_key, nil)
if local_gutenberg
options = { path: File.exist?(local_gutenberg) ? local_gutenberg : DEFAULT_GUTENBERG_LOCATION }
raise "Could not find Gutenberg pod at #{options[:path]}. You can configure the path using the #{local_gutenberg_key} environment variable." unless File.exist?(options[:path])
else
options[:git] = "https://github.com/#{GITHUB_ORG}/#{REPO_NAME}.git"
options[:submodules] = true
end
pod 'Gutenberg', options
pod 'RNTAztecView', options
gutenberg_dependencies(options: options)
end
def gutenberg_dependencies(options:)
if options[:path]
podspec_prefix = options[:path]
else
tag_or_commit = options[:tag] || options[:commit]
podspec_prefix = "https://raw.githubusercontent.com/#{GITHUB_ORG}/#{REPO_NAME}/#{tag_or_commit}"
end
podspec_prefix += '/third-party-podspecs'
podspec_extension = 'podspec.json'
# FBReactNativeSpec needs special treatment because of react-native-codegen code generation
pod 'FBReactNativeSpec', podspec: "#{podspec_prefix}/FBReactNativeSpec/FBReactNativeSpec.#{podspec_extension}"
DEPENDENCIES.each do |pod_name|
pod pod_name, podspec: "#{podspec_prefix}/#{pod_name}.#{podspec_extension}"
end
end