Commit cfc0d542 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' into pod_update

* master: (21 commits)
  Release 0.13.0
  Changelog
  [UserProjectIntegrator] Don't warn about overridden build settings if silent.
  [OpenURI] Reworked support for http to https redirects.
  [Podfile#podspec] Changelog and added disabled tests.
  [Podfile] Added Podfile#podspec.
  [Changelog]
  [UserProjectIntegrator] Check if the xcconfig files is overridden.
  [Linter] Detect warning disabling compiler flags.
  [OpenURI] Support for unsafe redirects.
  [inhibit_all_warningsDon't affect the final project.
  Release 0.12.0
  [Examples] Update RKTwitter Podfile.lock
  [CHANGELOG] Add entry about namespacing subspecs in Pods.xcodeproj
  [CHANGELOG] Update for 0.12.0
  [Project] Namespace subspecs in groups.
  Document Podfile#inhibit_all_warnings!
  Add Podfile#inhibit_all_warnings! to silence warnings, but not by default. #209
  Changelog
  "[Specification] Allow to require_arc in subspecs."
  ...
parents b0e8108f 79089b43
## Master ## 0.13.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.1...master) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.12.0...0.13.0)
###### Enhancements
- Add Podfile `podspec` which allows to use the dependencies of a podspec file. [#162](https://github.com/CocoaPods/CocoaPods/issues/162)
- Check if any of the build settings defined in the xcconfig files is overridden. [#92](https://github.com/CocoaPods/CocoaPods/issues/92)
- The Linter now checks that there are no compiler flags that disable warnings.
###### Bug fixes
- The final project isn’t affected anymore by the `inhibit_all_warnings!` option.
- Support for redirects while using podspec from an url. [#462](https://github.com/CocoaPods/CocoaPods/issues/462)
## 0.12.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.1...0.12.0)
###### Enhancements ###### Enhancements
- The documentation is generated using the public headers if they are specified. - The documentation is generated using the public headers if they are specified.
- In case of download failure, now the installation is aborted - In case of a download failure the installation is aborted and the error message is shown.
the error message of the external command that failed is presented.
- Git submodules are initialized only if requested. - Git submodules are initialized only if requested.
- 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) - 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)
- Support for GitHub Gists in the linter.
- Allow specifying ARC settings in subspecs.
- Add Podfile `inhibit_all_warnings!` which will inhibit all warnings from the Pods library. [#209](https://github.com/CocoaPods/CocoaPods/issues/209)
- Make the Pods Xcode project prettier by namespacing subspecs in nested groups. [#466](https://github.com/CocoaPods/CocoaPods/pull/466)
## 0.11.1 ## 0.11.1
......
...@@ -17,7 +17,7 @@ GIT ...@@ -17,7 +17,7 @@ GIT
PATH PATH
remote: . remote: .
specs: specs:
cocoapods (0.11.1) cocoapods (0.13.0)
activesupport (~> 3.2.6) activesupport (~> 3.2.6)
colored (~> 1.2) colored (~> 1.2)
escape (~> 0.0.4) escape (~> 0.0.4)
......
...@@ -2,30 +2,30 @@ PODS: ...@@ -2,30 +2,30 @@ PODS:
- FileMD5Hash (0.0.1) - FileMD5Hash (0.0.1)
- ISO8601DateFormatter (0.6) - ISO8601DateFormatter (0.6)
- JSONKit (1.5pre) - JSONKit (1.5pre)
- LibComponentLogging-Core (1.1.6) - LibComponentLogging-Core (1.2.2)
- LibComponentLogging-NSLog (1.0.4): - LibComponentLogging-NSLog (1.0.4):
- LibComponentLogging-Core (>= 1.1.6) - LibComponentLogging-Core (>= 1.1.6)
- NSData+Base64 (1.0.0) - NSData+Base64 (1.0.0)
- RestKit (0.10.1): - RestKit (0.10.2):
- RestKit/JSON (= 0.10.1) - RestKit/JSON (= 0.10.2)
- RestKit/JSON (0.10.1): - RestKit/JSON (0.10.2):
- RestKit/Network - RestKit/Network
- RestKit/ObjectMapping/CoreData - RestKit/ObjectMapping/CoreData
- RestKit/ObjectMapping/JSON - RestKit/ObjectMapping/JSON
- RestKit/UI - RestKit/UI
- RestKit/Network (0.10.1): - RestKit/Network (0.10.2):
- FileMD5Hash - FileMD5Hash
- LibComponentLogging-NSLog (>= 1.0.4) - LibComponentLogging-NSLog (>= 1.0.4)
- SOCKit - SOCKit
- cocoa-oauth - cocoa-oauth
- RestKit/ObjectMapping/CoreData (0.10.1): - RestKit/ObjectMapping/CoreData (0.10.2):
- ISO8601DateFormatter (>= 0.6) - ISO8601DateFormatter (>= 0.6)
- RestKit/Network - RestKit/Network
- RestKit/ObjectMapping/JSON (0.10.1): - RestKit/ObjectMapping/JSON (0.10.2):
- ISO8601DateFormatter (>= 0.6) - ISO8601DateFormatter (>= 0.6)
- JSONKit (>= 1.5pre) - JSONKit (>= 1.5pre)
- RestKit/Network - RestKit/Network
- RestKit/UI (0.10.1) - RestKit/UI (0.10.2)
- SOCKit (1.0) - SOCKit (1.0)
- cocoa-oauth (0.0.1): - cocoa-oauth (0.0.1):
- NSData+Base64 (~> 1.0) - NSData+Base64 (~> 1.0)
......
...@@ -13,7 +13,7 @@ unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new( ...@@ -13,7 +13,7 @@ unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(
end end
module Pod module Pod
VERSION = '0.11.1' VERSION = '0.13.0'
class PlainInformative < StandardError class PlainInformative < StandardError
end end
......
...@@ -220,22 +220,25 @@ module Pod ...@@ -220,22 +220,25 @@ module Pod
source = spec.source || {} source = spec.source || {}
text = @file.read text = @file.read
messages = [] messages = []
messages << "Missing license type" unless license[:type] messages << "Missing license type" unless license[:type]
messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/ messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/ messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/
messages << "The summary is not meaningful" if spec.summary =~ /A short description of/ messages << "The summary is not meaningful" if spec.summary =~ /A short description of/
messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/ messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/
messages << "The summary should end with a dot" if spec.summary !~ /.*\./ messages << "The summary should end with a dot" if spec.summary !~ /.*\./
messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
messages << "Git sources should specify either a tag or a commit" if source[:git] && !source[:commit] && !source[:tag] messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24
messages << "Github repositories should end in `.git'" if github_source? && source[:git] !~ /.*\.git/ messages << "Warnings must not be disabled (`-Wno' compiler flags)" if spec.compiler_flags.split(' ').any? {|flag| flag.start_with?('-Wno') }
messages << "Github repositories should use `https' link" if github_source? && source[:git] !~ /https:\/\/github.com/
messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24 if (git_source = source[:git])
messages messages << "Git sources should specify either a tag or a commit" unless source[:commit] || source[:tag]
end if git_source.include?('github.com')
messages << "Github repositories should end in `.git'" unless git_source.end_with?('.git')
messages << "Github repositories should use `https' link" unless git_source.start_with?('https://github.com') || git_source.start_with?('git://gist.github.com')
end
end
def github_source? messages
spec.source && spec.source[:git] =~ /github.com/
end end
# It creates a podfile in memory and builds a library containing # It creates a podfile in memory and builds a library containing
......
require 'open-uri' require 'cocoapods/open_uri'
module Pod module Pod
class Dependency < Gem::Dependency class Dependency < Gem::Dependency
......
...@@ -40,7 +40,7 @@ module Pod ...@@ -40,7 +40,7 @@ module Pod
if should_raise if should_raise
raise Informative, "#{name} #{command}\n\n#{output}" raise Informative, "#{name} #{command}\n\n#{output}"
else else
puts (Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red unless Config.instance.silent? puts((Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red) unless Config.instance.silent?
end end
end end
output output
......
...@@ -21,9 +21,11 @@ module Pod ...@@ -21,9 +21,11 @@ module Pod
@project.user_build_configurations = @podfile.user_build_configurations @project.user_build_configurations = @podfile.user_build_configurations
pods.each do |pod| pods.each do |pod|
# Add all source files to the project grouped by pod # Add all source files to the project grouped by pod
group = @project.add_pod_group(pod.name) pod.relative_source_files_by_spec.each do |spec, paths|
pod.relative_source_files.each do |path| group = @project.add_spec_group(spec.name)
group.files.new('path' => path.to_s) paths.each do |path|
group.files.new('path' => path.to_s)
end
end end
end end
# Add a group to hold all the target support files # Add a group to hold all the target support files
......
...@@ -13,10 +13,10 @@ module Pod ...@@ -13,10 +13,10 @@ module Pod
def xcconfig def xcconfig
@xcconfig ||= Xcodeproj::Config.new({ @xcconfig ||= Xcodeproj::Config.new({
# In a workspace this is where the static library headers should be found. # In a workspace this is where the static library headers should be found.
'PODS_ROOT' => @target_definition.relative_pods_root, 'PODS_ROOT' => @target_definition.relative_pods_root,
'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}', 'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}',
'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build 'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
'OTHER_LDFLAGS' => default_ld_flags, 'OTHER_LDFLAGS' => default_ld_flags
}) })
end end
...@@ -92,6 +92,7 @@ module Pod ...@@ -92,6 +92,7 @@ module Pod
config.build_settings['GCC_PREFIX_HEADER'] = @target_definition.prefix_header_name config.build_settings['GCC_PREFIX_HEADER'] = @target_definition.prefix_header_name
config.build_settings['PODS_ROOT'] = '${SRCROOT}' config.build_settings['PODS_ROOT'] = '${SRCROOT}'
config.build_settings['PODS_HEADERS_SEARCH_PATHS'] = '${PODS_BUILD_HEADERS_SEARCH_PATHS}' config.build_settings['PODS_HEADERS_SEARCH_PATHS'] = '${PODS_BUILD_HEADERS_SEARCH_PATHS}'
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = @target_definition.inhibit_all_warnings? ? 'YES' : 'NO'
end end
end end
...@@ -104,6 +105,8 @@ module Pod ...@@ -104,6 +105,8 @@ module Pod
end end
puts "- Generating xcconfig file at `#{sandbox.root + @target_definition.xcconfig_name}'" if config.verbose? puts "- Generating xcconfig file at `#{sandbox.root + @target_definition.xcconfig_name}'" if config.verbose?
xcconfig.save_as(sandbox.root + @target_definition.xcconfig_name) xcconfig.save_as(sandbox.root + @target_definition.xcconfig_name)
@target_definition.xcconfig = xcconfig
puts "- Generating prefix header at `#{sandbox.root + @target_definition.prefix_header_name}'" if config.verbose? puts "- Generating prefix header at `#{sandbox.root + @target_definition.prefix_header_name}'" if config.verbose?
save_prefix_header_as(sandbox.root + @target_definition.prefix_header_name, pods) save_prefix_header_as(sandbox.root + @target_definition.prefix_header_name, pods)
puts "- Generating copy resources script at `#{sandbox.root + @target_definition.copy_resources_script_name}'" if config.verbose? 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,7 +6,6 @@ require 'active_support/core_ext/array/conversions'
module Pod module Pod
class Installer class Installer
class UserProjectIntegrator class UserProjectIntegrator
include Pod::Config::Mixin include Pod::Config::Mixin
...@@ -58,6 +57,8 @@ module Pod ...@@ -58,6 +57,8 @@ module Pod
end end
class TargetIntegrator class TargetIntegrator
include Pod::Config::Mixin
attr_reader :target_definition attr_reader :target_definition
def initialize(target_definition) def initialize(target_definition)
...@@ -135,9 +136,30 @@ module Pod ...@@ -135,9 +136,30 @@ module Pod
def add_xcconfig_base_configuration def add_xcconfig_base_configuration
xcconfig = user_project.files.new('path' => @target_definition.xcconfig_relative_path) xcconfig = user_project.files.new('path' => @target_definition.xcconfig_relative_path)
targets.each do |target| targets.each do |target|
config_build_names_by_overriden_key = {}
target.build_configurations.each do |config| target.build_configurations.each do |config|
config_name = config.attributes["name"]
if @target_definition.xcconfig
@target_definition.xcconfig.attributes.each do |key, value|
target_value = config.build_settings[key]
if target_value && !target_value.include?('$(inherited)')
config_build_names_by_overriden_key[key] ||= []
config_build_names_by_overriden_key[key] << config_name
end
end
end
config.base_configuration = xcconfig config.base_configuration = xcconfig
end end
unless config.silent?
config_build_names_by_overriden_key.each do |key, config_build_names|
name = "#{target.attributes["name"]} [#{config_build_names.join(' - ')}]"
puts "\n[!] The target `#{name}' overrides the `#{key}' build setting defined in `#{@target_definition.xcconfig_relative_path}'.".yellow
puts " - Use the `$(inherited)' flag, or"
puts " - Remove the build settings from the target."
end
end
end end
end end
......
...@@ -194,6 +194,15 @@ module Pod ...@@ -194,6 +194,15 @@ module Pod
source_files.map{ |p| p.relative_path_from(@sandbox.root) } source_files.map{ |p| p.relative_path_from(@sandbox.root) }
end end
def relative_source_files_by_spec
result = {}
source_files_by_spec.each do |spec, paths|
result[spec] = paths.map{ |p| p.relative_path_from(@sandbox.root) }
end
result
end
# Finds the source files that every activated {Specification} requires. # Finds the source files that every activated {Specification} requires.
# #
# @note If the same file is required by two specifications the one at the # @note If the same file is required by two specifications the one at the
......
require 'open-uri'
# Inspiration from: https://gist.github.com/1271420
#
# Allow open-uri to follow http to https redirects.
# Relevant issue:
# http://redmine.ruby-lang.org/issues/3719
# Source here:
# https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb
module OpenURI
def OpenURI.redirectable?(uri1, uri2) # :nodoc:
# This test is intended to forbid a redirection from http://... to
# file:///etc/passwd, file:///dev/zero, etc. CVE-2011-1521
# https to http redirect is also forbidden intentionally.
# It avoids sending secure cookie or referer by non-secure HTTP protocol.
# (RFC 2109 4.3.1, RFC 2965 3.3, RFC 2616 15.1.3)
# However this is ad hoc. It should be extensible/configurable.
uri1.scheme.downcase == uri2.scheme.downcase ||
(/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
end
end
...@@ -62,7 +62,7 @@ module Pod ...@@ -62,7 +62,7 @@ module Pod
attr_reader :name, :target_dependencies attr_reader :name, :target_dependencies
attr_accessor :user_project, :link_with, :platform, :parent, :exclusive attr_accessor :user_project, :link_with, :platform, :parent, :exclusive, :inhibit_all_warnings
def initialize(name, options = {}) def initialize(name, options = {})
@name, @target_dependencies = name, [] @name, @target_dependencies = name, []
...@@ -96,6 +96,11 @@ module Pod ...@@ -96,6 +96,11 @@ module Pod
@platform || (@parent.platform if @parent) @platform || (@parent.platform if @parent)
end end
def inhibit_all_warnings
@inhibit_all_warnings.nil? ? (@parent.inhibit_all_warnings? if @parent) : @inhibit_all_warnings
end
alias_method :inhibit_all_warnings?, :inhibit_all_warnings
def label def label
if name == :default if name == :default
"Pods" "Pods"
...@@ -138,6 +143,8 @@ module Pod ...@@ -138,6 +143,8 @@ module Pod
relative_to_srcroot("Pods/#{xcconfig_name}").to_s relative_to_srcroot("Pods/#{xcconfig_name}").to_s
end end
attr_accessor :xcconfig
def copy_resources_script_name def copy_resources_script_name
"#{label}-resources.sh" "#{label}-resources.sh"
end end
...@@ -284,6 +291,13 @@ module Pod ...@@ -284,6 +291,13 @@ module Pod
@target_definition.link_with = targets @target_definition.link_with = targets
end end
# Inhibits **all** warnings from the Pods library.
#
# When used, this is applied to all targets inheriting from the current one.
def inhibit_all_warnings!
@target_definition.inhibit_all_warnings = true
end
# Specifies a dependency of the project. # Specifies a dependency of the project.
# #
# A dependency requirement is defined by the name of the Pod and _optionally_ # A dependency requirement is defined by the name of the Pod and _optionally_
...@@ -389,6 +403,26 @@ module Pod ...@@ -389,6 +403,26 @@ module Pod
@target_definition.target_dependencies << Dependency.new(*name_and_version_requirements, &block) @target_definition.target_dependencies << Dependency.new(*name_and_version_requirements, &block)
end end
# Use the dependencies of a podspec file.
#
def podspec(options = nil)
if options && path = options[:path]
path = File.extname(path) == '.podspec' ? path : "#{path}.podspec"
file = Pathname.new(File.expand_path(path))
elsif options && name = options[:name]
name = File.extname(name) == '.podspec' ? name : "#{name}.podspec"
file = config.project_root + name
else
file = config.project_root.glob('*.podspec').first
end
spec = Specification.from_file(file)
spec.activate_platform(@target_definition.platform)
deps = spec.recursive_subspecs.push(spec).map {|specification| specification.external_dependencies }
deps = deps.flatten.uniq
@target_definition.target_dependencies.concat(deps)
end
def dependency(*name_and_version_requirements, &block) def dependency(*name_and_version_requirements, &block)
warn "[DEPRECATED] `dependency' is deprecated (use `pod')" warn "[DEPRECATED] `dependency' is deprecated (use `pod')"
pod(*name_and_version_requirements, &block) pod(*name_and_version_requirements, &block)
......
...@@ -34,9 +34,15 @@ module Pod ...@@ -34,9 +34,15 @@ module Pod
groups.find { |g| g.name == 'Pods' } || groups.new({ 'name' => 'Pods' }) groups.find { |g| g.name == 'Pods' } || groups.new({ 'name' => 'Pods' })
end end
# Adds a group as child to the `Pods' group. # Adds a group as child to the `Pods' group namespacing subspecs.
def add_pod_group(name) def add_spec_group(name)
pods.groups.new('name' => name) groups = pods.groups
group = nil
name.split('/').each do |name|
group = groups.find { |g| g.name == name } || groups.new({ 'name' => name })
groups = group.groups
end
group
end end
def add_pod_target(name, platform) def add_pod_target(name, platform)
......
...@@ -51,8 +51,9 @@ module Pod ...@@ -51,8 +51,9 @@ module Pod
compiler_flags ].each do |attr| compiler_flags ].each do |attr|
instance_variable_set( "@#{attr}", { :ios => [], :osx => [] } ) instance_variable_set( "@#{attr}", { :ios => [], :osx => [] } )
end end
@xcconfig = { :ios => Xcodeproj::Config.new, :osx => Xcodeproj::Config.new } @xcconfig = { :ios => Xcodeproj::Config.new, :osx => Xcodeproj::Config.new }
@header_dir = { :ios => nil, :osx => nil } @header_dir = { :ios => nil, :osx => nil }
@requires_arc = { :ios => nil, :osx => nil }
yield self if block_given? yield self if block_given?
end end
...@@ -137,6 +138,7 @@ module Pod ...@@ -137,6 +138,7 @@ module Pod
compiler_flags= compiler_flags=
deployment_target= deployment_target=
header_dir= header_dir=
requires_arc
dependency }.each do |method| dependency }.each do |method|
define_method(method) do |args| define_method(method) do |args|
@specification._on_platform(@platform) do @specification._on_platform(@platform) do
...@@ -200,7 +202,6 @@ module Pod ...@@ -200,7 +202,6 @@ module Pod
top_attr_accessor :homepage top_attr_accessor :homepage
top_attr_accessor :summary top_attr_accessor :summary
top_attr_accessor :documentation top_attr_accessor :documentation
top_attr_accessor :requires_arc
top_attr_accessor :version, lambda { |v| Version.new(v) } top_attr_accessor :version, lambda { |v| Version.new(v) }
top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary } top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary }
...@@ -261,6 +262,24 @@ module Pod ...@@ -261,6 +262,24 @@ module Pod
alias_method :weak_framework=, :weak_frameworks= alias_method :weak_framework=, :weak_frameworks=
alias_method :library=, :libraries= alias_method :library=, :libraries=
# @!method requires_arc=
#
# @abstract Wether the `-fobjc-arc' flag should be added to the compiler
# flags.
#
# @param [Bool] Wether the source files require ARC.
#
platform_attr_writer :requires_arc
def requires_arc
requires_arc = @requires_arc[active_platform]
if requires_arc.nil?
requires_arc = @parent ? @parent.requires_arc : false
end
requires_arc
end
# @!method header_dir= # @!method header_dir=
# #
# @abstract The directory where to name space the headers files of # @abstract The directory where to name space the headers files of
......
...@@ -66,6 +66,21 @@ describe Pod::Installer::TargetInstaller do ...@@ -66,6 +66,21 @@ describe Pod::Installer::TargetInstaller do
@installer.xcconfig.to_hash['OTHER_LDFLAGS'].split(" ").should.include("-fobjc-arc") @installer.xcconfig.to_hash['OTHER_LDFLAGS'].split(" ").should.include("-fobjc-arc")
end end
it "does not enable the GCC_WARN_INHIBIT_ALL_WARNINGS flag by default" do
do_install!
@installer.target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'].should == 'NO'
end
end
it "enables the GCC_WARN_INHIBIT_ALL_WARNINGS flag" do
@podfile.inhibit_all_warnings!
do_install!
@installer.target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'].should == 'YES'
end
end
it "creates a prefix header, including the contents of the specification's prefix header file" do it "creates a prefix header, including the contents of the specification's prefix header file" do
do_install! do_install!
prefix_header = @sandbox.root + 'Pods.pch' prefix_header = @sandbox.root + 'Pods.pch'
......
...@@ -151,6 +151,7 @@ describe "Pod::Podfile" do ...@@ -151,6 +151,7 @@ describe "Pod::Podfile" do
target :test, :exclusive => true do target :test, :exclusive => true do
link_with 'TestRunner' link_with 'TestRunner'
inhibit_all_warnings!
pod 'JSONKit' pod 'JSONKit'
target :subtarget do target :subtarget do
pod 'Reachability' pod 'Reachability'
...@@ -295,6 +296,12 @@ describe "Pod::Podfile" do ...@@ -295,6 +296,12 @@ describe "Pod::Podfile" do
project.build_configurations.should == { 'Release' => :release, 'Debug' => :debug, 'Test' => :debug, 'App Store' => :release } project.build_configurations.should == { 'Release' => :release, 'Debug' => :debug, 'Test' => :debug, 'App Store' => :release }
end end
it "specifies that the inhibit all warnings flag should be added to the target's build settings" do
@podfile.target_definitions[:default].should.not.inhibit_all_warnings
@podfile.target_definitions[:test].should.inhibit_all_warnings
@podfile.target_definitions[:subtarget].should.inhibit_all_warnings
end
describe "with an Xcode project that's not in the project_root" do describe "with an Xcode project that's not in the project_root" do
before do before do
@target_definition = @podfile.target_definitions[:default] @target_definition = @podfile.target_definitions[:default]
...@@ -323,6 +330,19 @@ describe "Pod::Podfile" do ...@@ -323,6 +330,19 @@ describe "Pod::Podfile" do
end end
end end
end end
describe "concerning the podspec method" do
xit "it can use use the dependencies of a podspec" do
end
xit "it allows to specify the name of a podspec" do
end
xit "it allows to specify the path of a podspec" do
end
end
describe "concerning validations" do describe "concerning validations" do
......
...@@ -12,7 +12,7 @@ describe 'Pod::Project' do ...@@ -12,7 +12,7 @@ describe 'Pod::Project' do
end end
it "adds a group to the `Pods' group" do it "adds a group to the `Pods' group" do
group = @project.add_pod_group('JSONKit') group = @project.add_spec_group('JSONKit')
@project.pods.child_references.should.include group.uuid @project.pods.child_references.should.include group.uuid
find_object({ find_object({
'isa' => 'PBXGroup', 'isa' => 'PBXGroup',
...@@ -22,6 +22,17 @@ describe 'Pod::Project' do ...@@ -22,6 +22,17 @@ describe 'Pod::Project' do
}).should.not == nil }).should.not == nil
end end
it "namespaces subspecs in groups" do
group = @project.add_spec_group('JSONKit/Subspec')
@project.pods.groups.find { |g| g.name == 'JSONKit' }.child_references.should.include group.uuid
find_object({
'isa' => 'PBXGroup',
'name' => 'Subspec',
'sourceTree' => '<group>',
'children' => []
}).should.not == nil
end
it "creates a copy build header phase which will copy headers to a specified path" do it "creates a copy build header phase which will copy headers to a specified path" do
@project.targets.new @project.targets.new
phase = @project.targets.first.copy_files_build_phases.new_pod_dir("SomePod", "Path/To/Source") phase = @project.targets.first.copy_files_build_phases.new_pod_dir("SomePod", "Path/To/Source")
......
...@@ -305,6 +305,7 @@ describe "A Pod::Specification subspec" do ...@@ -305,6 +305,7 @@ describe "A Pod::Specification subspec" do
fss.subspec 'SecondSubSpec' do |sss| fss.subspec 'SecondSubSpec' do |sss|
sss.source_files = 'subsubspec.m' sss.source_files = 'subsubspec.m'
sss.requires_arc = false
end end
end end
end end
...@@ -329,7 +330,7 @@ describe "A Pod::Specification subspec" do ...@@ -329,7 +330,7 @@ describe "A Pod::Specification subspec" do
it "automatically forwards top level attributes to the top level parent" do it "automatically forwards top level attributes to the top level parent" do
@spec.activate_platform(:ios) @spec.activate_platform(:ios)
[:version, :license, :authors, :requires_arc, :compiler_flags].each do |attr| [:version, :license, :authors, :compiler_flags].each do |attr|
@spec.subspecs.first.send(attr).should == @spec.send(attr) @spec.subspecs.first.send(attr).should == @spec.send(attr)
@spec.subspecs.first.subspecs.first.send(attr).should == @spec.send(attr) @spec.subspecs.first.subspecs.first.send(attr).should == @spec.send(attr)
end end
...@@ -346,6 +347,13 @@ describe "A Pod::Specification subspec" do ...@@ -346,6 +347,13 @@ describe "A Pod::Specification subspec" do
@subsubspec.compiler_flags.should == ' -fobjc-arc -Wdeprecated-implementations' @subsubspec.compiler_flags.should == ' -fobjc-arc -Wdeprecated-implementations'
end end
it "allows to specify arc settings for subspecs" do
@spec.activate_platform(:ios)
@spec.requires_arc.should == true
@subspec.requires_arc.should == true
@subsubspec.requires_arc.should == false
end
it "returns empty arrays for chained attributes with no value in the chain" do it "returns empty arrays for chained attributes with no value in the chain" do
@spec = Pod::Spec.new do |s| @spec = Pod::Spec.new do |s|
s.name = 'MainSpec' s.name = 'MainSpec'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment