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
7d5f3928
Unverified
Commit
7d5f3928
authored
Apr 12, 2021
by
Jenn Magder
Committed by
GitHub
Apr 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache location of Java binary in devicelab tests (#80172)
parent
23404dfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
utils.dart
dev/devicelab/lib/framework/utils.dart
+15
-9
No files found.
dev/devicelab/lib/framework/utils.dart
View file @
7d5f3928
...
...
@@ -501,16 +501,22 @@ Future<int> dart(List<String> args) => exec(dartBin, <String>['--disable-dart-de
/// Returns a future that completes with a path suitable for JAVA_HOME
/// or with null, if Java cannot be found.
Future
<
String
>
findJavaHome
()
async
{
final
Iterable
<
String
>
hits
=
grep
(
'Java binary at: '
,
from:
await
evalFlutter
(
'doctor'
,
options:
<
String
>[
'-v'
]),
);
if
(
hits
.
isEmpty
)
return
null
;
final
String
javaBinary
=
hits
.
first
.
split
(
': '
).
last
;
// javaBinary == /some/path/to/java/home/bin/java
return
path
.
dirname
(
path
.
dirname
(
javaBinary
));
if
(
_javaHome
==
null
)
{
final
Iterable
<
String
>
hits
=
grep
(
'Java binary at: '
,
from:
await
evalFlutter
(
'doctor'
,
options:
<
String
>[
'-v'
]),
);
if
(
hits
.
isEmpty
)
return
null
;
final
String
javaBinary
=
hits
.
first
.
split
(
': '
)
.
last
;
// javaBinary == /some/path/to/java/home/bin/java
_javaHome
=
path
.
dirname
(
path
.
dirname
(
javaBinary
));
}
return
_javaHome
;
}
String
_javaHome
;
Future
<
T
>
inDirectory
<
T
>(
dynamic
directory
,
Future
<
T
>
Function
()
action
)
async
{
final
String
previousCwd
=
cwd
;
...
...
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