Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a80e5c20
Commit
a80e5c20
authored
Mar 15, 2017
by
John McCutchan
Committed by
GitHub
Mar 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a doctor check for host executable compatibility (#8798)
Fixes #6207
parent
2166ea5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+32
-0
No files found.
packages/flutter_tools/lib/src/doctor.dart
View file @
a80e5c20
...
...
@@ -9,6 +9,7 @@ import 'package:archive/archive.dart';
import
'android/android_studio_validator.dart'
;
import
'android/android_workflow.dart'
;
import
'artifacts.dart'
;
import
'base/common.dart'
;
import
'base/context.dart'
;
import
'base/file_system.dart'
;
...
...
@@ -67,6 +68,7 @@ class Doctor {
if
(
_validators
==
null
)
{
_validators
=
<
DoctorValidator
>[];
_validators
.
add
(
new
_FlutterValidator
());
_validators
.
add
(
new
_HostExecutableValidator
());
if
(
_androidWorkflow
.
appliesToHostPlatform
)
_validators
.
add
(
_androidWorkflow
);
...
...
@@ -244,6 +246,36 @@ class _FlutterValidator extends DoctorValidator {
}
}
class
_HostExecutableValidator
extends
DoctorValidator
{
_HostExecutableValidator
()
:
super
(
'Host Executable Compatibility'
);
bool
_genSnapshotRuns
(
String
genSnapshotPath
)
{
final
int
kExpectedExitCode
=
255
;
try
{
return
processManager
.
runSync
(<
String
>[
genSnapshotPath
]).
exitCode
==
kExpectedExitCode
;
}
catch
(
error
)
{
return
false
;
}
}
@override
Future
<
ValidationResult
>
validate
()
async
{
final
String
genSnapshotPath
=
artifacts
.
getArtifactPath
(
Artifact
.
genSnapshot
);
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
final
bool
hostExecutablesRun
=
_genSnapshotRuns
(
genSnapshotPath
);
final
ValidationType
valid
=
hostExecutablesRun
?
ValidationType
.
installed
:
ValidationType
.
missing
;
if
(
hostExecutablesRun
)
{
messages
.
add
(
new
ValidationMessage
(
'Downloaded executables execute on host'
));
}
else
{
messages
.
add
(
new
ValidationMessage
.
error
(
'Downloaded executables cannot execute on host. See https://github.com/flutter/flutter/issues/6207 for more information'
));
}
return
new
ValidationResult
(
valid
,
messages
);
}
}
class
NoIdeValidator
extends
DoctorValidator
{
NoIdeValidator
()
:
super
(
'Flutter IDE Support'
);
...
...
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