cocoapods 1.0.0.beta.3 → 1.0.0.beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04db614d298cf64360e2528b3a6a187fe56fae78
4
- data.tar.gz: 4c179f800285b164798be255164b2dd96f8f24f5
3
+ metadata.gz: 6a45e8f74520fb565c87e9868bddd55dc0fb6131
4
+ data.tar.gz: 4f454b54f7246fe6b0b7eb3d4e46f83bf4aa8a88
5
5
  SHA512:
6
- metadata.gz: 370854285b3569c125818e3b905794b5eac5487f2891aa21e19b36139143b9ad0a3e1970eca7ecb6b7b04ba5876460b502c1f65509a1bb3e05eac2ad2fbfbb57
7
- data.tar.gz: c5e7ac223cbac6a558528dbc5d43e8e937f04ec2fb667cdb8a9b32c825c1671e86767ddf876c2bc439aa09ea6808d04a4e94b8ad39a58731be7726dd6ddcf41a
6
+ metadata.gz: 284712afd5fcad4ab68829aa9976f8c2ef64c54a3554b93c69a637807187aa56c2ce050b62219529b7db976bad9a087e415d14227c337777103bacd63074fce7
7
+ data.tar.gz: edc7840b2eb983949a1d45fb2688b8eb9175d070ea6f840f944ace9238024823fb75154b64e6272c12af610d74d56d99d30f0ba3c2ebe291ba4e9fb2e0a40e43
@@ -1,9 +1,49 @@
1
- ## Installation & Update
1
+ # Installation & Update
2
2
 
3
3
  To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
4
4
 
5
5
  To install release candidates run `[sudo] gem install cocoapods --pre`
6
6
 
7
+ ## 1.0.0.beta.4 (2016-02-24)
8
+
9
+ ##### Enhancements
10
+
11
+ * Allow deduplication to take effect even when the same pod is used with
12
+ different sets of subspecs across different platforms.
13
+ This changes the general naming scheme scoped pod targets. They are
14
+ suffixed now on base of what makes them different among others for the
15
+ same root spec instead of being prefixed by the dependent target.
16
+ [Marius Rackwitz](https://github.com/mrackwitz)
17
+ [#4146](https://github.com/CocoaPods/CocoaPods/pull/4146)
18
+
19
+ * Pass `COCOAPODS_VERSION` as environment variable when invoking the
20
+ `prepare_command`.
21
+ [Marius Rackwitz](https://github.com/mrackwitz)
22
+ [#4933](https://github.com/CocoaPods/CocoaPods/pull/4933)
23
+
24
+ ##### Bug Fixes
25
+
26
+ * Pods are built by default in another scoping level of the build products
27
+ directory identified by their name to prevent name clashes among
28
+ dependencies.
29
+ [Marius Rackwitz](https://github.com/mrackwitz)
30
+ [#4146](https://github.com/CocoaPods/CocoaPods/pull/4146)
31
+
32
+ * Fix mixed integrations where static libraries are used along frameworks
33
+ from different target definitions in one Podfile.
34
+ [Marius Rackwitz](https://github.com/mrackwitz)
35
+ [#4146](https://github.com/CocoaPods/CocoaPods/pull/4146)
36
+
37
+ * Pass target device arguments to `ibtool` in the copy resources script, fixing
38
+ compilation of storyboards when targeting versions of iOS prior to iOS 8.
39
+ [seaders](https://github.com/seaders)
40
+ [#4913](https://github.com/CocoaPods/CocoaPods/issues/4913)
41
+
42
+ * Fix `pod repo lint` when passed a path argument.
43
+ [Boris Bügling](https://github.com/neonichu)
44
+ [#4883](https://github.com/CocoaPods/CocoaPods/issues/4883)
45
+
46
+
7
47
  ## 1.0.0.beta.3 (2016-02-03)
8
48
 
9
49
  ##### Breaking
@@ -34,17 +34,21 @@ module Pod
34
34
  # @todo add UI.print and enable print statements again.
35
35
  #
36
36
  def run
37
- if @name
38
- sources = SourcesManager.sources([@name])
39
- else
40
- sources = SourcesManager.aggregate.sources
41
- end
37
+ sources = if @name
38
+ if File.exist?(@name)
39
+ [Pathname.new(@name)]
40
+ else
41
+ SourcesManager.sources([@name]).map(&:repo)
42
+ end
43
+ else
44
+ SourcesManager.aggregate.sources.map(&:repo)
45
+ end
42
46
 
43
47
  sources.each do |source|
44
- SourcesManager.check_version_information(source.repo)
45
- UI.puts "\nLinting spec repo `#{source.repo.basename}`\n".yellow
48
+ SourcesManager.check_version_information(source)
49
+ UI.puts "\nLinting spec repo `#{source.basename}`\n".yellow
46
50
 
47
- validator = Source::HealthReporter.new(source.repo)
51
+ validator = Source::HealthReporter.new(source)
48
52
  validator.pre_check do |_name, _version|
49
53
  UI.print '.'
50
54
  end
@@ -30,7 +30,7 @@ module Pod
30
30
 
31
31
  # Executes the given command displaying it if in verbose mode.
32
32
  #
33
- # @param [String] bin
33
+ # @param [String] executable
34
34
  # The binary to use.
35
35
  #
36
36
  # @param [Array<#to_s>] command
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the CocoaPods command line tool.
3
3
  #
4
- VERSION = '1.0.0.beta.3'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.0.0.beta.4'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -106,6 +106,21 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
106
106
 
107
107
  XCASSET_FILES=()
108
108
 
109
+ case "${TARGETED_DEVICE_FAMILY}" in
110
+ 1,2)
111
+ TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
112
+ ;;
113
+ 1)
114
+ TARGET_DEVICE_ARGS="--target-device iphone"
115
+ ;;
116
+ 2)
117
+ TARGET_DEVICE_ARGS="--target-device ipad"
118
+ ;;
119
+ *)
120
+ TARGET_DEVICE_ARGS="--target-device mac"
121
+ ;;
122
+ esac
123
+
109
124
  realpath() {
110
125
  DIRECTORY="$(cd "${1%/*}" && pwd)"
111
126
  FILENAME="${1##*/}"
@@ -127,8 +142,8 @@ EOM
127
142
  fi
128
143
  case $RESOURCE_PATH in
129
144
  *\.storyboard)
130
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}"
131
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}"
145
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
146
+ ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT} ${TARGET_DEVICE_ARGS}"
132
147
  ;;
133
148
  *\.xib)
134
149
  echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
@@ -179,21 +194,6 @@ EOS
179
194
 
180
195
  if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
181
196
  then
182
- case "${TARGETED_DEVICE_FAMILY}" in
183
- 1,2)
184
- TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
185
- ;;
186
- 1)
187
- TARGET_DEVICE_ARGS="--target-device iphone"
188
- ;;
189
- 2)
190
- TARGET_DEVICE_ARGS="--target-device ipad"
191
- ;;
192
- *)
193
- TARGET_DEVICE_ARGS="--target-device mac"
194
- ;;
195
- esac
196
-
197
197
  # Find all other xcassets (this unfortunately includes those of path pods and other targets).
