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.
This commit is contained in:
9
packages/flutter_tools/bin/tool_backend.bat
Normal file
9
packages/flutter_tools/bin/tool_backend.bat
Normal file
@@ -0,0 +1,9 @@
|
||||
:: Copyright 2019 The Chromium Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style license that can be
|
||||
:: found in the LICENSE file.
|
||||
@echo off
|
||||
|
||||
set FLUTTER_BIN_DIR=%FLUTTER_ROOT%\bin
|
||||
set DART_BIN_DIR=%FLUTTER_BIN_DIR%\cache\dart-sdk\bin
|
||||
|
||||
"%DART_BIN_DIR%\dart" "%FLUTTER_ROOT%\packages\flutter_tools\bin\tool_backend.dart" %*
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'dart:io'; // ignore: dart_io_import.
|
||||
import 'package:path/path.dart' as path; // ignore: package_path_import.
|
||||
|
||||
/// Executes the required flutter tasks for a linux build.
|
||||
/// Executes the required flutter tasks for a desktop build.
|
||||
Future<void> main(List<String> arguments) async {
|
||||
final String targetPlatform = arguments[0];
|
||||
final String buildMode = arguments[1];
|
||||
@@ -26,9 +26,9 @@ ERROR: Requested build with Flutter local engine at '$localEngine'
|
||||
This engine is not compatible with FLUTTER_BUILD_MODE: '$buildMode'.
|
||||
You can fix this by updating the LOCAL_ENGINE environment variable, or
|
||||
by running:
|
||||
flutter build linux --local-engine=host_$buildMode
|
||||
flutter build <platform> --local-engine=host_$buildMode
|
||||
or
|
||||
flutter build linux --local-engine=host_${buildMode}_unopt
|
||||
flutter build <platform> --local-engine=host_${buildMode}_unopt
|
||||
========================================================================
|
||||
''');
|
||||
exit(1);
|
||||
@@ -39,6 +39,9 @@ or
|
||||
case 'linux-x64':
|
||||
cacheDirectory = 'linux/flutter';
|
||||
break;
|
||||
case 'windows-x64':
|
||||
cacheDirectory = 'windows/flutter';
|
||||
break;
|
||||
default:
|
||||
stderr.write('Unsupported target platform $targetPlatform');
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user