cocoapods 1.9.3 → 1.10.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +167 -5
  3. data/README.md +2 -1
  4. data/lib/cocoapods.rb +3 -1
  5. data/lib/cocoapods/command.rb +12 -2
  6. data/lib/cocoapods/command/lib/lint.rb +12 -3
  7. data/lib/cocoapods/command/repo/push.rb +1 -1
  8. data/lib/cocoapods/command/repo/update.rb +11 -0
  9. data/lib/cocoapods/command/spec/lint.rb +12 -3
  10. data/lib/cocoapods/config.rb +17 -0
  11. data/lib/cocoapods/downloader/cache.rb +2 -2
  12. data/lib/cocoapods/gem_version.rb +1 -1
  13. data/lib/cocoapods/generator/app_target_helper.rb +10 -2
  14. data/lib/cocoapods/generator/copy_dsyms_script.rb +56 -0
  15. data/lib/cocoapods/generator/copy_resources_script.rb +2 -14
  16. data/lib/cocoapods/generator/copy_xcframework_script.rb +245 -0
  17. data/lib/cocoapods/generator/embed_frameworks_script.rb +125 -212
  18. data/lib/cocoapods/generator/script_phase_constants.rb +99 -0
  19. data/lib/cocoapods/installer.rb +70 -3
  20. data/lib/cocoapods/installer/analyzer.rb +17 -8
  21. data/lib/cocoapods/installer/analyzer/target_inspection_result.rb +1 -1
  22. data/lib/cocoapods/installer/base_install_hooks_context.rb +135 -0
  23. data/lib/cocoapods/installer/installation_options.rb +5 -0
  24. data/lib/cocoapods/installer/pod_source_installer.rb +2 -1
  25. data/lib/cocoapods/installer/post_install_hooks_context.rb +1 -127
  26. data/lib/cocoapods/installer/post_integrate_hooks_context.rb +9 -0
  27. data/lib/cocoapods/installer/sandbox_dir_cleaner.rb +2 -1
  28. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +132 -111
  29. data/lib/cocoapods/installer/xcode/pods_project_generator.rb +45 -6
  30. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +13 -27
  31. data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +2 -1
  32. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_dependency_installer.rb +4 -4
  33. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +175 -58
  34. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +61 -30
  35. data/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb +3 -2
  36. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb +5 -7
  37. data/lib/cocoapods/installer/xcode/pods_project_generator_result.rb +19 -0
  38. data/lib/cocoapods/installer/xcode/target_validator.rb +1 -1
  39. data/lib/cocoapods/sources_manager.rb +2 -1
  40. data/lib/cocoapods/target.rb +44 -2
  41. data/lib/cocoapods/target/aggregate_target.rb +35 -0
  42. data/lib/cocoapods/target/build_settings.rb +84 -17
  43. data/lib/cocoapods/target/pod_target.rb +85 -11
  44. data/lib/cocoapods/user_interface/error_report.rb +1 -1
  45. data/lib/cocoapods/user_interface/inspector_reporter.rb +3 -10
  46. data/lib/cocoapods/validator.rb +32 -8
  47. data/lib/cocoapods/xcode/framework_paths.rb +1 -1
  48. data/lib/cocoapods/xcode/xcframework.rb +17 -4
  49. data/lib/cocoapods/xcode/xcframework/xcframework_slice.rb +81 -3
  50. metadata +30 -38
  51. data/lib/cocoapods/generator/prepare_artifacts_script.rb +0 -257
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.10.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-05-29 00:00:00.000000000 Z
14
+ date: 2020-07-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods-core
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.9.3
22
+ version: 1.10.0.beta.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.9.3
29
+ version: 1.10.0.beta.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +73,7 @@ dependencies:
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 1.2.2
76
+ version: 1.4.0
77
77
  - - "<"
78
78
  - !ruby/object:Gem::Version
79
79
  version: '2.0'
@@ -83,7 +83,7 @@ dependencies:
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 1.2.2
86
+ version: 1.4.0
87
87
  - - "<"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '2.0'
@@ -127,26 +127,6 @@ dependencies:
127
127
  - - "<"
128
128
  - !ruby/object:Gem::Version
129
129
  version: '2.0'
130
- - !ruby/object:Gem::Dependency
131
- name: cocoapods-stats
132
- requirement: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 1.0.0
137
- - - "<"
138
- - !ruby/object:Gem::Version
139
- version: '2.0'
140
- type: :runtime
141
- prerelease: false
142
- version_requirements: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 1.0.0
147
- - - "<"
148
- - !ruby/object:Gem::Version
149
- version: '2.0'
150
130
  - !ruby/object:Gem::Dependency
151
131
  name: cocoapods-trunk
152
132
  requirement: !ruby/object:Gem::Requirement
