cocoapods 1.3.1 → 1.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,7 +72,7 @@ module Pod
72
72
  # #requires_frameworks?.
73
73
  #
74
74
  def product_type
75
- requires_frameworks? ? :framework : :static_library
75
+ requires_frameworks? && !static_framework? ? :framework : :static_library
76
76
  end
77
77
 
78
78
  # @return [String] A string suitable for debugging.
@@ -90,6 +90,12 @@ module Pod
90
90
  host_requires_frameworks? || false
91
91
  end
92
92
 
93
+ # @return [Boolean] Whether the target should build a static framework.
94
+ #
95
+ def static_framework?
96
+ !is_a?(Pod::AggregateTarget) && specs.any? && specs.all?(&:static_framework)
97
+ end
98
+
93
99
  #-------------------------------------------------------------------------#
94
100
 
95
101
  # @!group Information storage
@@ -194,7 +194,7 @@ module Pod
194
194
  relevant_pod_targets = pod_targets.select do |pod_target|
195
195
  pod_target.include_in_build_config?(target_definition, config)
196
196
  end
197
- framework_paths_by_config[config] = relevant_pod_targets.flat_map(&:framework_paths)
197
+ framework_paths_by_config[config] = relevant_pod_targets.flat_map { |pt| pt.framework_paths(false) }
198
198
  end
199
199
  framework_paths_by_config
200
200
  end
@@ -210,7 +210,7 @@ module Pod
210
210
  user_build_configurations.keys.each_with_object({}) do |config, resources_by_config|
211
211
  resources_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
212
212
  next [] unless pod_target.include_in_build_config?(target_definition, config)
213
- (pod_target.resource_paths + [bridge_support_file].compact).uniq
213
+ (pod_target.resource_paths(false) + [bridge_support_file].compact).uniq
214
214
  end
215
215
  end
216
216
  end
@@ -197,51 +197,73 @@ module Pod
197
197
  specs.select(&:test_specification?).map(&:test_type).uniq
198
198
  end
199
199
 
200
+ # Returns the framework paths associated with this target. By default all paths include the framework paths
201
+ # that are part of test specifications.
202
+ #
203
+ # @param [Boolean] include_test_spec_paths
204
+ # Whether to include framework paths from test specifications or not.
205
+ #
200
206
  # @return [Array<Hash{Symbol => [String]}>] The vendored and non vendored framework paths
201
207
  # this target depends upon.
202
208
  #
203
- def framework_paths
204
- @framework_paths ||= begin
205
- frameworks = []
206
- file_accessors.flat_map(&:vendored_dynamic_artifacts).map do |framework_path|
207
- relative_path_to_sandbox = framework_path.relative_path_from(sandbox.root)
208
- framework = { :name => framework_path.basename.to_s,
209
- :input_path => "${PODS_ROOT}/#{relative_path_to_sandbox}",
210
- :output_path => "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{framework_path.basename}" }
211
- # Until this can be configured, assume the dSYM file uses the file name as the framework.
212
- # See https://github.com/CocoaPods/CocoaPods/issues/1698
213
- dsym_name = "#{framework_path.basename}.dSYM"
214
- dsym_path = Pathname.new("#{framework_path.dirname}/#{dsym_name}")
215
- if dsym_path.exist?
216
- framework[:dsym_name] = dsym_name
217
- framework[:dsym_input_path] = "${PODS_ROOT}/#{relative_path_to_sandbox}.dSYM"
218
- framework[:dsym_output_path] = "${DWARF_DSYM_FOLDER_PATH}/#{dsym_name}"
209
+ def framework_paths(include_test_spec_paths = true)
210
+ @framework_paths ||= Hash.new do |h, key|
211
+ h[key] = begin
212
+ accessors = file_accessors
213
+ accessors = accessors.reject { |a| a.spec.test_specification? } unless include_test_spec_paths
214
+ frameworks = []
215
+ accessors.flat_map(&:vendored_dynamic_artifacts).map do |framework_path|
216
+ relative_path_to_sandbox = framework_path.relative_path_from(sandbox.root)
217
+ framework = { :name => framework_path.basename.to_s,
218
+ :input_path => "${PODS_ROOT}/#{relative_path_to_sandbox}",
219
+ :output_path => "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{framework_path.basename}" }
220
+ # Until this can be configured, assume the dSYM file uses the file name as the framework.
221
+ # See https://github.com/CocoaPods/CocoaPods/issues/1698
222
+ dsym_name = "#{framework_path.basename}.dSYM"
223
+ dsym_path = Pathname.new("#{framework_path.dirname}/#{dsym_name}")
224
+ if dsym_path.exist?
225
+ framework[:dsym_name] = dsym_name
226
+ framework[:dsym_input_path] = "${PODS_ROOT}/#{relative_path_to_sandbox}.dSYM"
227
+ framework[:dsym_output_path] = "${DWARF_DSYM_FOLDER_PATH}/#{dsym_name}"
228
+ end
229
+ frameworks << framework
219
230
  end
