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
7dd752ac
Unverified
Commit
7dd752ac
authored
Mar 18, 2021
by
Jenn Magder
Committed by
GitHub
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trace logging to local engine path autodetection (#78482)
parent
4d4af7ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
local_engine.dart
packages/flutter_tools/lib/src/runner/local_engine.dart
+6
-1
local_engine_test.dart
...er_tools/test/general.shard/runner/local_engine_test.dart
+10
-3
No files found.
packages/flutter_tools/lib/src/runner/local_engine.dart
View file @
7dd752ac
...
...
@@ -66,6 +66,7 @@ class LocalEngineLocator {
Uri
engineUri
=
packageConfig
[
kFlutterEnginePackageName
]?.
packageUriRoot
;
final
String
cachedPath
=
_fileSystem
.
path
.
join
(
_flutterRoot
,
'bin'
,
'cache'
,
'pkg'
,
kFlutterEnginePackageName
,
'lib'
);
if
(
engineUri
!=
null
&&
_fileSystem
.
identicalSync
(
cachedPath
,
engineUri
.
path
))
{
_logger
.
printTrace
(
'Local engine auto-detection sky_engine in
$packagePath
is the same version in bin/cache.'
);
engineUri
=
null
;
}
// If sky_engine is specified and the engineSourcePath not set, try to
...
...
@@ -92,7 +93,8 @@ class LocalEngineLocator {
);
}
}
}
on
FileSystemException
{
}
on
FileSystemException
catch
(
e
)
{
_logger
.
printTrace
(
'Local engine auto-detection file exception:
$e
'
);
engineSourcePath
=
null
;
}
// If engineSourcePath is still not set, try to determine it by flutter root.
...
...
@@ -109,7 +111,10 @@ class LocalEngineLocator {
}
if
(
engineSourcePath
!=
null
)
{
_logger
.
printTrace
(
'Local engine source at
$engineSourcePath
'
);
return
_findEngineBuildPath
(
localEngine
,
engineSourcePath
);
}
else
if
(
localEngine
!=
null
)
{
_logger
.
printTrace
(
'Could not find engine source for
$localEngine
, skipping'
);
}
return
null
;
}
...
...
packages/flutter_tools/test/general.shard/runner/local_engine_test.dart
View file @
7dd752ac
...
...
@@ -36,10 +36,11 @@ void main() {
.
file
(
'bin/cache/pkg/sky_engine/lib'
)
.
createSync
(
recursive:
true
);
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
LocalEngineLocator
localEngineLocator
=
LocalEngineLocator
(
fileSystem:
fileSystem
,
flutterRoot:
''
,
logger:
BufferLogger
.
test
()
,
logger:
logger
,
userMessages:
UserMessages
(),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
);
...
...
@@ -51,6 +52,7 @@ void main() {
targetEngine:
'/arbitrary/engine/src/out/ios_debug'
,
),
);
expect
(
logger
.
traceText
,
contains
(
'Local engine source at /arbitrary/engine/src'
));
// Verify that this also works if the sky_engine path is a symlink to the engine root.
fileSystem
.
link
(
'/symlink'
).
createSync
(
kArbitraryEngineRoot
);
...
...
@@ -65,6 +67,7 @@ void main() {
targetEngine:
'/symlink/src/out/ios_debug'
,
),
);
expect
(
logger
.
traceText
,
contains
(
'Local engine source at /symlink/src'
));
});
testWithoutContext
(
'works if --local-engine is specified and --local-engine-src-path '
...
...
@@ -74,10 +77,11 @@ void main() {
fileSystem
.
directory
(
'
$kArbitraryEngineRoot
/src/out/ios_debug'
).
createSync
(
recursive:
true
);
fileSystem
.
directory
(
'
$kArbitraryEngineRoot
/src/out/host_debug'
).
createSync
(
recursive:
true
);
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
LocalEngineLocator
localEngineLocator
=
LocalEngineLocator
(
fileSystem:
fileSystem
,
flutterRoot:
''
,
logger:
BufferLogger
.
test
()
,
logger:
logger
,
userMessages:
UserMessages
(),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
);
...
...
@@ -89,6 +93,7 @@ void main() {
targetEngine:
'/arbitrary/engine/src/out/ios_debug'
,
),
);
expect
(
logger
.
traceText
,
contains
(
'Local engine source at /arbitrary/engine/src'
));
});
testWithoutContext
(
'works if --local-engine is specified and --local-engine-src-path '
...
...
@@ -105,10 +110,11 @@ void main() {
.
file
(
'bin/cache/pkg/sky_engine/lib'
)
.
createSync
(
recursive:
true
);
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
LocalEngineLocator
localEngineLocator
=
LocalEngineLocator
(
fileSystem:
fileSystem
,
flutterRoot:
'flutter/flutter'
,
logger:
BufferLogger
.
test
()
,
logger:
logger
,
userMessages:
UserMessages
(),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
);
...
...
@@ -120,6 +126,7 @@ void main() {
targetEngine:
'flutter/engine/src/out/ios_debug'
,
),
);
expect
(
logger
.
traceText
,
contains
(
'Local engine source at flutter/engine/src'
));
});
}
...
...
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