Permalink
Browse files

Remove activation of activesupport gem and make code work with Xcodep…

…roj gem again.
  • Loading branch information...
1 parent ace222e commit e1d788d94b140ad9b1c16f2f6dd4fde90a294a1d @alloy committed Nov 12, 2011
View
@@ -1,8 +1,6 @@
#!/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
View
@@ -21,10 +21,10 @@ class Informative < StandardError
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 @@ def initialize(podfile, project, definition)
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 @@ def initialize(podfile)
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 @@ def install!
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 @@ def configure_project(projpath)
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 @@ def configure_project(projpath)
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 @@ def self.from_file(path)
def initialize
@dependencies = []
- @xcconfig = Xcode::Config.new
+ @xcconfig = Xcodeproj::Config.new
yield self if block_given?
end
@@ -1,6 +1,6 @@
require 'xcodeproj'
-module Xcode
+module Xcodeproj
class Project
# Shortcut access to the `Pods' PBXGroup.
def pods
@@ -22,7 +22,7 @@ def self.new_pod_dir(project, pod_name, path)
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 @@ def self.for_platform(platform)
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 @@ def should_successfully_perform(command)
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 @@ def should_successfully_perform(command)
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|
View
@@ -4,7 +4,6 @@
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'
@@ -1,8 +1,8 @@
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)

0 comments on commit e1d788d

Please sign in to comment.