Permalink
Browse files

Remove hard dependency on cocoapods

  • Loading branch information...
rayh committed Mar 28, 2013
1 parent 8a0e6bd commit 501d4dc49287a5166daccf0fba1a87558c2e5a70
Showing with 14 additions and 14 deletions.
  1. +0 −3 Gemfile
  2. +14 −10 lib/xcode/builder/base_builder.rb
  3. +0 −1 xcoder.gemspec
View
@@ -8,9 +8,6 @@ gem 'multi_json'
gem 'plist'
gem 'rest-client'
-# Dependency Management
-gem 'cocoapods'
-
# Documentation
gem 'yard'
gem 'redcarpet'
@@ -24,19 +24,23 @@ def initialize(target, config)
@symroot = File.join(@build_path, 'Products')
end
+ def cocoapods_installed?
+ system("which pod > /dev/null 2>&1")
+ end
+
def has_dependencies?
podfile = File.join(File.dirname(@target.project.path), "Podfile")
File.exists? podfile
end
- #
+ #
# If a Podfile exists, perform a pod install
#
def dependencies
- print_task :builder, "Fetch depencies", :notice
- podfile = File.join(File.dirname(@target.project.path), "Podfile")
- # sandbox = File.join(File.dirname(@target.project.path), "Pods")
- if File.exists? podfile
+ if has_dependencies? and cocoapods_installed?
+ print_task :builder, "Fetch depencies", :notice
+ podfile = File.join(File.dirname(@target.project.path), "Podfile")
+
print_task :cocoapods, "pod setup", :info
cmd = Xcode::Shell::Command.new 'pod setup'
cmd.execute
@@ -67,7 +71,7 @@ def prepare_xcodebuild sdk=@sdk #:yield: Xcode::Shell::Command
unless @keychain.nil?
print_task 'builder', "Using keychain #{@keychain.path}", :debug
- cmd.env["OTHER_CODE_SIGN_FLAGS"] = "'--keychain #{@keychain.path}'"
+ cmd.env["OTHER_CODE_SIGN_FLAGS"] = "'--keychain #{@keychain.path}'"
end
unless @identity.nil?
@@ -126,7 +130,7 @@ def prepare_dsym_command
cmd
end
- #
+ #
# Build the project
#
def build options = {}, &block
@@ -219,7 +223,7 @@ def deploy method, options = {}
# testflight.upload(ipa_path, dsym_zip_path)
# end
- def clean options = {:sdk=>@sdk}, &block
+ def clean options = {:sdk=>@sdk}, &block
print_task :builder, "Cleaning #{product_name}", :notice
prepare_clean_command(options[:sdk]).execute
@@ -240,7 +244,7 @@ def clean options = {:sdk=>@sdk}, &block
# self
# end
- def package options = {}, &block
+ def package options = {}, &block
options = {:show_output => false}.merge(options)
raise "Can't find #{app_path}, do you need to call builder.build?" unless File.exists? app_path or File.symlink? app_path
@@ -308,7 +312,7 @@ def bundle_version
@config.info_plist.version
end
- private
+ private
def with_keychain(&block)
if @keychain.nil?
View
@@ -25,5 +25,4 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "rest-client"
s.add_runtime_dependency "colorize"
s.add_runtime_dependency "aws-sdk"
- s.add_runtime_dependency "cocoapods"
end

2 comments on commit 501d4dc

noticed the base_builder.rb still has the cocoapods require at the top of it. This still means i need to require the cocoapods gem.

Owner

rayh replied Apr 3, 2013

Please sign in to comment.