forked from firka/flutter
[flutter_tools] run UWP builds ahead of cmake (#80879)
This commit is contained in:
@@ -53,6 +53,7 @@ void main() {
|
||||
|
||||
setUpAll(() {
|
||||
Cache.disableLocking();
|
||||
Cache.flutterRoot = '';
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
@@ -530,7 +531,7 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier
|
||||
setUpMockProjectFilesForBuild();
|
||||
|
||||
// This message should include 'To enable, run "flutter config --enable-windows-uwp-desktop"."
|
||||
// once the `windowsUwpEmbedding` feature is available on all platforms.
|
||||
// once the `windowsUwpEmbedding` feature is available on all channels.
|
||||
expect(createTestCommandRunner(command).run(
|
||||
const <String>['winuwp', '--no-pub']
|
||||
), throwsToolExit(message: RegExp(r'"build winuwp" is not currently supported\.$')));
|
||||
@@ -541,19 +542,34 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier
|
||||
FeatureFlags: () => TestFeatureFlags(isWindowsUwpEnabled: false),
|
||||
});
|
||||
|
||||
testUsingContext('Windows UWP build fails after writing Cmake file', () async {
|
||||
testUsingContext('Windows UWP build completes successfully', () async {
|
||||
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio(cmakePath);
|
||||
final BuildWindowsUwpCommand command = BuildWindowsUwpCommand()
|
||||
..visualStudioOverride = fakeVisualStudio;
|
||||
setUpMockUwpFilesForBuild(0);
|
||||
|
||||
expect(createTestCommandRunner(command).run(
|
||||
await createTestCommandRunner(command).run(
|
||||
const <String>['winuwp', '--no-pub']
|
||||
), throwsToolExit(message: 'Windows UWP builds are not implemented'));
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => windowsPlatform,
|
||||
FileSystem: () => fileSystem,
|
||||
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
r'C:\flutter\bin\flutter',
|
||||
'assemble',
|
||||
'--no-version-check',
|
||||
'--output=build',
|
||||
'-dTargetPlatform=windows-uwp-x64',
|
||||
'-dTrackWidgetCreation=true',
|
||||
'-dBuildMode=release',
|
||||
r'-dTargetFile=lib\main.dart',
|
||||
'-dTreeShakeIcons="true"',
|
||||
'-dDartObfuscation=false',
|
||||
'release_bundle_windows_assets_uwp'
|
||||
],
|
||||
),
|
||||
cmakeGenerationCommand(winuwp: true),
|
||||
buildCommand('Release', stdout: 'STDOUT STUFF', winuwp: true),
|
||||
]),
|
||||
|
||||
@@ -22,7 +22,7 @@ void main() {
|
||||
FileSystem fileSystem;
|
||||
|
||||
setUp(() {
|
||||
fileSystem = MemoryFileSystem.test();
|
||||
fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
|
||||
});
|
||||
|
||||
testUsingContext('Generates install manifest for a debug build', () async {
|
||||
@@ -44,11 +44,11 @@ void main() {
|
||||
final File manifest = flutterProject.windowsUwp.ephemeralDirectory.childFile('install_manifest');
|
||||
expect(manifest, exists);
|
||||
expect(manifest.readAsLinesSync(), unorderedEquals(<String>[
|
||||
'/build/winuwp/flutter_assets/kernel_blob.bin',
|
||||
'/build/winuwp/flutter_assets/AssetManifest.json',
|
||||
'/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll',
|
||||
'/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll.pdb',
|
||||
'/winuwp/flutter/ephemeral/icudtl.dat',
|
||||
'C:/build/winuwp/flutter_assets/kernel_blob.bin',
|
||||
'C:/build/winuwp/flutter_assets/AssetManifest.json',
|
||||
'C:/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll',
|
||||
'C:/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll.pdb',
|
||||
'C:/winuwp/flutter/ephemeral/icudtl.dat',
|
||||
]));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
@@ -74,11 +74,11 @@ void main() {
|
||||
final File manifest = flutterProject.windowsUwp.ephemeralDirectory.childFile('install_manifest');
|
||||
expect(manifest, exists);
|
||||
expect(manifest.readAsLinesSync(), unorderedEquals(<String>[
|
||||
'/build/winuwp/app.so',
|
||||
'/build/winuwp/flutter_assets/AssetManifest.json',
|
||||
'/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll',
|
||||
'/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll.pdb',
|
||||
'/winuwp/flutter/ephemeral/icudtl.dat'
|
||||
'C:/build/winuwp/app.so',
|
||||
'C:/build/winuwp/flutter_assets/AssetManifest.json',
|
||||
'C:/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll',
|
||||
'C:/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll.pdb',
|
||||
'C:/winuwp/flutter/ephemeral/icudtl.dat'
|
||||
]));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
@@ -128,14 +128,14 @@ flutter:
|
||||
final File manifest = flutterProject.windowsUwp.ephemeralDirectory.childFile('install_manifest');
|
||||
expect(manifest, exists);
|
||||
expect(manifest.readAsLinesSync(), unorderedEquals(<String>[
|
||||
'/build/winuwp/app.so',
|
||||
'/build/winuwp/flutter_assets/assets/foo.png',
|
||||
'/build/winuwp/flutter_assets/AssetManifest.json',
|
||||
'/build/winuwp/flutter_assets/FontManifest.json',
|
||||
'/build/winuwp/flutter_assets/NOTICES',
|
||||
'/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll',
|
||||
'/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll.pdb',
|
||||
'/winuwp/flutter/ephemeral/icudtl.dat'
|
||||
'C:/build/winuwp/app.so',
|
||||
'C:/build/winuwp/flutter_assets/assets/foo.png',
|
||||
'C:/build/winuwp/flutter_assets/AssetManifest.json',
|
||||
'C:/build/winuwp/flutter_assets/FontManifest.json',
|
||||
'C:/build/winuwp/flutter_assets/NOTICES',
|
||||
'C:/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll',
|
||||
'C:/winuwp/flutter/ephemeral/flutter_windows_winuwp.dll.pdb',
|
||||
'C:/winuwp/flutter/ephemeral/icudtl.dat'
|
||||
]));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
|
||||
Reference in New Issue
Block a user