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
0778a2aa
Unverified
Commit
0778a2aa
authored
Mar 21, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Mar 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7522 from paulz/fix_test_spec
fix pod lib lint errors for pod with test_spec
parents
2fe815c9
690f9a56
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
3 deletions
+31
-3
CHANGELOG.md
CHANGELOG.md
+5
-0
pod_target_installer.rb
...ller/xcode/pods_project_generator/pod_target_installer.rb
+9
-1
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
+4
-2
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+4
-0
No files found.
CHANGELOG.md
View file @
0778a2aa
...
...
@@ -70,6 +70,11 @@ 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
)
*
Prevent
`xcassets`
compilation from stomping over the apps
`xcassets`
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7003
](
https://github.com/CocoaPods/CocoaPods/issues/7003
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
View file @
0778a2aa
...
...
@@ -274,7 +274,10 @@ module Pod
# requires frameworks. For tests we always use the test target name as the product name
# irrelevant to whether we use frameworks or not.
configuration
.
build_settings
[
'PRODUCT_NAME'
]
=
name
configuration
.
build_settings
[
'PRODUCT_MODULE_NAME'
]
=
name
# Use xcode default product module name, which is $(PRODUCT_NAME:c99extidentifier)
# this gives us always valid name that is distinct from the parent spec module name
# which allow tests to use either import or @testable import to access the parent framework
configuration
.
build_settings
.
delete
(
'PRODUCT_MODULE_NAME'
)
# We must codesign iOS XCTest bundles that contain binary frameworks to allow them to be launchable in the simulator
unless
target
.
platform
==
:osx
configuration
.
build_settings
[
'CODE_SIGNING_REQUIRED'
]
=
'YES'
...
...
@@ -288,6 +291,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 @
0778a2aa
...
...
@@ -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 @
0778a2aa
...
...
@@ -199,10 +199,11 @@ module Pod
native_test_target
.
product_reference
.
name
.
should
==
'CoconutLib-Unit-Tests'
native_test_target
.
build_configurations
.
each
do
|
bc
|
bc
.
build_settings
[
'PRODUCT_NAME'
].
should
==
'CoconutLib-Unit-Tests'
bc
.
build_settings
[
'PRODUCT_MODULE_NAME'
].
should
==
'CoconutLib-Unit-Tests'
bc
.
build_settings
[
'PRODUCT_MODULE_NAME'
].
should
.
be
.
nil
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
...
...
@@ -217,10 +218,11 @@ module Pod
native_test_target
.
product_reference
.
name
.
should
==
'CoconutLib-Unit-Tests'
native_test_target
.
build_configurations
.
each
do
|
bc
|
bc
.
build_settings
[
'PRODUCT_NAME'
].
should
==
'CoconutLib-Unit-Tests'
bc
.
build_settings
[
'PRODUCT_MODULE_NAME'
].
should
==
'CoconutLib-Unit-Tests'
bc
.
build_settings
[
'PRODUCT_MODULE_NAME'
].
should
.
be
.
nil
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 @
0778a2aa
...
...
@@ -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