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
2a8b296a
Unverified
Commit
2a8b296a
authored
Mar 15, 2021
by
Gary Qian
Committed by
GitHub
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Deferred components: Encode base module loading units in manifest metadata (#78079)
parent
f3725d0a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
176 additions
and
85 deletions
+176
-85
deferred_components_gen_snapshot_validator.dart
...c/android/deferred_components_gen_snapshot_validator.dart
+17
-8
deferred_components_gen_snapshot_validator_test.dart
...roid/deferred_components_gen_snapshot_validator_test.dart
+159
-77
No files found.
packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart
View file @
2a8b296a
...
...
@@ -107,6 +107,13 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator
}
}
}
for
(
final
LoadingUnit
unit
in
generatedLoadingUnits
)
{
if
(!
mapping
.
containsKey
(
unit
.
id
))
{
// Store an empty string for unassigned loading units,
// indicating that it is in the base component.
mapping
[
unit
.
id
]
=
''
;
}
}
// Encode the mapping as a string.
final
StringBuffer
mappingBuffer
=
StringBuffer
();
for
(
final
int
key
in
mapping
.
keys
)
{
...
...
@@ -120,14 +127,16 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator
// Check for existing metadata entry and see if needs changes.
bool
exists
=
false
;
bool
modified
=
false
;
for
(
final
XmlElement
metaData
in
document
.
findAllElements
(
'meta-data'
))
{
final
String
name
=
metaData
.
getAttribute
(
'android:name'
);
if
(
name
==
_mappingKey
)
{
exists
=
true
;
final
String
storedMappingString
=
metaData
.
getAttribute
(
'android:value'
);
if
(
storedMappingString
!=
encodedMapping
)
{
metaData
.
setAttribute
(
'android:value'
,
encodedMapping
);
modified
=
true
;
for
(
final
XmlElement
application
in
document
.
findAllElements
(
'application'
))
{
for
(
final
XmlElement
metaData
in
application
.
findElements
(
'meta-data'
))
{
final
String
name
=
metaData
.
getAttribute
(
'android:name'
);
if
(
name
==
_mappingKey
)
{
exists
=
true
;
final
String
storedMappingString
=
metaData
.
getAttribute
(
'android:value'
);
if
(
storedMappingString
!=
encodedMapping
)
{
metaData
.
setAttribute
(
'android:value'
,
encodedMapping
);
modified
=
true
;
}
}
}
}
...
...
packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart
View file @
2a8b296a
This diff is collapsed.
Click to expand it.
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