cocoapods 0.12.0 → 0.13.0

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.
@@ -1,3 +1,18 @@
1
+ ## 0.13.0
2
+
3
+ [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.12.0...0.13.0)
4
+
5
+ ###### Enhancements
6
+
7
+ - Add Podfile `podspec` which allows to use the dependencies of a podspec file. [#162](https://github.com/CocoaPods/CocoaPods/issues/162)
8
+ - Check if any of the build settings defined in the xcconfig files is overridden. [#92](https://github.com/CocoaPods/CocoaPods/issues/92)
9
+ - The Linter now checks that there are no compiler flags that disable warnings.
10
+
11
+ ###### Bug fixes
12
+
13
+ - The final project isn’t affected anymore by the `inhibit_all_warnings!` option.
14
+ - Support for redirects while using podspec from an url. [#462](https://github.com/CocoaPods/CocoaPods/issues/462)
15
+
1
16
  ## 0.12.0
2
17
 
3
18
  [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.1...0.12.0)
@@ -10,7 +25,7 @@
10
25
  - Don’t impose a certain structure of the user’s project by raising if no ‘Frameworks’ group exists. [#431](https://github.com/CocoaPods/CocoaPods/pull/431)
11
26
  - Support for GitHub Gists in the linter.
12
27
  - Allow specifying ARC settings in subspecs.
13
- - Add Podfile#inhibit_all_warnings! which will inhibit all warnings from the Pods library. [#209](https://github.com/CocoaPods/CocoaPods/issues/209)
28
+ - Add Podfile `inhibit_all_warnings!` which will inhibit all warnings from the Pods library. [#209](https://github.com/CocoaPods/CocoaPods/issues/209)
14
29
  - Make the Pods Xcode project prettier by namespacing subspecs in nested groups. [#466](https://github.com/CocoaPods/CocoaPods/pull/466)
15
30
 
16
31
 
@@ -13,7 +13,7 @@ unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(
13
13
  end
14
14
 
15
15
  module Pod
16
- VERSION = '0.12.0'
16
+ VERSION = '0.13.0'
17
17
 
18
18
  class PlainInformative < StandardError
19
19
  end
@@ -218,14 +218,15 @@ module Pod
218
218
  source = spec.source || {}
219
219
  text = @file.read
220
220
  messages = []
221
- messages << "Missing license type" unless license[:type]
222
- messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
223
- messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/
224
- messages << "The summary is not meaningful" if spec.summary =~ /A short description of/
225
- messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/
226
- messages << "The summary should end with a dot" if spec.summary !~ /.*\./
227
- messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
228
- messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24
221
+ messages << "Missing license type" unless license[:type]
222
+ messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
223
+ messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/
224
+ messages << "The summary is not meaningful" if spec.summary =~ /A short description of/
225
+ messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/
226
+ messages << "The summary should end with a dot" if spec.summary !~ /.*\./
227
+ messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
228
+ messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24
229
+ messages << "Warnings must not be disabled (`-Wno' compiler flags)" if spec.compiler_flags.split(' ').any? {|flag| flag.start_with?('-Wno') }
229
230
 
230
231
  if (git_source = source[:git])
231
232
  messages << "Git sources should specify either a tag or a commit" unless source[:commit] || source[:tag]
@@ -1,4 +1,4 @@
1
- require 'open-uri'
1
+ require 'cocoapods/open_uri'
2
2
 
3
3
  module Pod
4
4
  class Dependency < Gem::Dependency
@@ -40,7 +40,7 @@ module Pod
40
40
  if should_raise
41
41
  raise Informative, "#{name} #{command}\n\n#{output}"
42
42
  else
43
- puts (Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red unless Config.instance.silent?
43
+ puts((Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red) unless Config.instance.silent?
44
44
  end
45
45
  end
46
46
  output
@@ -16,8 +16,7 @@ module Pod
16
16
  'PODS_ROOT' => @target_definition.relative_pods_root,
17
17
  'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}',
18
18
  'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
19
- 'OTHER_LDFLAGS' => default_ld_flags,
20
- 'GCC_WARN_INHIBIT_ALL_WARNINGS' => @target_definition.inhibit_all_warnings? ? 'YES' : 'NO',
19
+ 'OTHER_LDFLAGS' => default_ld_flags
21
20
  })
22
21
  end
23
22
 
@@ -93,6 +92,7 @@ module Pod
93
92
  config.build_settings['GCC_PREFIX_HEADER'] = @target_definition.prefix_header_name
94
93
  config.build_settings['PODS_ROOT'] = '${SRCROOT}'
95
94
  config.build_settings['PODS_HEADERS_SEARCH_PATHS'] = '${PODS_BUILD_HEADERS_SEARCH_PATHS}'
95
+ config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = @target_definition.inhibit_all_warnings? ? 'YES' : 'NO'
96
96
  end
97
97
  end
98
98
 
@@ -105,6 +105,8 @@ module Pod
105
105
  end
106
106
  puts "- Generating xcconfig file at `#{sandbox.root + @target_definition.xcconfig_name}'" if config.verbose?
107
107
  xcconfig.save_as(sandbox.root + @target_definition.xcconfig_name)
108
+ @target_definition.xcconfig = xcconfig
109
+
108
110
  puts "- Generating prefix header at `#{sandbox.root + @target_definition.prefix_header_name}'" if config.verbose?
109
111
  save_prefix_header_as(sandbox.root + @target_definition.prefix_header_name, pods)
110
112
  puts "- Generating copy resources script at `#{sandbox.root + @target_definition.copy_resources_script_name}'" if config.verbose?
@@ -6,7 +6,6 @@ require 'active_support/core_ext/array/conversions'
6
6
 
7
7
  module Pod
8
8
  class Installer
9
-
10
9
  class UserProjectIntegrator
11
10
  include Pod::Config::Mixin
12
11
 
@@ -58,6 +57,8 @@ module Pod
58
57
  end
59
58
 
60
59
  class TargetIntegrator
60
+ include Pod::Config::Mixin
61
+
61
62
  attr_reader :target_definition
62
63
 
63
64
  def initialize(target_definition)
@@ -135,9 +136,30 @@ module Pod
135
136
  def add_xcconfig_base_configuration
136
137
  xcconfig = user_project.files.new('path' => @target_definition.xcconfig_relative_path)
137
138
  targets.each do |target|
139
+ config_build_names_by_overriden_key = {}
138
140
  target.build_configurations.each do |config|
141
+ config_name = config.attributes["name"]
142
+ if @target_definition.xcconfig
143
+ @target_definition.xcconfig.attributes.each do |key, value|
144
+ target_value = config.build_settings[key]
145
+ if target_value && !target_value.include?('$(inherited)')
146
+ config_build_names_by_overriden_key[key] ||= []
147
+ config_build_names_by_overriden_key[key] << config_name
148
+ end
149
+ end
150
+ end
151
+
139
152
  config.base_configuration = xcconfig
140
153
  end
154
+
155
+ unless config.silent?
156
+ config_build_names_by_overriden_key.each do |key, config_build_names|
157
+ name = "#{target.attributes["name"]} [#{config_build_names.join(' - ')}]"
158
+ puts "\n[!] The target `#{name}' overrides the `#{key}' build setting defined in `#{@target_definition.xcconfig_relative_path}'.".yellow
159
+ puts " - Use the `$(inherited)' flag, or"
160
+ puts " - Remove the build settings from the target."
161
+ end
162
+ end
141
163
  end
142
164
  end
143
165
 
@@ -0,0 +1,22 @@
1
+ require 'open-uri'
2
+
3
+ # Inspiration from: https://gist.github.com/1271420
4
+ #
5
+ # Allow open-uri to follow http to https redirects.
6
+ # Relevant issue:
7
+ # http://redmine.ruby-lang.org/issues/3719
8
+ # Source here:
9
+ # https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb
10
+
11
+ module OpenURI
12
+ def OpenURI.redirectable?(uri1, uri2) # :nodoc:
13
+ # This test is intended to forbid a redirection from http://... to
14
+ # file:///etc/passwd, file:///dev/zero, etc. CVE-2011-1521
15
+ # https to http redirect is also forbidden intentionally.
16
+ # It avoids sending secure cookie or referer by non-secure HTTP protocol.
17
+ # (RFC 2109 4.3.1, RFC 2965 3.3, RFC 2616 15.1.3)
18
+ # However this is ad hoc. It should be extensible/configurable.
19
+ uri1.scheme.downcase == uri2.scheme.downcase ||
20
+ (/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
21
+ end
22
+ end
@@ -143,6 +143,8 @@ module Pod
143
143
  relative_to_srcroot("Pods/#{xcconfig_name}").to_s
144
144
  end
145
145
 
146
+ attr_accessor :xcconfig
147
+
146
148
  def copy_resources_script_name
147
149
  "#{label}-resources.sh"
148
150
  end
@@ -401,6 +403,26 @@ module Pod
401
403
  @target_definition.target_dependencies << Dependency.new(*name_and_version_requirements, &block)
402
404
  end
403
405
 
406
+ # Use the dependencies of a podspec file.
407
+ #
408
+ def podspec(options = nil)
409
+ if options && path = options[:path]
410
+ path = File.extname(path) == '.podspec' ? path : "#{path}.podspec"
411
+ file = Pathname.new(File.expand_path(path))
412
+ elsif options && name = options[:name]
413
+ name = File.extname(name) == '.podspec' ? name : "#{name}.podspec"
414
+ file = config.project_root + name
415
+ else
416
+ file = config.project_root.glob('*.podspec').first
417
+ end
418
+
419
+ spec = Specification.from_file(file)
420
+ spec.activate_platform(@target_definition.platform)
421
+ deps = spec.recursive_subspecs.push(spec).map {|specification| specification.external_dependencies }
422
+ deps = deps.flatten.uniq
423
+ @target_definition.target_dependencies.concat(deps)
424
+ end
425
+
404
426
  def dependency(*name_and_version_requirements, &block)
405
427
  warn "[DEPRECATED] `dependency' is deprecated (use `pod')"
406
428
  pod(*name_and_version_requirements, &block)
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: 0.12.0
4
+ version: 0.13.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-21 00:00:00.000000000 Z
12
+ date: 2012-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -219,6 +219,7 @@ files:
219
219
  - lib/cocoapods/installer/user_project_integrator.rb
220
220
  - lib/cocoapods/installer.rb
221
221
  - lib/cocoapods/local_pod.rb
222
+ - lib/cocoapods/open_uri.rb
222
223
  - lib/cocoapods/platform.rb
223
224
  - lib/cocoapods/podfile.rb
224
225
  - lib/cocoapods/project.rb
@@ -247,6 +248,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
247
248
  - - ! '>='
248
249
  - !ruby/object:Gem::Version
249
250
  version: '0'
251
+ segments:
252
+ - 0
253
+ hash: -4262586361152659558
250
254
  required_rubygems_version: !ruby/object:Gem::Requirement
251
255
  none: false
252
256
  requirements:
@@ -255,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
259
  version: '0'
256
260
  requirements: []
257
261
  rubyforge_project:
258
- rubygems_version: 1.8.23
262
+ rubygems_version: 1.8.24
259
263
  signing_key:
260
264
  specification_version: 3
261
265
  summary: An Objective-C library package manager.