198
198
  OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
199
199
  while read line; do
@@ -59,6 +59,7 @@ module Pod
59
59
  'PODS_ROOT' => target.relative_pods_root,
60
60
  'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
61
61
  'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
62
+ 'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
62
63
  }
63
64
  if pod_targets.any?(&:uses_swift?)
64
65
  config['EMBEDDED_CONTENT_CONTAINS_SWIFT'] = 'YES'
@@ -94,15 +95,11 @@ module Pod
94
95
  #
95
96
  def settings_to_import_pod_targets
96
97
  if target.requires_frameworks?
97
- framework_header_search_paths = pod_targets.select(&:should_build?).map do |target|
98
- if target.scoped?
99
- "$PODS_FRAMEWORK_BUILD_PATH/#{target.product_name}/Headers"
100
- else
101
- "$CONFIGURATION_BUILD_DIR/#{target.product_name}/Headers"
102
- end
98
+ build_pod_targets = pod_targets.select(&:should_build?)
99
+ framework_header_search_paths = build_pod_targets.map do |target|
100
+ "#{target.build_product_path}/Headers"
103
101
  end
104
102
  build_settings = {
105
- 'PODS_FRAMEWORK_BUILD_PATH' => XCConfigHelper.quote([target.scoped_configuration_build_dir]),
106
103
  # Make framework headers discoverable by `import "…"`
107
104
  'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(framework_header_search_paths, '-iquote'),
108
105
  }
@@ -112,9 +109,6 @@ module Pod
112
109
  build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ' + XCConfigHelper.quote(library_header_search_paths)
113
110
  build_settings['OTHER_CFLAGS'] += ' ' + XCConfigHelper.quote(library_header_search_paths, '-isystem')
114
111
  end
115
- if pod_targets.any? { |t| t.should_build? && t.scoped? }
116
- build_settings['FRAMEWORK_SEARCH_PATHS'] = '$PODS_FRAMEWORK_BUILD_PATH'
117
- end
118
112
  build_settings
119
113
  else
120
114
  # Make headers discoverable from $PODS_ROOT/Headers directory
@@ -137,9 +131,11 @@ module Pod
137
131
  # - `@import …;` / `import …`
138
132
  #
139
133
  def generate_settings_to_import_pod_targets
134
+ @xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, pod_targets)
140
135
  @xcconfig.merge!(settings_to_import_pod_targets)
141
136
  target.search_paths_aggregate_targets.each do |search_paths_target|
142
137
  generator = AggregateXCConfig.new(search_paths_target, configuration_name)
138
+ @xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(nil, search_paths_target.pod_targets)
143
139
  @xcconfig.merge!(generator.settings_to_import_pod_targets)
144
140
  end
145
141
  end
@@ -45,32 +45,25 @@ module Pod
45
45
  search_paths = target_search_paths.concat(sandbox_search_paths).uniq
46
46
 
47
47
  config = {
48
+ 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
49
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
50
+ 'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
51
+ 'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
48
52
  'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
49
53
  'PODS_ROOT' => '${SRCROOT}',
50
- 'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
51
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
52
- 'SKIP_INSTALL' => 'YES',
53
- 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
54
54
  'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
55
+ 'SKIP_INSTALL' => 'YES',
55
56
  # 'USE_HEADERMAP' => 'NO'
56
57
  }
57
58
 
58
59
  @xcconfig = Xcodeproj::Config.new(config)
59
60
 
60
- if target.requires_frameworks? && target.scoped?
61
- build_settings = {
62
- 'PODS_FRAMEWORK_BUILD_PATH' => XCConfigHelper.quote([target.configuration_build_dir]),
63
- 'FRAMEWORK_SEARCH_PATHS' => '$PODS_FRAMEWORK_BUILD_PATH',
64
- 'CONFIGURATION_BUILD_DIR' => '$PODS_FRAMEWORK_BUILD_PATH',
65
- }
66
- @xcconfig.merge!(build_settings)
67
- end
68
-
69
61
  XCConfigHelper.add_settings_for_file_accessors_of_target(target, @xcconfig)
70
62
  target.file_accessors.each do |file_accessor|
71
63
  @xcconfig.merge!(file_accessor.spec_consumer.pod_target_xcconfig)
72
64
  end
73
65
  XCConfigHelper.add_target_specific_settings(target, @xcconfig)
66
+ @xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, target.dependent_targets)
74
67
  @xcconfig
75
68
  end
76
69
 
@@ -4,6 +4,13 @@ module Pod
4
4
  # Stores the shared logic of the classes of the XCConfig module.
5
5
  #
6
6
  module XCConfigHelper
7
+ # @return [String] Defined to hold the default Xcode build path, so
8
+ # that when this is overridden per {PodTarget}, it is still
9
+ # possible to reference other build products relative to the
10
+ # original path.
11
+ #
12
+ SHARED_BUILD_DIR_VARIABLE = 'PODS_SHARED_BUILD_DIR'.freeze
13
+
7
14
  # Converts an array of strings to a single string where the each string
8
15
  # is surrounded by double quotes and separated by a space. Used to
9
16
  # represent strings in a xcconfig file.
@@ -49,6 +56,8 @@ module Pod
49
56
  # @param [Xcodeproj::Config] xcconfig
50
57
  # The xcconfig to edit.
51
58
  #
59
+ # @return [void]
60
+ #
52
61
  def self.add_settings_for_file_accessors_of_target(target, xcconfig)
53
62
  target.file_accessors.each do |file_accessor|
54
63
  XCConfigHelper.add_spec_build_settings_to_xcconfig(file_accessor.spec_consumer, xcconfig)
