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
615d0768
Commit
615d0768
authored
Dec 03, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XCConfigIntegrator] Add spec for re-integrating when old config was in the CocoaPods sandbox
parent
629b02f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
xcconfig_integrator.rb
...oject_integrator/target_integrator/xcconfig_integrator.rb
+7
-3
xcconfig_integrator_spec.rb
..._integrator/target_integrator/xcconfig_integrator_spec.rb
+16
-1
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
View file @
615d0768
...
@@ -79,9 +79,14 @@ module Pod
...
@@ -79,9 +79,14 @@ module Pod
file_ref
=
group
.
files
.
find
{
|
f
|
f
.
path
==
path
}
file_ref
=
group
.
files
.
find
{
|
f
|
f
.
path
==
path
}
existing
=
config
.
base_configuration_reference
existing
=
config
.
base_configuration_reference
set_base_configuration_reference
=
->
()
do
file_ref
||=
group
.
new_file
(
path
)
config
.
base_configuration_reference
=
file_ref
end
if
existing
&&
existing
!=
file_ref
if
existing
&&
existing
!=
file_ref
if
existing
.
real_path
.
to_path
.
start_with?
(
pod_bundle
.
support_files_dir
.
to_path
)
if
existing
.
real_path
.
to_path
.
start_with?
(
pod_bundle
.
support_files_dir
.
to_path
)
existing
.
path
=
path
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
)
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 '
\
...
@@ -91,8 +96,7 @@ module Pod
...
@@ -91,8 +96,7 @@ module Pod
'build configuration.'
'build configuration.'
end
end
elsif
config
.
base_configuration_reference
.
nil?
||
file_ref
.
nil?
elsif
config
.
base_configuration_reference
.
nil?
||
file_ref
.
nil?
file_ref
||=
group
.
new_file
(
path
)
set_base_configuration_reference
.
call
config
.
base_configuration_reference
=
file_ref
end
end
end
end
...
...
spec/unit/installer/user_project_integrator/target_integrator/xcconfig_integrator_spec.rb
View file @
615d0768
...
@@ -5,7 +5,7 @@ module Pod
...
@@ -5,7 +5,7 @@ module Pod
before
do
before
do
project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
@project
=
Xcodeproj
::
Project
.
open
(
project_path
)
@project
=
Xcodeproj
::
Project
.
open
(
project_path
)
Xcodeproj
::
Project
.
new
(
config
.
sandbox
.
project_path
).
save
Project
.
new
(
config
.
sandbox
.
project_path
).
save
@target
=
@project
.
targets
.
first
@target
=
@project
.
targets
.
first
target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
target_definition
.
link_with_first_target
=
true
target_definition
.
link_with_first_target
=
true
...
@@ -105,5 +105,20 @@ module Pod
...
@@ -105,5 +105,20 @@ module Pod
UI
.
warnings
.
should
.
not
.
match
/not set.*base configuration/
UI
.
warnings
.
should
.
not
.
match
/not set.*base configuration/
end
end
it
'handles when xcconfig is set to another sandox xcconfig'
do
group
=
@project
.
new_group
(
'Pods'
)
old_config
=
group
.
new_file
(
'../Pods/Target Support Files/Pods/SampleConfig.xcconfig'
)
@target
.
build_configurations
.
each
do
|
config
|
config
.
base_configuration_reference
=
old_config
end
XCConfigIntegrator
.
integrate
(
@pod_bundle
,
[
@target
])
@target
.
build_configurations
.
each
do
|
config
|
config
.
base_configuration_reference
.
should
.
not
==
old_config
config
.
base_configuration_reference
.
path
.
should
==
@pod_bundle
.
xcconfig_relative_path
(
config
.
name
)
end
UI
.
warnings
.
should
.
be
.
empty
end
end
end
end
end
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