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
6d77b2c7
Unverified
Commit
6d77b2c7
authored
May 16, 2018
by
D. Koutsogiorgas
Committed by
GitHub
May 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7749 from dnkoutso/skip_build_script_phases
Do not build pod target if it contains script phases
parents
da431d33
cb1a15a5
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 @
6d77b2c7
...
@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### 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
*
Do not crash when creating build settings for a missing user build configuration
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7698
](
https://github.com/CocoaPods/CocoaPods/pull/7698
)
[
#7698
](
https://github.com/CocoaPods/CocoaPods/pull/7698
)
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
6d77b2c7
...
@@ -162,7 +162,7 @@ module Pod
...
@@ -162,7 +162,7 @@ module Pod
#
#
def
create_or_update_user_script_phases
(
script_phases
,
native_target
)
def
create_or_update_user_script_phases
(
script_phases
,
native_target
)
script_phase_names
=
script_phases
.
map
{
|
k
|
k
[
:name
]
}
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
=
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
|
native_target_script_phases
.
each
do
|
script_phase
|
script_phase_name_without_prefix
=
script_phase
.
name
.
sub
(
USER_BUILD_PHASE_PREFIX
,
''
)
script_phase_name_without_prefix
=
script_phase
.
name
.
sub
(
USER_BUILD_PHASE_PREFIX
,
''
)
...
@@ -171,16 +171,16 @@ module Pod
...
@@ -171,16 +171,16 @@ module Pod
end
end
end
end
# Create or update the ones that are expected to be.
# Create or update the ones that are expected to be.
script_phases
.
each
do
|
td_
script_phase
|
script_phases
.
each
do
|
script_phase
|
name_with_prefix
=
USER_BUILD_PHASE_PREFIX
+
td_
script_phase
[
:name
]
name_with_prefix
=
USER_BUILD_PHASE_PREFIX
+
script_phase
[
:name
]
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
name_with_prefix
)
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
name_with_prefix
)
phase
.
shell_script
=
td_
script_phase
[
:script
]
phase
.
shell_script
=
script_phase
[
:script
]
phase
.
shell_path
=
td_script_phase
[
:shell_path
]
if
td_
script_phase
.
key?
(
:shell_path
)
phase
.
shell_path
=
script_phase
[
:shell_path
]
if
script_phase
.
key?
(
:shell_path
)
phase
.
input_paths
=
td_script_phase
[
:input_files
]
if
td_
script_phase
.
key?
(
:input_files
)
phase
.
input_paths
=
script_phase
[
:input_files
]
if
script_phase
.
key?
(
:input_files
)
phase
.
output_paths
=
td_script_phase
[
:output_files
]
if
td_
script_phase
.
key?
(
:output_files
)
phase
.
output_paths
=
script_phase
[
:output_files
]
if
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
.
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
unless
execution_position
==
:any
compile_build_phase_index
=
native_target
.
build_phases
.
index
do
|
bp
|
compile_build_phase_index
=
native_target
.
build_phases
.
index
do
|
bp
|
bp
.
is_a?
(
Xcodeproj
::
Project
::
Object
::
PBXSourcesBuildPhase
)
bp
.
is_a?
(
Xcodeproj
::
Project
::
Object
::
PBXSourcesBuildPhase
)
...
...
lib/cocoapods/target/pod_target.rb
View file @
6d77b2c7
...
@@ -146,7 +146,6 @@ module Pod
...
@@ -146,7 +146,6 @@ module Pod
#
#
def
should_build?
def
should_build?
return
@should_build
if
defined?
@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?
}
accessors
=
file_accessors
.
reject
{
|
fa
|
fa
.
spec
.
test_specification?
}
source_files
=
accessors
.
flat_map
(
&
:source_files
)
source_files
=
accessors
.
flat_map
(
&
:source_files
)
source_files
-=
accessors
.
flat_map
(
&
:headers
)
source_files
-=
accessors
.
flat_map
(
&
:headers
)
...
...
spec/unit/target/build_settings/aggregate_target_settings_spec.rb
View file @
6d77b2c7
...
@@ -587,7 +587,8 @@ module Pod
...
@@ -587,7 +587,8 @@ module Pod
it
'adds values from all subspecs'
do
it
'adds values from all subspecs'
do
@consumer_b
.
stubs
(
:user_target_xcconfig
).
returns
(
'OTHER_CPLUSPLUSFLAGS'
=>
'-std=c++1y'
)
@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
])
@pod_targets
[
1
].
stubs
(
:spec_consumers
).
returns
([
@consumer_b
,
consumer_c
])
@xcconfig
=
@generator
.
generate
@xcconfig
=
@generator
.
generate
@xcconfig
.
to_hash
[
'OTHER_CPLUSPLUSFLAGS'
].
should
==
'-std=c++1y -stdlib=libc++'
@xcconfig
.
to_hash
[
'OTHER_CPLUSPLUSFLAGS'
].
should
==
'-std=c++1y -stdlib=libc++'
...
...
spec/unit/target/pod_target_spec.rb
View file @
6d77b2c7
...
@@ -88,13 +88,13 @@ module Pod
...
@@ -88,13 +88,13 @@ module Pod
@pod_target
.
should_build?
.
should
==
false
@pod_target
.
should_build?
.
should
==
false
end
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
=
Sandbox
::
FileAccessor
.
new
(
nil
,
@banana_spec
.
consumer
(
Platform
.
ios
))
fa
.
stubs
(
:source_files
).
returns
([
Pathname
.
new
(
'foo.h'
)])
fa
.
stubs
(
:source_files
).
returns
([
Pathname
.
new
(
'foo.h'
)])
@pod_target
.
stubs
(
:file_accessors
).
returns
([
fa
])
@pod_target
.
stubs
(
:file_accessors
).
returns
([
fa
])
@pod_target
.
root_spec
.
script_phase
=
{
:name
=>
'Hello World'
,
:script
=>
'echo "Hello World"'
}
@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
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