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
8326ec07
Commit
8326ec07
authored
Apr 19, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BuildSettings] Rename subclasses to include the word "Settings"
parent
47be0099
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
35 deletions
+35
-35
pod_target_installer.rb
...ller/xcode/pods_project_generator/pod_target_installer.rb
+1
-1
aggregate_target.rb
lib/cocoapods/target/aggregate_target.rb
+1
-1
build_settings.rb
lib/cocoapods/target/build_settings.rb
+2
-2
pod_target.rb
lib/cocoapods/target/pod_target.rb
+1
-1
aggregate_target_settings_spec.rb
...t/target/build_settings/aggregate_target_settings_spec.rb
+6
-6
pod_target_settings_spec.rb
spec/unit/target/build_settings/pod_target_settings_spec.rb
+22
-22
build_settings_spec.rb
spec/unit/target/build_settings_spec.rb
+2
-2
No files found.
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
View file @
8326ec07
...
...
@@ -426,7 +426,7 @@ module Pod
def
create_test_xcconfig_files
(
test_native_targets
,
test_resource_bundle_targets
)
target
.
supported_test_types
.
each
do
|
test_type
|
path
=
target
.
xcconfig_path
(
test_type
.
to_s
)
update_changed_file
(
Target
::
BuildSettings
::
Pod
.
new
(
target
,
true
),
path
)
update_changed_file
(
Target
::
BuildSettings
::
Pod
TargetSettings
.
new
(
target
,
true
),
path
)
xcconfig_file_ref
=
add_file_to_support_group
(
path
)
test_native_targets
.
each
do
|
test_target
|
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
8326ec07
...
...
@@ -320,7 +320,7 @@ module Pod
settings
=
{}
user_build_configurations
.
each_key
do
|
configuration_name
|
settings
[
configuration_name
]
=
BuildSettings
::
Aggregate
.
new
(
self
,
configuration_name
)
settings
[
configuration_name
]
=
BuildSettings
::
Aggregate
TargetSettings
.
new
(
self
,
configuration_name
)
end
settings
...
...
lib/cocoapods/target/build_settings.rb
View file @
8326ec07
...
...
@@ -412,7 +412,7 @@ module Pod
end
# A subclass that generates build settings for a {PodTarget}
class
Pod
<
BuildSettings
class
Pod
TargetSettings
<
BuildSettings
#-------------------------------------------------------------------------#
# @!group Public API
...
...
@@ -785,7 +785,7 @@ module Pod
end
# A subclass that generates build settings for a `PodTarget`
class
Aggregate
<
BuildSettings
class
Aggregate
TargetSettings
<
BuildSettings
#-------------------------------------------------------------------------#
# @!group Public API
...
...
lib/cocoapods/target/pod_target.rb
View file @
8326ec07
...
...
@@ -612,7 +612,7 @@ module Pod
end
def
create_build_settings
BuildSettings
::
Pod
.
new
(
self
,
false
)
BuildSettings
::
Pod
TargetSettings
.
new
(
self
,
false
)
end
end
end
spec/unit/target/build_settings/aggregate_spec.rb
→
spec/unit/target/build_settings/aggregate_
target_settings_
spec.rb
View file @
8326ec07
...
...
@@ -3,7 +3,7 @@ require File.expand_path('../../../../spec_helper', __FILE__)
module
Pod
class
Target
class
BuildSettings
describe
Aggregate
do
describe
Aggregate
TargetSettings
do
def
specs
[
fixture_spec
(
'banana-lib/BananaLib.podspec'
)]
end
...
...
@@ -22,7 +22,7 @@ module Pod
unless
@specs
.
empty?
@target
.
target_definition
.
whitelist_pod_for_configuration
(
@specs
.
first
.
name
,
'Release'
)
end
@generator
=
Aggregate
.
new
(
@target
,
'Release'
)
@generator
=
Aggregate
TargetSettings
.
new
(
@target
,
'Release'
)
end
shared
'Aggregate'
do
...
...
@@ -175,7 +175,7 @@ module Pod
end
it
'does not links the pod targets with the aggregate target for non-whitelisted configuration'
do
@generator
=
Aggregate
.
new
(
@target
,
'Debug'
)
@generator
=
Aggregate
TargetSettings
.
new
(
@target
,
'Debug'
)
@xcconfig
=
@generator
.
generate
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
not
.
include
'-l"Pods-BananaLib"'
end
...
...
@@ -215,9 +215,9 @@ module Pod
:product_basename
=>
'PodTarget'
,
:target_definitions
=>
[
target_definition
],
)
pod_target
.
stubs
(
:build_settings
=>
Pod
.
new
(
pod_target
,
false
))
pod_target
.
stubs
(
:build_settings
=>
Pod
TargetSettings
.
new
(
pod_target
,
false
))
aggregate_target
=
fixture_aggregate_target
([
pod_target
])
@generator
=
Aggregate
.
new
(
aggregate_target
,
'Debug'
)
@generator
=
Aggregate
TargetSettings
.
new
(
aggregate_target
,
'Debug'
)
@generator
.
other_ldflags
.
should
==
%w(-ObjC -l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "PodTarget" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest")
end
end
...
...
@@ -526,7 +526,7 @@ module Pod
describe
'an empty pod target'
do
before
do
@blank_target
=
fixture_aggregate_target
@generator
=
Aggregate
.
new
(
@blank_target
,
'Release'
)
@generator
=
Aggregate
TargetSettings
.
new
(
@blank_target
,
'Release'
)
end
it
'it should not have any framework search paths'
do
...
...
spec/unit/target/build_settings/pod_spec.rb
→
spec/unit/target/build_settings/pod_
target_settings_
spec.rb
View file @
8326ec07
...
...
@@ -3,7 +3,7 @@ require File.expand_path('../../../../spec_helper', __FILE__)
module
Pod
class
Target
class
BuildSettings
describe
Pod
do
describe
Pod
TargetSettings
do
describe
'in general'
do
before
do
@monkey_spec
=
fixture_spec
(
'monkey/monkey.podspec'
)
...
...
@@ -45,7 +45,7 @@ module Pod
:uses_modular_headers?
=>
false
,
:uses_swift?
=>
false
,
)
vendored_dep_target
.
stubs
(
:build_settings
=>
Pod
.
new
(
vendored_dep_target
,
false
))
vendored_dep_target
.
stubs
(
:build_settings
=>
Pod
TargetSettings
.
new
(
vendored_dep_target
,
false
))
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@pod_target
=
fixture_pod_target
(
@spec
,
true
)
...
...
@@ -53,7 +53,7 @@ module Pod
@consumer
=
@pod_target
.
spec_consumers
.
first
@podfile
=
@pod_target
.
podfile
@generator
=
Pod
.
new
(
@pod_target
,
false
)
@generator
=
Pod
TargetSettings
.
new
(
@pod_target
,
false
)
@spec
.
pod_target_xcconfig
=
{
'OTHER_LDFLAGS'
=>
'-no_compact_unwind'
}
@spec
.
user_target_xcconfig
=
{
'CLANG_CXX_LANGUAGE_STANDARD'
=>
'c++11'
}
...
...
@@ -209,7 +209,7 @@ module Pod
:sandbox
=>
config
.
sandbox
,
:should_build?
=>
true
,
)
pod_target
.
stubs
(
:build_settings
=>
Pod
.
new
(
pod_target
,
false
))
pod_target
.
stubs
(
:build_settings
=>
Pod
TargetSettings
.
new
(
pod_target
,
false
))
@generator
.
spec_consumers
.
each
{
|
sc
|
sc
.
stubs
(
:frameworks
=>
[])
}
@generator
.
stubs
(
:dependent_targets
=>
[
pod_target
])
@generator
.
send
:__clear__
...
...
@@ -241,7 +241,7 @@ module Pod
it
'does not merge pod target xcconfig of test specifications for a non test xcconfig'
do
@coconut_spec
.
pod_target_xcconfig
=
{
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'NON_TEST_FLAG=1'
}
@coconut_test_spec
.
pod_target_xcconfig
=
{
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'TEST_ONLY=1'
}
generator
=
Pod
.
new
(
@coconut_pod_target
,
false
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'GCC_PREPROCESSOR_DEFINITIONS'
].
should
==
'$(inherited) COCOAPODS=1 NON_TEST_FLAG=1'
end
...
...
@@ -249,41 +249,41 @@ module Pod
it
'merges the pod target xcconfig of non test specifications for test xcconfigs'
do
@coconut_spec
.
pod_target_xcconfig
=
{
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'NON_TEST_FLAG=1'
}
@coconut_test_spec
.
pod_target_xcconfig
=
{
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'TEST_ONLY=1'
}
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'GCC_PREPROCESSOR_DEFINITIONS'
].
should
==
'$(inherited) COCOAPODS=1 NON_TEST_FLAG=1 TEST_ONLY=1'
end
it
'includes correct other ld flags'
do
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'$(inherited) -ObjC -l"CoconutLib"'
end
it
'includes correct other ld flags when requires frameworks'
do
@coconut_pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'$(inherited) -ObjC -framework "CoconutLib"'
end
it
'includes other ld flags for transitive dependent targets'
do
@coconut_pod_target
.
dependent_targets
=
[
@monkey_pod_target
]
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'$(inherited) -ObjC -l"CoconutLib" -l"monkey" -framework "dynamic-monkey"'
end
it
'includes other ld flags for test dependent targets'
do
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@monkey_pod_target
]
}
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'$(inherited) -ObjC -l"CoconutLib" -l"monkey" -framework "dynamic-monkey"'
end
it
'adds settings for test dependent targets'
do
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@banana_pod_target
]
}
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
xcconfig
.
to_hash
[
'LIBRARY_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BananaLib" "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLib" "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
...
...
@@ -292,7 +292,7 @@ module Pod
it
'adds settings for test dependent targets excluding the parents targets'
do
@coconut_pod_target
.
dependent_targets
=
[
@banana_pod_target
]
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@banana_pod_target
]
}
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
xcconfig
.
to_hash
[
'LIBRARY_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BananaLib" "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLib" "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
...
...
@@ -302,11 +302,11 @@ module Pod
@banana_pod_target
.
spec_consumers
.
each
{
|
sc
|
sc
.
stubs
(
:frameworks
=>
%w(XCTest)
,
:vendored_frameworks
=>
[])
}
@coconut_pod_target
.
dependent_targets
=
[
@banana_pod_target
]
generator
=
Pod
.
new
(
@coconut_pod_target
,
false
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
==
'$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"'
generator
=
Pod
.
new
(
@banana_pod_target
,
false
)
generator
=
Pod
TargetSettings
.
new
(
@banana_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
==
'$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"'
end
...
...
@@ -322,7 +322,7 @@ module Pod
@coconut_pod_target
.
sandbox
.
public_headers
.
add_search_path
(
'CoconutLib'
,
Platform
.
ios
)
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@monkey_pod_target
]
}
@coconut_pod_target
.
dependent_targets
=
[
@banana_pod_target
]
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'HEADER_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_ROOT}/Headers/Private"'
\
' "${PODS_ROOT}/Headers/Private/CoconutLib"'
\
...
...
@@ -344,7 +344,7 @@ module Pod
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@monkey_pod_target
]
}
@coconut_pod_target
.
dependent_targets
=
[
@banana_pod_target
]
# This is not an test xcconfig so it should exclude header search paths for the 'monkey' pod
generator
=
Pod
.
new
(
@coconut_pod_target
,
false
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'HEADER_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_ROOT}/Headers/Private"'
\
' "${PODS_ROOT}/Headers/Private/CoconutLib"'
\
...
...
@@ -364,7 +364,7 @@ module Pod
@coconut_pod_target
.
sandbox
.
public_headers
.
add_search_path
(
'CoconutLib'
,
Platform
.
ios
)
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@monkey_pod_target
]
}
@coconut_pod_target
.
dependent_targets
=
[
@banana_pod_target
]
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'HEADER_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_ROOT}/Headers/Private"'
\
' "${PODS_ROOT}/Headers/Private/CoconutLib"'
\
...
...
@@ -382,7 +382,7 @@ module Pod
@coconut_pod_target
.
sandbox
.
public_headers
.
add_search_path
(
'CoconutLib'
,
Platform
.
ios
)
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@monkey_pod_target
]
}
@coconut_pod_target
.
dependent_targets
=
[
@banana_pod_target
]
generator
=
Pod
.
new
(
@coconut_pod_target
,
false
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'HEADER_SEARCH_PATHS'
].
should
==
'$(inherited) "${PODS_ROOT}/Headers/Private"'
\
' "${PODS_ROOT}/Headers/Private/CoconutLib"'
\
...
...
@@ -391,27 +391,27 @@ module Pod
it
'does not include other ld flags for test dependent targets if its not a test xcconfig'
do
@coconut_pod_target
.
test_dependent_targets_by_spec_name
=
{
@coconut_test_spec
.
name
=>
[
@monkey_pod_target
]
}
generator
=
Pod
.
new
(
@coconut_pod_target
,
false
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'LIBRARY_SEARCH_PATHS'
].
should
.
be
.
nil
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
be
.
nil
end
it
'includes default runpath search path list for test xcconfigs'
do
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'LD_RUNPATH_SEARCH_PATHS'
].
should
==
"$(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'"
end
it
'includes default runpath search path list for test xcconfigs for test bundle'
do
@coconut_pod_target
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:osx
,
'10.10'
))
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'LD_RUNPATH_SEARCH_PATHS'
].
should
==
"$(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks'"
end
it
'does not set configuration build dir for test xcconfigs'
do
generator
=
Pod
.
new
(
@coconut_pod_target
,
true
)
generator
=
Pod
TargetSettings
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'CONFIGURATION_BUILD_DIR'
].
should
.
be
.
nil
end
...
...
spec/unit/target/build_settings_spec.rb
View file @
8326ec07
...
...
@@ -4,11 +4,11 @@ module Pod
class
Target
describe
BuildSettings
do
def
pod
(
pod_target
,
test_xcconfig
=
false
)
BuildSettings
::
Pod
.
new
(
pod_target
,
test_xcconfig
)
BuildSettings
::
Pod
TargetSettings
.
new
(
pod_target
,
test_xcconfig
)
end
def
aggregate
(
aggregate_target
,
configuration_name
=
'Release'
)
BuildSettings
::
Aggregate
.
new
(
aggregate_target
,
configuration_name
)
BuildSettings
::
Aggregate
TargetSettings
.
new
(
aggregate_target
,
configuration_name
)
end
describe
'memoization'
do
...
...
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