Check for desktop project files before building (#48350)
Moves the checks that projects have been configured for desktop to a lower level, where they will cover more codepaths (e.g., 'run'), and improves them to check for native build projects, rather than just directories, to catch cases where the directory exists (e.g., due to accidental creation of generated files). Also adds links to the error messages pointing to instructions on adding desktop support to a project. Fixes #47145
This commit is contained in:
@@ -16,6 +16,13 @@ import 'visual_studio.dart';
|
||||
|
||||
/// Builds the Windows project using msbuild.
|
||||
Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {String target}) async {
|
||||
if (!windowsProject.solutionFile.existsSync()) {
|
||||
throwToolExit(
|
||||
'No Windows desktop project configured. '
|
||||
'See https://github.com/flutter/flutter/wiki/Desktop-shells#create '
|
||||
'to learn about adding Windows support to a project.');
|
||||
}
|
||||
|
||||
final Map<String, String> environment = <String, String>{
|
||||
'FLUTTER_ROOT': Cache.flutterRoot,
|
||||
'FLUTTER_EPHEMERAL_DIR': windowsProject.ephemeralDirectory.path,
|
||||
|
||||
Reference in New Issue
Block a user