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
1b2049ef
Commit
1b2049ef
authored
Oct 20, 2016
by
Jason Simmons
Committed by
GitHub
Oct 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix app refresh on Android in no-hot-reload mode (#6435)
Also remove the obsolete "flutter refresh" command
parent
a97cf4b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
86 deletions
+8
-86
executable.dart
packages/flutter_tools/lib/executable.dart
+0
-2
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+8
-1
refresh.dart
packages/flutter_tools/lib/src/commands/refresh.dart
+0
-83
No files found.
packages/flutter_tools/lib/executable.dart
View file @
1b2049ef
...
...
@@ -28,7 +28,6 @@ import 'src/commands/logs.dart';
import
'src/commands/setup.dart'
;
import
'src/commands/packages.dart'
;
import
'src/commands/precache.dart'
;
import
'src/commands/refresh.dart'
;
import
'src/commands/run.dart'
;
import
'src/commands/run_mojo.dart'
;
import
'src/commands/screenshot.dart'
;
...
...
@@ -73,7 +72,6 @@ Future<Null> main(List<String> args) async {
..
addCommand
(
new
LogsCommand
())
..
addCommand
(
new
PackagesCommand
())
..
addCommand
(
new
PrecacheCommand
())
..
addCommand
(
new
RefreshCommand
())
..
addCommand
(
new
RunCommand
(
verboseHelp:
verboseHelp
))
..
addCommand
(
new
RunMojoCommand
(
hidden:
!
verboseHelp
))
..
addCommand
(
new
ScreenshotCommand
())
...
...
packages/flutter_tools/lib/src/android/android_device.dart
View file @
1b2049ef
...
...
@@ -13,9 +13,11 @@ import '../application_package.dart';
import
'../base/os.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../dart/package_map.dart'
;
import
'../device.dart'
;
import
'../flx.dart'
as
flx
;
import
'../globals.dart'
;
import
'../toolchain.dart'
;
import
'../vmservice.dart'
;
import
'../protocol_discovery.dart'
;
import
'adb.dart'
;
...
...
@@ -461,7 +463,12 @@ class AndroidDevice extends Device {
try
{
String
snapshotPath
=
path
.
join
(
tempDir
.
path
,
'snapshot_blob.bin'
);
int
result
=
await
flx
.
createSnapshot
(
mainPath:
mainPath
,
snapshotPath:
snapshotPath
);
int
result
=
await
flx
.
createSnapshot
(
snapshotterPath:
tools
.
getHostToolPath
(
HostTool
.
SkySnapshot
),
mainPath:
mainPath
,
snapshotPath:
snapshotPath
,
packages:
path
.
absolute
(
PackageMap
.
globalPackagesPath
),
);
if
(
result
!=
0
)
{
printError
(
'Failed to run the Flutter compiler; exit code:
$result
'
);
...
...
packages/flutter_tools/lib/src/commands/refresh.dart
deleted
100644 → 0
View file @
a97cf4b5
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:path/path.dart'
as
path
;
import
'../android/android_device.dart'
;
import
'../application_package.dart'
;
import
'../cache.dart'
;
import
'../flx.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command.dart'
;
class
RefreshCommand
extends
FlutterCommand
{
@override
final
String
name
=
'refresh'
;
@override
final
String
description
=
'Build and deploy the Dart code in a Flutter app (Android only).'
;
RefreshCommand
()
{
usesTargetOption
();
argParser
.
addOption
(
'activity'
,
help:
'The Android activity that will be told to reload the Flutter code.'
);
}
Device
device
;
@override
Future
<
int
>
verifyThenRunCommand
()
async
{
if
(!
commandValidator
())
return
1
;
device
=
await
findTargetDevice
(
androidOnly:
true
);
if
(
device
==
null
)
return
1
;
return
super
.
verifyThenRunCommand
();
}
@override
Future
<
int
>
runCommand
()
async
{
Directory
tempDir
=
await
Directory
.
systemTemp
.
createTemp
(
'flutter_tools'
);
try
{
String
snapshotPath
=
path
.
join
(
tempDir
.
path
,
'snapshot_blob.bin'
);
int
result
=
await
createSnapshot
(
mainPath:
targetFile
,
snapshotPath:
snapshotPath
);
if
(
result
!=
0
)
{
printError
(
'Failed to run the Flutter compiler. Exit code:
$result
'
);
return
result
;
}
Cache
.
releaseLockEarly
();
String
activity
=
argResults
[
'activity'
];
if
(
activity
==
null
)
{
AndroidApk
apk
=
applicationPackages
.
getPackageForPlatform
(
device
.
platform
);
if
(
apk
!=
null
)
{
activity
=
apk
.
launchActivity
;
}
else
{
printError
(
'Unable to find the activity to be refreshed.'
);
return
1
;
}
}
AndroidDevice
androidDevice
=
device
;
bool
success
=
await
androidDevice
.
refreshSnapshot
(
activity
,
snapshotPath
);
if
(!
success
)
{
printError
(
'Error refreshing snapshot on
$device
.'
);
return
1
;
}
return
0
;
}
finally
{
tempDir
.
deleteSync
(
recursive:
true
);
}
}
}
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