Streamline Windows build process (#32783)
Allows Windows builds to use the same structure and script as Linux
builds now use, calling into tool_backend to manage copying resources to
the project directory and building the bundle.
Also switches from expecting name_update.bat to expecting flutter\exe_filename
to be written during the build, as with the recent changes to the macOS build, to
reduce the amount of boilerplate needed in a windows\ project directory.
diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart
index c841d54..8c8e94f 100644
--- a/packages/flutter_tools/lib/src/build_info.dart
+++ b/packages/flutter_tools/lib/src/build_info.dart
@@ -326,6 +326,8 @@
return TargetPlatform.darwin_x64;
case 'linux-x64':
return TargetPlatform.linux_x64;
+ case 'windows-x64':
+ return TargetPlatform.windows_x64;
case 'web':
return TargetPlatform.web;
}
@@ -397,6 +399,11 @@
return fs.path.join(getBuildDirectory(), 'linux');
}
+/// Returns the Windows build output directory.
+String getWindowsBuildDirectory() {
+ return fs.path.join(getBuildDirectory(), 'windows');
+}
+
/// Returns the Fuchsia build output directory.
String getFuchsiaBuildDirectory() {
return fs.path.join(getBuildDirectory(), 'fuchsia');