Skip to content

Commit caee457

Browse files
authored
Import most third party libraries as Swift packages (#23378)
2 parents e0fd9fd + 68cf81b commit caee457

File tree

253 files changed

+14788
-8496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+14788
-8496
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@ steps:
6262
- github_commit_status:
6363
context: "Unit Tests"
6464

65-
- label: "🔬 :wordpress: Tests {{ matrix }}"
66-
command: ".buildkite/commands/run-pod-tests.sh {{ matrix }}"
67-
plugins: [$CI_TOOLKIT_PLUGIN]
68-
artifact_paths:
69-
- "build/results/*"
70-
matrix:
71-
- WordPressKit
72-
- WordPressAuthenticator
73-
7465
#################
7566
# UI Tests
7667
#################

Podfile

Lines changed: 15 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,16 @@ inhibit_all_warnings!
1919
use_frameworks!
2020
workspace 'WordPress.xcworkspace'
2121

22-
## Pods shared between all the targets
23-
## ===================================
24-
##
25-
def wordpress_shared
26-
pod 'WordPressShared', '~> 2.3', '>= 2.3.1'
27-
# pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', branch: ''
28-
# pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', commit: ''
29-
# pod 'WordPressShared', path: '../WordPress-iOS-Shared'
30-
end
31-
3222
def aztec
3323
## When using a tagged version, feel free to comment out the WordPress-Aztec-iOS line below.
3424
## When using a commit number (during development) you should provide the same commit number for both pods.
3525
##
3626
# pod 'WordPress-Aztec-iOS', git: 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', commit: ''
3727
# pod 'WordPress-Editor-iOS', git: 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', commit: ''
3828
# pod 'WordPress-Editor-iOS', git: 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', tag: ''
39-
# pod 'WordPress-Editor-iOS', path: '../AztecEditor-iOS'
4029
pod 'WordPress-Editor-iOS', '~> 1.19.11'
4130
end
4231

43-
def wordpress_ui
44-
pod 'WordPressUI', '~> 1.16'
45-
# pod 'WordPressUI', git: 'https://github.com/wordpress-mobile/WordPressUI-iOS', tag: ''
46-
# pod 'WordPressUI', git: 'https://github.com/wordpress-mobile/WordPressUI-iOS', branch: ''
47-
# pod 'WordPressUI', git: 'https://github.com/wordpress-mobile/WordPressUI-iOS', commit: ''
48-
# pod 'WordPressUI', path: '../WordPressUI-iOS'
49-
end
50-
5132
def gravatar
5233
# pod 'Gravatar', path: '../Gravatar-SDK-iOS'
5334
# pod 'GravatarUI', path: '../Gravatar-SDK-iOS'
@@ -57,49 +38,9 @@ def gravatar
5738
pod 'GravatarUI', '2.0.0'
5839
end
5940

60-
def wordpress_kit
61-
pod 'WordPressKit', path: './WordPressKit', testspecs: ['Tests']
62-
end
63-
64-
def shared_with_all_pods
65-
wordpress_shared
66-
pod 'CocoaLumberjack/Swift', '~> 3.0'
67-
pod 'NSObject-SafeExpectations', '~> 0.0.4'
68-
end
69-
70-
def shared_with_networking_pods
71-
pod 'Reachability', '~> 3.7'
72-
73-
wordpress_kit
74-
end
75-
76-
def shared_test_pods
77-
pod 'OHHTTPStubs/Swift', '~> 9.1.0'
78-
pod 'OCMock', '~> 3.4.3'
79-
gutenberg_pod
80-
end
81-
82-
def shared_with_extension_pods
83-
shared_style_pods
84-
# The PrivacyInfo in this library is incorrectly copied to the app bundle's root directory.
85-
# That conflicts with the our own app's PrivacyInfo. We can update this library once the
86-
# issue is resolved.
87-
# See https://github.com/weichsel/ZIPFoundation/pull/314
88-
pod 'ZIPFoundation', '0.9.16'
89-
pod 'Down', '~> 0.6.6'
90-
end
91-
92-
def shared_style_pods
93-
pod 'Gridicons', '~> 1.2'
94-
end
95-
9641
abstract_target 'Apps' do
9742
project 'WordPress/WordPress.xcodeproj'
9843

99-
shared_with_all_pods
100-
shared_with_networking_pods
101-
shared_with_extension_pods
102-
10344
## Gutenberg (React Native)
10445
## =====================
10546
##
@@ -108,47 +49,27 @@ abstract_target 'Apps' do
10849
## Third party libraries
10950
## =====================
11051
##
111-
pod 'Gifu', '3.3.1'
11252

11353
app_center_version = '~> 5.0'
11454
app_center_configurations = %w[Release-Internal Release-Alpha]
11555
pod 'AppCenter', app_center_version, configurations: app_center_configurations
11656
pod 'AppCenter/Distribute', app_center_version, configurations: app_center_configurations
11757

118-
pod 'Starscream', '~> 4.0'
119-
pod 'SVProgressHUD', '2.2.5'
120-
pod 'ZendeskSupportSDK', '5.3.0'
121-
pod 'AlamofireImage', '~> 4.0'
12258
pod 'FSInteractiveMap', git: 'https://github.com/wordpress-mobile/FSInteractiveMap.git', tag: '0.2.0'
123-
pod 'JTAppleCalendar', '~> 8.0.5'
12459
pod 'CropViewController', '2.5.3'
12560

12661
## Automattic libraries
12762
## ====================
12863
##
129-
wordpress_kit
130-
wordpress_shared
13164
gravatar
13265

13366
# Production
13467

135-
pod 'Automattic-Tracks-iOS', '~> 3.3'
136-
# While in PR
137-
# pod 'Automattic-Tracks-iOS', git: 'https://github.com/Automattic/Automattic-Tracks-iOS.git', branch: ''
138-
# Local Development
139-
# pod 'Automattic-Tracks-iOS', path: '~/Projects/Automattic-Tracks-iOS'
140-
141-
pod 'NSURL+IDN', '~> 0.4'
142-
143-
pod 'WordPressAuthenticator', path: './WordPressAuthenticator', testspecs: ['Tests']
144-
14568
pod 'MediaEditor', '~> 1.2', '>= 1.2.2'
14669
# pod 'MediaEditor', git: 'https://github.com/wordpress-mobile/MediaEditor-iOS.git', commit: ''
14770
# pod 'MediaEditor', path: '../MediaEditor-iOS'
14871

14972
aztec
150-
wordpress_ui
151-
shared_style_pods
15273

15374
## WordPress App iOS
15475
## =================
@@ -157,7 +78,7 @@ abstract_target 'Apps' do
15778
target 'WordPressTest' do
15879
inherit! :search_paths
15980

160-
shared_test_pods
81+
gutenberg_pod
16182
end
16283
end
16384

@@ -173,23 +94,13 @@ end
17394
target 'WordPressShareExtension' do
17495
project 'WordPress/WordPress.xcodeproj'
17596

176-
shared_with_extension_pods
177-
17897
aztec
179-
shared_with_all_pods
180-
shared_with_networking_pods
181-
wordpress_ui
18298
end
18399

184100
target 'JetpackShareExtension' do
185101
project 'WordPress/WordPress.xcodeproj'
186102

187-
shared_with_extension_pods
188-
189103
aztec
190-
shared_with_all_pods
191-
shared_with_networking_pods
192-
wordpress_ui
193104
end
194105

195106
## DraftAction Extension
@@ -198,83 +109,13 @@ end
198109
target 'WordPressDraftActionExtension' do
199110
project 'WordPress/WordPress.xcodeproj'
200111

201-
shared_with_extension_pods
202-
203112
aztec
204-
shared_with_all_pods
205-
shared_with_networking_pods
206-
wordpress_ui
207113
end
208114

209115
target 'JetpackDraftActionExtension' do
210116
project 'WordPress/WordPress.xcodeproj'
211117

212-
shared_with_extension_pods
213-
214118
aztec
215-
shared_with_all_pods
216-
shared_with_networking_pods
217-
wordpress_ui
218-
end
219-
220-
## Widgets
221-
## ============
222-
##
223-
224-
target 'JetpackStatsWidgets' do
225-
project 'WordPress/WordPress.xcodeproj'
226-
227-
shared_with_all_pods
228-
shared_with_networking_pods
229-
shared_style_pods
230-
231-
wordpress_ui
232-
end
233-
234-
## Intents
235-
## ============
236-
##
237-
238-
target 'JetpackIntents' do
239-
project 'WordPress/WordPress.xcodeproj'
240-
241-
shared_with_all_pods
242-
shared_with_networking_pods
243-
244-
wordpress_ui
245-
end
246-
247-
## Notification Service Extension
248-
## ==============================
249-
##
250-
target 'WordPressNotificationServiceExtension' do
251-
project 'WordPress/WordPress.xcodeproj'
252-
253-
wordpress_kit
254-
wordpress_shared
255-
wordpress_ui
256-
end
257-
258-
target 'JetpackNotificationServiceExtension' do
259-
project 'WordPress/WordPress.xcodeproj'
260-
261-
wordpress_kit
262-
wordpress_shared
263-
wordpress_ui
264-
end
265-
266-
## Screenshot Generation
267-
## ===================
268-
##
269-
target 'WordPressScreenshotGeneration' do
270-
project 'WordPress/WordPress.xcodeproj'
271-
end
272-
273-
## UI Tests
274-
## ===================
275-
##
276-
target 'WordPressUITests' do
277-
project 'WordPress/WordPress.xcodeproj'
278119
end
279120

280121
## Tools
@@ -297,25 +138,28 @@ end
297138
# Make all pods that are not shared across multiple targets into static frameworks by overriding the static_framework? function to return true
298139
# Linking the shared frameworks statically would lead to duplicate symbols
299140
# A future version of CocoaPods may make this easier to do. See https://github.com/CocoaPods/CocoaPods/issues/7428
300-
shared_targets = ['WordPressFlux']
141+
shared_targets = %w[WordPressFlux]
142+
dyanmic_framework_pods = %w[WordPressFlux]
143+
# Statically linking Sentry results in a conflict with `NSDictionary.objectAtKeyPath`, but dynamically
144+
# linking it resolves this.
145+
dyanmic_framework_pods += %w[Sentry SentryPrivate]
301146
pre_install do |installer|
302147
static = []
303148
dynamic = []
304149
installer.pod_targets.each do |pod|
305-
# Statically linking Sentry results in a conflict with `NSDictionary.objectAtKeyPath`, but dynamically
306-
# linking it resolves this.
307-
if %w[Sentry SentryPrivate].include? pod.name
308-
dynamic << pod
309-
next
310-
end
150+
use_dynamic_frameworks = false
151+
use_dynamic_frameworks = true if dyanmic_framework_pods.include? pod.name
311152

312153
# If this pod is a dependency of one of our shared targets, it must be linked dynamically
313-
if pod.target_definitions.any? { |t| shared_targets.include? t.name }
154+
use_dynamic_frameworks = true if pod.target_definitions.any? { |t| shared_targets.include? t.name }
155+
156+
if use_dynamic_frameworks
314157
dynamic << pod
315-
next
158+
pod.instance_variable_set(:@build_type, Pod::BuildType.dynamic_framework)
159+
else
160+
static << pod
161+
pod.instance_variable_set(:@build_type, Pod::BuildType.static_framework)
316162
end
317-
static << pod
318-
pod.instance_variable_set(:@build_type, Pod::BuildType.static_framework)
319163
end
320164
puts "Installing #{static.count} pods as static frameworks"
321165
puts "Installing #{dynamic.count} pods as dynamic frameworks"
@@ -396,16 +240,6 @@ post_install do |installer|
396240
end
397241
# rubocop:enable Style/CombinableLoops
398242

399-
# Flag Alpha builds for Tracks
400-
# ============================
401-
#
402-
tracks_target = installer.pods_project.targets.find { |target| target.name == 'Automattic-Tracks-iOS' }
403-
# This will crash if/when we'll remove Tracks.
404-
# That's okay because it is a crash we'll only have to address once.
405-
tracks_target.build_configurations.each do |config|
406-
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'ALPHA=1'] if (config.name == 'Release-Alpha') || (config.name == 'Release-Internal')
407-
end
408-
409243
yellow_marker = "\033[33m"
410244
reset_marker = "\033[0m"
411245
puts "#{yellow_marker}The abstract target warning below is expected. Feel free to ignore it.#{reset_marker}"

0 commit comments

Comments
 (0)