cocoapods 1.4.0 → 1.5.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +149 -0
  3. data/lib/cocoapods.rb +1 -0
  4. data/lib/cocoapods/command/outdated.rb +2 -2
  5. data/lib/cocoapods/command/repo/push.rb +5 -0
  6. data/lib/cocoapods/command/update.rb +21 -5
  7. data/lib/cocoapods/gem_version.rb +1 -1
  8. data/lib/cocoapods/generator/acknowledgements.rb +6 -3
  9. data/lib/cocoapods/generator/constant.rb +19 -0
  10. data/lib/cocoapods/generator/copy_resources_script.rb +15 -3
  11. data/lib/cocoapods/generator/embed_frameworks_script.rb +11 -2
  12. data/lib/cocoapods/generator/module_map.rb +56 -5
  13. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +19 -13
  14. data/lib/cocoapods/generator/xcconfig/pod_xcconfig.rb +4 -6
  15. data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +25 -2
  16. data/lib/cocoapods/installer.rb +17 -8
  17. data/lib/cocoapods/installer/analyzer.rb +48 -38
  18. data/lib/cocoapods/installer/analyzer/analysis_result.rb +11 -0
  19. data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +7 -6
  20. data/lib/cocoapods/installer/analyzer/pod_variant.rb +8 -8
  21. data/lib/cocoapods/installer/analyzer/pod_variant_set.rb +3 -3
  22. data/lib/cocoapods/installer/analyzer/podfile_dependency_cache.rb +54 -0
  23. data/lib/cocoapods/installer/analyzer/specs_state.rb +16 -16
  24. data/lib/cocoapods/installer/analyzer/target_inspector.rb +7 -11
  25. data/lib/cocoapods/installer/pod_source_installer.rb +2 -3
  26. data/lib/cocoapods/installer/podfile_validator.rb +11 -10
  27. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +72 -28
  28. data/lib/cocoapods/installer/xcode/pods_project_generator.rb +8 -2
  29. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +9 -0
  30. data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +32 -24
  31. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +97 -54
  32. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +9 -11
  33. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +4 -9
  34. data/lib/cocoapods/installer/xcode/target_validator.rb +32 -18
  35. data/lib/cocoapods/project.rb +32 -17
  36. data/lib/cocoapods/resolver.rb +59 -31
  37. data/lib/cocoapods/resolver/lazy_specification.rb +28 -18
  38. data/lib/cocoapods/sandbox.rb +2 -4
  39. data/lib/cocoapods/sandbox/file_accessor.rb +25 -9
  40. data/lib/cocoapods/sandbox/headers_store.rb +31 -6
  41. data/lib/cocoapods/sandbox/path_list.rb +36 -46
  42. data/lib/cocoapods/target.rb +7 -4
  43. data/lib/cocoapods/target/aggregate_target.rb +10 -8
  44. data/lib/cocoapods/target/pod_target.rb +87 -20
  45. data/lib/cocoapods/user_interface/error_report.rb +1 -1
  46. data/lib/cocoapods/user_interface/inspector_reporter.rb +4 -4
  47. data/lib/cocoapods/validator.rb +40 -29
  48. metadata +11 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ef975b90a00794720b4ee7f518780d588916450692e9c8316337cb7035d0714
4
- data.tar.gz: '048a8ba73eeb3b2630dca90ce7d1dd2f04f9ce68f045f025ed21249c496448d0'
3
+ metadata.gz: 23ada42af2f965ab38a89ef0b7c1c131f23efb03297f118b9804a4232a59b791
4
+ data.tar.gz: f4f83b2e947828dec6f070c7f500261a8ee787f754e839ce76d82cecb93bf6bb
5
5
  SHA512:
6
- metadata.gz: c71ca98c34dcfac5cec43b9bb2fc16726d5d190b0a6f34d49d06f4189b86d6997b965cf04018b756324597643a35b4df6b5482dc71c06c2d45019fe722d1f676
7
- data.tar.gz: 9a8521c02a86e9056bc1b8387297b95694e60e2c314cfcac2b5c8b54ccd4a1a8f575f3e6317b5301d7ff5ef94e1e1e88e8f9ea44a619bcec5f72ef03a312b903
6
+ metadata.gz: 517bac4e5a5b1c9db7920e7d98672388d723e210144be3e25389b938b4d5cd7e958d9c82eb66e2a66ccde6f333f074ade23d64c24cc0a698b7eef3e2d69d3f04
7
+ data.tar.gz: d328813a70d9b5bb595a58c1995687efdf14667161b6de54448ea78fc03a8602a45dd7b08fc6b4ffd5ed412d71e6ba9dfdc06a40cef57096415cf4fcb2f151b1
@@ -4,6 +4,155 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
4
4
 
5
5
  To install release candidates run `[sudo] gem install cocoapods --pre`
6
6
 
7
+ ## 1.5.0.beta.1 (2018-03-23)
8
+
9
+ ##### Enhancements
10
+
11
+ * Add `--exclude-pods` option to `pod update` to allow excluding specific pods from update
12
+ [Oleksandr Kruk](https://github.com/0mega)
13
+ [#7334](https://github.com/CocoaPods/CocoaPods/issues/7334)
14
+
15
+ * Add support for mixed Objective-C and Swift static frameworks
16
+ [Paul Beusterien](https://github.com/paulb777)
17
+ [#7213](https://github.com/CocoaPods/CocoaPods/issues/7213)
18
+
19
+ * Improve `pod install` performance for pods with exact file paths rather than glob patterns
20
+ [Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
21
+ [#7473](https://github.com/CocoaPods/CocoaPods/pull/7473)
22
+
23
+ * Display a message when a pods source has changed during installation
24
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
25
+ [#7464](https://github.com/CocoaPods/CocoaPods/pull/7464)
26
+
27
+ * Add support for modular header search paths, include "legacy" support.
28
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
29
+ [#7412](https://github.com/CocoaPods/CocoaPods/pull/7412)
30
+
31
+ * Set direct and transitive dependency header search paths for pod targets
32
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
33
+ [#7116](https://github.com/CocoaPods/CocoaPods/pull/7116)
34
+
35
+ * Log target names missing host for libraries
36
+ [Keith Smiley](https://github.com/keith)
37
+ [#7346](https://github.com/CocoaPods/CocoaPods/pull/7346)
38
+
39
+ * Add a `--no-overwrite` flag to `pod repo push` to disable overwriting
40
+ existing specs that have already been pushed.
41
+ [Samuel Giddins](https://github.com/segiddins)
42
+
43
+ * Store which specs repo a pod comes from in the lockfile.
44
+ [Samuel Giddins](https://github.com/segiddins)
45
+
46
+ * Add `set -u` to the copy frameworks and copy resources scripts.
47
+ [Keith Smiley](https://github.com/keith)
48
+ [#7180](https://github.com/CocoaPods/CocoaPods/pull/7180)
49
+
50
+ * Allow integrating into static library targets without attempting to copy
51
+ resources or embed frameworks unless `UNLOCALIZED_RESOURCES_FOLDER_PATH`
52
+ or `FRAMEWORKS_FOLDER_PATH` is set.
53
+ [Samuel Giddins](https://github.com/segiddins)
54
+
55
+ * Change color scheme of `pod outdated` from red-yellow-green to red-blue-green to be more colorblind friendly
56
+ [iv-mexx](https://github.com/iv-mexx)
57
+ [#7372](https://github.com/CocoaPods/CocoaPods/issues/7372)
58
+
59
+ * Add support for integrating swift pods as static libraries.
60
+ [Danielle Tomlinson](https://github.com/dantoml)
61
+ [Samuel Giddins](https://github.com/segiddins)
62
+ [#6899](https://github.com/CocoaPods/CocoaPods/issues/6899)
63
+
64
+ * Document format of POD_NAMES in pod update
65
+ [mrh-is](https://github.com/mrh-is)
66
+
67
+ * Update validator to stream output as xcodebuild runs
68
+ [abbeycode](https://github.com/abbeycode)
69
+ [#7040](https://github.com/CocoaPods/CocoaPods/issues/7040)
70
+
71
+ ##### Bug Fixes
72
+
73
+ * Create a generic Info.plist file for test targets
74
+ Use xcode default `PRODUCT_MODULE_NAME` for generated test targets
75
+ [Paul Zabelin](https://github.com/paulz)
76
+ [#7506](https://github.com/CocoaPods/CocoaPods/issues/7506)
77
+
78
+ * Prevent `xcassets` compilation from stomping over the apps `xcassets`
79
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
80
+ [#7003](https://github.com/CocoaPods/CocoaPods/issues/7003)
81
+
82
+ * Fix script phase output path for `.xcasset` resources
83
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
84
+ [#7511](https://github.com/CocoaPods/CocoaPods/issues/7511)
85
+
86
+ * Fix `PRODUCT_MODULE_NAME` for generated test targets
87
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
88
+ [#7507](https://github.com/CocoaPods/CocoaPods/issues/7507)
89
+
90
+ * Ensure `SWIFT_VERSION` is set for test only pod targets during validation
91
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
92
+ [#7498](https://github.com/CocoaPods/CocoaPods/issues/7498)
93
+
94
+ * Fix iOS test native target signing settings
95
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
96
+ [#7504](https://github.com/CocoaPods/CocoaPods/pull/7504)
97
+
98
+ * Clear input/output paths if they exceed an arbitrary limit
99
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
100
+ [#7362](https://github.com/CocoaPods/CocoaPods/issues/7362)
101
+
102
+ * Warn instead of throwing an exception when a development pod specifies an invalid license file path
103
+ [Eric Amorde](https://github.com/amorde)
104
+ [#7377](https://github.com/CocoaPods/CocoaPods/issues/7377)
105
+
106
+ * Better static frameworks transitive dependency error checking
107
+ [Paul Beusterien](https://github.com/paulb777)
108
+ [#7352](https://github.com/CocoaPods/CocoaPods/issues/7352)
109
+
110
+ * Always update input/output paths even if they are empty
111
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
112
+ [#7368](https://github.com/CocoaPods/CocoaPods/pull/7368)
113
+
114
+ * Unique all available pre-release versions when displaying
115
+ [Samuel Giddins](https://github.com/segiddins)
116
+ [#7353](https://github.com/CocoaPods/CocoaPods/pull/7353)
117
+
118
+ * Do not attempt compilation for pods with no sources and skipping import validation
119
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
120
+ [#7336](https://github.com/CocoaPods/CocoaPods/issues/7336)
121
+
122
+ * Avoid adding copy resources and frameworks script phases when those phases
123
+ would not copy anything.
124
+ [Keith Smiley](https://github.com/keith)
125
+ [Samuel Giddins](https://github.com/segiddins)
126
+
127
+ * Speed up `pod install` times by up to 50% for very large project.
128
+ [Samuel Giddins](https://github.com/segiddins)
129
+
130
+ * Avoid dependency resolution conflicts when a pod depends upon a local pod.
131
+ [Samuel Giddins](https://github.com/segiddins)
132
+
133
+ * Fix legacy header search paths that broke due to #7116 and #7412.
134
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
135
+ [#7445](https://github.com/CocoaPods/CocoaPods/pull/7445)
136
+
137
+ * Stop adding header search paths that do not contain any headers.
138
+ [Samuel Giddins](https://github.com/segiddins)
139
+
140
+ * Do not warn when http source uses `file:///` URI scheme
141
+ [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
142
+ [#7460](https://github.com/CocoaPods/CocoaPods/issues/7460)
143
+
144
+ * Remove bogus `PROVISIONING_PROFILE_SPECIFIER` value from Pods project.
145
+ [Ruenzuo](https://github.com/Ruenzuo)
146
+ [#6964](https://github.com/CocoaPods/CocoaPods/issues/6964)
147
+
148
+ * Fix returning absolute paths from glob, fixes issue with static framework and public headers.
149
+ [Morgan McKenzie](https://github.com/rmtmckenzie)
150
+ [#7463](https://github.com/CocoaPods/CocoaPods/issues/7463)
151
+
152
+ * Improve messages when integrating Swift pods as static libraries.
153
+ [Marcelo Fabri](https://github.com/marcelofabri)
154
+ [#7495](https://github.com/CocoaPods/CocoaPods/issues/7495)
155
+
7
156
  ## 1.4.0 (2018-01-18)
8
157
 
9
158
  ##### Enhancements
@@ -57,6 +57,7 @@ module Pod
57
57
  autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
58
58
  autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
59
59
  autoload :BridgeSupport, 'cocoapods/generator/bridge_support'
60
+ autoload :Constant, 'cocoapods/generator/constant'
60
61
  autoload :CopyResourcesScript, 'cocoapods/generator/copy_resources_script'
61
62
  autoload :DummySource, 'cocoapods/generator/dummy_source'
62
63
  autoload :EmbedFrameworksScript, 'cocoapods/generator/embed_frameworks_script'
@@ -24,13 +24,13 @@ module Pod
24
24
  else
25
25
  UI.section 'The color indicates what happens when you run `pod update`' do
26
26
  UI.puts "#{'<green>'.green}\t\t - Will be updated to the newest version"
27
- UI.puts "#{'<yellow>'.yellow}\t - Will be updated, but not to the newest version because of specified version in Podfile"
27
+ UI.puts "#{'<blue>'.blue}\t - Will be updated, but not to the newest version because of specified version in Podfile"
28
28
  UI.puts "#{'<red>'.red}\t\t - Will not be updated because of specified version in Podfile"
29
29
  UI.puts ''
30
30
  end
31
31
  UI.section 'The following pod updates are available:' do
32
32
  updates.each do |(name, from_version, matching_version, to_version)|
33
- color = :yellow
33
+ color = :blue
34
34
  if matching_version == to_version
35
35
  color = :green
36
36
  elsif from_version == matching_version
@@ -36,6 +36,7 @@ module Pod
36
36
  ['--use-json', 'Push JSON spec to repo'],
37
37
  ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used when linting the spec. ' \
38
38
  'This takes precedence over a .swift-version file.'],
39
+ ['--no-overwrite', 'Disallow pushing that would overwrite an existing spec.'],
39
40
  ].concat(super)
40
41
  end
41
42
 
@@ -54,6 +55,7 @@ module Pod
54
55
  @swift_version = argv.option('swift-version', nil)
55
56
  @skip_import_validation = argv.flag?('skip-import-validation', false)
56
57
  @skip_tests = argv.flag?('skip-tests', false)
58
+ @allow_overwrite = argv.flag?('overwrite', true)
57
59
  super
58
60
  end
59
61
 
@@ -183,6 +185,9 @@ module Pod
183
185
  if @message && !@message.empty?
184
186
  message = @message
185
187
  elsif output_path.exist?
188
+ unless @allow_overwrite
189
+ raise Informative, "#{spec} already exists and overwriting has been disabled."
190
+ end
186
191
  message = "[Fix] #{spec}"
187
192
  elsif output_path.dirname.directory?
188
193
  message = "[Update] #{spec}"
@@ -8,11 +8,11 @@ module Pod
8
8
  'Podfile.lock'
9
9
 
10
10
  self.description = <<-DESC
11
- Updates the Pods identified by the specified `POD_NAMES`. If no
12
- `POD_NAMES` are specified it updates all the Pods ignoring the contents
13
- of the Podfile.lock.
14
- This command is reserved to the update of dependencies and pod install
15
- should be used to install changes to the Podfile.
11
+ Updates the Pods identified by the specified `POD_NAMES`, which is a
12
+ space-delimited list of pod names. If no `POD_NAMES` are specified, it
13
+ updates all the Pods, ignoring the contents of the Podfile.lock. This
14
+ command is reserved for the update of dependencies; pod install should
15
+ be used to install changes to the Podfile.
16
16
  DESC
17
17
 
18
18
  self.arguments = [
@@ -23,6 +23,7 @@ module Pod
23
23
  [
24
24
  ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to update dependent pods. ' \
25
25
  'Multiple sources must be comma-delimited. The master repo will not be included by default with this option.'],
26
+ ['--exclude-pods=podName', 'Pods to exclude during update. Multiple pods must be comma-delimited.'],
26
27
  ].concat(super)
27
28
  end
28
29
 
@@ -30,6 +31,7 @@ module Pod
30
31
  @pods = argv.arguments! unless argv.arguments.empty?
31
32
 
32
33
  source_urls = argv.option('sources', '').split(',')
34
+ excluded_pods = argv.option('exclude-pods', '').split(',')
33
35
  unless source_urls.empty?
34
36
  source_pods = source_urls.flat_map { |url| config.sources_manager.source_with_name_or_url(url).pods }
35
37
  unless source_pods.empty?
@@ -42,6 +44,20 @@ module Pod
42
44
  end
43
45
  end
44
46
 
47
+ unless excluded_pods.empty?
48
+ @pods ||= config.lockfile.pod_names.dup
49
+
50
+ non_installed_pods = (excluded_pods - @pods)
51
+ unless non_installed_pods.empty?
52
+ pluralized_words = non_installed_pods.length > 1 ? %w(Pods are) : %w(Pod is)
53
+ message = "Trying to skip `#{non_installed_pods.join('`, `')}` #{pluralized_words.first} " \
54
+ "which #{pluralized_words.last} not installed"
55
+ raise Informative, message
56
+ end
57
+
58
+ @pods.delete_if { |pod| excluded_pods.include?(pod) }
59
+ end
60
+
45
61
  super
46
62
  end
47
63
 
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the CocoaPods command line tool.
3
3
  #
4
- VERSION = '1.4.0'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.5.0.beta.1'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -73,13 +73,16 @@ module Pod
73
73
  return nil unless spec.license
74
74
  text = spec.license[:text]
75
75
  unless text
76
- if license_file = file_accessor(spec).license
77
- if license_file.exist?
78
- text = IO.read(license_file)
76
+ if license_file = spec.license[:file]
77
+ license_path = file_accessor(spec).root + license_file
78
+ if File.exist?(license_path)
79
+ text = IO.read(license_path)
79
80
  else
80
81
  UI.warn "Unable to read the license file `#{license_file}` " \
81
82
  "for the spec `#{spec}`"
82
83
  end
84
+ elsif license_file = file_accessor(spec).license
85
+ text = IO.read(license_file)
83
86
  end
84
87
  end
85
88
  text
@@ -0,0 +1,19 @@
1
+ module Pod
2
+ module Generator
3
+ # Generates a constant file.
4
+ #
5
+ class Constant
6
+ def initialize(contents)
7
+ @generate = contents
8
+ end
9
+
10
+ attr_reader :generate
11
+
12
+ def save_as(path)
13
+ path.open('w') do |f|
14
+ f.write(generate)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -96,6 +96,14 @@ module Pod
96
96
  INSTALL_RESOURCES_FUNCTION = <<EOS
97
97
  #!/bin/sh
98
98
  set -e
99
+ set -u
100
+ set -o pipefail
101
+
102
+ if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
103
+ # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
104
+ # resources to, so exit 0 (signalling the script phase was successful).
105
+ exit 0
106
+ fi
99
107
 
100
108
  mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
101
109
 
@@ -108,7 +116,7 @@ XCASSET_FILES=()
108
116
  # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
109
117
  RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
110
118
 
111
- case "${TARGETED_DEVICE_FAMILY}" in
119
+ case "${TARGETED_DEVICE_FAMILY:-}" in
112
120
  1,2)
113
121
  TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
114
122
  ;;
@@ -194,7 +202,7 @@ EOS
194
202
 
195
203
  XCASSETS_COMPILE = <<EOS
196
204
 
197
- if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
205
+ if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
198
206
  then
199
207
  # Find all other xcassets (this unfortunately includes those of path pods and other targets).
200
208
  OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
@@ -204,7 +212,11 @@ then
204
212
  fi
205
213
  done <<<"$OTHER_XCASSETS"
206
214
 
207
- printf "%s\\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
215
+ if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
216
+ printf "%s\\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
217
+ else
218
+ printf "%s\\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist"
219
+ fi
208
220
  fi
209
221
  EOS
210
222
  end
@@ -37,10 +37,19 @@ module Pod
37
37
  script = <<-SH.strip_heredoc
38
38
  #!/bin/sh
39
39
  set -e
40
+ set -u
41
+ set -o pipefail
42
+
43
+ if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
44
+ # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
45
+ # frameworks to, so exit 0 (signalling the script phase was successful).
46
+ exit 0
47
+ fi
40
48
 
41
49
  echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
42
50
  mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
43
51
 
52
+ COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
44
53
  SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
45
54
 
46
55
  # Used as a return value for each invocation of `strip_invalid_archs` function.
@@ -129,10 +138,10 @@ module Pod
129
138
 
130
139
  # Signs a framework with the provided identity
131
140
  code_sign_if_enabled() {
132
- if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
141
+ if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
133
142
  # Use the current code_sign_identitiy
134
143
  echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
135
- local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
144
+ local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
136
145
 
137
146
  if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
138
147
  code_sign_cmd="$code_sign_cmd &"
@@ -10,12 +10,41 @@ module Pod
10
10
  #
11
11
  attr_reader :target
12
12
 
13
+ attr_reader :headers
14
+
15
+ Header = Struct.new(:path, :umbrella, :private, :textual, :exclude, :size, :mtime) do
16
+ alias_method :private?, :private
17
+ def to_s
18
+ [
19
+ (:private if private?),
20
+ (:textual if textual),
21
+ (:umbrella if umbrella),
22
+ (:exclude if exclude),
23
+ 'header',
24
+ %("#{path}"),
25
+ attrs,
26
+ ].compact.join(' ')
27
+ end
28
+
29
+ def attrs
30
+ attrs = {
31
+ 'size' => size,
32
+ 'mtime' => mtime,
33
+ }.reject { |_k, v| v.nil? }
34
+ return nil if attrs.empty?
35
+ attrs.to_s
36
+ end
37
+ end
38
+
13
39
  # Initialize a new instance
14
40
  #
15
41
  # @param [PodTarget] target @see target
16
42
  #
17
43
  def initialize(target)
18
44
  @target = target
45
+ @headers = [
46
+ Header.new(target.umbrella_header_path.basename, true),
47
+ ]
19
48
  end
20
49
 
21
50
  # Generates and saves the Info.plist to the given path.
@@ -38,14 +67,36 @@ module Pod
38
67
  #
39
68
  def generate
40
69
  <<-MODULE_MAP.strip_heredoc
41
- framework module #{target.product_module_name} {
42
- umbrella header "#{target.umbrella_header_path.basename}"
70
+ #{module_specifier_prefix}module #{target.product_module_name}#{module_declaration_attributes} {
71
+ #{headers.join("\n ")}
43
72
 
44
- export *
45
- module * { export * }
46
- }
73
+ export *
74
+ module * { export * }
75
+ }
47
76
  MODULE_MAP
48
77
  end
78
+
79
+ private
80
+
81
+ # The prefix to `module` to prepend in the module map.
82
+ # Ensures that only framework targets have `framework` prepended.
83
+ #
84
+ def module_specifier_prefix
85
+ if target.requires_frameworks?
86
+ 'framework '
87
+ else
88
+ ''
89
+ end
90
+ end
91
+
92
+ # The suffix attributes to `module`.
93
+ # Ensures that library module maps are treated as `system` modules,
94
+ # supressing warnings when imported, as is done for header imports given via `-isystem`.
95
+ #
96
+ def module_declaration_attributes
97
+ return '' if target.requires_frameworks?
98
+ ' [system]'
99
+ end
49
100
  end
50
101
  end
51
102
  end