@@ -207,7 +187,7 @@ dependencies:
207
187
  requirements:
208
188
  - - ">="
209
189
  - !ruby/object:Gem::Version
210
- version: 1.14.0
190
+ version: 1.17.0
211
191
  - - "<"
212
192
  - !ruby/object:Gem::Version
213
193
  version: '2.0'
@@ -217,7 +197,7 @@ dependencies:
217
197
  requirements:
218
198
  - - ">="
219
199
  - !ruby/object:Gem::Version
220
- version: 1.14.0
200
+ version: 1.17.0
221
201
  - - "<"
222
202
  - !ruby/object:Gem::Version
223
203
  version: '2.0'
@@ -225,20 +205,14 @@ dependencies:
225
205
  name: activesupport
226
206
  requirement: !ruby/object:Gem::Requirement
227
207
  requirements:
228
- - - ">="
229
- - !ruby/object:Gem::Version
230
- version: 4.0.2
231
- - - "<"
208
+ - - ">"
232
209
  - !ruby/object:Gem::Version
233
210
  version: '5'
234
211
  type: :runtime
235
212
  prerelease: false
236
213
  version_requirements: !ruby/object:Gem::Requirement
237
214
  requirements:
238
- - - ">="
239
- - !ruby/object:Gem::Version
240
- version: 4.0.2
241
- - - "<"
215
+ - - ">"
242
216
  - !ruby/object:Gem::Version
243
217
  version: '5'
244
218
  - !ruby/object:Gem::Dependency
@@ -331,6 +305,20 @@ dependencies:
331
305
  - - "~>"
332
306
  - !ruby/object:Gem::Version
333
307
  version: '1.4'
308
+ - !ruby/object:Gem::Dependency
309
+ name: addressable
310
+ requirement: !ruby/object:Gem::Requirement
311
+ requirements:
312
+ - - "~>"
313
+ - !ruby/object:Gem::Version
314
+ version: '2.6'
315
+ type: :runtime
316
+ prerelease: false
317
+ version_requirements: !ruby/object:Gem::Requirement
318
+ requirements:
319
+ - - "~>"
320
+ - !ruby/object:Gem::Version
321
+ version: '2.6'
334
322
  - !ruby/object:Gem::Dependency
335
323
  name: bacon
336
324
  requirement: !ruby/object:Gem::Requirement
@@ -452,7 +440,9 @@ files:
452
440
  - lib/cocoapods/generator/app_target_helper.rb
453
441
  - lib/cocoapods/generator/bridge_support.rb
454
442
  - lib/cocoapods/generator/constant.rb
443
+ - lib/cocoapods/generator/copy_dsyms_script.rb
455
444
  - lib/cocoapods/generator/copy_resources_script.rb
445
+ - lib/cocoapods/generator/copy_xcframework_script.rb
456
446
  - lib/cocoapods/generator/dummy_source.rb
457
447
  - lib/cocoapods/generator/embed_frameworks_script.rb
458
448
  - lib/cocoapods/generator/file_list.rb
@@ -460,7 +450,7 @@ files:
460
450
  - lib/cocoapods/generator/info_plist_file.rb
461
451
  - lib/cocoapods/generator/module_map.rb
462
452
  - lib/cocoapods/generator/prefix_header.rb
463
- - lib/cocoapods/generator/prepare_artifacts_script.rb
453
+ - lib/cocoapods/generator/script_phase_constants.rb
464
454
  - lib/cocoapods/generator/umbrella_header.rb
465
455
  - lib/cocoapods/hooks_manager.rb
466
456
  - lib/cocoapods/installer.rb
@@ -474,11 +464,13 @@ files:
474
464
  - lib/cocoapods/installer/analyzer/specs_state.rb
475
465
  - lib/cocoapods/installer/analyzer/target_inspection_result.rb
476
466
  - lib/cocoapods/installer/analyzer/target_inspector.rb
467
+ - lib/cocoapods/installer/base_install_hooks_context.rb
477
468
  - lib/cocoapods/installer/installation_options.rb
478
469
  - lib/cocoapods/installer/pod_source_installer.rb
479
470
  - lib/cocoapods/installer/pod_source_preparer.rb
480
471
  - lib/cocoapods/installer/podfile_validator.rb
481
472
  - lib/cocoapods/installer/post_install_hooks_context.rb
473
+ - lib/cocoapods/installer/post_integrate_hooks_context.rb
482
474
  - lib/cocoapods/installer/pre_install_hooks_context.rb
483
475
  - lib/cocoapods/installer/project_cache/project_cache.rb
484
476
  - lib/cocoapods/installer/project_cache/project_cache_analysis_result.rb
@@ -553,7 +545,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
553
545
  requirements:
554
546
  - - ">="
