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
cd2ee62f
Commit
cd2ee62f
authored
Sep 14, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not merge `pod_target_xcconfig` from test specs into non test xcconfigs
parent
0586bd15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
8 deletions
+36
-8
CHANGELOG.md
CHANGELOG.md
+4
-0
pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
+1
-1
spec_helper.rb
spec/spec_helper.rb
+11
-5
pod_xcconfig_spec.rb
spec/unit/generator/xcconfig/pod_xcconfig_spec.rb
+20
-2
No files found.
CHANGELOG.md
View file @
cd2ee62f
...
@@ -38,6 +38,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -38,6 +38,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7036
](
https://github.com/CocoaPods/CocoaPods/pull/7036
)
[
#7036
](
https://github.com/CocoaPods/CocoaPods/pull/7036
)
*
Do not merge
`pod_target_xcconfig`
from test specs into non test xcconfigs
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7037
](
https://github.com/CocoaPods/CocoaPods/pull/7037
)
*
Fix common paths sometimes calculating incorrectly
*
Fix common paths sometimes calculating incorrectly
[
amorde
](
https://github.com/amorde
)
[
amorde
](
https://github.com/amorde
)
[
#7028
](
https://github.com/CocoaPods/CocoaPods/pull/7028
)
[
#7028
](
https://github.com/CocoaPods/CocoaPods/pull/7028
)
...
...
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
View file @
cd2ee62f
...
@@ -66,7 +66,7 @@ module Pod
...
@@ -66,7 +66,7 @@ module Pod
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
nil
,
target
,
@xcconfig
)
XCConfigHelper
.
add_settings_for_file_accessors_of_target
(
nil
,
target
,
@xcconfig
)
target
.
file_accessors
.
each
do
|
file_accessor
|
target
.
file_accessors
.
each
do
|
file_accessor
|
@xcconfig
.
merge!
(
file_accessor
.
spec_consumer
.
pod_target_xcconfig
)
@xcconfig
.
merge!
(
file_accessor
.
spec_consumer
.
pod_target_xcconfig
)
if
@test_xcconfig
==
file_accessor
.
spec
.
test_specification?
end
end
XCConfigHelper
.
add_target_specific_settings
(
target
,
@xcconfig
)
XCConfigHelper
.
add_target_specific_settings
(
target
,
@xcconfig
)
recursive_dependent_targets
=
target
.
recursive_dependent_targets
recursive_dependent_targets
=
target
.
recursive_dependent_targets
...
...
spec/spec_helper.rb
View file @
cd2ee62f
...
@@ -127,12 +127,18 @@ end
...
@@ -127,12 +127,18 @@ end
def
fixture_pod_target
(
spec_or_name
,
target_definitions
=
[])
def
fixture_pod_target
(
spec_or_name
,
target_definitions
=
[])
spec
=
spec_or_name
.
is_a?
(
Pod
::
Specification
)
?
spec_or_name
:
fixture_spec
(
spec_or_name
)
spec
=
spec_or_name
.
is_a?
(
Pod
::
Specification
)
?
spec_or_name
:
fixture_spec
(
spec_or_name
)
fixture_pod_target_with_specs
([
spec
],
target_definitions
)
end
def
fixture_pod_target_with_specs
(
specs
,
target_definitions
=
[])
target_definitions
<<
fixture_target_definition
if
target_definitions
.
empty?
target_definitions
<<
fixture_target_definition
if
target_definitions
.
empty?
target_definitions
.
each
{
|
td
|
td
.
store_pod
(
spec
.
name
)
}
target_definitions
.
each
{
|
td
|
specs
.
each
{
|
spec
|
td
.
store_pod
(
spec
.
name
)
}
}
Pod
::
PodTarget
.
new
([
spec
],
target_definitions
,
config
.
sandbox
).
tap
do
|
pod_target
|
Pod
::
PodTarget
.
new
(
specs
,
target_definitions
,
config
.
sandbox
).
tap
do
|
pod_target
|
pod_target
.
file_accessors
<<
fixture_file_accessor
(
spec
,
pod_target
.
platform
)
specs
.
each
do
|
spec
|
consumer
=
spec
.
consumer
(
pod_target
.
platform
)
pod_target
.
file_accessors
<<
fixture_file_accessor
(
spec
,
pod_target
.
platform
)
pod_target
.
spec_consumers
<<
consumer
consumer
=
spec
.
consumer
(
pod_target
.
platform
)
pod_target
.
spec_consumers
<<
consumer
end
end
end
end
end
...
...
spec/unit/generator/xcconfig/pod_xcconfig_spec.rb
View file @
cd2ee62f
...
@@ -142,16 +142,34 @@ module Pod
...
@@ -142,16 +142,34 @@ module Pod
@banana_pod_target
=
fixture_pod_target
(
@banana_spec
)
@banana_pod_target
=
fixture_pod_target
(
@banana_spec
)
@coconut_spec
=
fixture_spec
(
'coconut-lib/CoconutLib.podspec'
)
@coconut_spec
=
fixture_spec
(
'coconut-lib/CoconutLib.podspec'
)
@coconut_pod_target
=
fixture_pod_target
(
@coconut_spec
)
@coconut_test_spec
=
@coconut_spec
.
test_specs
.
first
@coconut_pod_target
=
fixture_pod_target_with_specs
([
@coconut_spec
,
@coconut_test_spec
])
@consumer
=
@coconut_pod_target
.
spec_consumers
.
first
@consumer
=
@coconut_pod_target
.
spec_consumers
.
first
@test_consumer
=
@coconut_pod_target
.
spec_consumers
[
1
]
@podfile
=
@coconut_pod_target
.
podfile
@podfile
=
@coconut_pod_target
.
podfile
file_accessors
=
[
Sandbox
::
FileAccessor
.
new
(
fixture
(
'coconut-lib'
),
@consumer
)]
file_accessors
=
[
Sandbox
::
FileAccessor
.
new
(
fixture
(
'coconut-lib'
),
@consumer
)
,
Sandbox
::
FileAccessor
.
new
(
fixture
(
'coconut-lib'
),
@test_consumer
)
]
@coconut_pod_target
.
stubs
(
:file_accessors
).
returns
(
file_accessors
)
@coconut_pod_target
.
stubs
(
:file_accessors
).
returns
(
file_accessors
)
end
end
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
=
PodXCConfig
.
new
(
@coconut_pod_target
,
false
)
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'GCC_PREPROCESSOR_DEFINITIONS'
].
should
==
'$(inherited) COCOAPODS=1 NON_TEST_FLAG=1'
end
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
=
PodXCConfig
.
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
it
'includes correct other ld flags'
do
generator
=
PodXCConfig
.
new
(
@coconut_pod_target
,
true
)
generator
=
PodXCConfig
.
new
(
@coconut_pod_target
,
true
)
xcconfig
=
generator
.
generate
xcconfig
=
generator
.
generate
...
...
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