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
37ebd5af
Commit
37ebd5af
authored
Jun 29, 2014
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate product_refs of generated frameworks
parent
c31b4b76
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
4 deletions
+59
-4
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+1
-1
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+1
-1
target.rb
lib/cocoapods/target.rb
+13
-2
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+20
-0
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+24
-0
No files found.
lib/cocoapods/installer/target_installer.rb
View file @
37ebd5af
...
...
@@ -36,7 +36,7 @@ module Pod
# @return [void]
#
def
add_target
product_type
=
target
.
requires_framework?
?
:
framework
:
:static_library
product_type
=
target
.
product_type
name
=
target
.
label
platform
=
target
.
platform
.
name
deployment_target
=
target
.
platform
.
deployment_target
.
to_s
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
37ebd5af
...
...
@@ -102,7 +102,7 @@ module Pod
frameworks
=
user_project
.
frameworks_group
native_targets_to_integrate
.
each
do
|
native_target
|
library
=
frameworks
.
files
.
select
{
|
f
|
f
.
path
==
target
.
product_name
}.
first
||
frameworks
.
new_product_ref_for_target
(
target
.
name
,
:static_library
)
frameworks
.
new_product_ref_for_target
(
target
.
name
,
target
.
product_type
)
unless
native_target
.
frameworks_build_phase
.
files_references
.
include?
(
library
)
native_target
.
frameworks_build_phase
.
add_file_reference
(
library
)
end
...
...
lib/cocoapods/target.rb
View file @
37ebd5af
...
...
@@ -27,10 +27,21 @@ module Pod
label
end
# @return [String] the name of the
library
.
# @return [String] the name of the
product
.
#
def
product_name
"lib
#{
label
}
.a"
if
requires_framework?
"
#{
label
}
.framework"
else
"lib
#{
label
}
.a"
end
end
# @return [Symbol] either :framework or :static_library, depends on
# #requires_framework?.
#
def
product_type
requires_framework?
?
:
framework
:
:static_library
end
# @return [String] the XCConfig namespaced prefix.
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
37ebd5af
...
...
@@ -133,12 +133,24 @@ module Pod
@target
.
host_requires_framework
=
true
end
it
'returns the product name'
do
@target
.
product_name
.
should
==
'Pods.framework'
end
it
'returns :framework as product type'
do
@target
.
product_type
.
should
==
:framework
end
it
'returns that it requires being built as framework'
do
@target
.
requires_framework?
.
should
==
true
end
end
describe
'Host does not requires frameworks'
do
it
'returns the product name'
do
@target
.
product_name
.
should
==
'libPods.a'
end
it
'returns :static_library as product type'
do
@target
.
product_type
.
should
==
:static_library
end
...
...
@@ -160,6 +172,14 @@ module Pod
@target
.
uses_swift?
.
should
==
true
end
it
'returns the product name'
do
@target
.
product_name
.
should
==
'Pods.framework'
end
it
'returns :framework as product type'
do
@target
.
product_type
.
should
==
:framework
end
it
'returns that it requires being built as framework'
do
@target
.
requires_framework?
.
should
==
true
end
...
...
spec/unit/target/pod_target_spec.rb
View file @
37ebd5af
...
...
@@ -117,12 +117,28 @@ module Pod
@pod_target
.
host_requires_framework
=
true
end
it
'returns the product name'
do
@pod_target
.
product_name
.
should
==
'Pods-BananaLib.framework'
end
it
'returns :framework as product type'
do
@pod_target
.
product_type
.
should
==
:framework
end
it
'returns that it requires being built as framework'
do
@pod_target
.
requires_framework?
.
should
==
true
end
end
describe
'Host does not requires frameworks'
do
it
'returns the product name'
do
@pod_target
.
product_name
.
should
==
'libPods-BananaLib.a'
end
it
'returns :static_library as product type'
do
@pod_target
.
product_type
.
should
==
:static_library
end
it
'returns that it does not require being built as framework'
do
@pod_target
.
requires_framework?
.
should
==
false
end
...
...
@@ -138,6 +154,14 @@ module Pod
@pod_target
.
uses_swift?
.
should
==
true
end
it
'returns the product name'
do
@pod_target
.
product_name
.
should
==
'Pods-OrangeFramework.framework'
end
it
'returns :framework as product type'
do
@pod_target
.
product_type
.
should
==
:framework
end
it
'returns that it requires being built as framework'
do
@pod_target
.
requires_framework?
.
should
==
true
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