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
if $0 == __FILE__
require 'rubygems'
gem 'activesupport', '~> 3.1.1'
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
end
......
Subproject commit 0c41e5333bdf4ff409515815c25eb433c03c2ded
Subproject commit 0a2952089f22bfd818bb9f5bcbb7cdff9bfaa991
......@@ -21,10 +21,10 @@ module Pod
autoload :Pathname, 'pathname'
end
module Xcode
autoload :Config, 'cocoapods/xcode_project'
autoload :Project, 'cocoapods/xcode_project'
autoload :Workspace, 'cocoapods/xcode_project'
module Xcodeproj
autoload :Config, 'cocoapods/xcodeproj_ext'
autoload :Project, 'cocoapods/xcodeproj_ext'
autoload :Workspace, 'cocoapods/xcodeproj_ext'
end
class Pathname
......
......@@ -55,7 +55,7 @@ EOS
end
def xcconfig
@xcconfig ||= Xcode::Config.new({
@xcconfig ||= Xcodeproj::Config.new({
# In a workspace this is where the static library headers should be found.
'USER_HEADER_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods"',
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
......@@ -164,7 +164,7 @@ EOS
def 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
# same correct versions of pods are being used for all targets. This
# happens when we call `build_specifications'.
......@@ -221,7 +221,7 @@ EOS
def configure_project(projpath)
root = File.dirname(projpath)
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')
root = Pathname.new(root).expand_path
[projpath, pods_projpath].each do |path|
......@@ -230,7 +230,7 @@ EOS
end
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$/ }
configfile = app_project.files.new('path' => 'Pods/Pods.xcconfig')
......@@ -242,7 +242,7 @@ EOS
libfile = app_project.files.new_static_library('Pods')
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
end
......
......@@ -22,7 +22,7 @@ module Pod
def initialize
@dependencies = []
@xcconfig = Xcode::Config.new
@xcconfig = Xcodeproj::Config.new
yield self if block_given?
end
......
require 'xcodeproj'
module Xcode
module Xcodeproj
class Project
# Shortcut access to the `Pods' PBXGroup.
def pods
......@@ -22,7 +22,7 @@ module Xcode
end
def self.for_platform(platform)
project = Xcode::Project.new
project = Xcodeproj::Project.new
project.main_group << project.groups.new({ 'name' => 'Pods' })
framework = project.add_system_framework(platform == :ios ? 'Foundation' : 'Cocoa')
framework.group = project.groups.new({ 'name' => 'Frameworks' })
......@@ -31,15 +31,15 @@ module Xcode
project.main_group << 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',
'defaultConfigurationName' => 'Release',
'buildConfigurations' => [
project.objects.add(Xcode::Project::XCBuildConfiguration, {
project.objects.add(Xcodeproj::Project::XCBuildConfiguration, {
'name' => 'Debug',
'buildSettings' => build_settings(platform, :debug)
}),
project.objects.add(Xcode::Project::XCBuildConfiguration, {
project.objects.add(Xcodeproj::Project::XCBuildConfiguration, {
'name' => 'Release',
'buildSettings' => build_settings(platform, :release)
})
......
......@@ -207,7 +207,7 @@ if false
installer = SpecHelper::Installer.new(spec)
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
end
......@@ -264,10 +264,10 @@ if false
installer.configure_project(projpath)
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']
project = Pod::Xcode::Project.new(projpath)
project = Xcodeproj::Project.new(projpath)
libPods = project.files.find { |f| f.name == 'libPods.a' }
project.targets.each do |target|
target.buildConfigurations.each do |config|
......
......@@ -4,7 +4,6 @@ require 'mac_bacon'
require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
gem 'activesupport', '~> 3.1.1'
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift (ROOT + 'lib').to_s
require 'cocoapods'
......
require File.expand_path('../../spec_helper', __FILE__)
describe 'Xcode::Project' do
describe 'Xcodeproj::Project' do
before do
@project = Xcode::Project.new
@project = Xcodeproj::Project.new
end
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