mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Some of the null-safety commands were missing - plumb them through. Ensure that verbose mode shows their output, and clean up the messaging around sound-null-safety. Fixes #59769 Adds a test that validate each of the null safety supporting build commands has everything plumbed through.
69 lines
2.1 KiB
Dart
69 lines
2.1 KiB
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:async';
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
import '../base/common.dart';
|
|
import '../build_info.dart';
|
|
import '../cache.dart';
|
|
import '../features.dart';
|
|
import '../globals.dart' as globals;
|
|
import '../macos/build_macos.dart';
|
|
import '../project.dart';
|
|
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
|
import 'build.dart';
|
|
|
|
/// A command to build a macOS desktop target through a build shell script.
|
|
class BuildMacosCommand extends BuildSubCommand {
|
|
BuildMacosCommand({ @required bool verboseHelp }) {
|
|
addTreeShakeIconsFlag();
|
|
addSplitDebugInfoOption();
|
|
usesTargetOption();
|
|
addBuildModeFlags();
|
|
addDartObfuscationOption();
|
|
usesExtraFrontendOptions();
|
|
usesBuildNumberOption();
|
|
usesBuildNameOption();
|
|
addEnableExperimentation(hide: !verboseHelp);
|
|
addBuildPerformanceFile(hide: !verboseHelp);
|
|
addBundleSkSLPathOption(hide: !verboseHelp);
|
|
addNullSafetyModeOptions(hide: !verboseHelp);
|
|
}
|
|
|
|
@override
|
|
final String name = 'macos';
|
|
|
|
@override
|
|
bool get hidden => !featureFlags.isMacOSEnabled || !globals.platform.isMacOS;
|
|
|
|
@override
|
|
Future<Set<DevelopmentArtifact>> get requiredArtifacts async => <DevelopmentArtifact>{
|
|
DevelopmentArtifact.macOS,
|
|
};
|
|
|
|
@override
|
|
String get description => 'Build a macOS desktop application.';
|
|
|
|
@override
|
|
Future<FlutterCommandResult> runCommand() async {
|
|
final BuildInfo buildInfo = getBuildInfo();
|
|
final FlutterProject flutterProject = FlutterProject.current();
|
|
if (!featureFlags.isMacOSEnabled) {
|
|
throwToolExit('"build macos" is not currently supported.');
|
|
}
|
|
if (!globals.platform.isMacOS) {
|
|
throwToolExit('"build macos" only supported on macOS hosts.');
|
|
}
|
|
await buildMacOS(
|
|
flutterProject: flutterProject,
|
|
buildInfo: buildInfo,
|
|
targetOverride: targetFile,
|
|
verboseLogging: globals.logger.isVerbose,
|
|
);
|
|
return FlutterCommandResult.success();
|
|
}
|
|
}
|