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
61291aee
Unverified
Commit
61291aee
authored
Dec 10, 2018
by
Jonah Williams
Committed by
GitHub
Dec 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure lastBuildTimestamp is set before early return (#25058)
parent
243222c0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
asset.dart
packages/flutter_tools/lib/src/asset.dart
+4
-2
asset_test.dart
packages/flutter_tools/test/asset_test.dart
+18
-0
.gitignore
...ages/flutter_tools/test/data/fuchsia_test/main/.gitignore
+1
-0
.packages
packages/flutter_tools/test/data/fuchsia_test/main/.packages
+1
-0
No files found.
packages/flutter_tools/lib/src/asset.dart
View file @
61291aee
...
@@ -107,6 +107,10 @@ class _ManifestAssetBundle implements AssetBundle {
...
@@ -107,6 +107,10 @@ class _ManifestAssetBundle implements AssetBundle {
if
(
flutterManifest
==
null
)
if
(
flutterManifest
==
null
)
return
1
;
return
1
;
// If the last build time isn't set before this early return, empty pubspecs will
// hang on hot reload, as the incremental dill files will never be copied to the
// device.
_lastBuildTimestamp
=
DateTime
.
now
();
if
(
flutterManifest
.
isEmpty
)
{
if
(
flutterManifest
.
isEmpty
)
{
entries
[
_assetManifestJson
]
=
DevFSStringContent
(
'{}'
);
entries
[
_assetManifestJson
]
=
DevFSStringContent
(
'{}'
);
return
0
;
return
0
;
...
@@ -114,8 +118,6 @@ class _ManifestAssetBundle implements AssetBundle {
...
@@ -114,8 +118,6 @@ class _ManifestAssetBundle implements AssetBundle {
final
String
assetBasePath
=
fs
.
path
.
dirname
(
fs
.
path
.
absolute
(
manifestPath
));
final
String
assetBasePath
=
fs
.
path
.
dirname
(
fs
.
path
.
absolute
(
manifestPath
));
_lastBuildTimestamp
=
DateTime
.
now
();
final
PackageMap
packageMap
=
PackageMap
(
packagesPath
);
final
PackageMap
packageMap
=
PackageMap
(
packagesPath
);
// The _assetVariants map contains an entry for each asset listed
// The _assetVariants map contains an entry for each asset listed
...
...
packages/flutter_tools/test/asset_test.dart
View file @
61291aee
...
@@ -41,8 +41,26 @@ void main() {
...
@@ -41,8 +41,26 @@ void main() {
await
getValueAsString
(
'FontManifest.json'
,
asset
),
await
getValueAsString
(
'FontManifest.json'
,
asset
),
'[{"family":"packages/font/test_font","fonts":[{"asset":"packages/font/test_font_file"}]}]'
,
'[{"family":"packages/font/test_font","fonts":[{"asset":"packages/font/test_font_file"}]}]'
,
);
);
expect
(
asset
.
wasBuiltOnce
(),
true
);
});
});
testUsingContext
(
'handles empty pubspec with .packages'
,
()
async
{
final
String
dataPath
=
fs
.
path
.
join
(
getFlutterRoot
(),
'packages'
,
'flutter_tools'
,
'test'
,
'data'
,
'fuchsia_test'
,
);
final
AssetBundle
asset
=
AssetBundleFactory
.
instance
.
createBundle
();
await
asset
.
build
(
manifestPath
:
fs
.
path
.
join
(
dataPath
,
'main'
,
'pubspec.yaml'
),
// file doesn't exist
packagesPath:
fs
.
path
.
join
(
dataPath
,
'main'
,
'.packages'
),
includeDefaultFonts:
false
,
);
expect
(
asset
.
wasBuiltOnce
(),
true
);
});
});
});
}
}
...
...
packages/flutter_tools/test/data/fuchsia_test/main/.gitignore
0 → 100644
View file @
61291aee
!.packages
\ No newline at end of file
packages/flutter_tools/test/data/fuchsia_test/main/.packages
0 → 100644
View file @
61291aee
testo:lib/
\ No newline at end of file
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