Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
2182e471
Commit
2182e471
authored
Feb 25, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let's make Pod::Project a class in it's own right, inheriting from Xcodeproj::Project, instead
of extending it.
parent
8a73c7d3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
33 deletions
+30
-33
cocoapods.rb
lib/cocoapods.rb
+1
-6
installer.rb
lib/cocoapods/installer.rb
+2
-2
project.rb
lib/cocoapods/project.rb
+12
-12
specification.rb
lib/cocoapods/specification.rb
+2
-0
integration_spec.rb
spec/integration_spec.rb
+3
-3
project_spec.rb
spec/unit/project_spec.rb
+10
-10
No files found.
lib/cocoapods.rb
View file @
2182e471
...
...
@@ -14,6 +14,7 @@ module Pod
autoload
:LocalPod
,
'cocoapods/local_pod'
autoload
:Platform
,
'cocoapods/platform'
autoload
:Podfile
,
'cocoapods/podfile'
autoload
:Project
,
'cocoapods/project'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:Sandbox
,
'cocoapods/sandbox'
autoload
:Source
,
'cocoapods/source'
...
...
@@ -30,12 +31,6 @@ module Pod
end
end
module
Xcodeproj
autoload
:Config
,
'xcodeproj/config'
autoload
:Project
,
'cocoapods/xcodeproj_pods'
autoload
:Workspace
,
'xcodeproj/workspace'
end
class
Pathname
def
glob
(
pattern
=
''
)
Dir
.
glob
((
self
+
pattern
).
to_s
).
map
{
|
f
|
Pathname
.
new
(
f
)
}
...
...
lib/cocoapods/installer.rb
View file @
2182e471
...
...
@@ -34,7 +34,7 @@ module Pod
def
project
return
@project
if
@project
@project
=
Xcodeproj
::
Project
.
for_platform
(
@podfile
.
platform
)
@project
=
Pod
::
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'.
...
...
@@ -162,7 +162,7 @@ module Pod
end
workspace
.
save_as
(
xcworkspace
)
app_project
=
Xcodeproj
::
Project
.
new
(
projpath
)
app_project
=
Pod
::
Project
.
new
(
projpath
)
return
if
app_project
.
files
.
find
{
|
file
|
file
.
path
=~
/libPods\.a$/
}
configfile
=
app_project
.
files
.
new
(
'path'
=>
'Pods/Pods.xcconfig'
)
...
...
lib/cocoapods/
xcodeproj_pods
.rb
→
lib/cocoapods/
project
.rb
View file @
2182e471
require
'xcodeproj/project'
module
Xcodeproj
class
Project
Xcodeproj
::
Project
::
PBXCopyFilesBuildPhase
.
instance_eval
do
def
self
.
new_pod_dir
(
project
,
pod_name
,
path
)
new
(
project
,
nil
,
{
"dstPath"
=>
"Pods/
#{
path
}
"
,
"name"
=>
"Copy
#{
pod_name
}
Public Headers"
,
})
end
end
module
Pod
class
Project
<
Xcodeproj
::
Project
# Shortcut access to the `Pods' PBXGroup.
def
pods
groups
.
find
{
|
g
|
g
.
name
==
'Pods'
}
||
groups
.
new
({
'name'
=>
'Pods'
})
...
...
@@ -21,17 +30,8 @@ module Xcodeproj
build_configurations
.
find
{
|
c
|
c
.
name
==
name
}
end
class
PBXCopyFilesBuildPhase
def
self
.
new_pod_dir
(
project
,
pod_name
,
path
)
new
(
project
,
nil
,
{
"dstPath"
=>
"Pods/
#{
path
}
"
,
"name"
=>
"Copy
#{
pod_name
}
Public Headers"
,
})
end
end
def
self
.
for_platform
(
platform
)
project
=
Xcodeproj
::
Project
.
new
project
=
Pod
::
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'
})
...
...
lib/cocoapods/specification.rb
View file @
2182e471
require
'xcodeproj/config'
module
Pod
extend
Config
::
Mixin
...
...
spec/integration_spec.rb
View file @
2182e471
...
...
@@ -143,7 +143,7 @@ else
end
SpecHelper
::
Installer
.
new
(
podfile
).
install!
project
=
Xcodeproj
::
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
=
Pod
::
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
.
targets
.
first
.
buildConfigurations
.
map
do
|
config
|
config
.
buildSettings
[
'GCC_ENABLE_OBJC_GC'
]
end
.
should
==
%w{ supported supported }
...
...
@@ -262,7 +262,7 @@ else
installer
=
SpecHelper
::
Installer
.
new
(
spec
)
installer
.
install!
project
=
Xcodeproj
::
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
=
Pod
::
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
.
source_files
.
should
==
installer
.
project
.
source_files
end
...
...
@@ -322,7 +322,7 @@ else
workspace
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
xcworkspace
)
workspace
.
projpaths
.
sort
.
should
==
[
'ASIHTTPRequest.xcodeproj'
,
'Pods/Pods.xcodeproj'
]
project
=
Xcodeproj
::
Project
.
new
(
projpath
)
project
=
Pod
::
Project
.
new
(
projpath
)
libPods
=
project
.
files
.
find
{
|
f
|
f
.
name
==
'libPods.a'
}
project
.
targets
.
each
do
|
target
|
target
.
buildConfigurations
.
each
do
|
config
|
...
...
spec/unit/
xcodeproj_ex
t_spec.rb
→
spec/unit/
projec
t_spec.rb
View file @
2182e471
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
'
Xcodeproj
::Project'
do
describe
'
Pod
::Project'
do
before
do
@project
=
Xcodeproj
::
Project
.
new
@project
=
Pod
::
Project
.
new
end
def
find_object
(
conditions
)
...
...
@@ -42,7 +42,7 @@ describe 'Xcodeproj::Project' do
describe
"for the :ios platform"
do
before
do
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
end
behaves_like
"for any platform"
...
...
@@ -54,35 +54,35 @@ describe 'Xcodeproj::Project' do
describe
"for the :ios platform with a deployment target"
do
it
"sets ARCHS to 'armv6 armv7' for both configurations if the deployment target is less than 4.3"
do
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.1"
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.1"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.2"
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.2"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"armv6 armv7"
end
it
"uses standard ARCHs if deployment target is 4.3 or above"
do
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.3"
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.3"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.4"
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.4"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"ARCHS"
].
should
==
"$(ARCHS_STANDARD_32_BIT)"
end
it
"sets IPHONEOS_DEPLOYMENT_TARGET for both configurations"
do
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.3"
@project
=
Xcodeproj
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
=
Pod
::
Project
.
for_platform
(
Pod
::
Platform
.
new
(
:ios
,
:deployment_target
=>
"4.0"
))
@project
.
build_configuration
(
"Debug"
).
buildSettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.0"
@project
.
build_configuration
(
"Release"
).
buildSettings
[
"IPHONEOS_DEPLOYMENT_TARGET"
].
should
==
"4.0"
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment