Commit fbad005f authored by Eloy Duran's avatar Eloy Duran

Merge branch 'develop' of github.com:CocoaPods/CocoaPods into develop

parents 9a80da4b 35b74956
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
revision: f0d455bcd839e8fdada2e117681ac93b296659b1
revision: 8588320c17db695f3ee87f11ab0953cc2e3a0f0d
branch: develop
specs:
xcodeproj (0.2.0.rc2)
xcodeproj (0.2.0.rc3)
PATH
remote: .
specs:
cocoapods (0.6.0.rc2)
cocoapods (0.6.0.rc5)
colored (~> 1.2)
escape (~> 0.0.4)
faraday (~> 0.8.1)
......@@ -16,7 +16,7 @@ PATH
octokit (~> 1.7.0)
open4 (~> 1.3.0)
rake (~> 0.9.0)
xcodeproj (~> 0.2.0.rc1)
xcodeproj (~> 0.2.0.rc3)
GEM
remote: http://rubygems.org/
......
......@@ -93,14 +93,14 @@ namespace :gem do
puts "You are about to release `#{gem_version}', is that correct? [y/n]"
exit if $stdin.gets.strip.downcase != 'y'
diff_lines = `git diff --numstat`.strip.split("\n")
diff_lines = `git diff --name-only`.strip.split("\n")
if diff_lines.size == 0 || !diff_lines.first.include?('lib/cocoapods.rb')
if diff_lines.size == 0
$stderr.puts "[!] Change the version number yourself in lib/cocoapods.rb"
exit 1
end
if diff_lines.size > 1 || !diff_lines.first.include?('lib/cocoapods.rb')
if diff_lines != ['Gemfile.lock', 'lib/cocoapods.rb']
$stderr.puts "[!] Only change the version number in a release commit!"
exit 1
end
......@@ -125,26 +125,28 @@ namespace :gem do
tmp = File.expand_path('../tmp', __FILE__)
tmp_gems = File.join(tmp, 'gems')
Rake::Task['gem:build'].invoke
puts "* Testing gem installation (tmp/gems)"
silent_sh "rm -rf '#{tmp}'"
silent_sh "gem install --install-dir='#{tmp_gems}' #{gem_filename}"
puts "* Building examples from gem (tmp/gems)"
ENV['GEM_HOME'] = ENV['GEM_PATH'] = tmp_gems
ENV['PATH'] = "#{tmp_gems}/bin:#{ENV['PATH']}"
ENV['FROM_GEM'] = '1'
silent_sh "rake examples:build"
# puts "* Building examples from gem (tmp/gems)"
# ENV['GEM_HOME'] = ENV['GEM_PATH'] = tmp_gems
# ENV['PATH'] = "#{tmp_gems}/bin:#{ENV['PATH']}"
# ENV['FROM_GEM'] = '1'
# silent_sh "rake examples:build"
# Then release
sh "git commit lib/cocoapods.rb -m 'Release #{gem_version}'"
sh "git commit Gemfile.lock lib/cocoapods.rb -m 'Release #{gem_version}'"
sh "git tag -a #{gem_version} -m 'Release #{gem_version}'"
sh "git push origin master"
sh "git push origin --tags"
sh "gem push #{gem_filename}"
# Update the last version in CocoaPods-version.yml
puts "* Updating last known version in Specs repo"
specs_branch = '0.6'
Dir.chdir('../Specs') do
puts Dir.pwd
sh "git checkout #{specs_branch}"
......@@ -265,13 +267,12 @@ namespace :examples do
puts
Dir.chdir(example.to_s) do
sh "rm -rf Pods DerivedData"
sh "#{'../../bin/' unless ENV['FROM_GEM']}pod install --verbose"
sh "#{'../../bin/' unless ENV['FROM_GEM']}pod install --verbose --no-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.
root = File.exist?("/Applications/Xcode.app") ? "/Applications/Xcode.app/Contents" : ""
command << " -sdk "
command << Dir.glob("#{root}/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk").last
command << Dir.glob("#{`xcode-select -print-path`.chomp}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk").last
end
sh command
end
......
......@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'json', '~> 1.7.3'
s.add_runtime_dependency 'open4', '~> 1.3.0'
s.add_runtime_dependency 'rake', '~> 0.9.0'
s.add_runtime_dependency 'xcodeproj', '~> 0.2.0.rc1'
s.add_runtime_dependency 'xcodeproj', '~> 0.2.0.rc3'
s.add_development_dependency 'bacon', '~> 1.1'
......
PODS:
- AFNetworking (0.7.0):
- JSONKit
- FormatterKit (0.7.0)
- FormatterKit (1.0.0):
- FormatterKit/ArrayFormatter (= 1.0.0)
- FormatterKit/LocationFormatter (= 1.0.0)
- FormatterKit/OrdinalNumberFormatter (= 1.0.0)
- FormatterKit/TimeIntervalFormatter (= 1.0.0)
- FormatterKit/URLRequestFormatter (= 1.0.0)
- FormatterKit/UnitOfInformationFormatter (= 1.0.0)
- FormatterKit/ArrayFormatter (1.0.0)
- FormatterKit/LocationFormatter (1.0.0)
- FormatterKit/OrdinalNumberFormatter (1.0.0)
- FormatterKit/TimeIntervalFormatter (1.0.0)
- FormatterKit/URLRequestFormatter (1.0.0)
- FormatterKit/UnitOfInformationFormatter (1.0.0)
- JSONKit (1.5pre)
DEPENDENCIES:
......
PODS:
- AFNetworking (0.7.0):
- JSONKit
- FormatterKit (0.7.0)
- FormatterKit (1.0.0):
- FormatterKit/ArrayFormatter (= 1.0.0)
- FormatterKit/LocationFormatter (= 1.0.0)
- FormatterKit/OrdinalNumberFormatter (= 1.0.0)
- FormatterKit/TimeIntervalFormatter (= 1.0.0)
- FormatterKit/URLRequestFormatter (= 1.0.0)
- FormatterKit/UnitOfInformationFormatter (= 1.0.0)
- FormatterKit/ArrayFormatter (1.0.0)
- FormatterKit/LocationFormatter (1.0.0)
- FormatterKit/OrdinalNumberFormatter (1.0.0)
- FormatterKit/TimeIntervalFormatter (1.0.0)
- FormatterKit/URLRequestFormatter (1.0.0)
- FormatterKit/UnitOfInformationFormatter (1.0.0)
- JSONKit (1.5pre)
DEPENDENCIES:
......
module Pod
VERSION = '0.6.0.rc2'
VERSION = '0.6.0.rc5'
class PlainInformative < StandardError
end
......
......@@ -65,7 +65,9 @@ module Pod
def self.run(*argv)
sub_command = parse(*argv)
unless ENV['SKIP_SETUP']
Setup.new(ARGV.new).run_if_needed
end
sub_command.run
rescue Interrupt
......
......@@ -31,7 +31,7 @@ module Pod
end
def read_only_url
'git://github.com/CocoaPods/Specs.git'
'https://github.com/CocoaPods/Specs.git'
end
def read_write_url
......
......@@ -11,15 +11,16 @@ module Pod
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
If a GitHub url is passed the spec is prepopulated.
$ pod spec lint [ NAME.podspec | REPO ]
$ pod spec lint [ NAME.podspec | DIRECTORY ]
Validates `NAME.podspec'. In case `NAME.podspec' is omitted, it defaults
to `*.podspec' in the current working dir. If the name of a repo is
provided it validates all its specs.}
Validates `NAME.podspec'. If a directory is provided it performs a quick
validation on all the podspec files found, including subfolders. In case
the argument is omitted, it defaults to the current working dir.
}
end
def self.options
[ ["--quick", "Lint skips checks that would require to donwload and build the spec"],
[ ["--quick", "Lint skips checks that would require to download and build the spec"],
["--only-errors", "Lint validates even if warnings are present"],
["--no-clean", "Lint leaves the build directory intact for inspection"] ].concat(super)
end
......@@ -74,10 +75,10 @@ module Pod
invalid_count = lint_podspecs
count = specs_to_lint.count
if invalid_count == 0
lint_passed_message = count == 1 ? "#{podspecs_to_lint.first.basename} passed validation" : "All the #{count} specs passed validation"
lint_passed_message = count == 1 ? "#{podspecs_to_lint.first.basename} passed validation." : "All the specs passed validation."
puts lint_passed_message.green << "\n\n" unless config.silent?
else
raise Informative, count == 1 ? "The spec did not pass validation" : "#{invalid_count} out of #{count} specs failed validation"
raise Informative, count == 1 ? "The spec did not pass validation." : "#{invalid_count} out of #{count} specs failed validation."
end
end
......@@ -87,12 +88,12 @@ module Pod
invalid_count = 0
specs_to_lint.each do |spec|
# Show immediatly which pod is being processed.
print " -> #{spec}\r" unless config.silent? || is_repo?
print " -> #{spec}\r" unless config.silent? || @multiple_files
$stdout.flush
linter = Linter.new(spec)
linter.lenient = @only_errors
linter.quick = @quick || is_repo?
linter.quick = @quick || @multiple_files
linter.no_clean = @no_clean
invalid_count += 1 unless linter.lint
......@@ -104,7 +105,7 @@ module Pod
puts unless config.silent? || should_skip?(linter)
end
puts "Analyzed #{specs_to_lint.count} specs in #{podspecs_to_lint.count} podspecs files.\n\n" if is_repo? && !config.silent?
puts "Analyzed #{specs_to_lint.count} specs in #{podspecs_to_lint.count} podspecs files.\n\n" if @multiple_files && !config.silent?
invalid_count
end
......@@ -119,7 +120,7 @@ module Pod
end
def should_skip?(linter)
is_repo? && linter.errors.empty? && linter.warnings.empty? && linter.notes.empty?
@multiple_files && linter.errors.empty? && linter.warnings.empty? && linter.notes.empty?
end
def print_messages(spec, type, messages)
......@@ -129,14 +130,14 @@ module Pod
def podspecs_to_lint
@podspecs_to_lint ||= begin
if (is_repo?)
files = (config.repos_dir + @repo_or_podspec).glob('**/*.podspec')
elsif @repo_or_podspec
files = [Pathname.new(@repo_or_podspec)]
raise Informative, "Unable to find a spec named #{@repo_or_podspec}" unless files[0].exist? && @repo_or_podspec.include?('.podspec')
path = Pathname.new(@repo_or_podspec || '.')
if path.directory?
files = path.glob('**/*.podspec')
raise Informative, "No specs found in the current directory." if files.empty?
@multiple_files = true
else
files = Pathname.pwd.glob('*.podspec')
raise Informative, "No specs found in the current directory" if files.empty?
files = [path]
raise Informative, "Unable to find a spec named `#{@repo_or_podspec}'." unless files[0].exist? && @repo_or_podspec.include?('.podspec')
end
files
end
......@@ -152,10 +153,6 @@ module Pod
end
end
def is_repo?
@is_repo ||= @repo_or_podspec && (config.repos_dir + @repo_or_podspec).exist? && !@repo_or_podspec.include?('/')
end
# Linter class
#
class Linter
......@@ -311,7 +308,7 @@ module Pod
# Some values are multiplaform
patterns = patterns.is_a?(Hash) ? patterns.values.flatten(1) : patterns
patterns.each do |pattern|
# Skip Filelist that would otherwise be resolved from the working directory resulting
# Skip FileList that would otherwise be resolved from the working directory resulting
# in a potentially very expensi operation
next if pattern.is_a?(FileList)
invalid = pattern.is_a?(Array) ? pattern.any? { |path| path.start_with?('/') } : pattern.start_with?('/')
......@@ -338,7 +335,7 @@ module Pod
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 << "Github repositories should end in `.git'" if github_source? && source[:git] !~ /.*\.git/
# messages << "Github repositories should use `https' link" if github_source? && source[:git] !~ /https:\/\/github.com/
messages << "Github repositories should use `https' link" if github_source? && source[:git] !~ /https:\/\/github.com/
messages << "Comments must be deleted" if text =~ /^\w*#\n\w*#/ # allow a single line comment as it is generally used in subspecs
messages
end
......
......@@ -71,7 +71,9 @@ module Pod
end
def already_installed?
Pathname.new(File.expand_path("~/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.#{name.gsub(/ /,'-')}.docset")).exist?
index = spec_appledoc_options.index('--company-id')
company_id = index ? spec_appledoc_options[index + 1] : docs_id
Pathname.new(File.expand_path("~/Library/Developer/Shared/Documentation/DocSets/#{company_id}.#{name.gsub(/ /,'-')}.docset")).exist?
end
def generate(install = false)
......
......@@ -450,10 +450,7 @@ module Pod
if pattern.directory? && options[:glob]
pattern += options[:glob]
end
pattern.glob.map do |file|
file
end
pattern.glob
end.flatten
end
end
......
......@@ -33,12 +33,6 @@ module Pod
# Platform.new(:ios)
# Platform.new(:ios, '4.3')
#
# @overload initialize(name, opts)
# @deprecated Remove after adding a warning to {Podfile} class.
# @param [Symbol] name The name of platform.
# @param [Hash] opts The options to create a platform with.
# @option opts [String, Version] :deployment_target The deployment target.
#
# @overload initialize(platform)
# @param [Platform] platform Another {Platform}.
#
......@@ -51,23 +45,9 @@ module Pod
if input.is_a? Platform
@symbolic_name = input.name
@deployment_target = input.deployment_target
@declared_deployment_target = input.declared_deployment_target
else
@symbolic_name = input
target = target[:deployment_target] if target.is_a?(Hash)
@declared_deployment_target = target
unless target
case @symbolic_name
when :ios
target = '4.3'
when :osx
target = '10.6'
else
target = ''
end
end
@deployment_target = Version.create(target)
end
end
......@@ -82,10 +62,6 @@ module Pod
#
attr_reader :deployment_target
# @return [Version] The deployment target declared on initialization.
#
attr_reader :declared_deployment_target
# @param [Platform, Symbol] other The other platform to check.
#
# @note If a symbol is passed the comparison does not take into account
......@@ -109,7 +85,11 @@ module Pod
#
def supports?(other)
other = Platform.new(other)
if other.deployment_target && deployment_target
(other.name == name) && (other.deployment_target <= deployment_target)
else
other.name == name
end
end
# @return [String] A string representation including the deployment target.
......@@ -121,7 +101,7 @@ module Pod
when :osx
s = 'OS X'
end
s << " #{declared_deployment_target}" if declared_deployment_target
s << " #{deployment_target}" if deployment_target
s
end
......@@ -134,7 +114,7 @@ module Pod
# @return Whether the platform requires legacy architectures for iOS.
#
def requires_legacy_ios_archs?
(name == :ios) && (deployment_target < Version.new("4.3"))
(name == :ios) && deployment_target && (deployment_target < Version.new("4.3"))
end
end
end
......@@ -173,19 +173,35 @@ module Pod
end
# Specifies the platform for which a static library should be build.
#
# This can be either `:osx` for Mac OS X applications, or `:ios` for iOS
# applications.
#
# For iOS applications, you can set the deployment target by passing a :deployment_target
# option, e.g:
# @param [Symbol] name The name of platform.
# @param [String, Version] target The optional deployment.
# If not provided a default value according to the platform name will
# be assigned.
#
# @example
#
# platform :ios, :deployment_target => "4.0"
# platform :ios, "4.0"
# platform :ios
#
# If the deployment target requires it (< 4.3), armv6 will be added to ARCHS.
# @note If the deployment target requires it (< 4.3), armv6 will be added
# to ARCHS.
#
def platform(platform, options={})
@target_definition.platform = Platform.new(platform, options)
def platform(name, target = nil)
# Support for deprecated options parameter
target = target[:deployment_target] if target.is_a?(Hash)
unless target
case name
when :ios
target = '4.3'
when :osx
target = '10.6'
end
end
@target_definition.platform = Platform.new(name, target)
end
# Specifies the Xcode workspace that should contain all the projects.
......
......@@ -17,7 +17,7 @@ describe "Pod::Command::Setup" do
it "returns the read only URL of the `master' spec-repo" do
cmd = Pod::Command::Setup.new(argv)
cmd.url.should == 'git://github.com/CocoaPods/Specs.git'
cmd.url.should == 'https://github.com/CocoaPods/Specs.git'
end
it "returns the push URL of the `master' spec-repo" do
......
......@@ -102,13 +102,13 @@ describe "Pod::Command::Spec#lint" do
it "lints a repo" do
# The fixture has warnings so it raises
cmd = command('spec', 'lint', 'master')
cmd = command('spec', 'lint', "#{config.repos_dir}/master")
lambda { cmd.run }.should.raise Pod::Informative
cmd.output.should.include "WARN"
end
it "complains if no repo name or url are provided and there a no specs in the current working directory" do
Dir.chdir(fixture('spec-repos') + 'master/JSONKit/') do
it "complains if it can't find any spec to lint" do
Dir.chdir(temporary_directory) do
lambda { command('spec', 'lint').run }.should.raise Pod::Informative
end
end
......
......@@ -55,10 +55,6 @@ describe Pod::Platform do
p.deployment_target.should == Pod::Version.new('4.0.0')
end
it "provides a default deployment target on initialization" do
p = Pod::Platform.new(:ios)
p.deployment_target.should == Pod::Version.new('4.3')
end
end
describe "regarding supporting platforms" do
......
......@@ -11,6 +11,11 @@ describe "Pod::Podfile" do
podfile.target_definitions[:default].platform.should == :ios
end
it "provides a default deployment target if not specified" do
podfile = Pod::Podfile.new { platform :ios }
podfile.target_definitions[:default].platform.deployment_target.should == Pod::Version.new('4.3')
end
it "adds dependencies" do
podfile = Pod::Podfile.new { dependency 'ASIHTTPRequest'; dependency 'SSZipArchive', '>= 0.1' }
podfile.dependencies.size.should == 2
......
......@@ -382,7 +382,7 @@ describe "A Pod::Specification subspec" do
@subspec.supports_platform?(:osx).should.be.false
@subspec.supports_platform?(:ios, '4.0').should.be.true
@subspec.supports_platform?(:ios, '5.0').should.be.true
@subsubspec.supports_platform?(:ios).should.be.false
@subsubspec.supports_platform?(:ios).should.be.true
@subsubspec.supports_platform?(:osx).should.be.false
@subsubspec.supports_platform?(:ios, '4.0').should.be.false
@subsubspec.supports_platform?(:ios, '5.0').should.be.true
......
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