@@ -73,6 +82,8 @@ module Pod
73
82
  # @param [Spec::FileAccessor] file_accessor
74
83
  # The file accessor, which holds the list of static frameworks.
75
84
  #
85
+ # @return [void]
86
+ #
76
87
  def self.add_static_dependency_build_settings(target, xcconfig, file_accessor)
77
88
  file_accessor.vendored_static_frameworks.each do |vendored_static_framework|
78
89
  XCConfigHelper.add_framework_build_settings(vendored_static_framework, xcconfig, target.sandbox.root)
@@ -90,6 +101,8 @@ module Pod
90
101
  # @param [Xcodeproj::Config] xcconfig
91
102
  # The xcconfig to edit.
92
103
  #
104
+ # @return [void]
105
+ #
93
106
  def self.add_dynamic_dependency_build_settings(target, xcconfig)
94
107
  target.file_accessors.each do |file_accessor|
95
108
  file_accessor.vendored_dynamic_frameworks.each do |vendored_dynamic_framework|
@@ -110,6 +123,8 @@ module Pod
110
123
  # @param [Xcodeproj::Config] xcconfig
111
124
  # The xcconfig to edit.
112
125
  #
126
+ # @return [void]
127
+ #
113
128
  def self.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
114
129
  xcconfig.libraries.merge(consumer.libraries)
115
130
  xcconfig.frameworks.merge(consumer.frameworks)
@@ -129,6 +144,8 @@ module Pod
129
144
  # @param [Pathname] sandbox_root
130
145
  # The path retrieved from Sandbox#root.
131
146
  #
147
+ # @return [void]
148
+ #
132
149
  def self.add_framework_build_settings(framework_path, xcconfig, sandbox_root)
133
150
  name = File.basename(framework_path, '.framework')
134
151
  dirname = '${PODS_ROOT}/' + framework_path.dirname.relative_path_from(sandbox_root).to_s
@@ -151,6 +168,8 @@ module Pod
151
168
  # @param [Pathname] sandbox_root
152
169
  # The path retrieved from Sandbox#root.
153
170
  #
171
+ # @return [void]
172
+ #
154
173
  def self.add_library_build_settings(library_path, xcconfig, sandbox_root)
155
174
  extension = File.extname(library_path)
156
175
  name = File.basename(library_path, extension).sub(/\Alib/, '')
@@ -172,6 +191,8 @@ module Pod
172
191
  # @param [Xcodeproj::Config] xcconfig
173
192
  # The xcconfig to edit.
174
193
  #
194
+ # @return [void]
195
+ #
175
196
  def self.add_code_signing_settings(target, xcconfig)
176
197
  build_settings = {}
177
198
  if target.platform.to_sym == :osx
@@ -189,6 +210,8 @@ module Pod
189
210
  # @param [Xcodeproj::Config] xcconfig
190
211
  # The xcconfig to edit.
191
212
  #
213
+ # @return [void]
214
+ #
192
215
  def self.add_target_specific_settings(target, xcconfig)
193
216
  if target.requires_frameworks?
194
217
  add_code_signing_settings(target, xcconfig)
@@ -196,6 +219,46 @@ module Pod
196
219
  add_language_specific_settings(target, xcconfig)
197
220
  end
198
221
 
222
+ # Returns the search paths for frameworks and libraries the given target
223
+ # depends on, so that it can be correctly built and linked.
224
+ #
225
+ # @param [Target] target
226
+ # The target.
227
+ #
228
+ # @param [Array<PodTarget>] dependent_targets
229
+ # The pod targets the given target depends on.
230
+ #
231
+ # @return [Hash<String, String>] the settings
232
+ #
233
+ def self.settings_for_dependent_targets(target, dependent_targets)
234
+ dependent_targets = dependent_targets.select(&:should_build?)
235
+ has_configuration_build_dir = target.respond_to?(:configuration_build_dir)
236
+ if has_configuration_build_dir
237
+ build_dir_var = "$#{SHARED_BUILD_DIR_VARIABLE}"
238
+ build_settings = {
239
+ 'CONFIGURATION_BUILD_DIR' => target.configuration_build_dir(build_dir_var),
240
+ SHARED_BUILD_DIR_VARIABLE => '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)',
241
+ }
242
+ else
243
+ build_dir_var = '$CONFIGURATION_BUILD_DIR'
244
+ build_settings = {}
245
+ end
246
+ unless dependent_targets.empty?
247
+ framework_search_paths = []
248
+ library_search_paths = []
249
+ dependent_targets.each do |dependent_target|
250
+ if dependent_target.requires_frameworks?
251
+ framework_search_paths << dependent_target.configuration_build_dir(build_dir_var)
252
+ else
253
+ library_search_paths << dependent_target.configuration_build_dir(build_dir_var)
254
+ end
255
+ end
256
+ build_settings['FRAMEWORK_SEARCH_PATHS'] = XCConfigHelper.quote(framework_search_paths.uniq)
257
+ build_settings['LIBRARY_SEARCH_PATHS'] = XCConfigHelper.quote(library_search_paths.uniq)
258
+ end
259
+ build_settings
260
+ end
261
+
199
262
  # Checks if the given target requires language specific settings and
200
263
  # configures the given Xcconfig.
201
264
  #
@@ -205,6 +268,8 @@ module Pod
205
268
  # @param [Xcodeproj::Config] xcconfig
206
269
  # The xcconfig to edit.
207
270
  #
271
+ # @return [void]
272
+ #
208
273
  def self.add_language_specific_settings(target, xcconfig)
209
274
  if target.uses_swift?
