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
f28be2d1
Commit
f28be2d1
authored
Oct 07, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2606 from CocoaPods/clintegracon_patch
Update to new CLIntegracon Patch
parents
af4579ef
1b24ef0c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
7 deletions
+28
-7
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+11
-3
xcconfig_integrator.rb
...oject_integrator/target_integrator/xcconfig_integrator.rb
+14
-3
integration.rb
spec/integration.rb
+1
-1
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+2
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
f28be2d1
...
...
@@ -27,8 +27,8 @@ module Pod
#
def
integrate!
UI
.
section
(
integration_message
)
do
XCConfigIntegrator
.
integrate
(
target
,
native_targets
)
update_to_cocoapods_0_34
user_project
.
save
if
XCConfigIntegrator
.
integrate
(
target
,
native_targets
)
u
ser_project
.
save
if
u
pdate_to_cocoapods_0_34
unless
native_targets_to_integrate
.
empty?
add_pods_library
...
...
@@ -52,6 +52,8 @@ module Pod
# Fixes the paths of the copy resource scripts.
#
# @return [Bool] whether any changes to the project were made.
#
# @todo This can be removed for CocoaPods 1.0
#
def
update_to_cocoapods_0_34
...
...
@@ -62,9 +64,15 @@ module Pod
end
.
flatten
script_path
=
target
.
copy_resources_script_relative_path
shell_script
=
%("#{script_path}"\n)
changes
=
false
phases
.
each
do
|
phase
|
phase
.
shell_script
=
%("#{script_path}"\n)
unless
phase
.
shell_script
==
shell_script
phase
.
shell_script
=
shell_script
changes
=
true
end
end
changes
end
# Adds spec libraries to the frameworks build phase of the
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
View file @
f28be2d1
...
...
@@ -15,13 +15,17 @@ module Pod
# The native targets associated which should be integrated
# with the Pod bundle.
#
# @return [Bool] whether any changes to the project were made.
#
def
self
.
integrate
(
pod_bundle
,
targets
)
changes
=
false
targets
.
each
do
|
target
|
target
.
build_configurations
.
each
do
|
config
|
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
set_target_xcconfig
(
pod_bundle
,
target
,
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
...
...
@@ -38,10 +42,13 @@ module Pod
# @param [Array<XcodeProj::PBXNativeTarget>] targets
# The native targets.
#
# @return [Bool] whether any changes to the project were made.
#
# @todo This can be removed for CocoaPods 1.0
#
def
self
.
update_to_cocoapods_0_34
(
pod_bundle
,
targets
)
sandbox
=
pod_bundle
.
sandbox
changes
=
false
targets
.
map
(
&
:project
).
uniq
.
each
do
|
project
|
file_refs
=
project
.
files
.
select
do
|
file_ref
|
path
=
file_ref
.
path
.
to_s
...
...
@@ -57,7 +64,10 @@ module Pod
file_ref
.
remove_from_project
end
end
changes
=
true
unless
file_refs
.
empty?
end
changes
end
# Creates a file reference to the xcconfig generated by
...
...
@@ -84,7 +94,8 @@ module Pod
'all, please either set the base configurations of the target '
\
"
#{
target
.
name
}
` to `
#{
path
}
` or include the `
#{
path
}
` in your "
\
'build configuration.'
else
false
elsif
!
file_ref
file_ref
||=
group
.
new_file
(
path
)
config
.
base_configuration_reference
=
file_ref
end
...
...
spec/integration.rb
View file @
f28be2d1
...
...
@@ -73,7 +73,7 @@ CLIntegracon.configure do |c|
# Remove CocoaPods version
yaml
=
File
.
open
(
path
)
{
|
f
|
YAML
.
load
(
f
)
}
yaml
.
delete
(
'COCOAPODS'
)
yaml
.
to_s
YAML
.
dump
(
yaml
)
end
end
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
f28be2d1
...
...
@@ -94,6 +94,8 @@ module Pod
end
it
'does not perform the integration if there are no targets to integrate'
do
Installer
::
UserProjectIntegrator
::
TargetIntegrator
::
XCConfigIntegrator
.
integrate
(
@pod_bundle
,
@target_integrator
.
send
(
:native_targets
))
@target_integrator
.
stubs
(
:native_targets_to_integrate
).
returns
([])
@target_integrator
.
expects
(
:add_pods_library
).
never
@target_integrator
.
expects
(
:add_copy_resources_script_phase
).
never
...
...
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