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
9286e467
Commit
9286e467
authored
Jan 04, 2016
by
Jed Lewison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't warn about setting base config when existing config is identical to new one.
parent
26b26f60
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
CHANGELOG.md
CHANGELOG.md
+8
-0
xcconfig_integrator.rb
...oject_integrator/target_integrator/xcconfig_integrator.rb
+12
-0
xcconfig_integrator_spec.rb
..._integrator/target_integrator/xcconfig_integrator_spec.rb
+14
-0
No files found.
CHANGELOG.md
View file @
9286e467
...
@@ -4,6 +4,14 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -4,6 +4,14 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
To install release candidates run
`[sudo] gem install cocoapods --pre`
To install release candidates run
`[sudo] gem install cocoapods --pre`
## Master
##### Enhancement
*
Don't warn about setting base config when identical to current config.
[
Jed Lewison
](
https://github.com/jedlewison
)
[
#4722
](
https://github.com/CocoaPods/CocoaPods/issues/4722
)
## 1.0.0.beta.1 (2015-12-30)
## 1.0.0.beta.1 (2015-12-30)
##### Breaking
##### Breaking
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
View file @
9286e467
...
@@ -88,6 +88,7 @@ module Pod
...
@@ -88,6 +88,7 @@ module Pod
if
existing
.
real_path
.
to_path
.
start_with?
(
pod_bundle
.
sandbox
.
root
.
to_path
<<
'/'
)
if
existing
.
real_path
.
to_path
.
start_with?
(
pod_bundle
.
sandbox
.
root
.
to_path
<<
'/'
)
set_base_configuration_reference
.
call
set_base_configuration_reference
.
call
elsif
!
xcconfig_includes_target_xcconfig?
(
config
.
base_configuration_reference
,
path
)
elsif
!
xcconfig_includes_target_xcconfig?
(
config
.
base_configuration_reference
,
path
)
unless
existing_config_is_identical_to_pod_config?
(
existing
.
real_path
,
pod_bundle
.
xcconfig_path
(
config
.
name
))
UI
.
warn
'CocoaPods did not set the base configuration of your '
\
UI
.
warn
'CocoaPods did not set the base configuration of your '
\
'project because your project already has a custom '
\
'project because your project already has a custom '
\
'config set. In order for CocoaPods integration to work at '
\
'config set. In order for CocoaPods integration to work at '
\
...
@@ -95,6 +96,7 @@ module Pod
...
@@ -95,6 +96,7 @@ module Pod
"`
#{
target
.
name
}
` to `
#{
path
}
` or include the `
#{
path
}
` in your "
\
"`
#{
target
.
name
}
` to `
#{
path
}
` or include the `
#{
path
}
` in your "
\
"build configuration (
#{
UI
.
path
(
existing
.
real_path
)
}
)."
"build configuration (
#{
UI
.
path
(
existing
.
real_path
)
}
)."
end
end
end
elsif
config
.
base_configuration_reference
.
nil?
||
file_ref
.
nil?
elsif
config
.
base_configuration_reference
.
nil?
||
file_ref
.
nil?
set_base_configuration_reference
.
call
set_base_configuration_reference
.
call
end
end
...
@@ -159,6 +161,16 @@ module Pod
...
@@ -159,6 +161,16 @@ module Pod
/x
/x
base_config_ref
.
real_path
.
readlines
.
find
{
|
line
|
line
=~
regex
}
base_config_ref
.
real_path
.
readlines
.
find
{
|
line
|
line
=~
regex
}
end
end
# Checks to see if the config files at two paths exist and are identical
#
# @param The existing config path
#
# @param The pod config path
#
def
self
.
existing_config_is_identical_to_pod_config?
(
existing_config_path
,
pod_config_path
)
existing_config_path
.
file?
&&
(
!
pod_config_path
.
file?
||
FileUtils
.
compare_file
(
existing_config_path
,
pod_config_path
))
end
end
end
end
end
end
end
...
...
spec/unit/installer/user_project_integrator/target_integrator/xcconfig_integrator_spec.rb
View file @
9286e467
...
@@ -88,6 +88,20 @@ module Pod
...
@@ -88,6 +88,20 @@ module Pod
UI
.
warnings
.
should
.
not
.
match
/not set.*base configuration/
UI
.
warnings
.
should
.
not
.
match
/not set.*base configuration/
end
end
it
'does not log a warning if the existing xcconfig is identical to the Pods config'
do
sample_config
=
@project
.
new_file
(
'SampleConfig.xcconfig'
)
File
.
write
(
sample_config
.
real_path
,
'sample config content.'
)
@target
.
build_configurations
.
each
do
|
config
|
config
.
base_configuration_reference
=
sample_config
end
XCConfigIntegrator
.
integrate
(
@pod_bundle
,
[
@target
])
@target
.
build_configurations
.
each
do
|
config
|
config
.
base_configuration_reference
.
should
==
sample_config
end
UI
.
warnings
.
should
.
not
.
match
/not set.*base configuration/
end
it
'does not log a warning if the user has set a xcconfig of their own that includes the silence warnings string'
do
it
'does not log a warning if the user has set a xcconfig of their own that includes the silence warnings string'
do
SILENCE_TOKEN
=
'// @COCOAPODS_SILENCE_WARNINGS@ //'
SILENCE_TOKEN
=
'// @COCOAPODS_SILENCE_WARNINGS@ //'
sample_config
=
@project
.
new_file
(
'SampleConfig.xcconfig'
)
sample_config
=
@project
.
new_file
(
'SampleConfig.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