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
a3a350df
Unverified
Commit
a3a350df
authored
Jul 26, 2019
by
Jason Simmons
Committed by
GitHub
Jul 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devicelab: replace the FLUTTER_ENGINE environment variable with the new local engine flags (#36969)
parent
9b150f13
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
62 deletions
+18
-62
flutter_run_test.dart
dev/devicelab/bin/tasks/flutter_run_test.dart
+1
-2
utils.dart
dev/devicelab/lib/framework/utils.dart
+11
-47
hot_mode_tests.dart
dev/devicelab/lib/tasks/hot_mode_tests.dart
+2
-3
microbenchmarks.dart
dev/devicelab/lib/tasks/microbenchmarks.dart
+1
-2
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+0
-3
run_without_leak.dart
dev/devicelab/lib/tasks/run_without_leak.dart
+1
-2
web_dev_mode_tests.dart
dev/devicelab/lib/tasks/web_dev_mode_tests.dart
+2
-3
No files found.
dev/devicelab/bin/tasks/flutter_run_test.dart
View file @
a3a350df
...
...
@@ -36,11 +36,10 @@ Future<TaskResult> createFlutterRunTask() async {
final
List
<
String
>
options
=
<
String
>[
'-t'
,
runTestSource
.
absolute
.
path
,
'-d'
,
device
.
deviceId
,
];
setLocalEngineOptionIfNecessary
(
options
);
await
inDirectory
<
void
>(
flutterGalleryDir
,
()
async
{
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
...
options
]
,
flutterCommandArgs
(
'run'
,
options
)
,
environment:
null
,
);
final
Completer
<
void
>
finished
=
Completer
<
void
>();
...
...
dev/devicelab/lib/framework/utils.dart
View file @
a3a350df
...
...
@@ -13,8 +13,6 @@ import 'package:path/path.dart' as path;
import
'package:process/process.dart'
;
import
'package:stack_trace/stack_trace.dart'
;
import
'adb.dart'
;
/// Virtual current working directory, which affect functions, such as [exec].
String
cwd
=
Directory
.
current
.
path
;
...
...
@@ -347,17 +345,21 @@ Future<String> eval(
return
output
.
toString
().
trimRight
();
}
Future
<
int
>
flutter
(
String
command
,
{
List
<
String
>
options
=
const
<
String
>[],
bool
canFail
=
false
,
// as in, whether failures are ok. False means that they are fatal.
Map
<
String
,
String
>
environment
,
})
{
final
List
<
String
>
args
=
<
String
>[
List
<
String
>
flutterCommandArgs
(
String
command
,
List
<
String
>
options
)
{
return
<
String
>[
command
,
if
(
localEngine
!=
null
)
...<
String
>[
'--local-engine'
,
localEngine
],
if
(
localEngineSrcPath
!=
null
)
...<
String
>[
'--local-engine-src-path'
,
localEngineSrcPath
],
...
options
,
];
}
Future
<
int
>
flutter
(
String
command
,
{
List
<
String
>
options
=
const
<
String
>[],
bool
canFail
=
false
,
// as in, whether failures are ok. False means that they are fatal.
Map
<
String
,
String
>
environment
,
})
{
final
List
<
String
>
args
=
flutterCommandArgs
(
command
,
options
);
return
exec
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
args
,
canFail:
canFail
,
environment:
environment
);
}
...
...
@@ -369,12 +371,7 @@ Future<String> evalFlutter(String command, {
Map
<
String
,
String
>
environment
,
StringBuffer
stderr
,
// if not null, the stderr will be written here.
})
{
final
List
<
String
>
args
=
<
String
>[
command
,
if
(
localEngine
!=
null
)
...<
String
>[
'--local-engine'
,
localEngine
],
if
(
localEngineSrcPath
!=
null
)
...<
String
>[
'--local-engine-src-path'
,
localEngineSrcPath
],
...
options
,
];
final
List
<
String
>
args
=
flutterCommandArgs
(
command
,
options
);
return
eval
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
args
,
canFail:
canFail
,
environment:
environment
,
stderr:
stderr
);
}
...
...
@@ -593,39 +590,6 @@ Uri parseServiceUri(String line, {
return
matches
.
isEmpty
?
null
:
Uri
.
parse
(
matches
[
0
].
group
(
0
));
}
/// If FLUTTER_ENGINE environment variable is set then we need to pass
/// correct --local-engine setting too.
void
setLocalEngineOptionIfNecessary
(
List
<
String
>
options
,
[
String
flavor
])
{
if
(
Platform
.
environment
[
'FLUTTER_ENGINE'
]
!=
null
)
{
if
(
flavor
==
null
)
{
// If engine flavor was not specified explicitly then scan options looking
// for flags that specify the engine flavor (--release, --profile or
// --debug). Default flavor to debug if no flags were found.
const
Map
<
String
,
String
>
optionToFlavor
=
<
String
,
String
>{
'--release'
:
'release'
,
'--debug'
:
'debug'
,
'--profile'
:
'profile'
,
};
for
(
String
option
in
options
)
{
flavor
=
optionToFlavor
[
option
];
if
(
flavor
!=
null
)
{
break
;
}
}
flavor
??=
'debug'
;
}
const
Map
<
DeviceOperatingSystem
,
String
>
osNames
=
<
DeviceOperatingSystem
,
String
>{
DeviceOperatingSystem
.
ios
:
'ios'
,
DeviceOperatingSystem
.
android
:
'android'
,
};
options
.
add
(
'--local-engine=
${osNames[deviceOperatingSystem]}
_
$flavor
'
);
}
}
/// Checks that the file exists, otherwise throws a [FileSystemException].
void
checkFileExists
(
String
file
)
{
if
(!
exists
(
File
(
file
)))
{
...
...
dev/devicelab/lib/tasks/hot_mode_tests.dart
View file @
a3a350df
...
...
@@ -25,7 +25,6 @@ TaskFunction createHotModeTest() {
final
List
<
String
>
options
=
<
String
>[
'--hot'
,
'-d'
,
device
.
deviceId
,
'--benchmark'
,
'--verbose'
,
'--resident'
,
];
setLocalEngineOptionIfNecessary
(
options
);
int
hotReloadCount
=
0
;
Map
<
String
,
dynamic
>
twoReloadsData
;
Map
<
String
,
dynamic
>
freshRestartReloadsData
;
...
...
@@ -39,7 +38,7 @@ TaskFunction createHotModeTest() {
{
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
...
options
]
,
flutterCommandArgs
(
'run'
,
options
)
,
environment:
null
,
);
...
...
@@ -93,7 +92,7 @@ TaskFunction createHotModeTest() {
{
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
...
options
]
,
flutterCommandArgs
(
'run'
,
options
)
,
environment:
null
,
);
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
...
...
dev/devicelab/lib/tasks/microbenchmarks.dart
View file @
a3a350df
...
...
@@ -35,7 +35,6 @@ TaskFunction createMicrobenchmarkTask() {
'-d'
,
device
.
deviceId
,
];
setLocalEngineOptionIfNecessary
(
options
);
options
.
add
(
benchmarkPath
);
return
await
_startFlutter
(
options:
options
,
...
...
@@ -70,7 +69,7 @@ Future<Process> _startFlutter({
bool
canFail
=
false
,
Map
<
String
,
String
>
environment
,
})
{
final
List
<
String
>
args
=
<
String
>[
'run'
,
...
options
]
;
final
List
<
String
>
args
=
flutterCommandArgs
(
'run'
,
options
)
;
return
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
args
,
environment:
environment
);
}
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
a3a350df
...
...
@@ -335,7 +335,6 @@ class CompileTest {
options
.
add
(
'android-arm'
);
break
;
}
setLocalEngineOptionIfNecessary
(
options
);
final
String
compileLog
=
await
evalFlutter
(
'build'
,
options:
options
);
watch
.
stop
();
...
...
@@ -357,7 +356,6 @@ class CompileTest {
final
Stopwatch
watch
=
Stopwatch
();
int
releaseSizeInBytes
;
final
List
<
String
>
options
=
<
String
>[
'--release'
];
setLocalEngineOptionIfNecessary
(
options
);
final
Map
<
String
,
dynamic
>
metrics
=
<
String
,
dynamic
>{};
switch
(
deviceOperatingSystem
)
{
...
...
@@ -405,7 +403,6 @@ class CompileTest {
await
flutter
(
'clean'
);
final
Stopwatch
watch
=
Stopwatch
();
final
List
<
String
>
options
=
<
String
>[
'--debug'
];
setLocalEngineOptionIfNecessary
(
options
);
switch
(
deviceOperatingSystem
)
{
case
DeviceOperatingSystem
.
ios
:
options
.
insert
(
0
,
'ios'
);
...
...
dev/devicelab/lib/tasks/run_without_leak.dart
View file @
a3a350df
...
...
@@ -19,12 +19,11 @@ TaskFunction createRunWithoutLeakTest(dynamic dir) {
final
List
<
String
>
options
=
<
String
>[
'-d'
,
device
.
deviceId
,
'--verbose'
,
];
setLocalEngineOptionIfNecessary
(
options
);
int
exitCode
;
await
inDirectory
<
void
>(
dir
,
()
async
{
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
...
options
]
,
flutterCommandArgs
(
'run'
,
options
)
,
environment:
null
,
);
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
...
...
dev/devicelab/lib/tasks/web_dev_mode_tests.dart
View file @
a3a350df
...
...
@@ -19,7 +19,6 @@ TaskFunction createWebDevModeTest() {
final
List
<
String
>
options
=
<
String
>[
'--hot'
,
'-d'
,
'chrome'
,
'--verbose'
,
'--resident'
,
'--target=lib/main.dart'
,
];
setLocalEngineOptionIfNecessary
(
options
);
int
hotRestartCount
=
0
;
await
inDirectory
<
void
>(
flutterDirectory
,
()
async
{
rmTree
(
_editedFlutterGalleryDir
);
...
...
@@ -37,7 +36,7 @@ TaskFunction createWebDevModeTest() {
await
packagesGet
.
exitCode
;
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
...
options
]
,
flutterCommandArgs
(
'run'
,
options
)
,
environment:
<
String
,
String
>{
'FLUTTER_WEB'
:
'true'
,
},
...
...
@@ -96,7 +95,7 @@ TaskFunction createWebDevModeTest() {
{
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
...
options
]
,
flutterCommandArgs
(
'run'
,
options
)
,
environment:
<
String
,
String
>{
'FLUTTER_WEB'
:
'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