Permalink
Browse files

Merge branch 'master' into pod_update

* master:
  [Excutable] Fix for ruby 1.8.7.
  [CHANGELOG] Didn't realize that github already adds a separator line for each entry.
  [CHANGELOG] Update
  Add static libraries to root of project if no Frameworks group exists. #431
  Cleanup a little by using ActiveSupport convenience methods.
  CHANGELOG.md
  [Documentation] Use public headers if specified.
  [Downloader] raise when importan commands fail.
  [Git] Init submodules only if requested.
  [Rakefile] commit Gemfile.lock on release.
  [Changelog] Release 0.11.1.
  Release 0.11.1
  [Changelog] Update.
  • Loading branch information...
2 parents 0a244e6 + 21bc6d4 commit fdc3d19bfabec5cbc9ce6007be55bf205f0daf81 @fabiopelosin fabiopelosin committed Aug 10, 2012
View
@@ -1,12 +1,36 @@
+## Master
+
+[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.1...master)
+
+###### Enhancements
+
+- The documentation is generated using the public headers if they are specified.
+- In case of download failure, now the installation is aborted
+ the error message of the external command that failed is presented.
+- 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)
+
+
+## 0.11.1
+
+[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.0...0.11.1)
+
+###### Bug fixes
+
+- Fixed a crash related to subspecs without header files. [#449]
+- Git submodules are loaded after the appropriate referenced is checked out and will be not loaded anymore in the cache. [#451]
+- Fixed SVN support for the head version. [#432]
+
+
## 0.11.0
-[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.10.0...master)
+[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.10.0...0.11.0)
###### Enhancements
- Added support for public headers. [#440]
- Added `pod repo lint`. [#423]
-- Improved support for `:head` option and svn repositories.
+- Improved support for `:head` option and SVN repositories.
- When integrating Pods with a project without "Frameworks" group in root of the project, raise an informative message. [#431](https://github.com/CocoaPods/CocoaPods/pull/431)
- Dropped support for legacy `config.ios?` and `config.osx?`
@@ -15,6 +39,7 @@
- Version message now correctly terminates with a 0 exit status.
- Resolved an issue that lead to git error messages in the error report.
+
## 0.10.0
[CocoaPods](http://git.io/4i75YA)
@@ -25,7 +50,6 @@
- Added line number information for errors generated in the Podfile. [#408](http://git.io/fWQvMg)
- Pods stored in git repositories now initialize submodules. [#406](http://git.io/L9ssSw)
-
###### Bug fixes
- Removed note about the post install hook form the linter.
@@ -222,7 +246,7 @@ class ::Pod::Generator::Acknowledgements
end
```
-You can even go one step further and customise the text on a per target basis by
+You can even go one step further and customise the text on a per target basis by
checking against the target name, like this:
```ruby
@@ -328,24 +352,18 @@ podspec, then update these method calls.
* Added weak quoting to `ibtool` input paths.
----------------------------------------
-
## 0.5.0
No longer requires MacRuby. Runs on MRI 1.8.7 (OS X system version) and 1.9.3.
A full list of all the changes since 0.3.0 can be found [here][7].
----------------------------------------
-
## 0.4.0
Oops, accidentally skipped this version.
----------------------------------------
-
## 0.3.0
### Multiple targets
View
@@ -17,7 +17,7 @@ GIT
PATH
remote: .
specs:
- cocoapods (0.11.0)
+ cocoapods (0.11.1)
activesupport (~> 3.2.6)
colored (~> 1.2)
escape (~> 0.0.4)
View
@@ -145,7 +145,7 @@ namespace :gem do
# silent_sh "rake examples:build"
# Then release
- sh "git commit lib/cocoapods.rb -m 'Release #{gem_version}'"
+ sh "git commit lib/cocoapods.rb Gemfile.lock -m 'Release #{gem_version}'"
sh "git tag -a #{gem_version} -m 'Release #{gem_version}'"
sh "git push origin master"
sh "git push origin --tags"
View
@@ -13,7 +13,7 @@
end
module Pod
- VERSION = '0.11.0'
+ VERSION = '0.11.1'
class PlainInformative < StandardError
end
@@ -14,6 +14,7 @@ class Git < Downloader
def download
create_cache unless cache_exist?
puts '-> Cloning git repo' if config.verbose?
+
if options[:tag]
download_tag
elsif options[:branch]
@@ -23,14 +24,16 @@ def download
else
download_head
end
+
+ Dir.chdir(target_path) { git! "submodule update --init" } if options[:submodules]
prune_cache
end
def create_cache
puts "-> Creating cache git repo (#{cache_path})" if config.verbose?
cache_path.rmtree if cache_path.exist?
cache_path.mkpath
- git %Q|clone "#{url}" "#{cache_path}"|
+ clone(url, cache_path)
end
def prune_cache
@@ -73,10 +76,9 @@ def caches_size
def update_cache
puts "-> Updating cache git repo (#{cache_path})" if config.verbose?
Dir.chdir(cache_path) do
- git "reset --hard HEAD"
- git "clean -d -x -f"
- git "pull"
- git "submodule update"
+ git! "reset --hard HEAD"
+ git! "clean -d -x -f"
+ git! "pull"
end
end
@@ -104,42 +106,44 @@ def download_head
else
create_cache
end
- git %Q|clone "#{clone_url}" "#{target_path}"|
- Dir.chdir(target_path) { git "submodule update --init" }
+
+ clone(clone_url, target_path)
+ Dir.chdir(target_path) { git! "submodule update --init" } if options[:submodules]
end
def download_tag
ensure_ref_exists(options[:tag])
Dir.chdir(target_path) do
- git "init"
- git "remote add origin '#{clone_url}'"
- git "fetch origin tags/#{options[:tag]}"
- git "reset --hard FETCH_HEAD"
- git "checkout -b activated-pod-commit"
- git "submodule update --init"
+ git! "init"
+ git! "remote add origin '#{clone_url}'"
+ git! "fetch origin tags/#{options[:tag]}"
+ git! "reset --hard FETCH_HEAD"
+ git! "checkout -b activated-pod-commit"
end
end
def download_commit
ensure_ref_exists(options[:commit])
- git %Q|clone "#{clone_url}" "#{target_path}"|
+ clone(clone_url, target_path)
Dir.chdir(target_path) do
- git "checkout -b activated-pod-commit #{options[:commit]}"
- git "submodule update --init"
+ git! "checkout -b activated-pod-commit #{options[:commit]}"
end
end
def download_branch
ensure_remote_branch_exists(options[:branch])
- git %Q|clone "#{clone_url}" "#{target_path}"|
+ clone(clone_url, target_path)
Dir.chdir(target_path) do
- git "remote add upstream '#{@url}'" # we need to add the original url, not the cache url
- git "fetch -q upstream" # refresh the branches
- git "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch
- git "submodule update --init"
+ git! "remote add upstream '#{@url}'" # we need to add the original url, not the cache url
+ git! "fetch -q upstream" # refresh the branches
+ git! "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch
puts "Just downloaded and checked out branch: #{options[:branch]} from upstream #{clone_url}" if config.verbose?
end
end
+
+ def clone(from, to)
+ git! %Q|clone "#{from}" "#{to}"|
+ end
end
class GitHub < Git
@@ -52,17 +52,17 @@ def filename_with_type(type=:zip)
end
def download_file(full_filename)
- curl "-L -o '#{full_filename}' '#{url}'"
+ curl! "-L -o '#{full_filename}' '#{url}'"
end
def extract_with_type(full_filename, type=:zip)
case type
when :zip
- unzip "'#{full_filename}' -d '#{target_path}'"
+ unzip! "'#{full_filename}' -d '#{target_path}'"
when :tgz
- tar "xfz '#{full_filename}' -C '#{target_path}'"
+ tar! "xfz '#{full_filename}' -C '#{target_path}'"
when :tar
- tar "xf '#{full_filename}' -C '#{target_path}'"
+ tar! "xf '#{full_filename}' -C '#{target_path}'"
else
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
end
@@ -12,11 +12,11 @@ def download
end
def download_head
- hg "clone \"#{url}\" \"#{target_path}\""
+ hg! "clone \"#{url}\" \"#{target_path}\""
end
def download_revision
- hg "clone \"#{url}\" --rev '#{options[:revision]}' \"#{target_path}\""
+ hg! "clone \"#{url}\" --rev '#{options[:revision]}' \"#{target_path}\""
end
end
end
@@ -4,11 +4,11 @@ class Subversion < Downloader
executable :svn
def download
- svn %|checkout "#{reference_url}" "#{target_path}"|
+ svn! %|checkout "#{reference_url}" "#{target_path}"|
end
def download_head
- svn %|checkout "#{trunk_url}" "#{target_path}"|
+ svn! %|checkout "#{trunk_url}" "#{target_path}"|
end
def reference_url
@@ -20,7 +20,8 @@ def <<(value)
def executable(name)
bin = `which #{name}`.strip
- define_method(name) do |command|
+ base_method = "base_" << name.to_s
+ define_method(base_method) do |command, should_raise|
if bin.empty?
raise Informative, "Unable to locate the executable `#{name}'"
end
@@ -33,9 +34,27 @@ def executable(name)
end
status = Open4.spawn(full_command, :stdout => stdout, :stderr => stderr, :status => true)
# TODO not sure that we should be silent in case of a failure.
- puts (Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red unless status.success? || Config.instance.silent?
- stdout.join("\n") + stderr.join("\n") # TODO will this suffice?
+
+ output = stdout.join("\n") + stderr.join("\n") # TODO will this suffice?
+ unless status.success?
+ if should_raise
+ raise Informative, "#{name} #{command}\n\n#{output}"
+ else
+ puts (Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red unless Config.instance.silent?
+ end
+ end
+ output
+ end
+
+ define_method(name) do |command|
+ send(base_method, command, false)
+ end
+
+ define_method(name.to_s + "!") do |command|
+ send(base_method, command, true)
end
+
+
private name
end
end
@@ -42,7 +42,7 @@ def docs_id
end
def files
- @pod.all_specs_public_header_files.map{ |f| f.relative_path_from(@pod.root).to_s }
+ @pod.documentation_headers.map{ |f| f.relative_path_from(@pod.root).to_s }
end
def index_file
@@ -1,6 +1,9 @@
require 'xcodeproj/workspace'
require 'xcodeproj/project'
+require 'active_support/core_ext/string/inflections'
+require 'active_support/core_ext/array/conversions'
+
module Pod
class Installer
@@ -69,10 +72,8 @@ def integrate!
return if targets.empty?
unless Config.instance.silent?
- # TODO let's just use ActiveSupport.
- plural = targets.size > 1
- puts "-> Integrating `#{@target_definition.lib_name}' into target#{'s' if plural} " \
- "`#{targets.map(&:name).join(', ')}' of Xcode project `#{user_project_path.basename}'.".green
+ puts "-> Integrating `#{@target_definition.lib_name}' into #{'target'.pluralize(targets.size)} " \
+ "`#{targets.map(&:name).to_sentence}' of Xcode project `#{user_project_path.basename}'.".green
end
add_xcconfig_base_configuration
@@ -141,10 +142,8 @@ def add_xcconfig_base_configuration
end
def add_pods_library
- framework_group = user_project.group("Frameworks")
- raise Informative, "Cannot add pod library to project. Please check if the project have a 'Frameworks' group in the root of the project." unless framework_group
-
- pods_library = framework_group.files.new_static_library(@target_definition.label)
+ group = user_project.group("Frameworks") || user_project.main_group
+ pods_library = group.files.new_static_library(@target_definition.label)
targets.each do |target|
target.frameworks_build_phases.each { |build_phase| build_phase << pods_library }
end
View
@@ -318,27 +318,35 @@ def xcconfig
end
# Computes the paths of all the public headers of the pod including every
- # subspec. For this reason the pod must not be cleaned before calling it.
+ # subspec (activated or not).
+ # For this reason the pod must not be cleaned when calling this command.
#
# This method is used by {Generator::Documentation}.
#
# @raise [Informative] If the pod was cleaned.
#
- # @todo Merge with #221
- #
# @return [Array<Pathname>] The path of all the public headers of the pod.
#
- def all_specs_public_header_files
+ def documentation_headers
if @cleaned
raise Informative, "The pod is cleaned and cannot compute the " \
"header files, as some might have been deleted."
end
- all_specs = [ top_specification ] + top_specification.subspecs
- options = {:glob => '*.{h}'}
- files = paths_by_spec(:source_files, options, all_specs).values.flatten
- headers = files.select { |f| f.extname == '.h' }
- headers
+ specs = [top_specification] + top_specification.recursive_subspecs
+ source_files = paths_by_spec(:source_files, { :glob => '*.{h}'}, specs)
+ public_headers = paths_by_spec(:public_header_files,{ :glob => '*.{h}'}, specs)
+
+ result = []
+ specs.each do |spec|
+ if (public_h = public_headers[spec]) && !public_h.empty?
+ result += public_h
+ elsif (source_f = source_files[spec]) && !source_f.empty?
+ build_h = source_f.select { |f| f.extname == '.h' }
+ result += build_h unless build_h.empty?
+ end
+ end
+ result
end
# @!group Target integration
Oops, something went wrong.

0 comments on commit fdc3d19

Please sign in to comment.