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
a19220a2
Commit
a19220a2
authored
Aug 22, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetIntegrator] Fix the path of the copy resource script if needed
parent
7f0d439f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+22
-3
xcconfig_integrator.rb
...oject_integrator/target_integrator/xcconfig_integrator.rb
+2
-2
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+9
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
a19220a2
...
@@ -28,6 +28,8 @@ module Pod
...
@@ -28,6 +28,8 @@ module Pod
def
integrate!
def
integrate!
UI
.
section
(
integration_message
)
do
UI
.
section
(
integration_message
)
do
XCConfigIntegrator
.
integrate
(
target
,
native_targets
)
XCConfigIntegrator
.
integrate
(
target
,
native_targets
)
update_to_cocoapods_0_34
unless
native_targets_to_integrate
.
empty?
unless
native_targets_to_integrate
.
empty?
add_pods_library
add_pods_library
add_copy_resources_script_phase
add_copy_resources_script_phase
...
@@ -48,6 +50,23 @@ module Pod
...
@@ -48,6 +50,23 @@ module Pod
# @!group Integration steps
# @!group Integration steps
#---------------------------------------------------------------------#
#---------------------------------------------------------------------#
# Fixes the paths of the copy resource scripts.
#
# @todo This can be removed for CocoaPods 1.0
#
def
update_to_cocoapods_0_34
phases
=
native_targets
.
map
do
|
target
|
target
.
shell_script_build_phases
.
select
do
|
bp
|
bp
.
name
==
'Copy Pods Resources'
end
end
.
flatten
script_path
=
target
.
copy_resources_script_relative_path
phases
.
each
do
|
phase
|
phase
.
shell_script
=
%("#{script_path}"\n)
end
end
# Adds spec libraries to the frameworks build phase of the
# Adds spec libraries to the frameworks build phase of the
# {TargetDefinition} integration libraries. Adds a file reference to
# {TargetDefinition} integration libraries. Adds a file reference to
# the library of the {TargetDefinition} and adds it to the frameworks
# the library of the {TargetDefinition} and adds it to the frameworks
...
@@ -75,9 +94,9 @@ module Pod
...
@@ -75,9 +94,9 @@ module Pod
def
add_copy_resources_script_phase
def
add_copy_resources_script_phase
phase_name
=
'Copy Pods Resources'
phase_name
=
'Copy Pods Resources'
native_targets_to_integrate
.
each
do
|
native_target
|
native_targets_to_integrate
.
each
do
|
native_target
|
phase
=
native_target
.
shell_script_build_phases
.
select
{
|
bp
|
bp
.
name
==
phase_name
}.
first
||
phase
=
native_target
.
shell_script_build_phases
.
select
{
|
bp
|
bp
.
name
==
phase_name
}.
first
native_target
.
new_shell_script_build_phase
(
phase_name
)
phase
||=
native_target
.
new_shell_script_build_phase
(
phase_name
)
script_path
=
target
.
copy_resources_script_relative_path
script_path
=
target
.
copy_resources_script_relative_path
phase
.
shell_script
=
%("#{script_path}"\n)
phase
.
shell_script
=
%("#{script_path}"\n)
phase
.
show_env_vars_in_log
=
'0'
phase
.
show_env_vars_in_log
=
'0'
end
end
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
View file @
a19220a2
...
@@ -18,7 +18,7 @@ module Pod
...
@@ -18,7 +18,7 @@ module Pod
def
self
.
integrate
(
pod_bundle
,
targets
)
def
self
.
integrate
(
pod_bundle
,
targets
)
targets
.
each
do
|
target
|
targets
.
each
do
|
target
|
target
.
build_configurations
.
each
do
|
config
|
target
.
build_configurations
.
each
do
|
config
|
update_
from_cocoapods_0_33_1
(
pod_bundle
,
targets
)
update_
to_cocoapods_0_34
(
pod_bundle
,
targets
)
set_target_xcconfig
(
pod_bundle
,
config
)
set_target_xcconfig
(
pod_bundle
,
config
)
end
end
end
end
...
@@ -40,7 +40,7 @@ module Pod
...
@@ -40,7 +40,7 @@ module Pod
#
#
# @todo This can be removed for CocoaPods 1.0
# @todo This can be removed for CocoaPods 1.0
#
#
def
self
.
update_
from_cocoapods_0_33_1
(
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
.
each
do
|
project
|
targets
.
map
(
&
:project
).
uniq
.
each
do
|
project
|
file_refs
=
project
.
files
.
select
do
|
file_ref
|
file_refs
=
project
.
files
.
select
do
|
file_ref
|
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
a19220a2
...
@@ -41,6 +41,15 @@ module Pod
...
@@ -41,6 +41,15 @@ module Pod
@target_integrator
.
integrate!
@target_integrator
.
integrate!
end
end
it
'fixes the copy resource scripts of legacy installations'
do
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
'Copy Pods Resources'
}
phase
.
shell_script
=
%("${SRCROOT}/../Pods/Pods-resources.sh"\n)
@target_integrator
.
integrate!
phase
.
shell_script
.
strip
.
should
==
"
\"
${SRCROOT}/../Pods/Target Support Files/Pods-resources.sh
\"
"
end
it
'adds references to the Pods static libraries to the Frameworks group'
do
it
'adds references to the Pods static libraries to the Frameworks group'
do
@target_integrator
.
integrate!
@target_integrator
.
integrate!
@target_integrator
.
send
(
:user_project
)[
'Frameworks/libPods.a'
].
should
.
not
.
nil?
@target_integrator
.
send
(
:user_project
)[
'Frameworks/libPods.a'
].
should
.
not
.
nil?
...
...
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