555
547
  - !ruby/object:Gem::Version
556
- version: 2.0.0
548
+ version: 2.3.3
557
549
  required_rubygems_version: !ruby/object:Gem::Requirement
558
550
  requirements:
559
551
  - - ">="
@@ -1,257 +0,0 @@
1
- require 'cocoapods/xcode'
2
-
3
- module Pod
4
- module Generator
5
- class PrepareArtifactsScript
6
- # @return [Hash{String => Array<Pod::Xcode::XCFramework>}] Multiple lists of xcframeworks per
7
- # configuration.
8
- #
9
- attr_reader :xcframeworks_by_config
10
-
11
- # @return [Pathname] the root directory of the sandbox
12
- #
13
- attr_reader :sandbox_root
14
-
15
- # @return [Platform] the platform of the target for which this script will run
16
- #
17
- attr_reader :platform
18
-
19
- # @param [Hash{String => Array<Pod::Xcode::XCFramework>] xcframeworks_by_config
20
- # @see #xcframeworks_by_config
21
- #
22
- # @param [Pathname] sandbox_root
23
- # the sandbox root of the installation
24
- #
25
- # @param [Platform] platform
26
- # the platform of the target for which this script will run
27
- #
28
- def initialize(xcframeworks_by_config, sandbox_root, platform)
29
- @xcframeworks_by_config = xcframeworks_by_config
30
- @sandbox_root = sandbox_root
31
- @platform = platform
32
- end
33
-
34
- # Saves the resource script to the given pathname.
35
- #
36
- # @param [Pathname] pathname
37
- # The path where the embed frameworks script should be saved.
38
- #
39
- # @return [void]
40
- #
41
- def save_as(pathname)
42
- pathname.open('w') do |file|
43
- file.puts(script)
44
- end
45
- File.chmod(0o755, pathname.to_s)
46
- end
47
-
48
- # @return [String] The contents of the embed frameworks script.
49
- #
50
- def generate
51
- script
52
- end
53
-
54
- private
55
-
56
- # @!group Private Helpers
57
-
58
- # @return [String] The contents of the prepare artifacts script.
59
- #
60
- def script
61
- script = <<-SH.strip_heredoc
62
- #!/bin/sh
63
- set -e
64
- set -u
65
- set -o pipefail
66
-
67
- function on_error {
68
- echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
69
- }
70
- trap 'on_error $LINENO' ERR
71
-
72
- if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
73
- # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
74
- # frameworks to, so exit 0 (signalling the script phase was successful).
75
- exit 0
76
- fi
77
-
78
- # This protects against multiple targets copying the same framework dependency at the same time. The solution
79
- # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
80
- RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
81
-
82
- ARTIFACT_LIST_FILE="${BUILT_PRODUCTS_DIR}/cocoapods-artifacts-${CONFIGURATION}.txt"
83
- cat > $ARTIFACT_LIST_FILE
84
-
85
- BCSYMBOLMAP_DIR="BCSymbolMaps"
86
-
87
- record_artifact()
88
- {
89
- echo "$1" >> $ARTIFACT_LIST_FILE
90
- }
91
-
92
- install_artifact()
93
- {
94
- local source="$1"
95
- local destination="$2"
96
- local record=${3:-false}
97
-
98
- # Use filter instead of exclude so missing patterns don't throw errors.
99
- echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" \\"${source}\\" \\"${destination}\\""
100
- rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" "${source}" "${destination}"
101
-
102
- if [[ "$record" == "true" ]]; then
103
- artifact="${destination}/$(basename "$source")"
104
- record_artifact "$artifact"
105
- fi
106
- }
107
-
108
- # Copies a framework to derived data for use in later build phases
109
- install_framework()
110
- {
111
- if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
112
- local source="${BUILT_PRODUCTS_DIR}/$1"
113
- elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
114
- local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
115
- elif [ -r "$1" ]; then
116
- local source="$1"
117
- fi
118
-
119
- local record_artifact=${2:-true}
120
- local destination="${CONFIGURATION_BUILD_DIR}"
121
-
122
- if [ -L "${source}" ]; then
123
- echo "Symlinked..."
124
- source="$(readlink "${source}")"
125
- fi
126
-
127
- install_artifact "$source" "$destination" "$record_artifact"
128
-
129
- if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then
130
- # Locate and install any .bcsymbolmaps if present
131
- find "${source}/${BCSYMBOLMAP_DIR}/" -name "*.bcsymbolmap"|while read f; do
132
- install_artifact "$f" "$destination" "true"
133
- done
134
- fi
135
- }
136
-
137
- install_xcframework() {
138
- local basepath="$1"
139
- local dsym_folder="$2"
140
- local embed="$3"
141
- shift
142
- local paths=("$@")
143
-
144
- # Locate the correct slice of the .xcframework for the current architectures
145
- local target_path=""
146
- local target_arch="$ARCHS"
147
-
148
- # Replace spaces in compound architectures with _ to match slice format
149
- target_arch=${target_arch//\ /_}
150
-
151
- local target_variant=""
152
- if [[ "$PLATFORM_NAME" == *"simulator" ]]; then
153
- target_variant="simulator"
154
- fi
155
- if [[ ! -z ${EFFECTIVE_PLATFORM_NAME+x} && "$EFFECTIVE_PLATFORM_NAME" == *"maccatalyst" ]]; then
156
- target_variant="maccatalyst"
157
- fi
158
- for i in ${!paths[@]}; do
159
- if [[ "${paths[$i]}" == *"$target_arch"* ]] && [[ "${paths[$i]}" == *"$target_variant"* ]]; then
160
- # Found a matching slice
161
- echo "Selected xcframework slice ${paths[$i]}"
162
- target_path=${paths[$i]}
163
- break;
164
- fi
165
- done
166
-
167
- if [[ -z "$target_path" ]]; then
168
- echo "warning: [CP] Unable to find matching .xcframework slice in '${paths[@]}' for the current build architectures ($ARCHS)."
169
- return
170
- fi
171
-
172
- install_framework "$basepath/$target_path" "$embed"
173
-
174
- if [[ -z "$dsym_folder" || ! -d "$dsym_folder" ]]; then
175
- return
176
- fi
177
-
178
- dsyms=($(ls "$dsym_folder"))
179
-
180
- local target_dsym=""
181
- for i in ${!dsyms[@]}; do
182
- install_artifact "$dsym_folder/${dsyms[$i]}" "$CONFIGURATION_BUILD_DIR" "true"
183
- done
184
- }
185
-
186
- SH
187
- contents_by_config = Hash.new do |hash, key|
188
- hash[key] = ''
189
- end
190
- xcframeworks_by_config.each do |config, xcframeworks|
191
- next if xcframeworks.empty?
192
- xcframeworks.each do |xcframework|
193
- slices = xcframework.slices.select { |f| f.platform.symbolic_name == platform.symbolic_name }
194
- dynamic_slices, static_slices = slices.partition { |slice| Xcode::LinkageAnalyzer.dynamic_binary?(slice.binary_path) }
195
- next if dynamic_slices.empty? && static_slices.empty?
196
- unless dynamic_slices.empty?
197
- args = install_xcframework_args(xcframework.path, dynamic_slices, false)
198
- contents_by_config[config] << %( install_xcframework #{args}\n)
199
- end
200
-
201
- unless static_slices.empty?
202
- args = install_xcframework_args(xcframework.path, static_slices, true)
203
- contents_by_config[config] << %( install_xcframework #{args}\n)
204
- end
205
- end
206
- end
207
-
208
- script << "\n" unless contents_by_config.empty?
209
- contents_by_config.keys.sort.each do |config|
210
- contents = contents_by_config[config]
211
- next if contents.empty?
212
- script << %(if [[ "$CONFIGURATION" == "#{config}" ]]; then\n)
213
- script << contents
214
- script << "fi\n"
215
- end
216
-
217
- script << "\necho \"Artifact list stored at $ARTIFACT_LIST_FILE\"\n"
218
- script << "\ncat \"$ARTIFACT_LIST_FILE\"\n"
219
- script
220
- end
221
-
222
- def shell_escape(value)
223
- "\"#{value}\""
224
- end
225
-
226
- def install_xcframework_args(root, slices, static)
227
- args = [shell_escape("${PODS_ROOT}/#{root.relative_path_from(sandbox_root)}")]
228
- dsym_folder_arg = if (dsym_folder = PrepareArtifactsScript.dsym_folder(root))
229
- shell_escape("${PODS_ROOT}/#{dsym_folder.relative_path_from(sandbox_root)}")
230
- else
231
- '""'
232
- end
233
- args << dsym_folder_arg
234
- embed = static ? 'false' : 'true'
235
- args << shell_escape(embed)
236
- slices.each do |slice|
237
- args << shell_escape(slice.path.relative_path_from(root))
238
- end
239
- args.join(' ')
240
- end
241
-
242
- class << self
243
- # @param [Pathname] xcframework_path
244
- # the base path of the .xcframework bundle
245
- #
246
- # @return [Array<Pathname>] all found .dSYM paths
247
- #
248
- def dsym_folder(xcframework_path)
249
- basename = File.basename(xcframework_path, '.xcframework')
250
- dsym_basename = basename + '.dSYMs'
251
- path = xcframework_path.dirname + dsym_basename
252
- Pathname.new(path) if File.directory?(path)
253
- end
254
- end
255
- end
256
- end
257
- end