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
3b900e68
Commit
3b900e68
authored
Aug 20, 2012
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Podfile#inhibit_all_warnings! to silence warnings, but not by default. #209
parent
1477c44d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+5
-4
podfile.rb
lib/cocoapods/podfile.rb
+10
-1
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+9
-0
podfile_spec.rb
spec/unit/podfile_spec.rb
+7
-0
No files found.
lib/cocoapods/installer/target_installer.rb
View file @
3b900e68
...
@@ -13,10 +13,11 @@ module Pod
...
@@ -13,10 +13,11 @@ module Pod
def
xcconfig
def
xcconfig
@xcconfig
||=
Xcodeproj
::
Config
.
new
({
@xcconfig
||=
Xcodeproj
::
Config
.
new
({
# In a workspace this is where the static library headers should be found.
# In a workspace this is where the static library headers should be found.
'PODS_ROOT'
=>
@target_definition
.
relative_pods_root
,
'PODS_ROOT'
=>
@target_definition
.
relative_pods_root
,
'PODS_HEADERS_SEARCH_PATHS'
=>
'${PODS_PUBLIC_HEADERS_SEARCH_PATHS}'
,
'PODS_HEADERS_SEARCH_PATHS'
=>
'${PODS_PUBLIC_HEADERS_SEARCH_PATHS}'
,
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
# needed to make EmbedReader build
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
# needed to make EmbedReader build
'OTHER_LDFLAGS'
=>
default_ld_flags
,
'OTHER_LDFLAGS'
=>
default_ld_flags
,
'GCC_WARN_INHIBIT_ALL_WARNINGS'
=>
@target_definition
.
inhibit_all_warnings?
?
'YES'
:
'NO'
,
})
})
end
end
...
...
lib/cocoapods/podfile.rb
View file @
3b900e68
...
@@ -62,7 +62,7 @@ module Pod
...
@@ -62,7 +62,7 @@ module Pod
attr_reader
:name
,
:target_dependencies
attr_reader
:name
,
:target_dependencies
attr_accessor
:user_project
,
:link_with
,
:platform
,
:parent
,
:exclusive
attr_accessor
:user_project
,
:link_with
,
:platform
,
:parent
,
:exclusive
,
:inhibit_all_warnings
def
initialize
(
name
,
options
=
{})
def
initialize
(
name
,
options
=
{})
@name
,
@target_dependencies
=
name
,
[]
@name
,
@target_dependencies
=
name
,
[]
...
@@ -96,6 +96,11 @@ module Pod
...
@@ -96,6 +96,11 @@ module Pod
@platform
||
(
@parent
.
platform
if
@parent
)
@platform
||
(
@parent
.
platform
if
@parent
)
end
end
def
inhibit_all_warnings
@inhibit_all_warnings
.
nil?
?
(
@parent
.
inhibit_all_warnings?
if
@parent
)
:
@inhibit_all_warnings
end
alias_method
:inhibit_all_warnings?
,
:inhibit_all_warnings
def
label
def
label
if
name
==
:default
if
name
==
:default
"Pods"
"Pods"
...
@@ -284,6 +289,10 @@ module Pod
...
@@ -284,6 +289,10 @@ module Pod
@target_definition
.
link_with
=
targets
@target_definition
.
link_with
=
targets
end
end
def
inhibit_all_warnings!
@target_definition
.
inhibit_all_warnings
=
true
end
# Specifies a dependency of the project.
# Specifies a dependency of the project.
#
#
# A dependency requirement is defined by the name of the Pod and _optionally_
# A dependency requirement is defined by the name of the Pod and _optionally_
...
...
spec/unit/installer/target_installer_spec.rb
View file @
3b900e68
...
@@ -66,6 +66,15 @@ describe Pod::Installer::TargetInstaller do
...
@@ -66,6 +66,15 @@ describe Pod::Installer::TargetInstaller do
@installer
.
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
split
(
" "
).
should
.
include
(
"-fobjc-arc"
)
@installer
.
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
split
(
" "
).
should
.
include
(
"-fobjc-arc"
)
end
end
it
"does not enable the GCC_WARN_INHIBIT_ALL_WARNINGS flag by default"
do
@installer
.
xcconfig
.
to_hash
[
'GCC_WARN_INHIBIT_ALL_WARNINGS'
].
should
==
'NO'
end
it
"enables the GCC_WARN_INHIBIT_ALL_WARNINGS flag"
do
@podfile
.
inhibit_all_warnings!
@installer
.
xcconfig
.
to_hash
[
'GCC_WARN_INHIBIT_ALL_WARNINGS'
].
should
==
'YES'
end
it
"creates a prefix header, including the contents of the specification's prefix header file"
do
it
"creates a prefix header, including the contents of the specification's prefix header file"
do
do_install!
do_install!
prefix_header
=
@sandbox
.
root
+
'Pods.pch'
prefix_header
=
@sandbox
.
root
+
'Pods.pch'
...
...
spec/unit/podfile_spec.rb
View file @
3b900e68
...
@@ -151,6 +151,7 @@ describe "Pod::Podfile" do
...
@@ -151,6 +151,7 @@ describe "Pod::Podfile" do
target
:test
,
:exclusive
=>
true
do
target
:test
,
:exclusive
=>
true
do
link_with
'TestRunner'
link_with
'TestRunner'
inhibit_all_warnings!
pod
'JSONKit'
pod
'JSONKit'
target
:subtarget
do
target
:subtarget
do
pod
'Reachability'
pod
'Reachability'
...
@@ -295,6 +296,12 @@ describe "Pod::Podfile" do
...
@@ -295,6 +296,12 @@ describe "Pod::Podfile" do
project
.
build_configurations
.
should
==
{
'Release'
=>
:release
,
'Debug'
=>
:debug
,
'Test'
=>
:debug
,
'App Store'
=>
:release
}
project
.
build_configurations
.
should
==
{
'Release'
=>
:release
,
'Debug'
=>
:debug
,
'Test'
=>
:debug
,
'App Store'
=>
:release
}
end
end
it
"specifies that the inhibit all warnings flag should be added to the target's build settings"
do
@podfile
.
target_definitions
[
:default
].
should
.
not
.
inhibit_all_warnings
@podfile
.
target_definitions
[
:test
].
should
.
inhibit_all_warnings
@podfile
.
target_definitions
[
:subtarget
].
should
.
inhibit_all_warnings
end
describe
"with an Xcode project that's not in the project_root"
do
describe
"with an Xcode project that's not in the project_root"
do
before
do
before
do
@target_definition
=
@podfile
.
target_definitions
[
:default
]
@target_definition
=
@podfile
.
target_definitions
[
:default
]
...
...
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