mirror of
https://github.com/zhigang1992/CocoaPods.git
synced 2026-01-12 17:12:54 +08:00
Move Xcode::Project extension to xcode_project.rb and use the xcodeproj lib from HEAD during dev.
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -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
|
||||
|
||||
1
bin/pod
1
bin/pod
@@ -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
1
external/xcodeproj
vendored
Submodule
Submodule external/xcodeproj added at 0c41e5333b
@@ -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
|
||||
|
||||
24
lib/cocoapods/xcode_project.rb
Normal file
24
lib/cocoapods/xcode_project.rb
Normal 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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user