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
1977ee75
Unverified
Commit
1977ee75
authored
Jun 25, 2021
by
Jonah Williams
Committed by
GitHub
Jun 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] ensure kernel paths match between init from dill and persist (#85252)
parent
dc4d808a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
4 deletions
+45
-4
bundle.dart
packages/flutter_tools/lib/src/bundle.dart
+3
-1
bundle_builder_test.dart
...flutter_tools/test/general.shard/bundle_builder_test.dart
+39
-0
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+3
-3
No files found.
packages/flutter_tools/lib/src/bundle.dart
View file @
1977ee75
...
...
@@ -32,8 +32,10 @@ String getDefaultCachedKernelPath({
Config
?
config
,
})
{
final
StringBuffer
buffer
=
StringBuffer
();
final
List
<
String
>
cacheFrontEndOptions
=
extraFrontEndOptions
.
toList
()
..
removeWhere
((
String
arg
)
=>
arg
.
startsWith
(
'--enable-experiment='
)
||
arg
==
'--flutter-widget-cache'
);
buffer
.
writeAll
(
dartDefines
);
buffer
.
writeAll
(
extra
FrontEndOptions
);
buffer
.
writeAll
(
cache
FrontEndOptions
);
String
buildPrefix
=
''
;
if
(
buffer
.
isNotEmpty
)
{
final
String
output
=
buffer
.
toString
();
...
...
packages/flutter_tools/test/general.shard/bundle_builder_test.dart
View file @
1977ee75
...
...
@@ -5,9 +5,11 @@
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/build_system/build_system.dart'
;
import
'package:flutter_tools/src/bundle.dart'
;
import
'package:flutter_tools/src/bundle_builder.dart'
;
import
'package:flutter_tools/src/globals_null_migrated.dart'
as
globals
;
import
'package:flutter_tools/src/project.dart'
;
...
...
@@ -117,4 +119,41 @@ void main() {
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testWithoutContext
(
'--flutter-widget-cache and --enable-experiment are removed from getDefaultCachedKernelPath hash'
,
()
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Config
config
=
Config
.
test
();
expect
(
getDefaultCachedKernelPath
(
trackWidgetCreation:
true
,
dartDefines:
<
String
>[],
extraFrontEndOptions:
<
String
>[
'--enable-experiment=foo'
,
'--flutter-widget-cache'
],
fileSystem:
fileSystem
,
config:
config
,
),
'build/cache.dill.track.dill'
);
expect
(
getDefaultCachedKernelPath
(
trackWidgetCreation:
true
,
dartDefines:
<
String
>[
'foo=bar'
],
extraFrontEndOptions:
<
String
>[
'--enable-experiment=foo'
,
'--flutter-widget-cache'
],
fileSystem:
fileSystem
,
config:
config
,
),
'build/06ad47d8e64bd28de537b62ff85357c4.cache.dill.track.dill'
);
expect
(
getDefaultCachedKernelPath
(
trackWidgetCreation:
false
,
dartDefines:
<
String
>[],
extraFrontEndOptions:
<
String
>[
'--enable-experiment=foo'
,
'--flutter-widget-cache'
],
fileSystem:
fileSystem
,
config:
config
,
),
'build/cache.dill'
);
expect
(
getDefaultCachedKernelPath
(
trackWidgetCreation:
true
,
dartDefines:
<
String
>[],
extraFrontEndOptions:
<
String
>[
'--enable-experiment=foo'
,
'--flutter-widget-cache'
,
'--foo=bar'
],
fileSystem:
fileSystem
,
config:
config
,
),
'build/95b595cca01caa5f0ca0a690339dd7f6.cache.dill.track.dill'
);
});
}
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
1977ee75
...
...
@@ -1555,7 +1555,7 @@ void main() {
BuildMode
.
debug
,
''
,
treeShakeIcons:
false
,
extraFrontEndOptions:
<
String
>[
'--enable-experiment=non-nullable
>
'
]
extraFrontEndOptions:
<
String
>[
'--enable-experiment=non-nullable'
]
)
),
target:
'main.dart'
,
...
...
@@ -1566,7 +1566,7 @@ void main() {
await
residentRunner
.
run
(
enableDevTools:
true
);
expect
(
await
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'
3416d3007730479552122f01c01e326d.
cache.dill'
)).
readAsString
(),
'ABC'
);
'build'
,
'cache.dill'
)).
readAsString
(),
'ABC'
);
}));
testUsingContext
(
'HotRunner does not copy app.dill if a dillOutputPath is given'
,
()
=>
testbed
.
run
(()
async
{
...
...
@@ -1735,7 +1735,7 @@ void main() {
)).
generator
as
DefaultResidentCompiler
;
expect
(
residentCompiler
.
initializeFromDill
,
globals
.
fs
.
path
.
join
(
getBuildDirectory
(),
'8
25b8f791aa86c5057fff6f064542c5
4.cache.dill'
));
globals
.
fs
.
path
.
join
(
getBuildDirectory
(),
'8
0b1a4cf4e7b90e1ab5f72022a0bc62
4.cache.dill'
));
expect
(
residentCompiler
.
librariesSpec
,
globals
.
fs
.
file
(
globals
.
artifacts
.
getHostArtifact
(
HostArtifact
.
flutterWebLibrariesJson
))
.
uri
.
toString
());
...
...
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