Commit 976f8ee8 authored by Marin Usalj's avatar Marin Usalj

Merge branch 'master' into inhibit_warnings

parents b78ef99b c2a192f0
## 0.17.3 (unreleased)
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.17.2...0.17.3)
[cocoapods-core](https://github.com/CocoaPods/Core/compare/0.17.2...0.17.3)
[Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.5.2...0.5.3)
[Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.5.2...0.5.4)
###### Enhancements
* The `pod search` commands now accepts the `--ios` and the `--osx` arguments
to filter the results by platform.
[#625](https://github.com/CocoaPods/CocoaPods/issues/625)
* The developer frameworks are automatically added if `SenTestingKit` is
detected. There is no need to specify them in specifications anymore.
[#771](https://github.com/CocoaPods/CocoaPods/issues/771)
* The `--no-update` argument of the `install`, `update`, `outdated` subcommands
has been renamed to `--no-repo-update`.
[#913](https://github.com/CocoaPods/CocoaPods/issues/913)
###### Enhancements
......@@ -13,12 +25,16 @@
###### Bug fixes
* Improved handling for Xcode projects containing non ASCII characters.
Special thanks to Cédric Luthi (@0xced) and to Vincent Isambart
(@vincentisambart) for helping to develop the workaround.
Special thanks to Cédric Luthi (@0xced), Vincent Isambart (@vincentisambart),
and Manfred Stienstra (@Manfred) for helping to develop the workaround.
[#926](https://github.com/CocoaPods/CocoaPods/issues/926)
* Corrected improper configuration of the PODS_ROOT xcconfig variable in
non-integrating installations.
[#918](https://github.com/CocoaPods/CocoaPods/issues/918)
* Improved support for pre-release versions using dashes.
[#935](https://github.com/CocoaPods/CocoaPods/issues/935)
* Documentation sets are now namespaced by pod solving improper attribution.
[#659](https://github.com/CocoaPods/CocoaPods/issues/659)
## 0.17.2
......
......@@ -6,13 +6,15 @@ end
gemspec
group :development do
gem "cocoapods-core", :git => "git://github.com/CocoaPods/Core.git"
gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
gem "cocoapods-downloader", :git => "git://github.com/CocoaPods/cocoapods-downloader"
# gem "cocoapods-core", :path => "../Core"
# gem "xcodeproj", :path => "../Xcodeproj"
# gem "cocoapods-downloader", :path => "../cocoapods-downloader"
if ENV['COCOA_PODS_DEPENDENCIES'] == 'local'
gem 'cocoapods-core', :path => '../Core'
gem 'xcodeproj', :path => '../Xcodeproj'
gem 'cocoapods-downloader', :path => '../cocoapods-downloader'
else
gem 'cocoapods-core', :git => "https://github.com/CocoaPods/Core.git"
gem 'xcodeproj', :git => "https://github.com/CocoaPods/Xcodeproj.git"
gem 'cocoapods-downloader', :git => "https://github.com/CocoaPods/cocoapods-downloader.git"
end
gem "mocha"
gem "bacon"
......@@ -35,3 +37,4 @@ group :documentation do
gem 'github-markup'
gem 'pygments.rb'
end
......@@ -323,7 +323,7 @@ namespace :examples do
puts "Building example: #{example}"
Dir.chdir(example.to_s) do
execute_command "rm -rf Pods DerivedData"
execute_command "#{'../../bin/' unless ENV['FROM_GEM']}pod install --verbose --no-update"
execute_command "#{'../../bin/' unless ENV['FROM_GEM']}pod install --verbose --no-repo-update"
command = "xcodebuild -workspace '#{example.basename}.xcworkspace' -scheme '#{example.basename}'"
if (example + 'Podfile').read.include?('platform :ios')
# Specifically build against the simulator SDK so we don't have to deal with code signing.
......
......@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'cocoapods-core', "= #{Pod::VERSION}"
s.add_runtime_dependency 'claide', '~> 0.2.0'
s.add_runtime_dependency 'cocoapods-downloader', '~> 0.1.0'
s.add_runtime_dependency 'xcodeproj', '~> 0.5.2'
s.add_runtime_dependency 'xcodeproj', '~> 0.5.4'
s.add_runtime_dependency 'faraday', '~> 0.8.1'
s.add_runtime_dependency 'octokit', '~> 1.7'
......
......@@ -9,11 +9,11 @@ module Pod
DESC
def self.options
[["--no-update", "Skip running `pod repo update` before install"]].concat(super)
[["--no-repo-update", "Skip running `pod repo update` before install"]].concat(super)
end
def initialize(argv)
config.skip_repo_update = argv.flag?('update', config.skip_repo_update)
config.skip_repo_update = argv.flag?('repo-update', config.skip_repo_update)
super
end
......
......@@ -8,10 +8,10 @@ module Pod
module Options
def options
[
["--no-clean", "Leave SCM dirs like `.git' and `.svn' intact after downloading"],
["--no-doc", "Skip documentation generation with appledoc"],
["--no-integrate", "Skip integration of the Pods libraries in the Xcode project(s)"],
["--no-update", "Skip running `pod repo update` before install"],
["--no-clean", "Leave SCM dirs like `.git' and `.svn' intact after downloading"],
["--no-doc", "Skip documentation generation with appledoc"],
["--no-integrate", "Skip integration of the Pods libraries in the Xcode project(s)"],
["--no-repo-update", "Skip running `pod repo update` before install"],
].concat(super)
end
end
......@@ -24,7 +24,7 @@ module Pod
config.clean = argv.flag?('clean', config.clean)
config.generate_docs = argv.flag?('doc', config.generate_docs)
config.integrate_targets = argv.flag?('integrate', config.integrate_targets)
config.skip_repo_update = !argv.flag?('update', !config.skip_repo_update)
config.skip_repo_update = !argv.flag?('repo-update', !config.skip_repo_update)
super
end
......
......@@ -14,13 +14,17 @@ module Pod
def self.options
[[
"--full", "Search by name, summary, and description",
"--stats", "Show additional stats (like GitHub watchers and forks)"
"--stats", "Show additional stats (like GitHub watchers and forks)",
"--ios", "Restricts the search to Pods supported on iOS",
"--osx", "Restricts the search to Pods supported on OS X",
]].concat(super)
end
def initialize(argv)
@full_text_search = argv.flag?('full')
@stats = argv.flag?('stats')
@supported_on_ios = argv.flag?('ios')
@supported_on_osx = argv.flag?('osx')
@query = argv.shift_argument
super
end
......@@ -32,10 +36,16 @@ module Pod
def run
sets = SourcesManager.search_by_name(@query.strip, @full_text_search)
if @supported_on_ios
sets.reject!{ |set| !set.specification.available_platforms.map(&:name).include?(:ios) }
end
if @supported_on_osx
sets.reject!{ |set| !set.specification.available_platforms.map(&:name).include?(:osx) }
end
sets.each do |set|
begin
UI.pod(set, (@stats ? :stats : :normal))
rescue DSLError => e
rescue DSLError
UI.warn "Skipping `#{set.name}` because the podspec contains errors."
end
end
......
......@@ -54,8 +54,7 @@ module Pod
#
def generate(install_docset)
if `which appledoc`.strip.empty?
UI.warn "[!] Skipping documentation generation because appledoc can't be found.",
actions = [], verbose_only = true
UI.warn "[!] Skipping documentation generation because appledoc can't be found.", [], true
return
end
......@@ -106,10 +105,10 @@ module Pod
specification.summary || specification.description || 'Generated by CocoaPods.'
end
# @return [String] The id of the docset.
# @return [String] The id of the docset, uniq for every Pod.
#
def docs_id
'org.cocoapods'
"org.cocoapods.#{specification.name.downcase}"
end
#-----------------------------------------------------------------------#
......
......@@ -61,10 +61,7 @@ module Pod
})
spec_consumers.each do |consumer|
@xcconfig.merge!(consumer.xcconfig);
@xcconfig.libraries.merge(consumer.libraries);
@xcconfig.frameworks.merge(consumer.frameworks);
@xcconfig.weak_frameworks.merge(consumer.weak_frameworks);
add_spec_build_settings_to_xcconfig(consumer, @xcconfig)
end
@xcconfig
......@@ -124,6 +121,63 @@ module Pod
def quote(strings)
strings.sort.map { |s| %W|"#{s}"| }.join(" ")
end
# Configures the given Xcconfig according to the build settings of the
# given Specification.
#
# @param [Specification::Consumer] consumer
# The consumer of the specification.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
# @return [void]
#
def add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.merge!(consumer.xcconfig)
xcconfig.libraries.merge(consumer.libraries)
xcconfig.frameworks.merge(consumer.frameworks)
xcconfig.weak_frameworks.merge(consumer.weak_frameworks)
add_developers_frameworks_if_needed(consumer, xcconfig)
end
# @return [Array<String>] The search paths for the developer frameworks.
#
# @todo Inheritance should be properly handled in Xcconfigs.
#
DEVELOPER_FRAMEWORKS_SEARCH_PATHS = [
'$(inherited)',
'"$(SDKROOT)/Developer/Library/Frameworks"',
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
]
# Adds the search paths of the developer frameworks to the specification
# if needed. This is done because the `SenTestingKit` requires them and
# adding them to each specification which requires it is repetitive and
# error prone.
#
# @param [Specification::Consumer] consumer
# The consumer of the specification.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
# @return [void]
#
def add_developers_frameworks_if_needed(consumer, xcconfig)
if xcconfig.frameworks.include?('SenTestingKit')
search_paths = xcconfig.attributes['FRAMEWORK_SEARCH_PATHS'] ||= ''
DEVELOPER_FRAMEWORKS_SEARCH_PATHS.each do |search_path|
unless search_paths.include?(search_path)
search_paths << ' ' unless search_paths.empty?
search_paths << search_path
end
end
end
end
#-----------------------------------------------------------------------#
end
end
end
......
......@@ -5,6 +5,8 @@ Pod::Spec.new do |s|
s.homepage = 'http://banana-corp.local/banana-lib.html'
s.summary = 'Chunky bananas!'
s.description = 'Full of chunky bananas.'
s.platform = :ios
s.source = { :git => 'http://banana-corp.local/banana-lib.git', :tag => 'v1.0' }
s.source_files = 'Classes/*.{h,m}', 'Vendor'
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework SystemConfiguration' }
......
......@@ -5,7 +5,7 @@ module Pod
extend SpecHelper::TemporaryRepos
it "tells the user that no Podfile was found in the current working dir" do
exception = lambda { run_command('outdated', '--no-update') }.should.raise Informative
exception = lambda { run_command('outdated', '--no-repo-update') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
......@@ -13,7 +13,7 @@ module Pod
file = temporary_directory + 'Podfile'
File.open(file, 'w') {|f| f.write('platform :ios') }
Dir.chdir(temporary_directory) do
exception = lambda { run_command('outdated', '--no-update') }.should.raise Informative
exception = lambda { run_command('outdated', '--no-repo-update') }.should.raise Informative
exception.message.should.include "No `Podfile.lock' found in the current working directory"
end
end
......
require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Command::Project do
it "tells the user that no Podfile or podspec was found in the current working dir" do
Command::Install.new(CLAide::ARGV.new(['--no-repo-update']))
config.skip_repo_update.should.be.true
end
end
#---------------------------------------------------------------------------#
describe Command::Install do
it "tells the user that no Podfile or podspec was found in the current working dir" do
exception = lambda { run_command('install', '--no-update') }.should.raise Informative
exception = lambda { run_command('install', '--no-repo-update') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
end
#--------------------------------------------------------------------------------#
#---------------------------------------------------------------------------#
describe Command::Update do
extend SpecHelper::TemporaryRepos
it "tells the user that no Podfile was found in the current working dir" do
exception = lambda { run_command('update','--no-update') }.should.raise Informative
exception = lambda { run_command('update','--no-repo-update') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
......@@ -23,11 +36,14 @@ module Pod
file = temporary_directory + 'Podfile'
File.open(file, 'w') {|f| f.write('platform :ios') }
Dir.chdir(temporary_directory) do
exception = lambda { run_command('update','--no-update') }.should.raise Informative
exception = lambda { run_command('update','--no-repo-update') }.should.raise Informative
exception.message.should.include "No `Podfile.lock' found in the current working directory"
end
end
end
#---------------------------------------------------------------------------#
end
......@@ -31,5 +31,18 @@ module Pod
output = run_command('search', 'Engelhart', '--full')
output.should.include? 'JSONKit'
end
it "restricts the search to Pods supported on iOS" do
output = run_command('search', 'BananaLib', '--ios')
output.should.include? 'BananaLib'
Specification.any_instance.stubs(:available_platforms).returns([Platform.osx])
output = run_command('search', 'BananaLib', '--ios')
output.should.not.include? 'BananaLib'
end
it "restricts the search to Pods supported on iOS" do
output = run_command('search', 'BananaLib', '--osx')
output.should.not.include? 'BananaLib'
end
end
end
......@@ -306,57 +306,57 @@ describe "Integration take 2" do
# Test subspecs inheritance
describe "Integrates a project with CocoaPods" do
check "install --no-update --no-doc", "install_new"
check "install --no-repo-update --no-doc", "install_new"
end
describe "Adds a Pod to an existing installation" do
check "install --no-update --no-doc", "install_add_pod"
check "install --no-repo-update --no-doc", "install_add_pod"
end
describe "Removes a Pod from an existing installation" do
check "install --no-update --no-doc", "install_remove_pod"
check "install --no-repo-update --no-doc", "install_remove_pod"
end
describe "Creates an installation with multiple target definitions" do
check "install --no-update --no-doc", "install_multiple_targets"
check "install --no-repo-update --no-doc", "install_multiple_targets"
end
describe "Installs a Pod with different subspecs activated across different targets" do
check "install --no-update --no-doc", "install_subspecs"
check "install --no-repo-update --no-doc", "install_subspecs"
end
describe "Installs a Pod with a local source" do
check "install --no-update --no-doc", "install_local_source"
check "install --no-repo-update --no-doc", "install_local_source"
end
describe "Installs a Pod with an external source" do
check "install --no-update --no-doc", "install_external_source"
check "install --no-repo-update --no-doc", "install_external_source"
end
describe "Installs a Pod given the podspec" do
check "install --no-update --no-doc", "install_podspec"
check "install --no-repo-update --no-doc", "install_podspec"
end
describe "Performs an installation using a custom workspace" do
check "install --no-update --no-doc", "install_custom_workspace"
check "install --no-repo-update --no-doc", "install_custom_workspace"
end
# @todo add tests for all the hooks API
#
describe "Runs the Podfile callbacks" do
check "install --no-update --no-doc", "install_podfile_callbacks"
check "install --no-repo-update --no-doc", "install_podfile_callbacks"
end
# @todo add tests for all the hooks API
#
describe "Runs the specification callbacks" do
check "install --no-update --no-doc", "install_spec_callbacks"
check "install --no-repo-update --no-doc", "install_spec_callbacks"
end
# @todo requires CocoaPods 0.17
#
# describe "Generates the documentation of Pod during installation" do
# check "install --no-update --no-doc", "install_docs"
# check "install --no-repo-update --no-doc", "install_docs"
# end
end
......@@ -366,7 +366,7 @@ describe "Integration take 2" do
describe "Pod update" do
describe "Updates an existing installation" do
check "update --no-update --no-doc", "update"
check "update --no-repo-update --no-doc", "update"
end
end
......
......@@ -3,7 +3,7 @@
if ENV['CI'] || ENV['GENERATE_COVERAGE']
require 'simplecov'
require 'coveralls'
# require 'coveralls'
if ENV['CI']
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
......
......@@ -25,7 +25,7 @@ module Pod
'--docset-desc', 'Chunky bananas!',
'--project-company', 'Banana Corp and Monkey Boy',
'--docset-copyright', 'Banana Corp and Monkey Boy',
'--company-id', 'org.cocoapods',
'--company-id', 'org.cocoapods.bananalib',
'--ignore', '.m',
'--keep-undocumented-objects',
'--keep-undocumented-members',
......@@ -47,7 +47,7 @@ module Pod
arguments.should.include?(" --docset-desc 'Chunky bananas!' ")
arguments.should.include?(" --project-company 'Banana Corp and Monkey Boy' ")
arguments.should.include?(" --docset-copyright 'Banana Corp and Monkey Boy' ")
arguments.should.include?(" --company-id org.cocoapods ")
arguments.should.include?(" --company-id org.cocoapods.bananalib ")
arguments.should.include?(" --ignore .m ")
arguments.should.include?(" --keep-undocumented-objects ")
arguments.should.include?(" --keep-undocumented-members ")
......
......@@ -91,6 +91,26 @@ module Pod
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-weak_framework iAd')
end
it "includes the developer frameworks search paths when SenTestingKit is detected" do
spec = fixture_spec('banana-lib/BananaLib.podspec')
consumer = spec.consumer(:ios)
generator = Generator::XCConfig.new(config.sandbox, [consumer], './Pods')
spec.xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' }
spec.frameworks = ['SenTestingKit']
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
end
it "doesn't include the developer frameworks if already present" do
spec = fixture_spec('banana-lib/BananaLib.podspec')
consumer_1 = spec.consumer(:ios)
consumer_2 = spec.consumer(:ios)
generator = Generator::XCConfig.new(config.sandbox, [consumer_1, consumer_2], './Pods')
spec.frameworks = ['SenTestingKit']
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
end
#-----------------------------------------------------------------------#
it 'returns the settings that the pods project needs to override' do
......
......@@ -103,7 +103,7 @@ module Pod
it "locks the version of the dependencies which did not change in the Podfile" do
@analyzer.analyze
@analyzer.send(:locked_dependencies).map(&:to_s).should == ["SVPullToRefresh"]
@analyzer.send(:locked_dependencies).map(&:to_s).should == ["SVPullToRefresh (= 0.4)"]
end
it "does not lock the dependencies in update mode" do
......
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