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
0407b396
Commit
0407b396
authored
May 31, 2016
by
Boris Bügling
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5410 from CocoaPods/seg-init-use-product-type
[Init] Use target product type to determine test targets
parents
9462f9f7
c9116172
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
6 deletions
+31
-6
CHANGELOG.md
CHANGELOG.md
+6
-1
Gemfile.lock
Gemfile.lock
+1
-1
init.rb
lib/cocoapods/command/init.rb
+1
-1
init_spec.rb
spec/functional/command/init_spec.rb
+23
-3
No files found.
CHANGELOG.md
View file @
0407b396
...
...
@@ -38,10 +38,15 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Marc Boquet
](
https://github.com/marcboquet
)
[
#5294
](
https://github.com/CocoaPods/CocoaPods/issues/5294
)
*
Guarding from crash if pod lib create has a + character in the name.
*
Guarding from crash if pod lib create has a + character in the name.
[
William Entriken
](
https://github.com/fulldecent
)
[
CocoaPods/pod-template#69
](
https://github.com/CocoaPods/pod-template/issues/69
)
*
Use target product types to determine whether a target is a test target when
running
`pod init`
.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#5378
](
https://github.com/CocoaPods/CocoaPods/issues/5378
)
## 1.0.0 (2016-05-10)
...
...
Gemfile.lock
View file @
0407b396
...
...
@@ -24,7 +24,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision:
480e2f99e5e9315b8032854a9530aa500761e13
8
revision:
cd03f259381c2b6317e60f088adff6b6e2b01d6
8
branch: master
specs:
xcodeproj (1.0.0)
...
...
lib/cocoapods/command/init.rb
View file @
0407b396
...
...
@@ -63,7 +63,7 @@ module Pod
# Split out the targets into app and test targets
test_targets
,
app_targets
=
project
.
native_targets
.
sort_by
{
|
t
|
t
.
name
.
downcase
}.
partition
{
|
t
|
t
.
name
=~
/test/i
}
partition
(
&
:test_target_type?
)
app_targets
.
each
do
|
app_target
|
test_targets_for_app
=
test_targets
.
select
do
|
target
|
...
...
spec/functional/command/init_spec.rb
View file @
0407b396
...
...
@@ -90,8 +90,8 @@ module Pod
Dir
.
chdir
(
temporary_directory
)
do
project
=
Xcodeproj
::
Project
.
new
(
temporary_directory
+
'test.xcodeproj'
)
project
.
new_target
(
:application
,
'App'
,
:ios
)
project
.
new_target
(
:
application
,
'AppTests'
,
:ios
)
project
.
new_target
(
:
application
,
'AppFeatureTests'
,
:ios
)
project
.
new_target
(
:
unit_test_bundle
,
'AppTests'
,
:ios
)
project
.
new_target
(
:
ui_test_bundle
,
'AppFeatureTests'
,
:ios
)
project
.
new_target
(
:application
,
'Swifty App'
,
:osx
,
nil
,
nil
,
:swift
)
project
.
save
...
...
@@ -142,7 +142,7 @@ module Pod
project
=
Xcodeproj
::
Project
.
new
(
temporary_directory
+
'test.xcodeproj'
)
project
.
new_target
(
:application
,
'App'
,
:ios
)
project
.
new_target
(
:
application
,
'AppTests'
,
:ios
)
project
.
new_target
(
:
unit_test_bundle
,
'AppTests'
,
:ios
)
project
.
save
run_command
(
'init'
)
...
...
@@ -152,6 +152,26 @@ module Pod
end
end
it
'does not treat non-test targets as test targets'
do
Dir
.
chdir
(
temporary_directory
)
do
tmp_templates_dir
=
Pathname
.
pwd
+
'templates_dir'
tmp_templates_dir
.
mkpath
config
.
stubs
(
:templates_dir
).
returns
(
tmp_templates_dir
)
open
(
config
.
default_test_podfile_path
,
'w'
)
{
|
f
|
f
<<
"pod 'Kiwi'"
}
project
=
Xcodeproj
::
Project
.
new
(
temporary_directory
+
'test.xcodeproj'
)
project
.
new_target
(
:application
,
'Test'
,
:ios
)
project
.
new_target
(
:application
,
'Test Test Test'
,
:ios
)
project
.
save
run_command
(
'init'
)
config
.
podfile
.
target_definitions
[
'Test'
].
dependencies
.
should
.
be
.
empty
config
.
podfile
.
target_definitions
[
'Test Test Test'
].
dependencies
.
should
.
be
.
empty
end
end
it
'does not include default test pods if there are no test targets'
do
Dir
.
chdir
(
temporary_directory
)
do
tmp_templates_dir
=
Pathname
.
pwd
+
'templates_dir'
...
...
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