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
971586ce
Commit
971586ce
authored
Oct 29, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'reference' instead of 'UUID', which is what it already uses to indicate foreign keys.
parent
bf963342
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
project.rb
lib/cocoapods/xcode/project.rb
+8
-8
project_spec.rb
spec/unit/xcode/project_spec.rb
+3
-3
No files found.
lib/cocoapods/xcode/project.rb
View file @
971586ce
...
@@ -15,7 +15,7 @@ module Pod
...
@@ -15,7 +15,7 @@ module Pod
def
self
.
has_many
(
plural_attr_name
,
options
)
def
self
.
has_many
(
plural_attr_name
,
options
)
klass
=
options
[
:class
]
klass
=
options
[
:class
]
singular_attr_name
=
plural_attr_name
.
to_s
[
0
..-
2
]
# strip off 's'
singular_attr_name
=
plural_attr_name
.
to_s
[
0
..-
2
]
# strip off 's'
uuid_list_name
=
"
#{
singular_attr_name
}
UUID
s"
uuid_list_name
=
"
#{
singular_attr_name
}
Reference
s"
attribute
(
plural_attr_name
,
uuid_list_name
)
attribute
(
plural_attr_name
,
uuid_list_name
)
define_method
(
plural_attr_name
)
do
define_method
(
plural_attr_name
)
do
uuids
=
send
(
uuid_list_name
)
uuids
=
send
(
uuid_list_name
)
...
@@ -26,9 +26,9 @@ module Pod
...
@@ -26,9 +26,9 @@ module Pod
end
end
end
end
def
self
.
has_one
(
singular_attr_name
,
options
=
{}
)
def
self
.
has_one
(
singular_attr_name
)
uuid_name
=
options
[
:uuid
]
||
"
#{
singular_attr_name
}
UUID"
# TODO change UUID to Reference?
uuid_name
=
"
#{
singular_attr_name
}
Reference"
attribute
(
options
[
:uuid
]
||
singular_attr_name
,
uuid_name
)
attribute
(
singular_attr_name
,
uuid_name
)
define_method
(
singular_attr_name
)
do
define_method
(
singular_attr_name
)
do
uuid
=
send
(
uuid_name
)
uuid
=
send
(
uuid_name
)
@project
.
objects
[
uuid
]
@project
.
objects
[
uuid
]
...
@@ -167,7 +167,7 @@ module Pod
...
@@ -167,7 +167,7 @@ module Pod
def
initialize
(
*
)
def
initialize
(
*
)
super
super
self
.
file
UUID
s
||=
[]
self
.
file
Reference
s
||=
[]
# These are always the same, no idea what they are.
# These are always the same, no idea what they are.
self
.
buildActionMask
||=
"2147483647"
self
.
buildActionMask
||=
"2147483647"
self
.
runOnlyForDeploymentPostprocessing
||=
"0"
self
.
runOnlyForDeploymentPostprocessing
||=
"0"
...
@@ -202,7 +202,7 @@ module Pod
...
@@ -202,7 +202,7 @@ module Pod
def
initialize
(
project
,
uuid
,
attributes
)
def
initialize
(
project
,
uuid
,
attributes
)
super
super
self
.
buildPhase
UUID
s
||=
[]
self
.
buildPhase
Reference
s
||=
[]
# TODO self.buildConfigurationList ||= new list?
# TODO self.buildConfigurationList ||= new list?
#self.buildRules ||= []
#self.buildRules ||= []
#self.dependencies ||= []
#self.dependencies ||= []
...
@@ -210,7 +210,7 @@ module Pod
...
@@ -210,7 +210,7 @@ module Pod
end
end
class
XCBuildConfiguration
<
PBXObject
class
XCBuildConfiguration
<
PBXObject
has_one
:baseConfiguration
,
:uuid
=>
:baseConfigurationReference
has_one
:baseConfiguration
end
end
class
XCConfigurationList
<
PBXObject
class
XCConfigurationList
<
PBXObject
...
@@ -218,7 +218,7 @@ module Pod
...
@@ -218,7 +218,7 @@ module Pod
def
initialize
(
*
)
def
initialize
(
*
)
super
super
self
.
buildConfiguration
UUID
s
||=
[]
self
.
buildConfiguration
Reference
s
||=
[]
end
end
end
end
...
...
spec/unit/xcode/project_spec.rb
View file @
971586ce
...
@@ -128,7 +128,7 @@ describe "Pod::Xcode::Project" do
...
@@ -128,7 +128,7 @@ describe "Pod::Xcode::Project" do
configuration
=
@project
.
objects
.
add
(
Pod
::
Xcode
::
Project
::
XCBuildConfiguration
)
configuration
=
@project
.
objects
.
add
(
Pod
::
Xcode
::
Project
::
XCBuildConfiguration
)
@list
.
buildConfigurations
.
to_a
.
should
==
[]
@list
.
buildConfigurations
.
to_a
.
should
==
[]
@list
.
buildConfigurations
=
[
configuration
]
@list
.
buildConfigurations
=
[
configuration
]
@list
.
buildConfiguration
UUID
s
.
should
==
[
configuration
.
uuid
]
@list
.
buildConfiguration
Reference
s
.
should
==
[
configuration
.
uuid
]
end
end
end
end
...
@@ -153,9 +153,9 @@ describe "Pod::Xcode::Project" do
...
@@ -153,9 +153,9 @@ describe "Pod::Xcode::Project" do
it
"returns the buildConfigurationList"
do
it
"returns the buildConfigurationList"
do
list
=
@target
.
buildConfigurationList
list
=
@target
.
buildConfigurationList
list
.
should
.
be
.
instance_of
Pod
::
Xcode
::
Project
::
XCConfigurationList
list
.
should
.
be
.
instance_of
Pod
::
Xcode
::
Project
::
XCConfigurationList
@target
.
buildConfigurationList
UUID
=
nil
@target
.
buildConfigurationList
Reference
=
nil
@target
.
buildConfigurationList
.
should
==
nil
@target
.
buildConfigurationList
.
should
==
nil
@target
.
buildConfigurationList
UUID
=
list
.
uuid
@target
.
buildConfigurationList
Reference
=
list
.
uuid
@target
.
buildConfigurationList
.
attributes
.
should
==
list
.
attributes
@target
.
buildConfigurationList
.
attributes
.
should
==
list
.
attributes
end
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