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
cb1a15a5
Commit
cb1a15a5
authored
May 15, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not build pod target if it only contains script phases
parent
da431d33
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
13 deletions
+17
-13
CHANGELOG.md
CHANGELOG.md
+4
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+9
-9
pod_target.rb
lib/cocoapods/target/pod_target.rb
+0
-1
aggregate_target_settings_spec.rb
...t/target/build_settings/aggregate_target_settings_spec.rb
+2
-1
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+2
-2
No files found.
CHANGELOG.md
View file @
cb1a15a5
...
...
@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Do not build pod target if it only contains script phases
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7746
](
https://github.com/CocoaPods/CocoaPods/issues/7746
)
*
Do not crash when creating build settings for a missing user build configuration
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7698
](
https://github.com/CocoaPods/CocoaPods/pull/7698
)
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
cb1a15a5
...
...
@@ -162,7 +162,7 @@ module Pod
#
def
create_or_update_user_script_phases
(
script_phases
,
native_target
)
script_phase_names
=
script_phases
.
map
{
|
k
|
k
[
:name
]
}
# Delete script phases no longer present in the target
definition
.
# Delete script phases no longer present in the target.
native_target_script_phases
=
native_target
.
shell_script_build_phases
.
select
{
|
bp
|
!
bp
.
name
.
nil?
&&
bp
.
name
.
start_with?
(
USER_BUILD_PHASE_PREFIX
)
}
native_target_script_phases
.
each
do
|
script_phase
|
script_phase_name_without_prefix
=
script_phase
.
name
.
sub
(
USER_BUILD_PHASE_PREFIX
,
''
)
...
...
@@ -171,16 +171,16 @@ module Pod
end
end
# Create or update the ones that are expected to be.
script_phases
.
each
do
|
td_
script_phase
|
name_with_prefix
=
USER_BUILD_PHASE_PREFIX
+
td_
script_phase
[
:name
]
script_phases
.
each
do
|
script_phase
|
name_with_prefix
=
USER_BUILD_PHASE_PREFIX
+
script_phase
[
:name
]
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
name_with_prefix
)
phase
.
shell_script
=
td_
script_phase
[
:script
]
phase
.
shell_path
=
td_script_phase
[
:shell_path
]
if
td_
script_phase
.
key?
(
:shell_path
)
phase
.
input_paths
=
td_script_phase
[
:input_files
]
if
td_
script_phase
.
key?
(
:input_files
)
phase
.
output_paths
=
td_script_phase
[
:output_files
]
if
td_
script_phase
.
key?
(
:output_files
)
phase
.
show_env_vars_in_log
=
td_script_phase
[
:show_env_vars_in_log
]
?
'1'
:
'0'
if
td_
script_phase
.
key?
(
:show_env_vars_in_log
)
phase
.
shell_script
=
script_phase
[
:script
]
phase
.
shell_path
=
script_phase
[
:shell_path
]
if
script_phase
.
key?
(
:shell_path
)
phase
.
input_paths
=
script_phase
[
:input_files
]
if
script_phase
.
key?
(
:input_files
)
phase
.
output_paths
=
script_phase
[
:output_files
]
if
script_phase
.
key?
(
:output_files
)
phase
.
show_env_vars_in_log
=
script_phase
[
:show_env_vars_in_log
]
?
'1'
:
'0'
if
script_phase
.
key?
(
:show_env_vars_in_log
)
execution_position
=
td_
script_phase
[
:execution_position
]
execution_position
=
script_phase
[
:execution_position
]
unless
execution_position
==
:any
compile_build_phase_index
=
native_target
.
build_phases
.
index
do
|
bp
|
bp
.
is_a?
(
Xcodeproj
::
Project
::
Object
::
PBXSourcesBuildPhase
)
...
...
lib/cocoapods/target/pod_target.rb
View file @
cb1a15a5
...
...
@@ -146,7 +146,6 @@ module Pod
#
def
should_build?
return
@should_build
if
defined?
@should_build
return
@should_build
=
true
if
contains_script_phases?
accessors
=
file_accessors
.
reject
{
|
fa
|
fa
.
spec
.
test_specification?
}
source_files
=
accessors
.
flat_map
(
&
:source_files
)
source_files
-=
accessors
.
flat_map
(
&
:headers
)
...
...
spec/unit/target/build_settings/aggregate_target_settings_spec.rb
View file @
cb1a15a5
...
...
@@ -587,7 +587,8 @@ module Pod
it
'adds values from all subspecs'
do
@consumer_b
.
stubs
(
:user_target_xcconfig
).
returns
(
'OTHER_CPLUSPLUSFLAGS'
=>
'-std=c++1y'
)
consumer_c
=
mock
(
'consumer_c'
,
:user_target_xcconfig
=>
{
'OTHER_CPLUSPLUSFLAGS'
=>
'-stdlib=libc++'
},
:script_phases
=>
[],
:spec
=>
mock
(
:test_specification?
=>
false
),
:frameworks
=>
[],
:libraries
=>
[])
consumer_c
=
mock
(
'consumer_c'
,
:user_target_xcconfig
=>
{
'OTHER_CPLUSPLUSFLAGS'
=>
'-stdlib=libc++'
},
:spec
=>
mock
(
:test_specification?
=>
false
),
:frameworks
=>
[],
:libraries
=>
[])
@pod_targets
[
1
].
stubs
(
:spec_consumers
).
returns
([
@consumer_b
,
consumer_c
])
@xcconfig
=
@generator
.
generate
@xcconfig
.
to_hash
[
'OTHER_CPLUSPLUSFLAGS'
].
should
==
'-std=c++1y -stdlib=libc++'
...
...
spec/unit/target/pod_target_spec.rb
View file @
cb1a15a5
...
...
@@ -88,13 +88,13 @@ module Pod
@pod_target
.
should_build?
.
should
==
false
end
it
'
builds
a pod target if there are no actual source files but there are script phases'
do
it
'
does not build
a pod target if there are no actual source files but there are script phases'
do
fa
=
Sandbox
::
FileAccessor
.
new
(
nil
,
@banana_spec
.
consumer
(
Platform
.
ios
))
fa
.
stubs
(
:source_files
).
returns
([
Pathname
.
new
(
'foo.h'
)])
@pod_target
.
stubs
(
:file_accessors
).
returns
([
fa
])
@pod_target
.
root_spec
.
script_phase
=
{
:name
=>
'Hello World'
,
:script
=>
'echo "Hello World"'
}
@pod_target
.
should_build?
.
should
==
tru
e
@pod_target
.
should_build?
.
should
==
fals
e
end
end
...
...
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