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
c2505623
Commit
c2505623
authored
Apr 18, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not crash in pods project generation when adding framework file references to stub targets
parent
644280b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
pods_project_generator.rb
lib/cocoapods/installer/xcode/pods_project_generator.rb
+1
-1
pods_project_generator_spec.rb
spec/unit/installer/xcode/pods_project_generator_spec.rb
+21
-0
No files found.
lib/cocoapods/installer/xcode/pods_project_generator.rb
View file @
c2505623
...
...
@@ -338,7 +338,7 @@ module Pod
end
def
add_framework_file_reference_to_native_target
(
native_target
,
pod_target
,
dependent_target
,
frameworks_group
)
if
pod_target
.
requires_frameworks?
&&
!
pod_target
.
static_framework?
&&
dependent_target
.
should_build?
if
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
&&
!
pod_target
.
static_framework?
&&
dependent_target
.
should_build?
product_ref
=
frameworks_group
.
files
.
find
{
|
f
|
f
.
path
==
dependent_target
.
product_name
}
||
frameworks_group
.
new_product_ref_for_target
(
dependent_target
.
product_basename
,
dependent_target
.
product_type
)
native_target
.
frameworks_build_phase
.
add_file_reference
(
product_ref
,
true
)
...
...
spec/unit/installer/xcode/pods_project_generator_spec.rb
View file @
c2505623
...
...
@@ -240,6 +240,27 @@ module Pod
]
end
it
'adds framework file references for framework pod targets that require building'
do
@orangeframework_pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@coconut_ios_pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@coconut_ios_pod_target
.
stubs
(
:should_build?
).
returns
(
true
)
@generator
.
generate!
native_target
=
@generator
.
project
.
targets
.
find
{
|
t
|
t
.
name
==
'CoconutLib-iOS'
}
native_target
.
isa
.
should
==
'PBXNativeTarget'
native_target
.
frameworks_build_phase
.
file_display_names
.
sort
.
should
==
[
'Foundation.framework'
,
'OrangeFramework.framework'
,
]
end
it
'does not add framework references for framework pod targets that do not require building'
do
@orangeframework_pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@coconut_ios_pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@coconut_ios_pod_target
.
stubs
(
:should_build?
).
returns
(
false
)
@generator
.
generate!
@generator
.
project
.
targets
.
find
{
|
t
|
t
.
name
==
'CoconutLib-iOS'
}.
isa
.
should
==
'PBXAggregateTarget'
end
it
'configures APPLICATION_EXTENSION_API_ONLY for pod targets of an aggregate target'
do
user_target
=
stub
(
'SampleApp-iOS-User-Target'
,
:symbol_type
=>
:app_extension
)
@ios_target
.
stubs
(
:user_targets
).
returns
([
user_target
])
...
...
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