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
694a7047
Commit
694a7047
authored
Oct 28, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start specifying the objects a (static library) target requires.
parent
6b9e1931
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
30 deletions
+129
-30
project.rb
lib/cocoapods/xcode/project.rb
+24
-5
integration_spec.rb
spec/integration_spec.rb
+23
-25
project_spec.rb
spec/unit/xcode/project_spec.rb
+82
-0
No files found.
lib/cocoapods/xcode/project.rb
View file @
694a7047
...
...
@@ -131,34 +131,53 @@ module Pod
end
class
PBXBuildPhase
<
PBXObject
attributes_accessor
:files
attributes_accessor
:files
,
:buildActionMask
,
:runOnlyForDeploymentPostprocessing
alias_method
:file_uuids
,
:files
alias_method
:file_uuids
=
,
:files
=
def
initialize
(
project
,
uuid
,
attributes
)
def
initialize
(
*
)
super
self
.
file_uuids
||=
[]
# These are always the same, no idea what they are.
self
.
buildActionMask
||=
"2147483647"
self
.
runOnlyForDeploymentPostprocessing
||=
"0"
end
def
files
list_by_class
(
file_uuids
,
PBXBuildFile
)
end
end
class
PBXCopyFilesBuildPhase
<
PBXBuildPhase
attributes_accessor
:dstPath
,
:dstSubfolderSpec
def
initialize
(
*
)
super
self
.
dstSubfolderSpec
||=
"16"
end
end
class
PBXSourcesBuildPhase
<
PBXBuildPhase
;
end
class
PBXCopyFilesBuildPhase
<
PBXBuildPhase
;
end
class
PBXFrameworksBuildPhase
<
PBXBuildPhase
;
end
class
PBXShellScriptBuildPhase
<
PBXBuildPhase
attributes_accessor
:shellScript
end
class
PBXNativeTarget
<
PBXObject
attributes_accessor
:
buildPhas
es
,
:buildConfigurationList
attributes_accessor
:
productName
,
:productReference
,
:productType
,
:buildPhases
,
:buildRules
,
:dependenci
es
,
:buildConfigurationList
alias_method
:build_phase_uuids
,
:buildPhases
alias_method
:build_phase_uuids
=
,
:buildPhases
=
alias_method
:build_configuration_list_uuid
,
:buildConfigurationList
alias_method
:build_configuration_list_uuid
=
,
:buildConfigurationList
=
def
initialize
(
project
,
uuid
,
attributes
)
super
self
.
buildPhases
||=
[]
# TODO self.buildConfigurationList ||= new list?
#self.buildRules ||= []
#self.dependencies ||= []
end
def
buildPhases
list_by_class
(
build_phase_uuids
,
PBXBuildPhase
)
end
...
...
spec/integration_spec.rb
View file @
694a7047
...
...
@@ -145,31 +145,29 @@ else
project
.
source_files
.
should
==
installer
.
xcodeproj
.
source_files
end
it
"creates a project with multiple targets"
do
Pod
::
Source
.
reset!
Pod
::
Spec
::
Set
.
reset!
podfile
=
Pod
::
Podfile
.
new
do
# first ensure that the correct info is available to the specs when they load
config
.
rootspec
=
self
self
.
platform
platform
target
(
:debug
)
{
dependency
'SSZipArchive'
}
target
(
:test
,
:exclusive
=>
true
)
{
dependency
'JSONKit'
}
dependency
'ASIHTTPRequest'
end
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
install!
puts
"
\n
[!] Compiling static library..."
Dir
.
chdir
(
config
.
project_pods_root
)
do
puts
`ls -l`
#system("xcodebuild > /dev/null 2>&1").should == true
system
(
"xcodebuild -target Pods"
).
should
==
true
system
(
"xcodebuild -target Pods-debug"
).
should
==
true
system
(
"xcodebuild -target Pods-test"
).
should
==
true
end
end
#it "creates a project with multiple targets" do
#Pod::Source.reset!
#Pod::Spec::Set.reset!
#podfile = Pod::Podfile.new do
## first ensure that the correct info is available to the specs when they load
#config.rootspec = self
#self.platform platform
#target(:debug) { dependency 'SSZipArchive' }
#target(:test, :exclusive => true) { dependency 'JSONKit' }
#dependency 'ASIHTTPRequest'
#end
#installer = Pod::Installer.new(podfile)
#installer.install!
#puts "\n[!] Compiling static library..."
#Dir.chdir(config.project_pods_root) do
##system("xcodebuild -target Pods").should == true
#system("xcodebuild -target Pods-debug").should == true
#system("xcodebuild -target Pods-test").should == true
#end
#end
it
"sets up an existing project with pods"
do
basename
=
platform
==
:ios
?
'iPhone'
:
'Mac'
...
...
spec/unit/xcode/project_spec.rb
View file @
694a7047
...
...
@@ -50,6 +50,88 @@ describe "Pod::Xcode::Project" do
end
end
describe
"a new PBXBuildPhase"
do
before
do
@phase
=
@project
.
objects
.
add
(
Pod
::
Xcode
::
Project
::
PBXBuildPhase
)
end
it
"has an empty list of files"
do
@phase
.
files
.
to_a
.
should
==
[]
end
it
"always returns the same buildActionMask (no idea what it is)"
do
@phase
.
buildActionMask
.
should
==
"2147483647"
end
it
"always returns zero for runOnlyForDeploymentPostprocessing (no idea what it is)"
do
@phase
.
runOnlyForDeploymentPostprocessing
.
should
==
"0"
end
end
describe
"a new PBXCopyFilesBuildPhase"
do
before
do
@phase
=
@project
.
objects
.
add
(
Pod
::
Xcode
::
Project
::
PBXCopyFilesBuildPhase
,
'dstPath'
=>
'some/path'
)
end
it
"is a PBXBuildPhase"
do
@phase
.
should
.
be
.
kind_of
Pod
::
Xcode
::
Project
::
PBXBuildPhase
end
it
"returns the dstPath"
do
@phase
.
dstPath
.
should
==
'some/path'
end
it
"returns the dstSubfolderSpec (no idea what it is yet, but it's not always the same)"
do
@phase
.
dstSubfolderSpec
.
should
==
"16"
end
end
describe
"a new PBXSourcesBuildPhase"
do
before
do
@phase
=
@project
.
objects
.
add
(
Pod
::
Xcode
::
Project
::
PBXSourcesBuildPhase
)
end
it
"is a PBXBuildPhase"
do
@phase
.
should
.
be
.
kind_of
Pod
::
Xcode
::
Project
::
PBXBuildPhase
end
end
describe
"a new PBXFrameworksBuildPhase"
do
before
do
@phase
=
@project
.
objects
.
add
(
Pod
::
Xcode
::
Project
::
PBXFrameworksBuildPhase
)
end
it
"is a PBXBuildPhase"
do
@phase
.
should
.
be
.
kind_of
Pod
::
Xcode
::
Project
::
PBXBuildPhase
end
end
describe
"a new PBXNativeTarget"
do
before
do
@target
=
@project
.
targets
.
first
end
describe
"concerning its build phases"
do
extend
SpecHelper
::
TemporaryDirectory
it
"returns an empty sources build phase"
do
phase
=
@target
.
buildPhases
.
select_by_class
(
Pod
::
Xcode
::
Project
::
PBXSourcesBuildPhase
).
first
phase
.
files
.
to_a
.
should
==
[]
end
it
"returns a libraries/frameworks build phase, which by default only contains `Foundation.framework'"
do
phase
=
@target
.
buildPhases
.
select_by_class
(
Pod
::
Xcode
::
Project
::
PBXFrameworksBuildPhase
).
first
phase
.
files
.
map
{
|
buildFile
|
buildFile
.
file
.
name
}.
should
==
[
'Foundation.framework'
]
end
it
"returns an empty 'copy headers' phase"
do
phase
=
@target
.
buildPhases
.
select_by_class
(
Pod
::
Xcode
::
Project
::
PBXCopyFilesBuildPhase
).
first
phase
.
dstPath
.
should
==
"$(PUBLIC_HEADERS_FOLDER_PATH)"
phase
.
files
.
to_a
.
should
==
[]
end
end
end
it
"returns the objects as PBXObject instances"
do
@project
.
objects
.
each
do
|
object
|
@project
.
objects_hash
[
object
.
uuid
].
should
==
object
.
attributes
...
...
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