Move Xcode::Project extension to xcode_project.rb and use the xcodeproj lib from HEAD during dev.

This commit is contained in:
Eloy Duran
2011-11-12 00:43:53 +01:00
parent be78f0dce8
commit 738cf91be8
6 changed files with 36 additions and 27 deletions

3
.gitmodules vendored
View File

@@ -13,3 +13,6 @@
[submodule "spec/fixtures/integration/sstoolkit"]
path = spec/fixtures/integration/sstoolkit
url = https://github.com/samsoffes/sstoolkit.git
[submodule "external/xcodeproj"]
path = external/xcodeproj
url = git@github.com:alloy/xcodeproj.git

View File

@@ -3,6 +3,7 @@
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

1
external/xcodeproj vendored Submodule

Submodule external/xcodeproj added at 0c41e5333b

View File

@@ -1,6 +1,3 @@
require 'rubygems'
require 'xcodeproj'
module Pod
VERSION = '0.2.0'
@@ -25,31 +22,13 @@ module Pod
autoload :Pathname, 'pathname'
end
module Xcode
autoload :Config, 'cocoapods/xcode_project'
autoload :Project, 'cocoapods/xcode_project'
end
class Pathname
def glob(pattern = '')
Dir.glob((self + pattern).to_s).map { |f| Pathname.new(f) }
end
end
# Sorry to dump these here...
class Xcode::Project
# Shortcut access to the `Pods' PBXGroup.
def pods
groups.find { |g| g.name == 'Pods' } || groups.new({ 'name' => 'Pods' })
end
# Adds a group as child to the `Pods' group.
def add_pod_group(name)
pods.groups.new('name' => name)
end
class PBXCopyFilesBuildPhase
def self.new_pod_dir(project, pod_name, path)
new(project, nil, {
"dstPath" => "$(PUBLIC_HEADERS_FOLDER_PATH)/#{path}",
"name" => "Copy #{pod_name} Public Headers",
})
end
end
end

View File

@@ -0,0 +1,24 @@
require 'xcodeproj'
module Xcode
class Project
# Shortcut access to the `Pods' PBXGroup.
def pods
groups.find { |g| g.name == 'Pods' } || groups.new({ 'name' => 'Pods' })
end
# Adds a group as child to the `Pods' group.
def add_pod_group(name)
pods.groups.new('name' => name)
end
class PBXCopyFilesBuildPhase
def self.new_pod_dir(project, pod_name, path)
new(project, nil, {
"dstPath" => "$(PUBLIC_HEADERS_FOLDER_PATH)/#{path}",
"name" => "Copy #{pod_name} Public Headers",
})
end
end
end
end

View File

@@ -5,7 +5,8 @@ require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
gem 'activesupport', '~> 3.1.1'
$:.unshift((ROOT + 'lib').to_s)
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift (ROOT + 'lib').to_s
require 'cocoapods'
$:.unshift((ROOT + 'spec').to_s)