forked from firka/flutter
[fuchsia_asset_builder] Write depfile (#82469)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/asset.dart';
|
||||
import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/globals_null_migrated.dart' as globals;
|
||||
|
||||
@@ -30,9 +31,13 @@ void main() {
|
||||
// that AssetBundle with fonts also works on Windows.
|
||||
testUsingContext('app font uses local font file', () async {
|
||||
final AssetBundle asset = AssetBundleFactory.instance.createBundle();
|
||||
final String manifestPath =
|
||||
globals.fs.path.join(dataPath, 'main', 'pubspec.yaml');
|
||||
final String packagesPath =
|
||||
globals.fs.path.join(dataPath, 'main', '.packages');
|
||||
await asset.build(
|
||||
manifestPath : globals.fs.path.join(dataPath, 'main', 'pubspec.yaml'),
|
||||
packagesPath: globals.fs.path.join(dataPath, 'main', '.packages'),
|
||||
manifestPath: manifestPath,
|
||||
packagesPath: packagesPath,
|
||||
);
|
||||
|
||||
expect(asset.entries.containsKey('FontManifest.json'), isTrue);
|
||||
@@ -41,6 +46,16 @@ void main() {
|
||||
'[{"family":"packages/font/test_font","fonts":[{"asset":"packages/font/test_font_file"}]}]',
|
||||
);
|
||||
expect(asset.wasBuiltOnce(), true);
|
||||
expect(
|
||||
asset.inputFiles.map((File f) {
|
||||
return f.path;
|
||||
}),
|
||||
<String>[
|
||||
packagesPath,
|
||||
globals.fs.path.join(dataPath, 'font', 'pubspec.yaml'),
|
||||
manifestPath,
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
testUsingContext('handles empty pubspec with .packages', () async {
|
||||
@@ -54,10 +69,17 @@ void main() {
|
||||
);
|
||||
final AssetBundle asset = AssetBundleFactory.instance.createBundle();
|
||||
await asset.build(
|
||||
manifestPath : globals.fs.path.join(dataPath, 'main', 'pubspec.yaml'), // file doesn't exist
|
||||
manifestPath: globals.fs.path
|
||||
.join(dataPath, 'main', 'pubspec.yaml'), // file doesn't exist
|
||||
packagesPath: globals.fs.path.join(dataPath, 'main', '.packages'),
|
||||
);
|
||||
expect(asset.wasBuiltOnce(), true);
|
||||
expect(
|
||||
asset.inputFiles.map((File f) {
|
||||
return f.path;
|
||||
}),
|
||||
<String>[],
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user