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
Show 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,12 +65,15 @@ module Pod
script_path
=
target
.
copy_resources_script_relative_path
shell_script
=
%("#{script_path}"\n)
phases
.
reduce
(
false
)
do
|
changes
,
phase
|
changes
=
false
phases
.
each
do
|
phase
|
unless
phase
.
shell_script
==
shell_script
phase
.
shell_script
=
shell_script
end
||
changes
changes
=
true
end
end
changes
end
# Adds spec libraries to the frameworks build phase of the
# {TargetDefinition} integration libraries. Adds a file reference to
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
View file @
1b24ef0c
...
...
@@ -18,14 +18,15 @@ module Pod
# @return [Bool] whether any changes to the project were made.
#
def
self
.
integrate
(
pod_bundle
,
targets
)
targets
.
reduce
(
false
)
do
|
changes
,
target
|
target
.
build_configurations
.
reduce
(
false
)
do
|
c
,
config
|
change
=
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
change
=
set_target_xcconfig
(
pod_bundle
,
target
,
config
)
||
change
change
||
c
end
||
changes
changes
=
false
targets
.
each
do
|
target
|
target
.
build_configurations
.
each
do
|
config
|
changes
=
true
if
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
changes
=
true
if
set_target_xcconfig
(
pod_bundle
,
target
,
config
)
end
end
changes
end
private
...
...
@@ -47,7 +48,8 @@ module Pod
#
def
self
.
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
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
|
path
=
file_ref
.
path
.
to_s
if
File
.
extname
(
path
)
==
'.xcconfig'
...
...
@@ -63,8 +65,9 @@ module Pod
end
end
changes
||
!
file_refs
.
empty?
changes
=
true
unless
file_refs
.
empty?
end
changes
end
# 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