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
690f9a56
Commit
690f9a56
authored
Mar 20, 2018
by
Paul Zabelin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a generic Info.plist file for test targets
parent
534a2bf5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
0 deletions
+21
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
pod_target_installer.rb
...ller/xcode/pods_project_generator/pod_target_installer.rb
+5
-0
pod_target.rb
lib/cocoapods/target/pod_target.rb
+9
-0
pod_target_installer_spec.rb
...xcode/pods_project_generator/pod_target_installer_spec.rb
+2
-0
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+4
-0
No files found.
CHANGELOG.md
View file @
690f9a56
...
...
@@ -60,6 +60,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Create a generic Info.plist file for test targets
Use xcode default
`PRODUCT_MODULE_NAME`
for generated test targets
[
Paul Zabelin
](
https://github.com/paulz
)
[
#7506
](
https://github.com/CocoaPods/CocoaPods/issues/7506
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
View file @
690f9a56
...
...
@@ -294,6 +294,11 @@ module Pod
create_test_target_embed_frameworks_script
(
test_type
)
create_test_target_copy_resources_script
(
test_type
)
# Generate vanila Info.plist for test target similar to the one xcode gererates for new test target.
# This creates valid test bundle accessible at the runtime, allowing tests to load bundle resources
# defined in podspec.
create_info_plist_file
(
target
.
info_plist_path_for_test_type
(
test_type
),
native_test_target
,
'1.0'
,
target
.
platform
,
:bndl
)
target
.
test_native_targets
<<
native_test_target
end
end
...
...
lib/cocoapods/target/pod_target.rb
View file @
690f9a56
...
...
@@ -436,6 +436,15 @@ module Pod
support_files_dir
+
"
#{
test_target_label
(
test_type
)
}
-frameworks.sh"
end
# @param [Symbol] test_type
# The test type this Info.plist path is for.
#
# @return [Pathname] The absolute path of the Info.plist for the given test type.
#
def
info_plist_path_for_test_type
(
test_type
)
support_files_dir
+
"
#{
test_target_label
(
test_type
)
}
-Info.plist"
end
# @return [Pathname] the absolute path of the prefix header file.
#
def
prefix_header_path
...
...
spec/unit/installer/xcode/pods_project_generator/pod_target_installer_spec.rb
View file @
690f9a56
...
...
@@ -203,6 +203,7 @@ module Pod
bc
.
build_settings
[
'CODE_SIGNING_REQUIRED'
].
should
==
'YES'
bc
.
build_settings
[
'CODE_SIGNING_ALLOWED'
].
should
==
'YES'
bc
.
build_settings
[
'CODE_SIGN_IDENTITY'
].
should
==
'iPhone Developer'
bc
.
build_settings
[
'INFOPLIST_FILE'
].
should
==
'Target Support Files/CoconutLib/CoconutLib-Unit-Tests-Info.plist'
end
native_test_target
.
symbol_type
.
should
==
:unit_test_bundle
@coconut_pod_target
.
test_native_targets
.
count
.
should
==
1
...
...
@@ -221,6 +222,7 @@ module Pod
bc
.
build_settings
[
'CODE_SIGNING_REQUIRED'
].
should
.
be
.
nil
bc
.
build_settings
[
'CODE_SIGNING_ALLOWED'
].
should
.
be
.
nil
bc
.
build_settings
[
'CODE_SIGN_IDENTITY'
].
should
==
''
bc
.
build_settings
[
'INFOPLIST_FILE'
].
should
==
'Target Support Files/CoconutLib/CoconutLib-Unit-Tests-Info.plist'
end
native_test_target
.
symbol_type
.
should
==
:unit_test_bundle
@coconut_pod_target2
.
test_native_targets
.
count
.
should
==
1
...
...
spec/unit/target/pod_target_spec.rb
View file @
690f9a56
...
...
@@ -551,6 +551,10 @@ module Pod
@test_pod_target
.
prefix_header_path_for_test_type
(
:unit
).
to_s
.
should
.
include
'Pods/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-prefix.pch'
end
it
'returns correct path for info plist for unit test type'
do
@test_pod_target
.
info_plist_path_for_test_type
(
:unit
).
to_s
.
should
.
include
'Pods/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-Info.plist'
end
it
'returns the correct resource path for test resource bundles'
do
fa
=
Sandbox
::
FileAccessor
.
new
(
nil
,
@test_pod_target
)
fa
.
stubs
(
:resource_bundles
).
returns
(
'TestResourceBundle'
=>
[
Pathname
.
new
(
'Model.xcdatamodeld'
)])
...
...
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