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
4563109b
Commit
4563109b
authored
Nov 10, 2017
by
Nickolay Tarbayev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install resource bundles and embed frameworks for every test target's configuration
parent
71211b50
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
CHANGELOG.md
CHANGELOG.md
+4
-0
pod_target_installer.rb
...ller/xcode/pods_project_generator/pod_target_installer.rb
+6
-2
pod_target_installer_spec.rb
...xcode/pods_project_generator/pod_target_installer_spec.rb
+28
-0
No files found.
CHANGELOG.md
View file @
4563109b
...
...
@@ -18,6 +18,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Install resource bundles and embed frameworks for every test target's configuration
[
Nickolay Tarbayev
](
https://github.com/tarbayev
)
[
#7012
](
https://github.com/CocoaPods/CocoaPods/issues/7012
)
*
Set
`SWIFT_VERSION`
to test native targets during validation
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7216
](
https://github.com/CocoaPods/CocoaPods/pull/7216
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
View file @
4563109b
...
...
@@ -402,7 +402,9 @@ module Pod
def
create_test_target_copy_resources_script
(
test_type
)
path
=
target
.
copy_resources_script_path_for_test_type
(
test_type
)
pod_targets
=
target
.
all_test_dependent_targets
resource_paths_by_config
=
{
'Debug'
=>
pod_targets
.
flat_map
(
&
:resource_paths
)
}
resource_paths_by_config
=
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
resources_by_config
|
resources_by_config
[
config
]
=
pod_targets
.
flat_map
(
&
:resource_paths
)
end
generator
=
Generator
::
CopyResourcesScript
.
new
(
resource_paths_by_config
,
target
.
platform
)
update_changed_file
(
generator
,
path
)
add_file_to_support_group
(
path
)
...
...
@@ -418,7 +420,9 @@ module Pod
def
create_test_target_embed_frameworks_script
(
test_type
)
path
=
target
.
embed_frameworks_script_path_for_test_type
(
test_type
)
pod_targets
=
target
.
all_test_dependent_targets
framework_paths_by_config
=
{
'Debug'
=>
pod_targets
.
flat_map
(
&
:framework_paths
)
}
framework_paths_by_config
=
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
paths_by_config
|
paths_by_config
[
config
]
=
pod_targets
.
flat_map
(
&
:framework_paths
)
end
generator
=
Generator
::
EmbedFrameworksScript
.
new
(
framework_paths_by_config
)
update_changed_file
(
generator
,
path
)
add_file_to_support_group
(
path
)
...
...
spec/unit/installer/xcode/pods_project_generator/pod_target_installer_spec.rb
View file @
4563109b
...
...
@@ -277,6 +277,34 @@ module Pod
end
end
it
'creates embed frameworks script for test target'
do
@coconut_pod_target
.
stubs
(
:requires_frameworks?
=>
true
)
@installer
.
install!
script_path
=
@coconut_pod_target
.
embed_frameworks_script_path_for_test_type
(
:unit
)
script
=
script_path
.
read
@coconut_pod_target
.
user_build_configurations
.
keys
.
each
do
|
configuration
|
script
.
should
.
include
<<-
eos
.
strip_heredoc
if [[ "$CONFIGURATION" == "
#{
configuration
}
" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/CoconutLib/CoconutLib.framework"
fi
eos
end
end
it
'adds the resources bundles for to the copy resources script for test target'
do
@coconut_spec
.
test_specs
.
first
.
resource_bundle
=
{
'CoconutLibTestResources'
=>
[
'Tests/*.xib'
]
}
@installer
.
install!
script_path
=
@coconut_pod_target
.
copy_resources_script_path_for_test_type
(
:unit
)
script
=
script_path
.
read
@coconut_pod_target
.
user_build_configurations
.
keys
.
each
do
|
configuration
|
script
.
should
.
include
<<-
eos
.
strip_heredoc
if [[ "$CONFIGURATION" == "
#{
configuration
}
" ]]; then
install_resource "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLibTestResources.bundle"
fi
eos
end
end
describe
'app host generation'
do
before
do
@coconut_spec
.
test_specs
.
first
.
requires_app_host
=
true
...
...
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