[flutter_tools] output release artifacts to build/winuwp (#80137)

This commit is contained in:
Jonah Williams
2021-04-21 18:39:04 -07:00
committed by GitHub
parent 24f0d28562
commit 44c284baa2
2 changed files with 110 additions and 10 deletions

View File

@@ -289,7 +289,7 @@ void main() {
environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfProfile(TargetPlatform.windows_x64)).build(environment);
await const WindowsAotBundle(AotElfProfile(TargetPlatform.windows_x64), uwp: false).build(environment);
await const ProfileBundleWindowsAssets().build(environment);
// Depfile is created and so is copied.
@@ -302,6 +302,60 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('ReleaseBundleWindowsAssets creates correct bundle structure with UWP', () async {
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
fileSystem: fileSystem,
logger: BufferLogger.test(),
defines: <String, String>{
kBuildMode: 'release',
}
);
environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfRelease(TargetPlatform.windows_x64), uwp: true).build(environment);
await const ReleaseBundleWindowsAssets().build(environment);
// Depfile is created and so is copied.
expect(environment.buildDir.childFile('flutter_assets.d'), exists);
expect(fileSystem.file(r'C:\winuwp\app.so'), exists);
expect(fileSystem.file(r'C:\flutter_assets\kernel_blob.bin').existsSync(), false);
expect(fileSystem.file(r'C:\flutter_assets\AssetManifest.json'), exists);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('ProfileBundleWindowsAssets creates correct bundle structure with UWP', () async {
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
fileSystem: fileSystem,
logger: BufferLogger.test(),
defines: <String, String>{
kBuildMode: 'profile',
}
);
environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfProfile(TargetPlatform.windows_x64), uwp: true).build(environment);
await const ProfileBundleWindowsAssets().build(environment);
// Depfile is created and so is copied.
expect(environment.buildDir.childFile('flutter_assets.d'), exists);
expect(fileSystem.file(r'C:\winuwp\app.so'), exists);
expect(fileSystem.file(r'C:\flutter_assets\kernel_blob.bin').existsSync(), false);
expect(fileSystem.file(r'C:\flutter_assets\AssetManifest.json'), exists);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('ReleaseBundleWindowsAssets creates correct bundle structure', () async {
final Environment environment = Environment.test(
fileSystem.currentDirectory,
@@ -316,7 +370,7 @@ void main() {
environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfRelease(TargetPlatform.windows_x64)).build(environment);
await const WindowsAotBundle(AotElfRelease(TargetPlatform.windows_x64), uwp: false).build(environment);
await const ReleaseBundleWindowsAssets().build(environment);
// Depfile is created and so is copied.