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
38eaf223
Commit
38eaf223
authored
Aug 20, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"[Specification] Allow to require_arc in subspecs."
Closes #464.
parent
7c5ed225
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
specification.rb
lib/cocoapods/specification.rb
+22
-3
specification_spec.rb
spec/unit/specification_spec.rb
+9
-1
No files found.
lib/cocoapods/specification.rb
View file @
38eaf223
...
...
@@ -51,8 +51,9 @@ module Pod
compiler_flags ]
.
each
do
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
{
:ios
=>
[],
:osx
=>
[]
}
)
end
@xcconfig
=
{
:ios
=>
Xcodeproj
::
Config
.
new
,
:osx
=>
Xcodeproj
::
Config
.
new
}
@header_dir
=
{
:ios
=>
nil
,
:osx
=>
nil
}
@xcconfig
=
{
:ios
=>
Xcodeproj
::
Config
.
new
,
:osx
=>
Xcodeproj
::
Config
.
new
}
@header_dir
=
{
:ios
=>
nil
,
:osx
=>
nil
}
@requires_arc
=
{
:ios
=>
nil
,
:osx
=>
nil
}
yield
self
if
block_given?
end
...
...
@@ -137,6 +138,7 @@ module Pod
compiler_flags=
deployment_target=
header_dir=
requires_arc
dependency }
.
each
do
|
method
|
define_method
(
method
)
do
|
args
|
@specification
.
_on_platform
(
@platform
)
do
...
...
@@ -194,7 +196,6 @@ module Pod
top_attr_accessor
:homepage
top_attr_accessor
:summary
top_attr_accessor
:documentation
top_attr_accessor
:requires_arc
top_attr_accessor
:version
,
lambda
{
|
v
|
Version
.
new
(
v
)
}
top_attr_reader
:description
,
lambda
{
|
instance
,
ivar
|
ivar
||
instance
.
summary
}
...
...
@@ -255,6 +256,24 @@ 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
# flags.
#
# @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
# @!method header_dir=
#
# @abstract The directory where to name space the headers files of
...
...
spec/unit/specification_spec.rb
View file @
38eaf223
...
...
@@ -305,6 +305,7 @@ describe "A Pod::Specification subspec" do
fss
.
subspec
'SecondSubSpec'
do
|
sss
|
sss
.
source_files
=
'subsubspec.m'
sss
.
requires_arc
=
false
end
end
end
...
...
@@ -329,7 +330,7 @@ describe "A Pod::Specification subspec" do
it
"automatically forwards top level attributes to the top level parent"
do
@spec
.
activate_platform
(
:ios
)
[
:version
,
:license
,
:authors
,
:
requires_arc
,
:
compiler_flags
].
each
do
|
attr
|
[
:version
,
:license
,
:authors
,
:compiler_flags
].
each
do
|
attr
|
@spec
.
subspecs
.
first
.
send
(
attr
).
should
==
@spec
.
send
(
attr
)
@spec
.
subspecs
.
first
.
subspecs
.
first
.
send
(
attr
).
should
==
@spec
.
send
(
attr
)
end
...
...
@@ -346,6 +347,13 @@ describe "A Pod::Specification subspec" do
@subsubspec
.
compiler_flags
.
should
==
' -fobjc-arc -Wdeprecated-implementations'
end
it
"allows to specify arc settings for subspecs"
do
@spec
.
activate_platform
(
:ios
)
@spec
.
requires_arc
.
should
==
true
@subspec
.
requires_arc
.
should
==
true
@subsubspec
.
requires_arc
.
should
==
false
end
it
"returns empty arrays for chained attributes with no value in the chain"
do
@spec
=
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'MainSpec'
...
...
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