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
1905f1b3
Commit
1905f1b3
authored
Oct 29, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a shortcut to define multiple attribute accessors at once.
parent
971586ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
project.rb
lib/cocoapods/xcode/project.rb
+11
-17
No files found.
lib/cocoapods/xcode/project.rb
View file @
1905f1b3
...
...
@@ -12,6 +12,10 @@ module Pod
define_method
(
"
#{
name
}
="
)
{
|
value
|
@attributes
[
attribute_name
]
=
value
}
end
def
self
.
attributes
(
*
names
)
names
.
each
{
|
name
|
attribute
(
name
)
}
end
def
self
.
has_many
(
plural_attr_name
,
options
)
klass
=
options
[
:class
]
singular_attr_name
=
plural_attr_name
.
to_s
[
0
..-
2
]
# strip off 's'
...
...
@@ -43,8 +47,7 @@ module Pod
end
attr_reader
:uuid
,
:attributes
attribute
:isa
attribute
:name
attributes
:isa
,
:name
def
initialize
(
project
,
uuid
,
attributes
)
@project
,
@uuid
,
@attributes
=
project
,
uuid
||
generate_uuid
,
attributes
...
...
@@ -78,8 +81,7 @@ module Pod
end
class
PBXGroup
<
PBXObject
attribute
:sourceTree
attribute
:children
attributes
:sourceTree
,
:children
def
initialize
(
project
,
uuid
,
attributes
)
super
...
...
@@ -122,8 +124,7 @@ module Pod
end
class
PBXFileReference
<
PBXObject
attribute
:path
attribute
:sourceTree
attributes
:path
,
:sourceTree
def
initialize
(
project
,
uuid
,
attributes
)
is_new
=
uuid
.
nil?
...
...
@@ -145,8 +146,7 @@ module Pod
end
class
PBXBuildFile
<
PBXObject
attribute
:fileRef
attribute
:settings
attributes
:fileRef
,
:settings
# Takes a PBXFileReference instance and assigns its uuid to the fileRef attribute.
def
file
=
(
file
)
...
...
@@ -162,8 +162,7 @@ module Pod
class
PBXBuildPhase
<
PBXObject
has_many
:files
,
:class
=>
PBXBuildFile
attribute
:buildActionMask
attribute
:runOnlyForDeploymentPostprocessing
attributes
:buildActionMask
,
:runOnlyForDeploymentPostprocessing
def
initialize
(
*
)
super
...
...
@@ -175,8 +174,7 @@ module Pod
end
class
PBXCopyFilesBuildPhase
<
PBXBuildPhase
attribute
:dstPath
attribute
:dstSubfolderSpec
attributes
:dstPath
,
:dstSubfolderSpec
def
initialize
(
*
)
super
...
...
@@ -191,11 +189,7 @@ module Pod
end
class
PBXNativeTarget
<
PBXObject
attribute
:productName
attribute
:productReference
attribute
:productType
attribute
:buildRules
attribute
:dependencies
attributes
:productName
,
:productReference
,
:productType
,
:buildRules
,
:dependencies
has_many
:buildPhases
,
:class
=>
PBXBuildPhase
has_one
:buildConfigurationList
...
...
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