Unverified Commit e5118376 authored by J-P Nurmi's avatar J-P Nurmi Committed by GitHub

[flutter_tools] deploy version.json asset on Linux (#69920)

parent f373c307
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import '../../artifacts.dart'; import '../../artifacts.dart';
import '../../base/file_system.dart'; import '../../base/file_system.dart';
import '../../build_info.dart'; import '../../build_info.dart';
import '../../devfs.dart';
import '../../project.dart';
import '../build_system.dart'; import '../build_system.dart';
import '../depfile.dart'; import '../depfile.dart';
import '../exceptions.dart'; import '../exceptions.dart';
...@@ -124,10 +126,14 @@ abstract class BundleLinuxAssets extends Target { ...@@ -124,10 +126,14 @@ abstract class BundleLinuxAssets extends Target {
environment.buildDir.childFile('app.dill') environment.buildDir.childFile('app.dill')
.copySync(outputDirectory.childFile('kernel_blob.bin').path); .copySync(outputDirectory.childFile('kernel_blob.bin').path);
} }
final String versionInfo = FlutterProject.current().getVersionInfo();
final Depfile depfile = await copyAssets( final Depfile depfile = await copyAssets(
environment, environment,
outputDirectory, outputDirectory,
targetPlatform: TargetPlatform.linux_x64, targetPlatform: TargetPlatform.linux_x64,
additionalContent: <String, DevFSContent>{
'version.json': DevFSStringContent(versionInfo),
}
); );
final DepfileService depfileService = DepfileService( final DepfileService depfileService = DepfileService(
fileSystem: environment.fileSystem, fileSystem: environment.fileSystem,
......
...@@ -89,6 +89,7 @@ void main() { ...@@ -89,6 +89,7 @@ void main() {
expect(output.childFile('kernel_blob.bin'), exists); expect(output.childFile('kernel_blob.bin'), exists);
expect(output.childFile('AssetManifest.json'), exists); expect(output.childFile('AssetManifest.json'), exists);
expect(output.childFile('version.json'), exists);
// SkSL // SkSL
expect(output.childFile('io.flutter.shaders.json'), exists); expect(output.childFile('io.flutter.shaders.json'), exists);
expect(output.childFile('io.flutter.shaders.json').readAsStringSync(), '{"data":{"A":"B"}}'); expect(output.childFile('io.flutter.shaders.json').readAsStringSync(), '{"data":{"A":"B"}}');
...@@ -126,6 +127,7 @@ void main() { ...@@ -126,6 +127,7 @@ void main() {
expect(libDir.childFile('libapp.so'), exists); expect(libDir.childFile('libapp.so'), exists);
expect(assetsDir.childFile('AssetManifest.json'), exists); expect(assetsDir.childFile('AssetManifest.json'), exists);
expect(assetsDir.childFile('version.json'), exists);
// No bundled fonts // No bundled fonts
expect(assetsDir.childFile('FontManifest.json'), isNot(exists)); expect(assetsDir.childFile('FontManifest.json'), isNot(exists));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -159,6 +161,7 @@ void main() { ...@@ -159,6 +161,7 @@ void main() {
expect(libDir.childFile('libapp.so'), exists); expect(libDir.childFile('libapp.so'), exists);
expect(assetsDir.childFile('AssetManifest.json'), exists); expect(assetsDir.childFile('AssetManifest.json'), exists);
expect(assetsDir.childFile('version.json'), exists);
// No bundled fonts // No bundled fonts
expect(assetsDir.childFile('FontManifest.json'), isNot(exists)); expect(assetsDir.childFile('FontManifest.json'), isNot(exists));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment