Revert "[flutter_tools] add --android-gradle-daemon option, use in devicelab (#68409)" (#68489)

This reverts commit ddab72e79f.
This commit is contained in:
Jonah Williams
2020-10-19 09:33:52 -07:00
committed by GitHub
parent ddab72e79f
commit ed5482de19
16 changed files with 44 additions and 108 deletions

View File

@@ -279,9 +279,6 @@ Future<void> buildGradleApp({
} else {
command.add('-q');
}
if (!buildInfo.androidGradleDaemon) {
command.add('--no-daemon');
}
if (globals.artifacts is LocalEngineArtifacts) {
final LocalEngineArtifacts localEngineArtifacts = globals.artifacts as LocalEngineArtifacts;
final Directory localEngineRepo = _getLocalEngineRepo(
@@ -595,9 +592,6 @@ Future<void> buildGradleAar({
} else {
command.add('-q');
}
if (!buildInfo.androidGradleDaemon) {
command.add('--no-daemon');
}
if (target != null && target.isNotEmpty) {
command.add('-Ptarget=$target');

View File

@@ -34,7 +34,6 @@ class BuildInfo {
this.packagesPath = '.packages',
this.nullSafetyMode = NullSafetyMode.autodetect,
this.codeSizeDirectory,
this.androidGradleDaemon = true,
});
final BuildMode mode;
@@ -119,20 +118,6 @@ class BuildInfo {
/// will be written for code size profiling.
final String codeSizeDirectory;
/// Whether to enable the Gradle daemon when performing an Android build.
///
/// Starting the daemon is the default behavior of the gradle wrapper script created
/// in a Flutter project. Setting this value to false will cause the tool to pass
/// `--no-daemon` to the gradle wrapper script, preventing it from spawning a daemon
/// process.
///
/// For one-off builds or CI systems, preventing the daemon from spawning will
/// reduce system resource usage, at the cost of any subsequent builds starting
/// up slightly slower.
///
/// The Gradle daemon may also be disabled in the Android application's properties file.
final bool androidGradleDaemon;
static const BuildInfo debug = BuildInfo(BuildMode.debug, null, treeShakeIcons: false);
static const BuildInfo profile = BuildInfo(BuildMode.profile, null, treeShakeIcons: kIconTreeShakerEnabledDefault);
static const BuildInfo jitRelease = BuildInfo(BuildMode.jitRelease, null, treeShakeIcons: kIconTreeShakerEnabledDefault);

View File

@@ -43,7 +43,6 @@ class BuildAarCommand extends BuildSubCommand {
usesTrackWidgetCreation(verboseHelp: false);
addNullSafetyModeOptions(hide: !verboseHelp);
addEnableExperimentation(hide: !verboseHelp);
addAndroidSpecificBuildOptions(hide: !verboseHelp);
argParser
..addMultiOption(
'target-platform',

View File

@@ -33,7 +33,6 @@ class BuildApkCommand extends BuildSubCommand {
addBuildPerformanceFile(hide: !verboseHelp);
addNullSafetyModeOptions(hide: !verboseHelp);
usesAnalyzeSizeFlag();
addAndroidSpecificBuildOptions(hide: !verboseHelp);
argParser
..addFlag('split-per-abi',
negatable: false,

View File

@@ -33,7 +33,6 @@ class BuildAppBundleCommand extends BuildSubCommand {
addNullSafetyModeOptions(hide: !verboseHelp);
addEnableExperimentation(hide: !verboseHelp);
usesAnalyzeSizeFlag();
addAndroidSpecificBuildOptions(hide: !verboseHelp);
argParser.addMultiOption('target-platform',
splitCommas: true,
defaultsTo: <String>['android-arm', 'android-arm64', 'android-x64'],

View File

@@ -88,7 +88,6 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
usesDeviceUserOption();
usesDeviceTimeoutOption();
addDdsOptions(verboseHelp: verboseHelp);
addAndroidSpecificBuildOptions(hide: !verboseHelp);
}
bool get traceStartup => boolArg('trace-startup');

View File

@@ -114,7 +114,6 @@ class FlutterOptions {
static const String kDeviceTimeout = 'device-timeout';
static const String kAnalyzeSize = 'analyze-size';
static const String kNullAssertions = 'null-assertions';
static const String kAndroidGradleDaemon = 'android-gradle-daemon';
}
abstract class FlutterCommand extends Command<void> {
@@ -612,18 +611,6 @@ abstract class FlutterCommand extends Command<void> {
);
}
void addAndroidSpecificBuildOptions({ bool hide = false }) {
argParser.addFlag(
FlutterOptions.kAndroidGradleDaemon,
help: 'Whether to enable the Gradle daemon when performing an Android build. '
'Starting the daemon is the default behavior of the gradle wrapper script created '
' in a Flutter project. Setting this flag to false corresponds to passing '
"'--no-daemon' to the gradle wrapper script. This flag will cause the daemon "
'process to terminate after the build is completed',
defaultsTo: true,
);
}
/// Adds build options common to all of the desktop build commands.
void addCommonDesktopBuildOptions({ bool verboseHelp = false }) {
addBuildModeFlags(verboseHelp: verboseHelp);
@@ -777,9 +764,6 @@ abstract class FlutterCommand extends Command<void> {
? stringArg(FlutterOptions.kSplitDebugInfoOption)
: null;
final bool androidGradleDaemon = !argParser.options.containsKey(FlutterOptions.kAndroidGradleDaemon)
|| boolArg(FlutterOptions.kAndroidGradleDaemon);
if (dartObfuscation && (splitDebugInfoPath == null || splitDebugInfoPath.isEmpty)) {
throwToolExit(
'"--${FlutterOptions.kDartObfuscationOption}" can only be used in '
@@ -843,7 +827,6 @@ abstract class FlutterCommand extends Command<void> {
packagesPath: globalResults['packages'] as String ?? '.packages',
nullSafetyMode: nullSafetyMode,
codeSizeDirectory: codeSizeDirectory,
androidGradleDaemon: androidGradleDaemon,
);
}