220
- frameworks << framework
221
- end
222
- if should_build? && requires_frameworks?
223
- frameworks << { :name => product_name,
224
- :input_path => build_product_path('${BUILT_PRODUCTS_DIR}'),
225
- :output_path => "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{product_name}" }
231
+ if should_build? && requires_frameworks? && !static_framework?
232
+ frameworks << { :name => product_name,
233
+ :input_path => build_product_path('${BUILT_PRODUCTS_DIR}'),
234
+ :output_path => "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{product_name}" }
235
+ end
236
+ frameworks
226
237
  end
227
- frameworks
228
238
  end
239
+ @framework_paths[include_test_spec_paths]
229
240
  end
230
241
 
242
+ # Returns the resource paths associated with this target. By default all paths include the resource paths
243
+ # that are part of test specifications.
244
+ #
245
+ # @param [Boolean] include_test_spec_paths
246
+ # Whether to include resource paths from test specifications or not.
247
+ #
231
248
  # @return [Array<String>] The resource and resource bundle paths this target depends upon.
232
249
  #
233
- def resource_paths
234
- @resource_paths ||= begin
235
- resource_paths = file_accessors.flat_map do |accessor|
236
- accessor.resources.flat_map { |res| "${PODS_ROOT}/#{res.relative_path_from(sandbox.project.path.dirname)}" }
237
- end
238
- resource_bundles = file_accessors.flat_map do |accessor|
239
- prefix = Generator::XCConfig::XCConfigHelper::CONFIGURATION_BUILD_DIR_VARIABLE
240
- prefix = configuration_build_dir unless accessor.spec.test_specification?
241
- accessor.resource_bundles.keys.map { |name| "#{prefix}/#{name.shellescape}.bundle" }
250
+ def resource_paths(include_test_spec_paths = true)
251
+ @resource_paths ||= Hash.new do |h, key|
252
+ h[key] = begin
253
+ accessors = file_accessors
254
+ accessors = accessors.reject { |a| a.spec.test_specification? } unless include_test_spec_paths
255
+ resource_paths = accessors.flat_map do |accessor|
256
+ accessor.resources.flat_map { |res| "${PODS_ROOT}/#{res.relative_path_from(sandbox.project.path.dirname)}" }
257
+ end
258
+ resource_bundles = accessors.flat_map do |accessor|
259
+ prefix = Generator::XCConfig::XCConfigHelper::CONFIGURATION_BUILD_DIR_VARIABLE
260
+ prefix = configuration_build_dir unless accessor.spec.test_specification?
261
+ accessor.resource_bundles.keys.map { |name| "#{prefix}/#{name.shellescape}.bundle" }
262
+ end
263
+ resource_paths + resource_bundles
242
264
  end
243
- resource_paths + resource_bundles
244
265
  end
266
+ @resource_paths[include_test_spec_paths]
245
267
  end
246
268
 
247
269
  # Returns the corresponding native target to use based on the provided specification.
@@ -249,7 +271,7 @@ module Pod
249
271
  # test native targets.
250
272
  #
251
273
  # @param [Specification] spec
252
- # The specifcation to base from in order to find the native target.
274
+ # The specification to base from in order to find the native target.
253
275
  #
254
276
  # @return [PBXNativeTarget] the native target to use or `nil` if none is found.
255
277
  #
@@ -14,6 +14,10 @@ module Pod
14
14
  class Validator
15
15
  include Config::Mixin
16
16
 
17
+ # The default version of Swift to use when linting pods
18
+ #
19
+ DEFAULT_SWIFT_VERSION = '3.0'.freeze
20
+
17
21
  # @return [Specification::Linter] the linter instance from CocoaPods
18
22
  # Core.
19
23
  #
@@ -252,7 +256,12 @@ module Pod
252
256
  # @return [String] the SWIFT_VERSION to use for validation.
253
257
  #
254
258
  def swift_version
255
- @swift_version ||= dot_swift_version || '3.0'
259
+ return @swift_version if defined?(@swift_version)
260
+ if version = dot_swift_version
261
+ @swift_version = version
262
+ else
263
+ DEFAULT_SWIFT_VERSION
264
+ end
256
265
  end
257
266
 
258
267
  # Set the SWIFT_VERSION that should be used to validate the pod.
@@ -386,7 +395,7 @@ module Pod
386
395
  end
387
396
 
388
397
  def validate_dot_swift_version
389
- if !used_swift_version.nil? && dot_swift_version.nil?
398
+ if !used_swift_version.nil? && @swift_version.nil?
390
399
  warning(:swift_version,
391
400
  'The validator for Swift projects uses ' \
392
401
  'Swift 3.0 by default, if you are using a different version of ' \
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.3.1
4
+ version: 1.4.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: 2017-08-06 00:00:00.000000000 Z
14
+ date: 2017-09-24 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.3.1
22
+ version: 1.4.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.3.1
29
+ version: 1.4.0.beta.1
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.5.7
196
+ version: 0.6.1
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.5.7
203
+ version: 0.6.1
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.5.1
210
+ version: 1.5.2
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.5.1
220
+ version: 1.5.2
221
221
  - - "<"
222
222
  - !ruby/object:Gem::Version
223
223
  version: '2.0'