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
09a05954
Commit
09a05954
authored
Nov 21, 2014
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Refactor] Pluralize name of attribute Target#requires_framework
Same for underlying host_requires_framework
parent
f5cd3f12
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
32 deletions
+32
-32
aggregate_xcconfig.rb
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+2
-2
private_pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb
+1
-1
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+1
-1
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+2
-2
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+1
-1
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+1
-1
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+2
-2
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+3
-3
target.rb
lib/cocoapods/target.rb
+11
-11
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+4
-4
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+4
-4
No files found.
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
View file @
09a05954
...
@@ -55,7 +55,7 @@ module Pod
...
@@ -55,7 +55,7 @@ module Pod
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'$(inherited) COCOAPODS=1'
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'$(inherited) COCOAPODS=1'
,
}
}
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
# Framework headers are automatically discoverable by `#import <…>`.
# Framework headers are automatically discoverable by `#import <…>`.
header_search_paths
=
pod_targets
.
map
{
|
target
|
"$PODS_FRAMEWORK_BUILD_PATH/
#{
target
.
product_name
}
/Headers"
}
header_search_paths
=
pod_targets
.
map
{
|
target
|
"$PODS_FRAMEWORK_BUILD_PATH/
#{
target
.
product_name
}
/Headers"
}
build_settings
=
{
build_settings
=
{
...
@@ -87,7 +87,7 @@ module Pod
...
@@ -87,7 +87,7 @@ module Pod
# Add pod target to list of frameworks / libraries that are
# Add pod target to list of frameworks / libraries that are
# linked with the user’s project.
# linked with the user’s project.
next
unless
pod_target
.
should_build?
next
unless
pod_target
.
should_build?
if
pod_target
.
requires_framework?
if
pod_target
.
requires_framework
s
?
@xcconfig
.
merge!
(
'OTHER_LDFLAGS'
=>
%(-framework "#{pod_target.product_basename}")
)
@xcconfig
.
merge!
(
'OTHER_LDFLAGS'
=>
%(-framework "#{pod_target.product_basename}")
)
else
else
@xcconfig
.
merge!
(
'OTHER_LDFLAGS'
=>
%(-l "#{pod_target.product_basename}")
)
@xcconfig
.
merge!
(
'OTHER_LDFLAGS'
=>
%(-l "#{pod_target.product_basename}")
)
...
...
lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb
View file @
09a05954
...
@@ -57,7 +57,7 @@ module Pod
...
@@ -57,7 +57,7 @@ module Pod
# 'USE_HEADERMAP' => 'NO'
# 'USE_HEADERMAP' => 'NO'
}
}
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
dependencies
=
target
.
module_dependencies
.
reject
{
|
dep
|
dep
==
target
.
product_module_name
}
dependencies
=
target
.
module_dependencies
.
reject
{
|
dep
|
dep
==
target
.
product_module_name
}
build_settings
=
{
build_settings
=
{
'PODS_FRAMEWORK_BUILD_PATH'
=>
target
.
configuration_build_dir
,
'PODS_FRAMEWORK_BUILD_PATH'
=>
target
.
configuration_build_dir
,
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
09a05954
...
@@ -142,7 +142,7 @@ module Pod
...
@@ -142,7 +142,7 @@ module Pod
# The xcconfig to edit.
# The xcconfig to edit.
#
#
def
self
.
add_target_specific_settings
(
target
,
xcconfig
)
def
self
.
add_target_specific_settings
(
target
,
xcconfig
)
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
add_code_signing_settings
(
target
,
xcconfig
)
add_code_signing_settings
(
target
,
xcconfig
)
end
end
add_language_specific_settings
(
target
,
xcconfig
)
add_language_specific_settings
(
target
,
xcconfig
)
...
...
lib/cocoapods/installer/analyzer.rb
View file @
09a05954
...
@@ -204,7 +204,7 @@ module Pod
...
@@ -204,7 +204,7 @@ module Pod
user_project
=
Xcodeproj
::
Project
.
open
(
project_path
)
user_project
=
Xcodeproj
::
Project
.
open
(
project_path
)
native_targets
=
compute_user_project_targets
(
target_definition
,
user_project
)
native_targets
=
compute_user_project_targets
(
target_definition
,
user_project
)
target
.
host_requires_framework
|=
compute_user_project_targets_require_framework
(
target_definition
,
native_targets
)
target
.
host_requires_framework
s
|=
compute_user_project_targets_require_framework
(
target_definition
,
native_targets
)
target
.
user_project_path
=
project_path
target
.
user_project_path
=
project_path
target
.
client_root
=
project_path
.
dirname
target
.
client_root
=
project_path
.
dirname
target
.
user_target_uuids
=
native_targets
.
map
(
&
:uuid
)
target
.
user_target_uuids
=
native_targets
.
map
(
&
:uuid
)
...
@@ -258,7 +258,7 @@ module Pod
...
@@ -258,7 +258,7 @@ module Pod
def
generate_pod_target
(
target
,
pod_specs
)
def
generate_pod_target
(
target
,
pod_specs
)
pod_target
=
PodTarget
.
new
(
pod_specs
,
target
.
target_definition
,
sandbox
)
pod_target
=
PodTarget
.
new
(
pod_specs
,
target
.
target_definition
,
sandbox
)
pod_target
.
host_requires_framework
|=
target
.
host_requires_framework
pod_target
.
host_requires_framework
s
|=
target
.
host_requires_frameworks
if
config
.
integrate_targets?
if
config
.
integrate_targets?
pod_target
.
user_build_configurations
=
target
.
user_build_configurations
pod_target
.
user_build_configurations
=
target
.
user_build_configurations
pod_target
.
archs
=
@archs_by_target_def
[
target
.
target_definition
]
pod_target
.
archs
=
@archs_by_target_def
[
target
.
target_definition
]
...
...
lib/cocoapods/installer/target_installer.rb
View file @
09a05954
...
@@ -60,7 +60,7 @@ module Pod
...
@@ -60,7 +60,7 @@ module Pod
settings
[
'PODS_ROOT'
]
=
'$(SRCROOT)'
settings
[
'PODS_ROOT'
]
=
'$(SRCROOT)'
end
end
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
settings
[
'PRODUCT_NAME'
]
=
target
.
product_module_name
settings
[
'PRODUCT_NAME'
]
=
target
.
product_module_name
else
else
settings
.
merge!
(
'OTHER_LDFLAGS'
=>
''
,
'OTHER_LIBTOOLFLAGS'
=>
''
)
settings
.
merge!
(
'OTHER_LDFLAGS'
=>
''
,
'OTHER_LIBTOOLFLAGS'
=>
''
)
...
...
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
09a05954
...
@@ -14,7 +14,7 @@ module Pod
...
@@ -14,7 +14,7 @@ module Pod
create_support_files_dir
create_support_files_dir
create_support_files_group
create_support_files_group
create_xcconfig_file
create_xcconfig_file
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
create_info_plist_file
create_info_plist_file
create_module_map
create_module_map
create_umbrella_header
create_umbrella_header
...
...
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
09a05954
...
@@ -20,7 +20,7 @@ module Pod
...
@@ -20,7 +20,7 @@ module Pod
add_files_to_build_phases
add_files_to_build_phases
add_resources_bundle_targets
add_resources_bundle_targets
create_xcconfig_file
create_xcconfig_file
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
create_info_plist_file
create_info_plist_file
create_module_map
create_module_map
create_umbrella_header
do
|
generator
|
create_umbrella_header
do
|
generator
|
...
@@ -65,7 +65,7 @@ module Pod
...
@@ -65,7 +65,7 @@ module Pod
header_file_refs
=
headers
.
map
{
|
sf
|
project
.
reference_for_path
(
sf
)
}
header_file_refs
=
headers
.
map
{
|
sf
|
project
.
reference_for_path
(
sf
)
}
native_target
.
add_file_references
(
header_file_refs
)
do
|
build_file
|
native_target
.
add_file_references
(
header_file_refs
)
do
|
build_file
|
# Set added headers as public if needed
# Set added headers as public if needed
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
if
public_headers
.
include?
(
build_file
.
file_ref
.
real_path
)
if
public_headers
.
include?
(
build_file
.
file_ref
.
real_path
)
build_file
.
settings
||=
{}
build_file
.
settings
||=
{}
build_file
.
settings
[
'ATTRIBUTES'
]
=
[
'Public'
]
build_file
.
settings
[
'ATTRIBUTES'
]
=
[
'Public'
]
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
09a05954
...
@@ -33,7 +33,7 @@ module Pod
...
@@ -33,7 +33,7 @@ module Pod
update_to_cocoapods_0_34
,
update_to_cocoapods_0_34
,
unless
native_targets_to_integrate
.
empty?
unless
native_targets_to_integrate
.
empty?
add_pods_library
add_pods_library
add_embed_frameworks_script_phase
if
target
.
requires_framework?
add_embed_frameworks_script_phase
if
target
.
requires_framework
s
?
add_copy_resources_script_phase
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
add_check_manifest_lock_script_phase
true
true
...
@@ -105,7 +105,7 @@ module Pod
...
@@ -105,7 +105,7 @@ module Pod
build_phase
=
native_target
.
frameworks_build_phase
build_phase
=
native_target
.
frameworks_build_phase
# Find and delete possible reference for the other product type
# Find and delete possible reference for the other product type
old_product_name
=
target
.
requires_framework?
?
target
.
static_library_name
:
target
.
framework_name
old_product_name
=
target
.
requires_framework
s
?
?
target
.
static_library_name
:
target
.
framework_name
old_product_ref
=
frameworks
.
files
.
find
{
|
f
|
f
.
path
==
old_product_name
}
old_product_ref
=
frameworks
.
files
.
find
{
|
f
|
f
.
path
==
old_product_name
}
if
old_product_ref
.
present?
if
old_product_ref
.
present?
UI
.
message
(
"Remove old Pod product reference
#{
old_product_name
}
from project."
)
UI
.
message
(
"Remove old Pod product reference
#{
old_product_name
}
from project."
)
...
@@ -120,7 +120,7 @@ module Pod
...
@@ -120,7 +120,7 @@ module Pod
unless
build_file
=
build_phase
.
build_file
(
new_product_ref
)
unless
build_file
=
build_phase
.
build_file
(
new_product_ref
)
build_file
=
build_phase
.
add_file_reference
(
new_product_ref
)
build_file
=
build_phase
.
add_file_reference
(
new_product_ref
)
end
end
if
target
.
requires_framework?
if
target
.
requires_framework
s
?
build_file
.
settings
||=
{}
build_file
.
settings
||=
{}
build_file
.
settings
[
'ATTRIBUTES'
]
=
[
'Weak'
]
build_file
.
settings
[
'ATTRIBUTES'
]
=
[
'Weak'
]
end
end
...
...
lib/cocoapods/target.rb
View file @
09a05954
...
@@ -18,8 +18,8 @@ module Pod
...
@@ -18,8 +18,8 @@ module Pod
# @return [Boolean] Whether the target needs to be implemented as a framework.
# @return [Boolean] Whether the target needs to be implemented as a framework.
# Computed by analyzer.
# Computed by analyzer.
#
#
attr_accessor
:host_requires_framework
attr_accessor
:host_requires_framework
s
alias_method
:host_requires_framework
?
,
:host_requires_framework
alias_method
:host_requires_framework
s?
,
:host_requires_frameworks
# @return [String] the name of the library.
# @return [String] the name of the library.
#
#
...
@@ -30,7 +30,7 @@ module Pod
...
@@ -30,7 +30,7 @@ module Pod
# @return [String] the name of the product.
# @return [String] the name of the product.
#
#
def
product_name
def
product_name
if
requires_framework?
if
requires_framework
s
?
framework_name
framework_name
else
else
static_library_name
static_library_name
...
@@ -38,11 +38,11 @@ module Pod
...
@@ -38,11 +38,11 @@ module Pod
end
end
# @return [String] the name of the product excluding the file extension or
# @return [String] the name of the product excluding the file extension or
# a product type specific prefix, depends on #requires_framework?
# a product type specific prefix, depends on #requires_framework
s
?
# and #product_module_name or #label.
# and #product_module_name or #label.
#
#
def
product_basename
def
product_basename
if
requires_framework?
if
requires_framework
s
?
product_module_name
product_module_name
else
else
label
label
...
@@ -51,7 +51,7 @@ module Pod
...
@@ -51,7 +51,7 @@ module Pod
# @return [String] the name of the framework, depends on #label.
# @return [String] the name of the framework, depends on #label.
#
#
# @note This may not depend on #requires_framework? indirectly as it is
# @note This may not depend on #requires_framework
s
? indirectly as it is
# used for migration.
# used for migration.
#
#
def
framework_name
def
framework_name
...
@@ -60,7 +60,7 @@ module Pod
...
@@ -60,7 +60,7 @@ module Pod
# @return [String] the name of the library, depends on #label.
# @return [String] the name of the library, depends on #label.
#
#
# @note This may not depend on #requires_framework? indirectly as it is
# @note This may not depend on #requires_framework
s
? indirectly as it is
# used for migration.
# used for migration.
#
#
def
static_library_name
def
static_library_name
...
@@ -68,10 +68,10 @@ module Pod
...
@@ -68,10 +68,10 @@ module Pod
end
end
# @return [Symbol] either :framework or :static_library, depends on
# @return [Symbol] either :framework or :static_library, depends on
# #requires_framework?.
# #requires_framework
s
?.
#
#
def
product_type
def
product_type
requires_framework?
?
:
framework
:
:static_library
requires_framework
s
?
?
:
framework
:
:static_library
end
end
# @return [String] the XCConfig namespaced prefix.
# @return [String] the XCConfig namespaced prefix.
...
@@ -96,8 +96,8 @@ module Pod
...
@@ -96,8 +96,8 @@ module Pod
# dependents, which can only be checked after the specs were been
# dependents, which can only be checked after the specs were been
# fetched.
# fetched.
#
#
def
requires_framework?
def
requires_framework
s
?
host_requires_framework?
||
uses_swift?
host_requires_framework
s
?
||
uses_swift?
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
09a05954
...
@@ -151,7 +151,7 @@ module Pod
...
@@ -151,7 +151,7 @@ module Pod
describe
'Host requires frameworks'
do
describe
'Host requires frameworks'
do
before
do
before
do
@target
.
host_requires_framework
=
true
@target
.
host_requires_framework
s
=
true
end
end
it
'returns the product name'
do
it
'returns the product name'
do
...
@@ -171,7 +171,7 @@ module Pod
...
@@ -171,7 +171,7 @@ module Pod
end
end
it
'returns that it requires being built as framework'
do
it
'returns that it requires being built as framework'
do
@target
.
requires_framework?
.
should
==
true
@target
.
requires_framework
s
?
.
should
==
true
end
end
end
end
...
@@ -193,7 +193,7 @@ module Pod
...
@@ -193,7 +193,7 @@ module Pod
end
end
it
'returns that it does not require being built as framework'
do
it
'returns that it does not require being built as framework'
do
@target
.
requires_framework?
.
should
==
false
@target
.
requires_framework
s
?
.
should
==
false
end
end
end
end
end
end
...
@@ -230,7 +230,7 @@ module Pod
...
@@ -230,7 +230,7 @@ module Pod
end
end
it
'returns that it requires being built as framework'
do
it
'returns that it requires being built as framework'
do
@target
.
requires_framework?
.
should
==
true
@target
.
requires_framework
s
?
.
should
==
true
end
end
end
end
end
end
...
...
spec/unit/target/pod_target_spec.rb
View file @
09a05954
...
@@ -129,7 +129,7 @@ module Pod
...
@@ -129,7 +129,7 @@ module Pod
describe
'Host requires frameworks'
do
describe
'Host requires frameworks'
do
before
do
before
do
@pod_target
.
host_requires_framework
=
true
@pod_target
.
host_requires_framework
s
=
true
end
end
it
'returns the product name'
do
it
'returns the product name'
do
...
@@ -149,7 +149,7 @@ module Pod
...
@@ -149,7 +149,7 @@ module Pod
end
end
it
'returns that it requires being built as framework'
do
it
'returns that it requires being built as framework'
do
@pod_target
.
requires_framework?
.
should
==
true
@pod_target
.
requires_framework
s
?
.
should
==
true
end
end
end
end
...
@@ -171,7 +171,7 @@ module Pod
...
@@ -171,7 +171,7 @@ module Pod
end
end
it
'returns that it does not require being built as framework'
do
it
'returns that it does not require being built as framework'
do
@pod_target
.
requires_framework?
.
should
==
false
@pod_target
.
requires_framework
s
?
.
should
==
false
end
end
end
end
end
end
...
@@ -206,7 +206,7 @@ module Pod
...
@@ -206,7 +206,7 @@ module Pod
end
end
it
'returns that it requires being built as framework'
do
it
'returns that it requires being built as framework'
do
@pod_target
.
requires_framework?
.
should
==
true
@pod_target
.
requires_framework
s
?
.
should
==
true
end
end
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