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
77d34d36
Unverified
Commit
77d34d36
authored
Mar 20, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Mar 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7064 from abbeycode/issue7040
Update validator to stream output as xcodebuild runs
parents
1680ff7b
3760780d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
CHANGELOG.md
CHANGELOG.md
+4
-0
validator.rb
lib/cocoapods/validator.rb
+7
-12
validator_spec.rb
spec/unit/validator_spec.rb
+12
-11
No files found.
CHANGELOG.md
View file @
77d34d36
...
@@ -60,6 +60,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -60,6 +60,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
*
Document format of POD_NAMES in pod update
*
Document format of POD_NAMES in pod update
[
mrh-is
](
https://github.com/mrh-is
)
[
mrh-is
](
https://github.com/mrh-is
)
*
Update validator to stream output as xcodebuild runs
[
abbeycode
](
https://github.com/abbeycode
)
[
#7040
](
https://github.com/CocoaPods/CocoaPods/issues/7040
)
##### Bug Fixes
##### Bug Fixes
...
...
lib/cocoapods/validator.rb
View file @
77d34d36
...
@@ -576,7 +576,6 @@ module Pod
...
@@ -576,7 +576,6 @@ module Pod
UI
.
warn
"Skipping compilation with `xcodebuild` because target contains no sources.
\n
"
.
yellow
UI
.
warn
"Skipping compilation with `xcodebuild` because target contains no sources.
\n
"
.
yellow
else
else
output
=
xcodebuild
(
'build'
,
scheme
,
'Release'
)
output
=
xcodebuild
(
'build'
,
scheme
,
'Release'
)
UI
.
puts
output
parsed_output
=
parse_xcodebuild_output
(
output
)
parsed_output
=
parse_xcodebuild_output
(
output
)
translate_output_to_linter_messages
(
parsed_output
)
translate_output_to_linter_messages
(
parsed_output
)
end
end
...
@@ -600,7 +599,6 @@ module Pod
...
@@ -600,7 +599,6 @@ module Pod
consumer
.
spec
.
test_specs
.
each
do
|
test_spec
|
consumer
.
spec
.
test_specs
.
each
do
|
test_spec
|
scheme
=
pod_target
.
native_target_for_spec
(
test_spec
)
scheme
=
pod_target
.
native_target_for_spec
(
test_spec
)
output
=
xcodebuild
(
'test'
,
scheme
,
'Debug'
)
output
=
xcodebuild
(
'test'
,
scheme
,
'Debug'
)
UI
.
puts
output
parsed_output
=
parse_xcodebuild_output
(
output
)
parsed_output
=
parse_xcodebuild_output
(
output
)
translate_output_to_linter_messages
(
parsed_output
)
translate_output_to_linter_messages
(
parsed_output
)
end
end
...
@@ -873,25 +871,22 @@ module Pod
...
@@ -873,25 +871,22 @@ module Pod
command
+=
Fourflusher
::
SimControl
.
new
.
destination
(
:oldest
,
'tvOS'
,
deployment_target
)
command
+=
Fourflusher
::
SimControl
.
new
.
destination
(
:oldest
,
'tvOS'
,
deployment_target
)
end
end
output
,
status
=
_xcodebuild
(
command
)
begin
_xcodebuild
(
command
,
true
)
unless
status
.
success?
rescue
=>
e
message
=
'Returned an unsuccessful exit code.'
message
=
'Returned an unsuccessful exit code.'
message
+=
' You can use `--verbose` for more information.'
unless
config
.
verbose?
message
+=
' You can use `--verbose` for more information.'
unless
config
.
verbose?
error
(
'xcodebuild'
,
message
)
error
(
'xcodebuild'
,
message
)
e
.
message
end
end
output
end
end
# Executes the given command in the current working directory.
# Executes the given command in the current working directory.
#
#
# @return [(String, Status)] The output of the given command and its
# @return [String] The output of the given command
# resulting status.
#
#
def
_xcodebuild
(
command
)
def
_xcodebuild
(
command
,
raise_on_failure
=
false
)
UI
.
puts
'xcodebuild '
<<
command
.
join
(
' '
)
if
config
.
verbose
Executable
.
execute_command
(
'xcodebuild'
,
command
,
raise_on_failure
)
Executable
.
capture_command
(
'xcodebuild'
,
command
,
:capture
=>
:merge
)
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
spec/unit/validator_spec.rb
View file @
77d34d36
...
@@ -491,9 +491,7 @@ module Pod
...
@@ -491,9 +491,7 @@ module Pod
git
=
Executable
.
which
(
:git
)
git
=
Executable
.
which
(
:git
)
Executable
.
stubs
(
:which
).
with
(
'git'
).
returns
(
git
)
Executable
.
stubs
(
:which
).
with
(
'git'
).
returns
(
git
)
Executable
.
stubs
(
:which
).
with
(
:xcrun
)
Executable
.
stubs
(
:which
).
with
(
:xcrun
)
status
=
mock
validator
.
stubs
(
:_xcodebuild
).
raises
(
Informative
)
status
.
stubs
(
:success?
).
returns
(
false
)
validator
.
stubs
(
:_xcodebuild
).
returns
([
'Output'
,
status
])
validator
.
validate
validator
.
validate
first
=
validator
.
results
.
map
(
&
:to_s
).
first
first
=
validator
.
results
.
map
(
&
:to_s
).
first
first
.
should
.
include
'[xcodebuild] Returned an unsuccessful exit code'
first
.
should
.
include
'[xcodebuild] Returned an unsuccessful exit code'
...
@@ -504,6 +502,7 @@ module Pod
...
@@ -504,6 +502,7 @@ module Pod
require
'fourflusher'
require
'fourflusher'
Fourflusher
::
SimControl
.
any_instance
.
stubs
(
:destination
).
returns
([
'-destination'
,
'id=XXX'
])
Fourflusher
::
SimControl
.
any_instance
.
stubs
(
:destination
).
returns
([
'-destination'
,
'id=XXX'
])
Validator
.
any_instance
.
unstub
(
:xcodebuild
)
Validator
.
any_instance
.
unstub
(
:xcodebuild
)
PodTarget
.
any_instance
.
stubs
(
:should_build?
).
returns
(
true
)
validator
=
Validator
.
new
(
podspec_path
,
config
.
sources_manager
.
master
.
map
(
&
:url
))
validator
=
Validator
.
new
(
podspec_path
,
config
.
sources_manager
.
master
.
map
(
&
:url
))
validator
.
stubs
(
:check_file_patterns
)
validator
.
stubs
(
:check_file_patterns
)
validator
.
stubs
(
:validate_url
)
validator
.
stubs
(
:validate_url
)
...
@@ -512,16 +511,17 @@ module Pod
...
@@ -512,16 +511,17 @@ module Pod
Executable
.
stubs
(
:which
).
with
(
'git'
).
returns
(
git
)
Executable
.
stubs
(
:which
).
with
(
'git'
).
returns
(
git
)
Executable
.
stubs
(
:capture_command
).
with
(
'git'
,
[
'config'
,
'--get'
,
'remote.origin.url'
],
:capture
=>
:out
).
returns
([
'https://github.com/CocoaPods/Specs.git'
])
Executable
.
stubs
(
:capture_command
).
with
(
'git'
,
[
'config'
,
'--get'
,
'remote.origin.url'
],
:capture
=>
:out
).
returns
([
'https://github.com/CocoaPods/Specs.git'
])
Executable
.
stubs
(
:which
).
with
(
:xcrun
)
Executable
.
stubs
(
:which
).
with
(
:xcrun
)
Executable
.
expects
(
:execute_command
).
with
{
|
executable
,
command
,
_
|
executable
==
'git'
&&
command
.
first
==
'clone'
}.
once
# Command should include the pod target 'JSONKit' instead of the 'App' target.
# Command should include the pod target 'JSONKit' instead of the 'App' target.
command
=
[
'clean'
,
'build'
,
'-workspace'
,
File
.
join
(
validator
.
validation_dir
,
'App.xcworkspace'
),
'-scheme'
,
'JSONKit'
,
'-configuration'
,
'Release'
]
command
=
[
'clean'
,
'build'
,
'-workspace'
,
File
.
join
(
validator
.
validation_dir
,
'App.xcworkspace'
),
'-scheme'
,
'JSONKit'
,
'-configuration'
,
'Release'
]
args
=
%w(CODE_SIGN_IDENTITY=)
args
=
%w(CODE_SIGN_IDENTITY=)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple TV 1080p'
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple TV 1080p'
)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'iPhone 4s'
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'iPhone 4s'
)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple Watch - 38mm'
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple Watch - 38mm'
)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
validator
.
validate
validator
.
validate
end
end
...
@@ -536,15 +536,16 @@ module Pod
...
@@ -536,15 +536,16 @@ module Pod
Executable
.
stubs
(
:which
).
with
(
'git'
).
returns
(
git
)
Executable
.
stubs
(
:which
).
with
(
'git'
).
returns
(
git
)
Executable
.
stubs
(
:capture_command
).
with
(
'git'
,
[
'config'
,
'--get'
,
'remote.origin.url'
],
:capture
=>
:out
).
returns
([
'https://github.com/CocoaPods/Specs.git'
])
Executable
.
stubs
(
:capture_command
).
with
(
'git'
,
[
'config'
,
'--get'
,
'remote.origin.url'
],
:capture
=>
:out
).
returns
([
'https://github.com/CocoaPods/Specs.git'
])
Executable
.
stubs
(
:which
).
with
(
:xcrun
)
Executable
.
stubs
(
:which
).
with
(
:xcrun
)
Executable
.
expects
(
:execute_command
).
with
{
|
executable
,
command
,
_
|
executable
==
'git'
&&
command
.
first
==
'clone'
}.
once
command
=
[
'clean'
,
'build'
,
'-workspace'
,
File
.
join
(
validator
.
validation_dir
,
'App.xcworkspace'
),
'-scheme'
,
'App'
,
'-configuration'
,
'Release'
]
command
=
[
'clean'
,
'build'
,
'-workspace'
,
File
.
join
(
validator
.
validation_dir
,
'App.xcworkspace'
),
'-scheme'
,
'App'
,
'-configuration'
,
'Release'
]
args
=
%w(CODE_SIGN_IDENTITY=)
args
=
%w(CODE_SIGN_IDENTITY=)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple TV 1080p'
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple TV 1080p'
)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'iPhone 4s'
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'iPhone 4s'
)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple Watch - 38mm'
)
args
=
%w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
+
Fourflusher
::
SimControl
.
new
.
destination
(
'Apple Watch - 38mm'
)
Executable
.
expects
(
:
capture_command
).
with
(
'xcodebuild'
,
command
+
args
,
:capture
=>
:merge
).
once
.
returns
([
''
,
stub
(
:success?
=>
true
)]
)
Executable
.
expects
(
:
execute_command
).
with
(
'xcodebuild'
,
command
+
args
,
true
).
once
.
returns
(
''
)
validator
.
validate
validator
.
validate
end
end
...
...
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