210
275
  build_settings = {
@@ -108,7 +108,6 @@ module Pod
108
108
  prepare
109
109
  resolve_dependencies
110
110
  download_dependencies
111
- determine_dependency_product_types
112
111
  verify_no_duplicate_framework_names
113
112
  verify_no_static_framework_transitive_dependencies
114
113
  verify_framework_usage
@@ -376,22 +375,6 @@ module Pod
376
375
  end
377
376
  end
378
377
 
379
- # Determines if the dependencies need to be built as dynamic frameworks or
380
- # if they can be built as static libraries by checking for the Swift source
381
- # presence. Therefore it is important that the file accessors of the
382
- # #pod_targets are created.
383
- #
384
- # @return [void]
385
- #
386
- def determine_dependency_product_types
387
- aggregate_targets.each do |aggregate_target|
388
- aggregate_target.pod_targets.each do |pod_target|
389
- pod_target.host_requires_frameworks ||= aggregate_target.requires_frameworks?
390
- pod_target.platform = nil # needs to be recomputed
391
- end
392
- end
393
- end
394
-
395
378
  def verify_no_duplicate_framework_names
396
379
  aggregate_targets.each do |aggregate_target|
397
380
  aggregate_target.user_build_configurations.keys.each do |config|
@@ -629,13 +612,11 @@ module Pod
629
612
  def install_libraries
630
613
  UI.message '- Installing targets' do
631
614
  pod_targets.sort_by(&:name).each do |pod_target|
632
- next if pod_target.target_definitions.all?(&:abstract?)
633
615
  target_installer = PodTargetInstaller.new(sandbox, pod_target)
634
616
  target_installer.install!
635
617
  end
636
618
 
637
619
  aggregate_targets.sort_by(&:name).each do |target|
638
- next if target.target_definition.abstract?
639
620
  target_installer = AggregateTargetInstaller.new(sandbox, target)
640
621
  target_installer.install!
641
622
  end
@@ -679,23 +660,15 @@ module Pod
679
660
  aggregate_target.native_target.add_dependency(pod_target.native_target)
680
661
  configure_app_extension_api_only_for_target(pod_target) if is_app_extension
681
662
 
682
- pod_target.dependencies.each do |dep|
683
- unless dep == pod_target.pod_name
684
- pod_dependency_target = aggregate_target.pod_targets.find { |target| target.pod_name == dep }
685
- # TODO: remove me
686
- unless pod_dependency_target
687
- puts "[BUG] DEP: #{dep}"
688
- end
689
-
690
- next unless pod_dependency_target.should_build?
691
- pod_target.native_target.add_dependency(pod_dependency_target.native_target)
692
- configure_app_extension_api_only_for_target(pod_dependency_target) if is_app_extension
663
+ pod_target.dependent_targets.each do |pod_dependency_target|
664
+ next unless pod_dependency_target.should_build?
665
+ pod_target.native_target.add_dependency(pod_dependency_target.native_target)
666
+ configure_app_extension_api_only_for_target(pod_dependency_target) if is_app_extension
693
667
 
694
- if pod_target.requires_frameworks?
695
- product_ref = frameworks_group.files.find { |f| f.path == pod_dependency_target.product_name } ||
696
- frameworks_group.new_product_ref_for_target(pod_dependency_target.product_basename, pod_dependency_target.product_type)
697
- pod_target.native_target.frameworks_build_phase.add_file_reference(product_ref, true)
698
- end
668
+ if pod_target.requires_frameworks?
669
+ product_ref = frameworks_group.files.find { |f| f.path == pod_dependency_target.product_name } ||
670
+ frameworks_group.new_product_ref_for_target(pod_dependency_target.product_basename, pod_dependency_target.product_type)
671
+ pod_target.native_target.frameworks_build_phase.add_file_reference(product_ref, true)
699
672
  end
700
673
  end
701
674
  end
@@ -13,6 +13,8 @@ module Pod
13
13
  autoload :SandboxAnalyzer, 'cocoapods/installer/analyzer/sandbox_analyzer'
14
14
  autoload :SpecsState, 'cocoapods/installer/analyzer/specs_state'
15
15
  autoload :LockingDependencyAnalyzer, 'cocoapods/installer/analyzer/locking_dependency_analyzer'
16
+ autoload :PodVariant, 'cocoapods/installer/analyzer/pod_variant'
17
+ autoload :PodVariantSet, 'cocoapods/installer/analyzer/pod_variant_set'
16
18
  autoload :TargetInspectionResult, 'cocoapods/installer/analyzer/target_inspection_result'
17
19
  autoload :TargetInspector, 'cocoapods/installer/analyzer/target_inspector'
18
20
 
@@ -228,8 +230,9 @@ module Pod
228
230
  # @return [Array<AggregateTarget>]
229
231
  #
230
232
  def generate_targets
231
- pod_targets = generate_pod_targets(result.specs_by_target)
232
- aggregate_targets = result.specs_by_target.keys.reject(&:abstract?).map do |target_definition|
233
+ specs_by_target = result.specs_by_target.reject { |td, _| td.abstract? }
234
+ pod_targets = generate_pod_targets(specs_by_target)
235
+ aggregate_targets = specs_by_target.keys.map do |target_definition|
233
236
  generate_target(target_definition, pod_targets)
234
237
  end
235
238
  aggregate_targets.each do |target|
@@ -286,85 +289,84 @@ module Pod
286
289
  # @return [Array<PodTarget>]
287
290
  #
288
291
  def generate_pod_targets(specs_by_target)
289
- dedupe_cache = {}
290
292
  if installation_options.deduplicate_targets?
291
- all_specs = specs_by_target.flat_map do |target_definition, dependent_specs|
292
- dependent_specs.group_by(&:root).map do |root_spec, specs|
293
- [root_spec, specs, target_definition]
293
+ distinct_targets = specs_by_target.each_with_object({}) do |dependency, hash|
294
+ target_definition, dependent_specs = *dependency
295
+ dependent_specs.group_by(&:root).each do |root_spec, specs|
296
+ pod_variant = PodVariant.new(specs, target_definition.platform, target_definition.uses_frameworks?)
297
+ hash[root_spec] ||= {}
298
+ (hash[root_spec][pod_variant] ||= []) << target_definition
294
299
  end
295
300
  end
296
301
 
297
- distinct_targets = all_specs.each_with_object({}) do |dependency, hash|
298
- root_spec, specs, target_definition = *dependency
299
- hash[root_spec] ||= {}
300
- (hash[root_spec][[specs, target_definition.platform]] ||= []) << target_definition
301
- end
302
-
303
- pod_targets = distinct_targets.flat_map do |_, targets_by_distinctors|
304
- if targets_by_distinctors.count > 1
305
- # There are different sets of subspecs or the spec is used across different platforms
306
- targets_by_distinctors.flat_map do |distinctor, target_definitions|
307
- specs, = *distinctor
308
- generate_pod_target(target_definitions, specs).scoped(dedupe_cache)
309
- end
310
- else
311
- (specs, _), target_definitions = targets_by_distinctors.first
312
- generate_pod_target(target_definitions, specs)
302
+ pod_targets = distinct_targets.flat_map do |_root, target_definitions_by_variant|
303
+ suffixes = PodVariantSet.new(target_definitions_by_variant.keys).scope_suffixes
304
+ target_definitions_by_variant.flat_map do |variant, target_definitions|
305
+ generate_pod_target(target_definitions, variant.specs, :scope_suffix => suffixes[variant])
313
306
  end
314
307
  end
315
308
 
316
- # A `PodTarget` can't be deduplicated if any of its
317
- # transitive dependencies can't be deduplicated.
318
- pod_targets.flat_map do |target|
319
- dependent_targets = transitive_dependencies_for_pod_target(target, pod_targets)
320
- target.dependent_targets = dependent_targets
321
- if dependent_targets.any?(&:scoped?)
322
- target.scoped(dedupe_cache)
323
- else
324
- target
309
+ all_specs = specs_by_target.values.flatten.uniq
310
+ pod_targets_by_name = pod_targets.group_by(&:pod_name).each_with_object({}) do |(name, values), hash|
311
+ # Sort the target by the number of activated subspecs, so that
312
+ # we prefer a minimal target as transitive dependency.
313
+ hash[name] = values.sort_by { |pt| pt.specs.count }
314
+ end
315
+ pod_targets.each do |target|
316
+ dependencies = transitive_dependencies_for_specs(target.specs, target.platform, all_specs).group_by(&:root)
317
+ target.dependent_targets = dependencies.map do |root_spec, deps|
318
+ pod_targets_by_name[root_spec.name].find do |t|
319
+ next false if t.platform.symbolic_name != target.platform.symbolic_name ||
320
+ t.requires_frameworks? != target.requires_frameworks?
321
+ spec_names = t.specs.map(&:name)
322
+ deps.all? { |dep| spec_names.include?(dep.name) }
323
+ end
325
324
  end
326
325
  end
327
326
  else
328
- pod_targets = specs_by_target.flat_map do |target_definition, specs|
329
- grouped_specs = specs.group_by.group_by(&:root).values.uniq
330
- grouped_specs.flat_map do |pod_specs|
327
+ dedupe_cache = {}
328
+ specs_by_target.flat_map do |target_definition, specs|
329
+ grouped_specs = specs.group_by(&:root).values.uniq
330
+ pod_targets = grouped_specs.flat_map do |pod_specs|
331
331
  generate_pod_target([target_definition], pod_specs).scoped(dedupe_cache)
332
332
  end
333
- end
334
- pod_targets.each do |target|
335
- target.dependent_targets = transitive_dependencies_for_pod_target(target, pod_targets)
333
+
334
+ pod_targets.each do |target|
335
+ dependencies = transitive_dependencies_for_specs(target.specs, target.platform, specs).group_by(&:root)
336
+ target.dependent_targets = pod_targets.reject { |t| dependencies[t.root_spec].nil? }
337
+ end
336
338
  end
337
339
  end
338
340
  end
339
341
 
340
- # Finds the names of the Pods upon which the given target _transitively_
341
- # depends.
342
+ # Returns the specs upon which the given specs _transitively_ depend.
342
343
  #
343
344
  # @note: This is implemented in the analyzer, because we don't have to
344
345
  # care about the requirements after dependency resolution.
345
346
  #
346
- # @param [PodTarget] pod_target
347
- # The pod target, whose dependencies should be returned.
347
+ # @param [Array<Specification>] specs
348
+ # The specs, whose dependencies should be returned.
348
349
  #
349
- # @param [Array<PodTarget>] targets
350
- # All pod targets, which are integrated alongside.
350
+ # @param [Platform] platform
351
+ # The platform for which the dependencies should be returned.
351
352
  #
352
- # @return [Array<PodTarget>]
353
+ # @param [Array<Specification>] all_specs
354
+ # All specifications which are installed alongside.
353
355
  #
354
- def transitive_dependencies_for_pod_target(pod_target, targets)
355
- if targets.any?
356
- dependent_targets = pod_target.dependencies.flat_map do |dep|
357
- next [] if pod_target.pod_name == dep
358
- targets.select { |t| t.pod_name == dep }
359
- end
360
- remaining_targets = targets - dependent_targets
361
- dependent_targets += dependent_targets.flat_map do |target|
362
- transitive_dependencies_for_pod_target(target, remaining_targets)
363
- end
364
- dependent_targets.uniq
365
- else
366
- []
367
- end
356
+ # @return [Array<Specification>]
357
+ #
358
+ def transitive_dependencies_for_specs(specs, platform, all_specs)
359
+ return [] if specs.empty? || all_specs.empty?
360
+ dependent_specs = specs.flat_map do |spec|
361
+ spec.consumer(platform).dependencies.flat_map do |dependency|
362
+ all_specs.find do |s|
363
+ next false if specs.include?(s)
364
+ s.name == dependency.name
365
+ end
366
+ end.compact
367
+ end.uniq
368
+ remaining_specs = all_specs - dependent_specs
369
+ dependent_specs + transitive_dependencies_for_specs(dependent_specs, platform, remaining_specs)
368
370
  end
369
371
 
370
372
  # Create a target for each spec group
@@ -372,13 +374,17 @@ module Pod
372
374
  # @param [TargetDefinitions] target_definitions
373
375
  # the aggregate target
374
376
  #
375
- # @param [Array<Specification>] specs
377
+ # @param [Array<Specification>] pod_specs
376
378
  # the specifications of an equal root.
377
379
  #
380
+ # @param [String] scope_suffix
381
+ # @see PodTarget#scope_suffix
382
+ #
378
383
  # @return [PodTarget]
379
384
  #
380
- def generate_pod_target(target_definitions, pod_specs)
381
- pod_target = PodTarget.new(pod_specs, target_definitions, sandbox)
385
+ def generate_pod_target(target_definitions, pod_specs, scope_suffix: nil)
386
+ pod_target = PodTarget.new(pod_specs, target_definitions, sandbox, scope_suffix)
387
+ pod_target.host_requires_frameworks = target_definitions.any?(&:uses_frameworks?)
382
388
 
383
389
  if installation_options.integrate_targets?
384
390
  target_inspections = result.target_inspections.select { |t, _| target_definitions.include?(t) }.values
@@ -21,8 +21,8 @@ module Pod
21
21
  #
22
22
  attr_accessor :sandbox_state
23
23
 
24
- # @return [Array<Target>] The Podfile targets containing library
25
- # dependencies.
24
+ # @return [Array<AggregateTarget>] The aggregate targets created for each
25
+ # {TargetDefinition} from the {Podfile}.
26
26
  #
27
27
  attr_accessor :targets
28
28
 
@@ -0,0 +1,59 @@
1
+ module Pod
2
+ class Installer
3
+ class Analyzer
4
+ # Bundles the information needed to setup a {PodTarget}.
5
+ class PodVariant
6
+ # @return [Array<Specification>] the spec and subspecs for the target
7
+ #
8
+ attr_accessor :specs
9
+
10
+ # @return [Platform] the platform
11
+ #
12
+ attr_accessor :platform
13
+
14
+ # @return [Bool] whether this pod should be built as framework
15
+ #
16
+ attr_accessor :requires_frameworks
17
+ alias_method :requires_frameworks?, :requires_frameworks
18
+
19
+ # @return [Specification] the root specification
20
+ #
21
+ def root_spec
22
+ specs.first.root
23
+ end
24
+
25
+ # Initialize a new instance from its attributes.
26
+ #
27
+ # @param [Array<String>] specs @see #specs
28
+ # @param [Platform] platform @see #platform
29
+ # @param [Bool] requires_frameworks @see #requires_frameworks?
30
+ #
31
+ def initialize(specs, platform, requires_frameworks = false)
32
+ self.specs = specs
33
+ self.platform = platform
34
+ self.requires_frameworks = requires_frameworks
35
+ end
36
+
37
+ # @return [Bool] whether the {PodVariant} is equal to another taking all
38
+ # all their attributes into account
39
+ #
40
+ def ==(other)
41
+ self.class == other.class &&
42
+ specs == other.specs &&
43
+ platform == other.platform &&
44
+ requires_frameworks == other.requires_frameworks
45
+ end
46
+ alias_method :eql?, :==
47
+
48
+ # Hashes the instance by all its attributes.
49
+ #
50
+ # This adds support to make instances usable as Hash keys.
51
+ #
52
+ # @!visibility private
53
+ def hash
54
+ [specs, platform, requires_frameworks].hash
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,153 @@
1
+ require 'set'
2
+
3
+ module Pod
4
+ class Installer
5
+ class Analyzer
6
+ # Collects all {PodVariant}.
7
+ class PodVariantSet
8
+ # @return [Array<PodVariant>] the different variants.
9
+ #
10
+ attr_accessor :variants
11
+
12
+ # Initialize a new instance.
13
+ #
14
+ # @param [Array<PodVariant>] variants @see #variants
15
+ #
16
+ def initialize(variants)
17
+ self.variants = variants
18
+ end
19
+
20
+ # Describes what makes each {PodVariant} distinct among the others.
21
+ #
22
+ # @return [Hash<PodVariant, String>]
23
+ #
24
+ def scope_suffixes
25
+ return { variants.first => nil } if variants.count == 1
26
+ scope_by_specs
27
+ end
28
+
29
+ # Groups the collection by result of the block.
30
+ #
31
+ # @param [Block<Variant, #hash>] block
32
+ # @return [Array<PodVariantSet>]
33
+ #
34
+ def group_by(&block)
35
+ variants.group_by(&block).map { |_, v| PodVariantSet.new(v) }
36
+ end
37
+
38
+ # @private
39
+ #
40
+ # Prepends the given scoped {PodVariant}s with another scoping label, if there
41
+ # was more than one group of {PodVariant}s given.
42
+ #
43
+ # @param [Array<Hash<PodVariant, String>>] scoped_variants
44
+ # {PodVariant}s, which where grouped on base of a criteria, which is used
45
+ # in the block argument to generate a descriptive label.
46
+ #
47
+ # @param [Block<PodVariant, String>] block
48
+ # takes a {PodVariant} and returns a scope suffix which is prepended, if
49
+ # necessary.
50
+ #
51
+ # @return [Hash<PodVariant, String>]
52
+ #
53
+ def scope_if_necessary(scoped_variants, &block)
54
+ if scoped_variants.count == 1
55
+ return scoped_variants.first
56
+ end
57
+ Hash[scoped_variants.flat_map do |variants|
58
+ variants.map do |variant, suffix|
59
+ prefix = block.call(variant)
60
+ scope = [prefix, suffix].compact.join('-')
61
+ [variant, !scope.empty? ? scope : nil]
62
+ end
63
+ end]
64
+ end
65
+
66
+ # @private
67
+ # @return [Hash<PodVariant, String>]
68
+ #
69
+ def scope_by_build_type
70
+ scope_if_necessary(group_by(&:requires_frameworks).map(&:scope_by_platform)) do |variant|
71
+ variant.requires_frameworks? ? 'framework' : 'library'
72
+ end
73
+ end
74
+
75
+ # @private
76
+ # @return [Hash<PodVariant, String>]
77
+ #
78
+ def scope_by_platform
79
+ grouped_variants = group_by { |v| v.platform.name }
80
+ if grouped_variants.all? { |set| set.variants.count == 1 }
81
+ # => Platform name
82
+ platform_name_proc = proc { |v| Platform.string_name(v.platform.symbolic_name).tr(' ', '') }
83
+ else
84
+ grouped_variants = group_by(&:platform)
85
+ # => Platform name + SDK version
86
+ platform_name_proc = proc { |v| v.platform.to_s.tr(' ', '') }
87
+ end
88
+ scope_if_necessary(grouped_variants.map(&:scope_without_suffix), &platform_name_proc)
89
+ end
90
+
91
+ # @private
92
+ # @return [Hash<PodVariant, String>]
93
+ #
94
+ def scope_by_specs
95
+ root_spec = variants.first.root_spec
96
+ specs = [root_spec]
97
+ if root_spec.default_subspecs.empty?
98
+ specs += root_spec.subspecs.compact
99
+ else
100
+ specs += root_spec.default_subspecs.map do |subspec_name|
101
+ root_spec.subspec_by_name("#{root_spec.name}/#{subspec_name}")
102
+ end
103
+ end
104
+ default_specs = Set.new(specs)
105
+ grouped_variants = group_by(&:specs)
106
+ all_spec_variants = grouped_variants.map { |set| set.variants.first.specs }
107
+ common_specs = all_spec_variants.map(&:to_set).flatten.inject(&:&)
108
+ omit_common_specs = common_specs.any? && common_specs.proper_superset?(default_specs)
109
+ scope_if_necessary(grouped_variants.map(&:scope_by_build_type)) do |variant|
110
+ specs = variant.specs.to_set
111
+
112
+ # The current variant contains all default specs
113
+ omit_default_specs = default_specs.any? && default_specs.subset?(specs)
114
+ if omit_default_specs
115
+ specs -= default_specs
116
+ end
117
+
118
+ # There are common specs, which are different from the default specs
119
+ if omit_common_specs
120
+ specs -= common_specs
121
+ end
122
+
123
+ spec_names = specs.map do |spec|
124
+ spec.root? ? '.root' : spec.name.split('/')[1..-1].join('_')
125
+ end.sort
126
+ if spec_names.empty?
127
+ omit_common_specs ? '.common' : nil
128
+ else
129
+ if omit_common_specs
130
+ spec_names.unshift('.common')
131
+ elsif omit_default_specs
132
+ spec_names.unshift('.default')
133
+ end
134
+ spec_names.reduce('') do |acc, name|
135
+ "#{acc}#{acc.empty? || name[0] == '.' ? '' : '-'}#{name}"
136
+ end
137
+ end
138
+ end
139
+ end
140
+
141
+ # @private
142
+ #
143
+ # Helps to define scope suffixes recursively.
144
+ #
145
+ # @return [Hash<PodVariant, String>]
146
+ #
147
+ def scope_without_suffix
148
+ Hash[variants.map { |v| [v, nil] }]
149
+ end
150
+ end
151
+ end
152
+ end
153
+ end
@@ -58,10 +58,15 @@ module Pod
58
58
  return unless spec.prepare_command
59
59
  UI.section(' > Running prepare command', '', 1) do
60
60
  Dir.chdir(path) do
61
- ENV.delete('CDPATH')
62
- prepare_command = spec.prepare_command.strip_heredoc.chomp
63
- full_command = "\nset -e\n" + prepare_command
64
- bash!('-c', full_command)
61
+ begin
62
+ ENV.delete('CDPATH')
63
+ ENV['COCOAPODS_VERSION'] = Pod::VERSION
64
+ prepare_command = spec.prepare_command.strip_heredoc.chomp
65
+ full_command = "\nset -e\n" + prepare_command
66
+ bash!('-c', full_command)
67
+ ensure
68
+ ENV.delete('COCOAPODS_VERSION')
69
+ end
65
70
  end
66
71
  end
67
72
  end
@@ -151,7 +151,7 @@ module Pod
151
151
  end
152
152
  frameworks_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
153
153
  frameworks = pod_target.file_accessors.flat_map(&:vendored_dynamic_artifacts).map { |fw| "${PODS_ROOT}/#{fw.relative_path_from(sandbox.root)}" }
154
- frameworks << "#{target_definition.label}/#{pod_target.product_name}" if pod_target.should_build? && pod_target.requires_frameworks?
154
+ frameworks << pod_target.build_product_path if pod_target.should_build? && pod_target.requires_frameworks?
155
155
  frameworks
156
156
  end
157
157
  end
@@ -216,7 +216,7 @@ module Pod
216
216
  end
217
217
 
218
218
  def targets_to_integrate
219
- targets.reject { |target| target.target_definition.abstract? }
219
+ targets
220
220
  end
221
221
 
222
222
  # Prints a warning informing the user that a build configuration of
@@ -13,6 +13,7 @@ module Pod
13
13
  # @param [Sandbox] sandbox @see sandbox
14
14
  #
15
15
  def initialize(target_definition, sandbox)
16
+ raise "Can't initialize an AggregateTarget with an abstract TargetDefinition" if target_definition.abstract?
16
17
  super()
17
18
  @target_definition = target_definition
18
19
  @sandbox = sandbox
@@ -205,13 +206,6 @@ module Pod
205
206
  "${SRCROOT}/#{relative_to_srcroot(embed_frameworks_script_path)}"
206
207
  end
207
208
 
208
- # @return [String] The scoped configuration build dir, relevant if the
209
- # target is integrated as framework.
210
- #
211
- def scoped_configuration_build_dir
212
- "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/#{target_definition.label}"
213
- end
214
-
215
209
  private
216
210
 
217
211
  # @!group Private Helpers
@@ -19,19 +19,25 @@ module Pod
19
19
  # @return [Bool] whether the target needs to be scoped by target definition,
20
20
  # because the spec is used with different subspec sets across them.
21
21
  #
22
- # @note For frameworks the target products of {PodTarget}s are named
23
- # after their specs. The namespacing cannot directly happen in
24
- # the product name itself, because this must be equal to the module
25
- # name and this will be used in source code, which should stay
26
- # agnostic over the dependency manager.
22
+ # @note The target products of {PodTarget}s are named after their specs.
23
+ # The namespacing cannot directly happen in the product name itself,
24
+ # because this must be equal to the module name and this will be
25
+ # used in source code, which should stay agnostic over the
26
+ # dependency manager.
27
27
  # We need namespacing because multiple targets can exist for the
28
28
  # same podspec and their products should not collide. This
29
29
  # duplication is needed when multiple user targets have the same
30
30
  # dependency, but they require different sets of subspecs or they
31
31
  # are on different platforms.
32
32
  #
33
- attr_reader :scoped
34
- alias_method :scoped?, :scoped
33
+ def scoped?
34
+ !scope_suffix.nil?
35
+ end
36
+
37
+ # @return [String] used for the label and the directory name, which is used to
38
+ # scope the build product in the default configuration build dir.
39
+ #
40
+ attr_reader :scope_suffix
35
41
 
36
42
  # @return [Array<PodTarget>] the targets that this target has a dependency
37
43
  # upon.
@@ -41,16 +47,18 @@ module Pod
41
47
  # @param [Array<Specification>] @spec #see spec
42
48
  # @param [Array<TargetDefinition>] target_definitions @see target_definitions
43
49
  # @param [Sandbox] sandbox @see sandbox
44
- # @param [Bool] scoped @see scoped
50
+ # @param [String] scope_suffix @see scope_suffix
45
51
  #
46
- def initialize(specs, target_definitions, sandbox, scoped = false)
52
+ def initialize(specs, target_definitions, sandbox, scope_suffix = nil)
47
53
  raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
48
54
  raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty?
55
+ raise "Can't initialize a PodTarget with only abstract TargetDefinitions" if target_definitions.all?(&:abstract?)
56
+ raise "Can't initialize a PodTarget with an empty string scope suffix!" if scope_suffix == ''
49
57
  super()
50
58
  @specs = specs
51
59
  @target_definitions = target_definitions
52
60
  @sandbox = sandbox
53
- @scoped = scoped
61
+ @scope_suffix = scope_suffix
54
62
  @build_headers = Sandbox::HeadersStore.new(sandbox, 'Private')
55
63
  @file_accessors = []
56
64
  @resource_bundle_targets = []
@@ -67,7 +75,7 @@ module Pod
67
75
  if cache[cache_key]
68
76
  cache[cache_key]
69
77
  else
70
- target = PodTarget.new(specs, [target_definition], sandbox, true)
78
+ target = PodTarget.new(specs, [target_definition], sandbox, target_definition.label)
71
79
  target.file_accessors = file_accessors
72
80
  target.user_build_configurations = user_build_configurations
73
81
  target.native_target = native_target
@@ -82,7 +90,11 @@ module Pod
82
90
  #
83
91
  def label
84
92
  if scoped?
85
- "#{target_definitions.first.label}-#{root_spec.name}"
93
+ if scope_suffix[0] == '.'
94
+ "#{root_spec.name}#{scope_suffix}"
95
+ else
96
+ "#{root_spec.name}-#{scope_suffix}"
97
+ end
86
98
  else
87
99
  root_spec.name
88
100
  end
@@ -241,15 +253,24 @@ module Pod
241
253
  end
242
254
  end
243
255
 
244
- # @return [String] The configuration build dir, relevant if the target is
245
- # integrated as framework.
256
+ # @param [String] dir
257
+ # The directory (which might be a variable) relative to which
258
+ # the returned path should be. This must be used if the
259
+ # $CONFIGURATION_BUILD_DIR is modified.
246
260
  #
247
- def configuration_build_dir
248
- if scoped?
249
- "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/#{target_definitions.first.label}"
250
- else
251
- '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
252
- end
261
+ # @return [String] The absolute path to the configuration build dir
262
+ #
263
+ def configuration_build_dir(dir = '$CONFIGURATION_BUILD_DIR')
264
+ "#{dir}/#{label}"
265
+ end
266
+
267
+ # @param [String] dir
268
+ # @see #configuration_build_dir
269
+ #
270
+ # @return [String] The absolute path to the build product
271
+ #
272
+ def build_product_path(dir = '$CONFIGURATION_BUILD_DIR')
273
+ "#{configuration_build_dir(dir)}/#{product_name}"
253
274
  end
254
275
 
255
276
  private
@@ -65,20 +65,31 @@ EOS
65
65
  end
66
66
 
67
67
  def stack
68
- <<-EOS
68
+ parts = {
69
+ 'CocoaPods' => Pod::VERSION,
70
+ 'Ruby' => RUBY_DESCRIPTION,
71
+ 'RubyGems' => Gem::VERSION,
72
+ 'Host' => host_information,
73
+ 'Xcode' => xcode_information,
74
+ 'Git' => git_information,
75
+ 'Ruby lib dir' => RbConfig::CONFIG['libdir'],
76
+ 'Repositories' => repo_information,
77
+ }
78
+ justification = parts.keys.map(&:size).max
79
+
80
+ str = <<-EOS
69
81
  ### Stack
70
82
 
71
- ```
72
- CocoaPods : #{Pod::VERSION}
73
- Ruby : #{RUBY_DESCRIPTION}
74
- RubyGems : #{Gem::VERSION}
75
- Host : #{host_information}
76
- Xcode : #{xcode_information}
77
- Git : #{git_information}
78
- Ruby lib dir : #{RbConfig::CONFIG['libdir']}
79
- Repositories : #{repo_information.join("\n ")}
80
83
  ```
81
84
  EOS
85
+ parts.each do |name, value|
86
+ str << name.rjust(justification)
87
+ str << ' : '
88
+ str << Array(value).join("\n" << (' ' * (justification + 3)))
89
+ str << "\n"
90
+ end
91
+
92
+ str << "```\n"
82
93
  end
83
94
 
84
95
  def plugins_string
@@ -428,7 +428,7 @@ module Pod
428
428
  # for all available platforms with xcodebuild.
429
429
  #
430
430
  def install_pod
431
- %i(determine_dependency_product_types verify_no_duplicate_framework_names
431
+ %i(verify_no_duplicate_framework_names
432
432
  verify_no_static_framework_transitive_dependencies
433
433
  verify_framework_usage generate_pods_project integrate_user_project
434
434
  perform_post_install_actions).each { |m| @installer.send(m) }
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.0.0.beta.3
4
+ version: 1.0.0.beta.4
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: 2016-02-02 00:00:00.000000000 Z
14
+ date: 2016-02-23 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.0.0.beta.3
22
+ version: 1.0.0.beta.4
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.0.0.beta.3
29
+ version: 1.0.0.beta.4
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -193,21 +193,21 @@ dependencies:
193
193
  requirements:
194
194
  - - ~>
195
195
  - !ruby/object:Gem::Version
196
- version: 0.4.2
196
+ version: 0.4.3
197
197
  type: :runtime
198
198
  prerelease: false
199
199
  version_requirements: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ~>
202
202
  - !ruby/object:Gem::Version
203
- version: 0.4.2
203
+ version: 0.4.3
204
204
  - !ruby/object:Gem::Dependency
205
205
  name: xcodeproj
206
206
  requirement: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - '>='
209
209
  - !ruby/object:Gem::Version
210
- version: 1.0.0.beta.1
210
+ version: 1.0.0.beta.3
211
211
  - - <
212
212
  - !ruby/object:Gem::Version
213
213
  version: '2.0'
@@ -217,7 +217,7 @@ dependencies:
217
217
  requirements:
218
218
  - - '>='
219
219
  - !ruby/object:Gem::Version
220
- version: 1.0.0.beta.1
220
+ version: 1.0.0.beta.3
221
221
  - - <
222
222
  - !ruby/object:Gem::Version
223
223
  version: '2.0'
@@ -415,6 +415,8 @@ files:
415
415
  - lib/cocoapods/installer/analyzer.rb
416
416
  - lib/cocoapods/installer/analyzer/analysis_result.rb
417
417
  - lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
418
+ - lib/cocoapods/installer/analyzer/pod_variant.rb
419
+ - lib/cocoapods/installer/analyzer/pod_variant_set.rb
418
420
  - lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
419
421
  - lib/cocoapods/installer/analyzer/specs_state.rb
420
422
  - lib/cocoapods/installer/analyzer/target_inspection_result.rb