Commit e1d788d9 authored by Eloy Duran's avatar Eloy Duran

Remove activation of activesupport gem and make code work with Xcodeproj gem again.

parent ace222ef
#!/usr/bin/env macruby #!/usr/bin/env macruby
if $0 == __FILE__ if $0 == __FILE__
require 'rubygems'
gem 'activesupport', '~> 3.1.1'
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__) $:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__) $:.unshift File.expand_path('../../lib', __FILE__)
end end
......
Subproject commit 0c41e5333bdf4ff409515815c25eb433c03c2ded Subproject commit 0a2952089f22bfd818bb9f5bcbb7cdff9bfaa991
...@@ -21,10 +21,10 @@ module Pod ...@@ -21,10 +21,10 @@ module Pod
autoload :Pathname, 'pathname' autoload :Pathname, 'pathname'
end end
module Xcode module Xcodeproj
autoload :Config, 'cocoapods/xcode_project' autoload :Config, 'cocoapods/xcodeproj_ext'
autoload :Project, 'cocoapods/xcode_project' autoload :Project, 'cocoapods/xcodeproj_ext'
autoload :Workspace, 'cocoapods/xcode_project' autoload :Workspace, 'cocoapods/xcodeproj_ext'
end end
class Pathname class Pathname
......
...@@ -55,7 +55,7 @@ EOS ...@@ -55,7 +55,7 @@ EOS
end end
def xcconfig def xcconfig
@xcconfig ||= Xcode::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.
'USER_HEADER_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods"', 'USER_HEADER_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods"',
'ALWAYS_SEARCH_USER_PATHS' => 'YES', 'ALWAYS_SEARCH_USER_PATHS' => 'YES',
...@@ -164,7 +164,7 @@ EOS ...@@ -164,7 +164,7 @@ EOS
def project def project
return @project if @project return @project if @project
@project = Xcode::Project.for_platform(@podfile.platform) @project = Xcodeproj::Project.for_platform(@podfile.platform)
# First we need to resolve dependencies across *all* targets, so that the # First we need to resolve dependencies across *all* targets, so that the
# same correct versions of pods are being used for all targets. This # same correct versions of pods are being used for all targets. This
# happens when we call `build_specifications'. # happens when we call `build_specifications'.
...@@ -221,7 +221,7 @@ EOS ...@@ -221,7 +221,7 @@ EOS
def configure_project(projpath) def configure_project(projpath)
root = File.dirname(projpath) root = File.dirname(projpath)
xcworkspace = File.join(root, File.basename(projpath, '.xcodeproj') + '.xcworkspace') xcworkspace = File.join(root, File.basename(projpath, '.xcodeproj') + '.xcworkspace')
workspace = Xcode::Workspace.new_from_xcworkspace(xcworkspace) workspace = Xcodeproj::Workspace.new_from_xcworkspace(xcworkspace)
pods_projpath = File.join(config.project_pods_root, 'Pods.xcodeproj') pods_projpath = File.join(config.project_pods_root, 'Pods.xcodeproj')
root = Pathname.new(root).expand_path root = Pathname.new(root).expand_path
[projpath, pods_projpath].each do |path| [projpath, pods_projpath].each do |path|
...@@ -230,7 +230,7 @@ EOS ...@@ -230,7 +230,7 @@ EOS
end end
workspace.save_as(xcworkspace) workspace.save_as(xcworkspace)
app_project = Xcode::Project.new(projpath) app_project = Xcodeproj::Project.new(projpath)
return if app_project.files.find { |file| file.path =~ /libPods\.a$/ } return if app_project.files.find { |file| file.path =~ /libPods\.a$/ }
configfile = app_project.files.new('path' => 'Pods/Pods.xcconfig') configfile = app_project.files.new('path' => 'Pods/Pods.xcconfig')
...@@ -242,7 +242,7 @@ EOS ...@@ -242,7 +242,7 @@ EOS
libfile = app_project.files.new_static_library('Pods') libfile = app_project.files.new_static_library('Pods')
libfile.group = app_project.main_group.groups.find { |g| g.name == 'Frameworks' } libfile.group = app_project.main_group.groups.find { |g| g.name == 'Frameworks' }
app_project.objects.select_by_class(Xcode::Project::PBXFrameworksBuildPhase).each do |build_phase| app_project.objects.select_by_class(Xcodeproj::Project::PBXFrameworksBuildPhase).each do |build_phase|
build_phase.files << libfile.buildFiles.new build_phase.files << libfile.buildFiles.new
end end
......
...@@ -22,7 +22,7 @@ module Pod ...@@ -22,7 +22,7 @@ module Pod
def initialize def initialize
@dependencies = [] @dependencies = []
@xcconfig = Xcode::Config.new @xcconfig = Xcodeproj::Config.new
yield self if block_given? yield self if block_given?
end end
......
require 'xcodeproj' require 'xcodeproj'
module Xcode module Xcodeproj
class Project class Project
# Shortcut access to the `Pods' PBXGroup. # Shortcut access to the `Pods' PBXGroup.
def pods def pods
...@@ -22,7 +22,7 @@ module Xcode ...@@ -22,7 +22,7 @@ module Xcode
end end
def self.for_platform(platform) def self.for_platform(platform)
project = Xcode::Project.new project = Xcodeproj::Project.new
project.main_group << project.groups.new({ 'name' => 'Pods' }) project.main_group << project.groups.new({ 'name' => 'Pods' })
framework = project.add_system_framework(platform == :ios ? 'Foundation' : 'Cocoa') framework = project.add_system_framework(platform == :ios ? 'Foundation' : 'Cocoa')
framework.group = project.groups.new({ 'name' => 'Frameworks' }) framework.group = project.groups.new({ 'name' => 'Frameworks' })
...@@ -31,15 +31,15 @@ module Xcode ...@@ -31,15 +31,15 @@ module Xcode
project.main_group << products project.main_group << products
project.root_object.products = products project.root_object.products = products
project.root_object.attributes['buildConfigurationList'] = project.objects.add(Xcode::Project::XCConfigurationList, { project.root_object.attributes['buildConfigurationList'] = project.objects.add(Xcodeproj::Project::XCConfigurationList, {
'defaultConfigurationIsVisible' => '0', 'defaultConfigurationIsVisible' => '0',
'defaultConfigurationName' => 'Release', 'defaultConfigurationName' => 'Release',
'buildConfigurations' => [ 'buildConfigurations' => [
project.objects.add(Xcode::Project::XCBuildConfiguration, { project.objects.add(Xcodeproj::Project::XCBuildConfiguration, {
'name' => 'Debug', 'name' => 'Debug',
'buildSettings' => build_settings(platform, :debug) 'buildSettings' => build_settings(platform, :debug)
}), }),
project.objects.add(Xcode::Project::XCBuildConfiguration, { project.objects.add(Xcodeproj::Project::XCBuildConfiguration, {
'name' => 'Release', 'name' => 'Release',
'buildSettings' => build_settings(platform, :release) 'buildSettings' => build_settings(platform, :release)
}) })
......
...@@ -207,7 +207,7 @@ if false ...@@ -207,7 +207,7 @@ if false
installer = SpecHelper::Installer.new(spec) installer = SpecHelper::Installer.new(spec)
installer.install! installer.install!
project = Pod::Xcode::Project.new(config.project_pods_root + 'Pods.xcodeproj') project = Xcodeproj::Project.new(config.project_pods_root + 'Pods.xcodeproj')
project.source_files.should == installer.project.source_files project.source_files.should == installer.project.source_files
end end
...@@ -264,10 +264,10 @@ if false ...@@ -264,10 +264,10 @@ if false
installer.configure_project(projpath) installer.configure_project(projpath)
xcworkspace = temporary_directory + 'ASIHTTPRequest.xcworkspace' xcworkspace = temporary_directory + 'ASIHTTPRequest.xcworkspace'
workspace = Pod::Xcode::Workspace.new_from_xcworkspace(xcworkspace) workspace = Xcodeproj::Workspace.new_from_xcworkspace(xcworkspace)
workspace.projpaths.sort.should == ['ASIHTTPRequest.xcodeproj', 'Pods/Pods.xcodeproj'] workspace.projpaths.sort.should == ['ASIHTTPRequest.xcodeproj', 'Pods/Pods.xcodeproj']
project = Pod::Xcode::Project.new(projpath) project = Xcodeproj::Project.new(projpath)
libPods = project.files.find { |f| f.name == 'libPods.a' } libPods = project.files.find { |f| f.name == 'libPods.a' }
project.targets.each do |target| project.targets.each do |target|
target.buildConfigurations.each do |config| target.buildConfigurations.each do |config|
......
...@@ -4,7 +4,6 @@ require 'mac_bacon' ...@@ -4,7 +4,6 @@ require 'mac_bacon'
require 'pathname' require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__)) ROOT = Pathname.new(File.expand_path('../../', __FILE__))
gem 'activesupport', '~> 3.1.1'
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__) $:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift (ROOT + 'lib').to_s $:.unshift (ROOT + 'lib').to_s
require 'cocoapods' require 'cocoapods'
......
require File.expand_path('../../spec_helper', __FILE__) require File.expand_path('../../spec_helper', __FILE__)
describe 'Xcode::Project' do describe 'Xcodeproj::Project' do
before do before do
@project = Xcode::Project.new @project = Xcodeproj::Project.new
end end
def find_object(conditions) def find_object(conditions)
......
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