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
1d018387
Commit
1d018387
authored
Aug 09, 2016
by
Devon Carew
Committed by
GitHub
Aug 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the apk building part of flutter run optional (#5301)
parent
4f9e329f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
10 deletions
+29
-10
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+4
-1
hot.dart
packages/flutter_tools/lib/src/hot.dart
+10
-4
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+5
-1
run.dart
packages/flutter_tools/lib/src/run.dart
+10
-4
No files found.
packages/flutter_tools/lib/src/commands/run.dart
View file @
1d018387
...
...
@@ -56,6 +56,9 @@ class RunCommand extends RunCommandBase {
help:
'Start in a paused mode and wait for a debugger to connect.'
);
argParser
.
addOption
(
'debug-port'
,
help:
'Listen to the given port for a debug connection (defaults to
$kDefaultObservatoryPort
).'
);
argParser
.
addFlag
(
'build'
,
defaultsTo:
true
,
help:
'If necessary, build the app before running.'
);
usesPubOption
();
// Option to enable hot reloading.
...
...
@@ -171,7 +174,7 @@ class RunCommand extends RunCommandBase {
);
}
return
runner
.
run
(
route:
route
);
return
runner
.
run
(
route:
route
,
shouldBuild:
argResults
[
'build'
]
);
}
}
...
...
packages/flutter_tools/lib/src/hot.dart
View file @
1d018387
...
...
@@ -76,12 +76,17 @@ class HotRunner extends ResidentRunner {
}
@override
Future
<
int
>
run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
})
{
Future
<
int
>
run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
,
bool
shouldBuild:
true
})
{
// Don't let uncaught errors kill the process.
return
runZoned
(()
{
return
_run
(
observatoryPortCompleter:
observatoryPortCompleter
,
route:
route
route:
route
,
shouldBuild:
shouldBuild
);
},
onError:
(
dynamic
error
,
StackTrace
stackTrace
)
{
printError
(
'Exception from flutter run:
$error
'
,
stackTrace
);
...
...
@@ -90,7 +95,8 @@ class HotRunner extends ResidentRunner {
Future
<
int
>
_run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
String
route
,
bool
shouldBuild:
true
})
async
{
_mainPath
=
findMainDartFile
(
target
);
if
(!
FileSystemEntity
.
isFileSync
(
_mainPath
))
{
...
...
@@ -113,7 +119,7 @@ class HotRunner extends ResidentRunner {
}
// TODO(devoncarew): We shouldn't have to do type checks here.
if
(
device
is
AndroidDevice
)
{
if
(
shouldBuild
&&
device
is
AndroidDevice
)
{
printTrace
(
'Running build command.'
);
int
result
=
await
buildApk
(
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
1d018387
...
...
@@ -31,7 +31,11 @@ abstract class ResidentRunner {
StreamSubscription
<
String
>
_loggingSubscription
;
/// Start the app and keep the process running during its lifetime.
Future
<
int
>
run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
});
Future
<
int
>
run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
,
bool
shouldBuild:
true
});
Future
<
bool
>
restart
();
...
...
packages/flutter_tools/lib/src/run.dart
View file @
1d018387
...
...
@@ -36,14 +36,19 @@ class RunAndStayResident extends ResidentRunner {
bool
benchmark
;
@override
Future
<
int
>
run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
})
{
Future
<
int
>
run
({
Completer
<
int
>
observatoryPortCompleter
,
String
route
,
bool
shouldBuild:
true
})
{
// Don't let uncaught errors kill the process.
return
runZoned
(()
{
return
_run
(
traceStartup:
traceStartup
,
benchmark:
benchmark
,
observatoryPortCompleter:
observatoryPortCompleter
,
route:
route
route:
route
,
shouldBuild:
shouldBuild
);
},
onError:
(
dynamic
error
,
StackTrace
stackTrace
)
{
printError
(
'Exception from flutter run:
$error
'
,
stackTrace
);
...
...
@@ -88,7 +93,8 @@ class RunAndStayResident extends ResidentRunner {
bool
traceStartup:
false
,
bool
benchmark:
false
,
Completer
<
int
>
observatoryPortCompleter
,
String
route
String
route
,
bool
shouldBuild:
true
})
async
{
_mainPath
=
findMainDartFile
(
target
);
if
(!
FileSystemEntity
.
isFileSync
(
_mainPath
))
{
...
...
@@ -113,7 +119,7 @@ class RunAndStayResident extends ResidentRunner {
Stopwatch
startTime
=
new
Stopwatch
()..
start
();
// TODO(devoncarew): We shouldn't have to do type checks here.
if
(
device
is
AndroidDevice
)
{
if
(
shouldBuild
&&
device
is
AndroidDevice
)
{
printTrace
(
'Running build command.'
);
int
result
=
await
buildApk
(
...
...
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