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
943e14c4
Commit
943e14c4
authored
Jul 02, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve fix and improve spec for compiler_flags of subspecs. #364.
parent
ee2dc5f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
specification.rb
lib/cocoapods/specification.rb
+3
-8
specification_spec.rb
spec/unit/specification_spec.rb
+4
-2
No files found.
lib/cocoapods/specification.rb
View file @
943e14c4
...
@@ -264,16 +264,11 @@ module Pod
...
@@ -264,16 +264,11 @@ module Pod
def
compiler_flags
def
compiler_flags
if
@parent
if
@parent
chained
=
@compiler_flags
[
active_platform
].
clone
flags
=
[
@parent
.
compiler_flags
]
# TODO hack to get the parent's compiler flags without it being
# converted to a String by Specification#compiler_flags.
chained
.
unshift
@parent
.
instance_variable_get
(
:@compiler_flags
)[
active_platform
]
else
else
chained
=
@compiler_flags
[
active_platform
].
clone
flags
=
[
requires_arc
?
' -fobjc-arc'
:
''
]
chained
.
unshift
'-fobjc-arc'
if
requires_arc
chained
.
unshift
''
end
end
chained
.
join
(
' '
)
(
flags
+
@compiler_flags
[
active_platform
].
clone
)
.
join
(
' '
)
end
end
platform_attr_writer
:compiler_flags
,
lambda
{
|
value
,
current
|
current
<<
value
}
platform_attr_writer
:compiler_flags
,
lambda
{
|
value
,
current
|
current
<<
value
}
...
...
spec/unit/specification_spec.rb
View file @
943e14c4
...
@@ -321,7 +321,7 @@ describe "A Pod::Specification subspec" do
...
@@ -321,7 +321,7 @@ describe "A Pod::Specification subspec" do
it
"automatically forwards top level attributes to the top level parent"
do
it
"automatically forwards top level attributes to the top level parent"
do
@spec
.
activate_platform
(
:ios
)
@spec
.
activate_platform
(
:ios
)
[
:version
,
:license
,
:authors
,
:requires_arc
].
each
do
|
attr
|
[
:version
,
:license
,
:authors
,
:requires_arc
,
:compiler_flags
].
each
do
|
attr
|
@spec
.
subspecs
.
first
.
send
(
attr
).
should
==
@spec
.
send
(
attr
)
@spec
.
subspecs
.
first
.
send
(
attr
).
should
==
@spec
.
send
(
attr
)
@spec
.
subspecs
.
first
.
subspecs
.
first
.
send
(
attr
).
should
==
@spec
.
send
(
attr
)
@spec
.
subspecs
.
first
.
subspecs
.
first
.
send
(
attr
).
should
==
@spec
.
send
(
attr
)
end
end
...
@@ -332,8 +332,10 @@ describe "A Pod::Specification subspec" do
...
@@ -332,8 +332,10 @@ describe "A Pod::Specification subspec" do
@spec
.
source_files
.
map
{
|
f
|
f
.
to_s
}.
should
==
%w[ spec.m ]
@spec
.
source_files
.
map
{
|
f
|
f
.
to_s
}.
should
==
%w[ spec.m ]
@subspec
.
source_files
.
map
{
|
f
|
f
.
to_s
}.
should
==
%w[ spec.m subspec_ios.m ]
@subspec
.
source_files
.
map
{
|
f
|
f
.
to_s
}.
should
==
%w[ spec.m subspec_ios.m ]
@subsubspec
.
source_files
.
map
{
|
f
|
f
.
to_s
}.
should
==
%w[ spec.m subspec_ios.m subsubspec.m ]
@subsubspec
.
source_files
.
map
{
|
f
|
f
.
to_s
}.
should
==
%w[ spec.m subspec_ios.m subsubspec.m ]
@subsubspec
.
resources
.
should
==
%w[ resource ]
@subsubspec
.
resources
.
should
==
%w[ resource ]
@subsubspec
.
compiler_flags
=
'-Wdeprecated-implementations'
@subsubspec
.
compiler_flags
.
should
==
' -fobjc-arc -Wdeprecated-implementations'
end
end
it
"returns empty arrays for chained attributes with no value in the chain"
do
it
"returns empty arrays for chained attributes with no value in the chain"
do
...
...
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