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
9c41e570
Unverified
Commit
9c41e570
authored
Apr 07, 2020
by
Jonah Williams
Committed by
GitHub
Apr 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] migrate engine location check (#54208)
parent
2ce36f61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+18
-3
No files found.
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
9c41e570
...
@@ -9,6 +9,7 @@ import 'package:args/command_runner.dart';
...
@@ -9,6 +9,7 @@ import 'package:args/command_runner.dart';
import
'package:completion/completion.dart'
;
import
'package:completion/completion.dart'
;
import
'package:file/file.dart'
;
import
'package:file/file.dart'
;
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
import
'package:package_config/package_config.dart'
;
import
'../artifacts.dart'
;
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/common.dart'
;
...
@@ -278,7 +279,7 @@ class FlutterCommandRunner extends CommandRunner<void> {
...
@@ -278,7 +279,7 @@ class FlutterCommandRunner extends CommandRunner<void> {
Cache
.
flutterRoot
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
absolute
(
flutterRoot
));
Cache
.
flutterRoot
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
absolute
(
flutterRoot
));
// Set up the tooling configuration.
// Set up the tooling configuration.
final
String
enginePath
=
_findEnginePath
(
topLevelResults
);
final
String
enginePath
=
await
_findEnginePath
(
topLevelResults
);
if
(
enginePath
!=
null
)
{
if
(
enginePath
!=
null
)
{
contextOverrides
.
addAll
(<
Type
,
dynamic
>{
contextOverrides
.
addAll
(<
Type
,
dynamic
>{
Artifacts:
Artifacts
.
getLocalEngine
(
_findEngineBuildPath
(
topLevelResults
,
enginePath
)),
Artifacts:
Artifacts
.
getLocalEngine
(
_findEngineBuildPath
(
topLevelResults
,
enginePath
)),
...
@@ -348,13 +349,27 @@ class FlutterCommandRunner extends CommandRunner<void> {
...
@@ -348,13 +349,27 @@ class FlutterCommandRunner extends CommandRunner<void> {
return
null
;
return
null
;
}
}
String
_findEnginePath
(
ArgResults
globalResults
)
{
Future
<
String
>
_findEnginePath
(
ArgResults
globalResults
)
async
{
String
engineSourcePath
=
globalResults
[
'local-engine-src-path'
]
as
String
String
engineSourcePath
=
globalResults
[
'local-engine-src-path'
]
as
String
??
globals
.
platform
.
environment
[
kFlutterEngineEnvironmentVariableName
];
??
globals
.
platform
.
environment
[
kFlutterEngineEnvironmentVariableName
];
if
(
engineSourcePath
==
null
&&
globalResults
[
'local-engine'
]
!=
null
)
{
if
(
engineSourcePath
==
null
&&
globalResults
[
'local-engine'
]
!=
null
)
{
try
{
try
{
Uri
engineUri
=
PackageMap
(
PackageMap
.
globalPackagesPath
,
fileSystem:
globals
.
fs
).
map
[
kFlutterEnginePackageName
];
final
PackageConfig
packageConfig
=
await
loadPackageConfigUri
(
globals
.
fs
.
file
(
PackageMap
.
globalPackagesPath
).
absolute
.
uri
,
onError:
(
dynamic
error
)
{
// Errors indicate the automatic detection will fail, but are not
// fatal.
},
loader:
(
Uri
uri
)
{
final
File
file
=
globals
.
fs
.
file
(
uri
);
if
(!
file
.
existsSync
())
{
return
null
;
}
return
file
.
readAsBytes
();
},
);
Uri
engineUri
=
packageConfig
[
kFlutterEnginePackageName
]?.
packageUriRoot
;
// Skip if sky_engine is the self-contained one.
// Skip if sky_engine is the self-contained one.
if
(
engineUri
!=
null
&&
globals
.
fs
.
identicalSync
(
globals
.
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'cache'
,
'pkg'
,
kFlutterEnginePackageName
,
'lib'
),
engineUri
.
path
))
{
if
(
engineUri
!=
null
&&
globals
.
fs
.
identicalSync
(
globals
.
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'cache'
,
'pkg'
,
kFlutterEnginePackageName
,
'lib'
),
engineUri
.
path
))
{
engineUri
=
null
;
engineUri
=
null
;
...
...
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