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
1b24ef0c
Commit
1b24ef0c
authored
Oct 07, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Style] Don't use reduce to determine if there are changes
Use a var instead, as per @alloy
parent
7522194f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+5
-2
xcconfig_integrator.rb
...oject_integrator/target_integrator/xcconfig_integrator.rb
+11
-8
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
1b24ef0c
...
@@ -65,11 +65,14 @@ module Pod
...
@@ -65,11 +65,14 @@ module Pod
script_path
=
target
.
copy_resources_script_relative_path
script_path
=
target
.
copy_resources_script_relative_path
shell_script
=
%("#{script_path}"\n)
shell_script
=
%("#{script_path}"\n)
phases
.
reduce
(
false
)
do
|
changes
,
phase
|
changes
=
false
phases
.
each
do
|
phase
|
unless
phase
.
shell_script
==
shell_script
unless
phase
.
shell_script
==
shell_script
phase
.
shell_script
=
shell_script
phase
.
shell_script
=
shell_script
end
||
changes
changes
=
true
end
end
end
changes
end
end
# Adds spec libraries to the frameworks build phase of the
# Adds spec libraries to the frameworks build phase of the
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
View file @
1b24ef0c
...
@@ -18,13 +18,14 @@ module Pod
...
@@ -18,13 +18,14 @@ module Pod
# @return [Bool] whether any changes to the project were made.
# @return [Bool] whether any changes to the project were made.
#
#
def
self
.
integrate
(
pod_bundle
,
targets
)
def
self
.
integrate
(
pod_bundle
,
targets
)
targets
.
reduce
(
false
)
do
|
changes
,
target
|
changes
=
false
target
.
build_configurations
.
reduce
(
false
)
do
|
c
,
config
|
targets
.
each
do
|
target
|
change
=
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
target
.
build_configurations
.
each
do
|
config
|
change
=
set_target_xcconfig
(
pod_bundle
,
target
,
config
)
||
change
change
s
=
true
if
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
change
||
c
change
s
=
true
if
set_target_xcconfig
(
pod_bundle
,
target
,
config
)
end
||
changes
end
end
end
changes
end
end
private
private
...
@@ -47,7 +48,8 @@ module Pod
...
@@ -47,7 +48,8 @@ module Pod
#
#
def
self
.
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
def
self
.
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
sandbox
=
pod_bundle
.
sandbox
sandbox
=
pod_bundle
.
sandbox
targets
.
map
(
&
:project
).
uniq
.
reduce
(
false
)
do
|
changes
,
project
|
changes
=
false
targets
.
map
(
&
:project
).
uniq
.
each
do
|
project
|
file_refs
=
project
.
files
.
select
do
|
file_ref
|
file_refs
=
project
.
files
.
select
do
|
file_ref
|
path
=
file_ref
.
path
.
to_s
path
=
file_ref
.
path
.
to_s
if
File
.
extname
(
path
)
==
'.xcconfig'
if
File
.
extname
(
path
)
==
'.xcconfig'
...
@@ -63,8 +65,9 @@ module Pod
...
@@ -63,8 +65,9 @@ module Pod
end
end
end
end
changes
||
!
file_refs
.
empty?
changes
=
true
unless
file_refs
.
empty?
end
end
changes
end
end
# Creates a file reference to the xcconfig generated by
# Creates a file reference to the xcconfig generated by
...
...
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