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
b6ee92e3
Commit
b6ee92e3
authored
Oct 05, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build pod targets with script phases and integrate them properly
parent
3237d4dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
4 deletions
+38
-4
CHANGELOG.md
CHANGELOG.md
+4
-0
pods_project_generator.rb
lib/cocoapods/installer/xcode/pods_project_generator.rb
+3
-3
pod_target.rb
lib/cocoapods/target/pod_target.rb
+7
-1
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+24
-0
No files found.
CHANGELOG.md
View file @
b6ee92e3
...
...
@@ -30,6 +30,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Build pod targets with script phases and integrate them properly
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7104
](
https://github.com/CocoaPods/CocoaPods/pull/7104
)
*
Fix framework and resources paths caching
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7068
](
https://github.com/CocoaPods/CocoaPods/pull/7068
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator.rb
View file @
b6ee92e3
...
...
@@ -180,10 +180,10 @@ module Pod
end
def
integrate_targets
pod_targets_
with_test_targets
=
pod_targets
.
reject
{
|
pt
|
pt
.
test_native_targets
.
empty
?
}
unless
pod_targets_
with_test_targets
.
empty?
pod_targets_
to_integrate
=
pod_targets
.
select
{
|
pt
|
!
pt
.
test_native_targets
.
empty?
||
pt
.
contains_script_phases
?
}
unless
pod_targets_
to_integrate
.
empty?
UI
.
message
'- Integrating targets'
do
pod_targets_
with_test_targets
.
each
do
|
pod_target
|
pod_targets_
to_integrate
.
each
do
|
pod_target
|
PodTargetIntegrator
.
new
(
pod_target
).
integrate!
end
end
...
...
lib/cocoapods/target/pod_target.rb
View file @
b6ee92e3
...
...
@@ -163,7 +163,7 @@ module Pod
@should_build
=
begin
source_files
=
file_accessors
.
flat_map
(
&
:source_files
)
source_files
-=
file_accessors
.
flat_map
(
&
:headers
)
!
source_files
.
empty?
!
source_files
.
empty?
||
contains_script_phases?
end
end
...
...
@@ -185,6 +185,12 @@ module Pod
end
end
# @return [Boolean] Whether the target contains any script phases.
#
def
contains_script_phases?
!
spec_consumers
.
map
(
&
:script_phases
).
flatten
.
empty?
end
# @return [Hash{Array => Specification}] a hash where the keys are the test native targets and the value
# an array of all the test specs associated with this native target.
#
...
...
spec/unit/target/pod_target_spec.rb
View file @
b6ee92e3
...
...
@@ -109,6 +109,15 @@ 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
fa
=
Sandbox
::
FileAccessor
.
new
(
nil
,
@pod_target
)
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
==
true
end
end
describe
'target version'
do
...
...
@@ -333,6 +342,21 @@ module Pod
end
end
describe
'script phases support'
do
before
do
@pod_target
=
fixture_pod_target
(
'coconut-lib/CoconutLib.podspec'
)
end
it
'returns false if it does not contain test specifications'
do
@pod_target
.
contains_script_phases?
.
should
==
false
end
it
'returns true if it contains test specifications'
do
@pod_target
.
root_spec
.
script_phase
=
{
:name
=>
'Hello World'
,
:script
=>
'echo "Hello World"'
}
@pod_target
.
contains_script_phases?
.
should
==
true
end
end
describe
'test spec support'
do
before
do
@coconut_spec
=
fixture_spec
(
'coconut-lib/CoconutLib.podspec'
)
...
...
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