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
c573dc2d
Commit
c573dc2d
authored
Jan 31, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs for not adding unneeded script phases
parent
15090a45
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+24
-8
No files found.
cocoapods-integration-specs
@
382f474f
Subproject commit
42f00e7a2b76ce69b0f3c7a06f85baa7a874d71b
Subproject commit
382f474f5f42af0cbfeccac15371fe6dd9ee579c
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
c573dc2d
...
@@ -19,6 +19,8 @@ module Pod
...
@@ -19,6 +19,8 @@ module Pod
@pod_bundle
.
user_build_configurations
=
{
'Release'
=>
:release
,
'Debug'
=>
:debug
}
@pod_bundle
.
user_build_configurations
=
{
'Release'
=>
:release
,
'Debug'
=>
:debug
}
@pod_bundle
.
client_root
=
project_path
.
dirname
@pod_bundle
.
client_root
=
project_path
.
dirname
@pod_bundle
.
user_target_uuids
=
[
@target
.
uuid
]
@pod_bundle
.
user_target_uuids
=
[
@target
.
uuid
]
@pod_bundle
.
stubs
(
:resource_paths_by_config
).
returns
(
'Release'
=>
%w(${PODS_ROOT}/Lib/Resources/image.png)
)
@pod_bundle
.
stubs
(
:framework_paths_by_config
).
returns
(
'Release'
=>
[{
:input_path
=>
'${PODS_BUILD_DIR}/Lib/Lib.framework'
}])
configuration
=
Xcodeproj
::
Config
.
new
(
configuration
=
Xcodeproj
::
Config
.
new
(
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'$(inherited) COCOAPODS=1'
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'$(inherited) COCOAPODS=1'
,
)
)
...
@@ -290,13 +292,28 @@ module Pod
...
@@ -290,13 +292,28 @@ module Pod
phase
.
nil?
.
should
==
true
phase
.
nil?
.
should
==
true
end
end
it
'does not add copy pods resources
input and output paths
with no resources'
do
it
'does not add copy pods resources
script phase
with no resources'
do
@pod_bundle
.
stubs
(
:resource_paths_by_config
=>
{
'Debug'
=>
[],
'Release'
=>
[]
})
@pod_bundle
.
stubs
(
:resource_paths_by_config
=>
{
'Debug'
=>
[],
'Release'
=>
[]
})
@target_integrator
.
integrate!
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@copy_pods_resources_phase_name
}
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@copy_pods_resources_phase_name
}
phase
.
input_paths
.
should
.
be
.
empty
phase
.
should
.
be
.
nil
phase
.
output_paths
.
should
.
be
.
empty
end
it
'removes copy resources phase if it becomes empty'
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_name
}
phase
.
input_paths
.
sort
.
should
==
%w(
${PODS_ROOT}/Lib/Resources/image.png
${SRCROOT}/../Pods/Target\ Support\ Files/Pods/Pods-resources.sh
)
# Now pretend the same target has no more framework paths, it should update the targets input/output paths
@pod_bundle
.
stubs
(
:resource_paths_by_config
=>
{})
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@copy_pods_resources_phase_name
}
phase
.
should
.
be
.
nil
end
end
it
'clears input and output paths from script phase if it exceeds limit'
do
it
'clears input and output paths from script phase if it exceeds limit'
do
...
@@ -378,16 +395,15 @@ module Pod
...
@@ -378,16 +395,15 @@ module Pod
)
)
end
end
it
'does not add embed frameworks build phase
input output paths
with no frameworks'
do
it
'does not add embed frameworks build phase with no frameworks'
do
@pod_bundle
.
stubs
(
:framework_paths_by_config
=>
{
'Debug'
=>
{},
'Release'
=>
{}
})
@pod_bundle
.
stubs
(
:framework_paths_by_config
=>
{
'Debug'
=>
{},
'Release'
=>
{}
})
@target_integrator
.
integrate!
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
input_paths
.
should
.
be
.
empty
phase
.
should
.
be
.
nil
phase
.
output_paths
.
should
.
be
.
empty
end
end
it
'
updat
es embed frameworks phase if it becomes empty'
do
it
'
remov
es embed frameworks phase if it becomes empty'
do
debug_non_vendored_framework
=
{
:name
=>
'DebugCompiledFramework.framework'
,
debug_non_vendored_framework
=
{
:name
=>
'DebugCompiledFramework.framework'
,
:input_path
=>
'${BUILT_PRODUCTS_DIR}/DebugCompiledFramework/DebugCompiledFramework.framework'
,
:input_path
=>
'${BUILT_PRODUCTS_DIR}/DebugCompiledFramework/DebugCompiledFramework.framework'
,
:output_path
=>
'${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DebugCompiledFramework.framework'
}
:output_path
=>
'${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DebugCompiledFramework.framework'
}
...
@@ -407,7 +423,7 @@ module Pod
...
@@ -407,7 +423,7 @@ module Pod
@target_integrator
.
integrate!
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
input_paths
.
sort
.
should
.
be
.
empty
phase
.
should
.
be
.
nil
end
end
it
'adds embed frameworks build phase input and output paths for vendored and non vendored frameworks'
do
it
'adds embed frameworks build phase input and output paths for vendored and non vendored frameworks'
do
...
...
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