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
f7d94fef
Commit
f7d94fef
authored
Feb 22, 2016
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update status messages when unsupported devices are detected by the tools
parent
d0e2d1a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
devices.dart
packages/flutter_tools/lib/src/commands/devices.dart
+2
-6
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+12
-2
No files found.
packages/flutter_tools/lib/src/commands/devices.dart
View file @
f7d94fef
...
...
@@ -30,10 +30,8 @@ class DevicesCommand extends FlutterCommand {
printStatus
(
'
${devices.length}
connected
${pluralize('device', devices.length)}
:'
);
for
(
Device
device
in
devices
)
{
printStatus
(
'
\t
${_supportIndicator(device)}
:
${device.name}
(
${device.id}
)'
);
if
(!
device
.
isSupported
())
{
printStatus
(
"
\t\t
${device.supportMessage()}
"
);
}
String
supportIndicator
=
device
.
isSupported
()
?
''
:
'- unsupported'
;
printStatus
(
'
${device.name}
(
${device.id}
)
${supportIndicator}
'
);
}
}
...
...
@@ -41,6 +39,4 @@ class DevicesCommand extends FlutterCommand {
}
}
String
_supportIndicator
(
Device
device
)
=>
device
.
isSupported
()
?
"[✔] Supported"
:
"[✘] Unsupported"
;
String
pluralize
(
String
word
,
int
count
)
=>
count
==
1
?
word
:
word
+
's'
;
packages/flutter_tools/lib/src/commands/run.dart
View file @
f7d94fef
...
...
@@ -17,6 +17,7 @@ import '../globals.dart';
import
'../runner/flutter_command.dart'
;
import
'../toolchain.dart'
;
import
'apk.dart'
;
import
'devices.dart'
;
import
'install.dart'
;
import
'stop.dart'
;
...
...
@@ -173,6 +174,7 @@ Future<int> startApp(
}
bool
startedSomething
=
false
;
int
unsupportedCount
=
0
;
for
(
Device
device
in
devices
.
all
)
{
ApplicationPackage
package
=
applicationPackages
.
getPackageForPlatform
(
device
.
platform
);
...
...
@@ -180,7 +182,8 @@ Future<int> startApp(
continue
;
if
(!
device
.
isSupported
())
{
printStatus
(
"Skipping unsupported device:
${device.name}
"
);
printStatus
(
"Skipping unsupported device '
${device.name}
'.
${device.supportMessage()}
"
);
unsupportedCount
++;
continue
;
}
...
...
@@ -220,7 +223,14 @@ Future<int> startApp(
}
if
(!
startedSomething
)
{
printError
(
'Unable to run application. Please ensure that a supported device/simulator is connected.'
);
int
connected
=
devices
.
all
.
where
((
device
)
=>
device
.
isConnected
()).
length
;
String
message
=
'Unable to run application'
;
if
(
connected
==
0
)
{
message
+=
' - no connected devices.'
;
}
else
if
(
unsupportedCount
!=
0
)
{
message
+=
' -
$unsupportedCount
unsupported
${pluralize('device', unsupportedCount)}
connected'
;
}
printError
(
message
);
}
return
startedSomething
?
0
:
2
;
...
...
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