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
e9261526
Commit
e9261526
authored
Aug 30, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specification] support for `header_mappings_dir` in subspecs.
parent
9986aa4c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
local_pod.rb
lib/cocoapods/local_pod.rb
+2
-1
specification.rb
lib/cocoapods/specification.rb
+19
-20
No files found.
lib/cocoapods/local_pod.rb
View file @
e9261526
...
...
@@ -429,9 +429,10 @@ module Pod
mappings
=
{}
files_by_spec
.
each
do
|
spec
,
paths
|
paths
=
paths
-
headers_excluded_from_search_paths
dir
=
spec
.
header_dir
?
(
headers_sandbox
+
spec
.
header_dir
)
:
headers_sandbox
paths
.
each
do
|
from
|
from_relative
=
from
.
relative_path_from
(
root
)
to
=
headers_sandbox
+
(
spec
.
header_dir
)
+
spec
.
copy_header_mapping
(
from_relative
)
to
=
dir
+
spec
.
copy_header_mapping
(
from_relative
)
(
mappings
[
to
.
dirname
]
||=
[])
<<
from
end
end
...
...
lib/cocoapods/specification.rb
View file @
e9261526
...
...
@@ -54,6 +54,7 @@ module Pod
@xcconfig
=
{
:ios
=>
Xcodeproj
::
Config
.
new
,
:osx
=>
Xcodeproj
::
Config
.
new
}
@header_dir
=
{
:ios
=>
nil
,
:osx
=>
nil
}
@requires_arc
=
{
:ios
=>
nil
,
:osx
=>
nil
}
@header_mappings_dir
=
{
:ios
=>
nil
,
:osx
=>
nil
}
yield
self
if
block_given?
end
...
...
@@ -88,6 +89,7 @@ module Pod
# Returns the value of the attribute for the active platform
# chained with the upstream specifications. The ivar must store
# the platform specific values as an array.
#
def
self
.
pltf_chained_attr_reader
(
attr
)
define_method
(
attr
)
do
active_plaform_check
...
...
@@ -96,6 +98,17 @@ module Pod
end
end
# Returns the first value defined of the attribute traversing the chain
# upwards.
#
def
self
.
pltf_first_defined_attr_reader
(
attr
)
define_method
(
attr
)
do
active_plaform_check
ivar_value
=
instance_variable_get
(
"@
#{
attr
}
"
)[
active_platform
]
ivar_value
||
(
@parent
.
send
(
attr
)
if
@parent
)
end
end
def
active_plaform_check
raise
Informative
,
"
#{
self
.
inspect
}
not activated for a platform before consumption."
unless
active_platform
end
...
...
@@ -240,13 +253,11 @@ module Pod
### Attributes **with** multiple platform support
# @todo allow for subspecs
# @todo allow for subspecs
?
#
top_attr_accessor
:header_mappings_dir
,
lambda
{
|
file
|
Pathname
.
new
(
file
)
}
# If not provided the headers files are flattened
top_attr_accessor
:prefix_header_file
,
lambda
{
|
file
|
Pathname
.
new
(
file
)
}
top_attr_accessor
:prefix_header_contents
pltf_chained_attr_accessor
:source_files
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_accessor
:public_header_files
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_accessor
:resources
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
...
...
@@ -262,7 +273,6 @@ module Pod
alias_method
:weak_framework
=
,
:weak_frameworks
=
alias_method
:library
=
,
:libraries
=
# @!method requires_arc=
#
# @abstract Wether the `-fobjc-arc' flag should be added to the compiler
...
...
@@ -271,14 +281,7 @@ module Pod
# @param [Bool] Wether the source files require ARC.
#
platform_attr_writer
:requires_arc
def
requires_arc
requires_arc
=
@requires_arc
[
active_platform
]
if
requires_arc
.
nil?
requires_arc
=
@parent
?
@parent
.
requires_arc
:
false
end
requires_arc
end
pltf_first_defined_attr_reader
:requires_arc
# @!method header_dir=
#
...
...
@@ -288,16 +291,12 @@ module Pod
# @param [String] The headers directory.
#
platform_attr_writer
:header_dir
,
lambda
{
|
dir
,
_
|
Pathname
.
new
(
dir
)
}
pltf_first_defined_attr_reader
:header_dir
# @abstract (see #header_dir=)
#
# @return [Pathname] The headers directory.
# If not provided the headers files are flattened
#
# @note If no value is provided it returns an empty {Pathname}.
#
def
header_dir
@header_dir
[
active_platform
]
||
(
@parent
.
header_dir
if
@parent
)
||
Pathname
.
new
(
''
)
end
platform_attr_writer
:header_mappings_dir
,
lambda
{
|
file
,
_
|
Pathname
.
new
(
file
)
}
pltf_first_defined_attr_reader
:header_mappings_dir
# @!method xcconfig=
#
...
...
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