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
c83d24d5
Unverified
Commit
c83d24d5
authored
Apr 17, 2018
by
Todd Volkert
Committed by
GitHub
Apr 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always add a DevFS asset entry for the font manifest (#16650)
The engine expects it to always be there.
parent
9e0a6107
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
asset.dart
packages/flutter_tools/lib/src/asset.dart
+1
-3
asset_bundle_package_fonts_test.dart
...s/flutter_tools/test/asset_bundle_package_fonts_test.dart
+2
-2
asset_bundle_package_test.dart
packages/flutter_tools/test/asset_bundle_package_test.dart
+10
-3
No files found.
packages/flutter_tools/lib/src/asset.dart
View file @
c83d24d5
...
...
@@ -204,8 +204,6 @@ class _ManifestAssetBundle implements AssetBundle {
entries
[
_kAssetManifestJson
]
=
_createAssetManifest
(
assetVariants
);
if
(
fonts
.
isNotEmpty
)
entries
[
_kFontManifestJson
]
=
new
DevFSStringContent
(
json
.
encode
(
fonts
));
// TODO(ianh): Only do the following line if we've changed packages or if our LICENSE file changed
...
...
packages/flutter_tools/test/asset_bundle_package_fonts_test.dart
View file @
c83d24d5
...
...
@@ -123,8 +123,8 @@ $fontsSection
final
AssetBundle
bundle
=
AssetBundleFactory
.
instance
.
createBundle
();
await
bundle
.
build
(
manifestPath:
'pubspec.yaml'
);
expect
(
bundle
.
entries
.
length
,
2
);
// LICENSE, Asse
tManifest
expect
(
bundle
.
entries
.
containsKey
(
'FontManifest.json'
),
fals
e
);
expect
(
bundle
.
entries
.
length
,
3
);
// LICENSE, AssetManifest, Fon
tManifest
expect
(
bundle
.
entries
.
containsKey
(
'FontManifest.json'
),
isTru
e
);
});
testUsingContext
(
'App font uses font file from package'
,
()
async
{
...
...
packages/flutter_tools/test/asset_bundle_package_test.dart
View file @
c83d24d5
...
...
@@ -124,12 +124,16 @@ $assetsSection
final
AssetBundle
bundle
=
AssetBundleFactory
.
instance
.
createBundle
();
await
bundle
.
build
(
manifestPath:
'pubspec.yaml'
);
expect
(
bundle
.
entries
.
length
,
2
);
// LICENSE, Asse
tManifest
expect
(
bundle
.
entries
.
length
,
3
);
// LICENSE, AssetManifest, Fon
tManifest
const
String
expectedAssetManifest
=
'{}'
;
expect
(
utf8
.
decode
(
await
bundle
.
entries
[
'AssetManifest.json'
].
contentsAsBytes
()),
expectedAssetManifest
,
);
expect
(
utf8
.
decode
(
await
bundle
.
entries
[
'FontManifest.json'
].
contentsAsBytes
()),
'[]'
,
);
});
testUsingContext
(
'No assets are bundled when the package has an asset that is not listed'
,
()
async
{
...
...
@@ -144,13 +148,16 @@ $assetsSection
final
AssetBundle
bundle
=
AssetBundleFactory
.
instance
.
createBundle
();
await
bundle
.
build
(
manifestPath:
'pubspec.yaml'
);
expect
(
bundle
.
entries
.
length
,
2
);
// LICENSE, Asse
tManifest
expect
(
bundle
.
entries
.
length
,
3
);
// LICENSE, AssetManifest, Fon
tManifest
const
String
expectedAssetManifest
=
'{}'
;
expect
(
utf8
.
decode
(
await
bundle
.
entries
[
'AssetManifest.json'
].
contentsAsBytes
()),
expectedAssetManifest
,
);
expect
(
utf8
.
decode
(
await
bundle
.
entries
[
'FontManifest.json'
].
contentsAsBytes
()),
'[]'
,
);
});
testUsingContext
(
'One asset is bundled when the package has and lists one asset its pubspec'
,
()
async
{
...
...
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