Unified analytics events migration for BuildEvent (#137562)
Related to tracker issue: - https://github.com/flutter/flutter/issues/128251
This commit is contained in:
@@ -7,6 +7,7 @@ import 'dart:math';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:process/process.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
import 'package:xml/xml.dart';
|
||||
|
||||
import '../artifacts.dart';
|
||||
@@ -149,6 +150,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
required FileSystem fileSystem,
|
||||
required Artifacts artifacts,
|
||||
required Usage usage,
|
||||
required Analytics analytics,
|
||||
required GradleUtils gradleUtils,
|
||||
required Platform platform,
|
||||
required AndroidStudio? androidStudio,
|
||||
@@ -157,6 +159,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
_fileSystem = fileSystem,
|
||||
_artifacts = artifacts,
|
||||
_usage = usage,
|
||||
_analytics = analytics,
|
||||
_gradleUtils = gradleUtils,
|
||||
_androidStudio = androidStudio,
|
||||
_fileSystemUtils = FileSystemUtils(fileSystem: fileSystem, platform: platform),
|
||||
@@ -168,6 +171,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
final FileSystem _fileSystem;
|
||||
final Artifacts _artifacts;
|
||||
final Usage _usage;
|
||||
final Analytics _analytics;
|
||||
final GradleUtils _gradleUtils;
|
||||
final FileSystemUtils _fileSystemUtils;
|
||||
final AndroidStudio? _androidStudio;
|
||||
@@ -300,7 +304,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
@visibleForTesting int? maxRetries,
|
||||
}) async {
|
||||
if (!project.android.isSupportedVersion) {
|
||||
_exitWithUnsupportedProjectMessage(_usage, _logger.terminal);
|
||||
_exitWithUnsupportedProjectMessage(_usage, _logger.terminal, analytics: _analytics);
|
||||
}
|
||||
|
||||
final List<ProjectMigrator> migrators = <ProjectMigrator>[
|
||||
@@ -318,8 +322,11 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
final bool usesAndroidX = isAppUsingAndroidX(project.android.hostAppGradleRoot);
|
||||
if (usesAndroidX) {
|
||||
BuildEvent('app-using-android-x', type: 'gradle', flutterUsage: _usage).send();
|
||||
_analytics.send(Event.flutterBuildInfo(label: 'app-using-android-x', buildType: 'gradle'));
|
||||
} else if (!usesAndroidX) {
|
||||
BuildEvent('app-not-using-android-x', type: 'gradle', flutterUsage: _usage).send();
|
||||
_analytics.send(Event.flutterBuildInfo(label: 'app-not-using-android-x', buildType: 'gradle'));
|
||||
|
||||
_logger.printStatus("${_logger.terminal.warningMark} Your app isn't using AndroidX.", emphasis: true);
|
||||
_logger.printStatus(
|
||||
'To avoid potential build failures, you can quickly migrate your app '
|
||||
@@ -488,6 +495,8 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
if (exitCode != 0) {
|
||||
if (detectedGradleError == null) {
|
||||
BuildEvent('gradle-unknown-failure', type: 'gradle', flutterUsage: _usage).send();
|
||||
_analytics.send(Event.flutterBuildInfo(label: 'gradle-unknown-failure', buildType: 'gradle'));
|
||||
|
||||
throwToolExit(
|
||||
'Gradle task $assembleTask failed with exit code $exitCode',
|
||||
exitCode: exitCode,
|
||||
@@ -520,13 +529,19 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
configOnly: configOnly,
|
||||
);
|
||||
final String successEventLabel = 'gradle-${detectedGradleError!.eventLabel}-success';
|
||||
|
||||
BuildEvent(successEventLabel, type: 'gradle', flutterUsage: _usage).send();
|
||||
_analytics.send(Event.flutterBuildInfo(label: successEventLabel, buildType: 'gradle'));
|
||||
|
||||
return;
|
||||
case GradleBuildStatus.exit:
|
||||
// Continue and throw tool exit.
|
||||
}
|
||||
}
|
||||
BuildEvent('gradle-${detectedGradleError?.eventLabel}-failure', type: 'gradle', flutterUsage: _usage).send();
|
||||
final String usageLabel = 'gradle-${detectedGradleError?.eventLabel}-failure';
|
||||
BuildEvent(usageLabel, type: 'gradle', flutterUsage: _usage).send();
|
||||
_analytics.send(Event.flutterBuildInfo(label: usageLabel, buildType: 'gradle'));
|
||||
|
||||
throwToolExit(
|
||||
'Gradle task $assembleTask failed with exit code $exitCode',
|
||||
exitCode: exitCode,
|
||||
@@ -534,7 +549,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
}
|
||||
|
||||
if (isBuildingBundle) {
|
||||
final File bundleFile = findBundleFile(project, buildInfo, _logger, _usage);
|
||||
final File bundleFile = findBundleFile(project, buildInfo, _logger, _usage, _analytics);
|
||||
final String appSize = (buildInfo.mode == BuildMode.debug)
|
||||
? '' // Don't display the size when building a debug variant.
|
||||
: ' (${getSizeAsMB(bundleFile.lengthSync())})';
|
||||
@@ -551,7 +566,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
}
|
||||
// Gradle produced APKs.
|
||||
final Iterable<String> apkFilesPaths = project.isModule
|
||||
? findApkFilesModule(project, androidBuildInfo, _logger, _usage)
|
||||
? findApkFilesModule(project, androidBuildInfo, _logger, _usage, _analytics)
|
||||
: listApkPaths(androidBuildInfo);
|
||||
final Directory apkDirectory = getApkDirectory(project);
|
||||
|
||||
@@ -563,6 +578,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
|
||||
fileExtension: '.apk',
|
||||
logger: _logger,
|
||||
usage: _usage,
|
||||
analytics: _analytics,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -886,8 +902,14 @@ String _calculateSha(File file) {
|
||||
return _hex(sha1.convert(bytes).bytes);
|
||||
}
|
||||
|
||||
void _exitWithUnsupportedProjectMessage(Usage usage, Terminal terminal) {
|
||||
void _exitWithUnsupportedProjectMessage(Usage usage, Terminal terminal, {required Analytics analytics}) {
|
||||
BuildEvent('unsupported-project', type: 'gradle', eventError: 'gradle-plugin', flutterUsage: usage).send();
|
||||
analytics.send(Event.flutterBuildInfo(
|
||||
label: 'unsupported-project',
|
||||
buildType: 'gradle',
|
||||
error: 'gradle-plugin',
|
||||
));
|
||||
|
||||
throwToolExit(
|
||||
'${terminal.warningMark} Your app is using an unsupported Gradle project. '
|
||||
'To fix this problem, create a new project by running `flutter create -t app <app-directory>` '
|
||||
@@ -913,6 +935,7 @@ Iterable<String> findApkFilesModule(
|
||||
AndroidBuildInfo androidBuildInfo,
|
||||
Logger logger,
|
||||
Usage usage,
|
||||
Analytics analytics,
|
||||
) {
|
||||
final Iterable<String> apkFileNames = _apkFilesFor(androidBuildInfo);
|
||||
final Directory apkDirectory = getApkDirectory(project);
|
||||
@@ -948,6 +971,7 @@ Iterable<String> findApkFilesModule(
|
||||
fileExtension: '.apk',
|
||||
logger: logger,
|
||||
usage: usage,
|
||||
analytics: analytics,
|
||||
);
|
||||
}
|
||||
return apks.map((File file) => file.path);
|
||||
@@ -986,7 +1010,7 @@ Iterable<String> listApkPaths(
|
||||
}
|
||||
|
||||
@visibleForTesting
|
||||
File findBundleFile(FlutterProject project, BuildInfo buildInfo, Logger logger, Usage usage) {
|
||||
File findBundleFile(FlutterProject project, BuildInfo buildInfo, Logger logger, Usage usage, Analytics analytics) {
|
||||
final List<File> fileCandidates = <File>[
|
||||
getBundleDirectory(project)
|
||||
.childDirectory(camelCase(buildInfo.modeName))
|
||||
@@ -1043,6 +1067,7 @@ File findBundleFile(FlutterProject project, BuildInfo buildInfo, Logger logger,
|
||||
fileExtension: '.aab',
|
||||
logger: logger,
|
||||
usage: usage,
|
||||
analytics: analytics,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1052,17 +1077,25 @@ Never _exitWithExpectedFileNotFound({
|
||||
required String fileExtension,
|
||||
required Logger logger,
|
||||
required Usage usage,
|
||||
required Analytics analytics,
|
||||
}) {
|
||||
|
||||
final String androidGradlePluginVersion =
|
||||
getGradleVersionForAndroidPlugin(project.android.hostAppGradleRoot, logger);
|
||||
final String gradleBuildSettings = 'androidGradlePluginVersion: $androidGradlePluginVersion, '
|
||||
'fileExtension: $fileExtension';
|
||||
|
||||
BuildEvent('gradle-expected-file-not-found',
|
||||
type: 'gradle',
|
||||
settings:
|
||||
'androidGradlePluginVersion: $androidGradlePluginVersion, '
|
||||
'fileExtension: $fileExtension',
|
||||
settings: gradleBuildSettings,
|
||||
flutterUsage: usage,
|
||||
).send();
|
||||
analytics.send(Event.flutterBuildInfo(
|
||||
label: 'gradle-expected-file-not-found',
|
||||
buildType: 'gradle',
|
||||
settings: gradleBuildSettings,
|
||||
));
|
||||
|
||||
throwToolExit(
|
||||
'Gradle build failed to produce an $fileExtension file. '
|
||||
"It's likely that this file was generated under ${project.android.buildDirectory.path}, "
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:process/process.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
@@ -741,6 +742,11 @@ void exitWithNoSdkMessage() {
|
||||
eventError: 'android-sdk-not-found',
|
||||
flutterUsage: globals.flutterUsage)
|
||||
.send();
|
||||
globals.analytics.send(Event.flutterBuildInfo(
|
||||
label: 'unsupported-project',
|
||||
buildType: 'gradle',
|
||||
error: 'android-sdk-not-found',
|
||||
));
|
||||
throwToolExit('${globals.logger.terminal.warningMark} No Android SDK found. '
|
||||
'Try setting the ANDROID_HOME environment variable.');
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'dart:typed_data';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
|
||||
import '../base/analyze_size.dart';
|
||||
import '../base/common.dart';
|
||||
@@ -669,7 +670,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
|
||||
xcodeBuildResult = result;
|
||||
|
||||
if (!result.success) {
|
||||
await diagnoseXcodeBuildFailure(result, globals.flutterUsage, globals.logger);
|
||||
await diagnoseXcodeBuildFailure(result, globals.flutterUsage, globals.logger, globals.analytics);
|
||||
final String presentParticiple = xcodeBuildAction == XcodeBuildAction.build ? 'building' : 'archiving';
|
||||
throwToolExit('Encountered error while $presentParticiple for $logTarget.');
|
||||
}
|
||||
@@ -739,13 +740,19 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
|
||||
final bool? impellerEnabled = globals.plistParser.getValueFromFile<bool>(
|
||||
plistPath, PlistParser.kFLTEnableImpellerKey,
|
||||
);
|
||||
BuildEvent(
|
||||
impellerEnabled == false
|
||||
|
||||
final String buildLabel = impellerEnabled == false
|
||||
? 'plist-impeller-disabled'
|
||||
: 'plist-impeller-enabled',
|
||||
: 'plist-impeller-enabled';
|
||||
BuildEvent(
|
||||
buildLabel,
|
||||
type: 'ios',
|
||||
flutterUsage: globals.flutterUsage,
|
||||
).send();
|
||||
globals.analytics.send(Event.flutterBuildInfo(
|
||||
label: buildLabel,
|
||||
buildType: 'ios',
|
||||
));
|
||||
|
||||
return FlutterCommandResult.success();
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ class BuildWebCommand extends BuildSubCommand {
|
||||
fileSystem: globals.fs,
|
||||
flutterVersion: globals.flutterVersion,
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
);
|
||||
await webBuilder.buildWeb(
|
||||
flutterProject,
|
||||
|
||||
@@ -101,6 +101,7 @@ Future<T> runInContext<T>(
|
||||
fileSystem: globals.fs,
|
||||
artifacts: globals.artifacts!,
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
gradleUtils: globals.gradleUtils!,
|
||||
platform: globals.platform,
|
||||
androidStudio: globals.androidStudio,
|
||||
@@ -387,6 +388,7 @@ Future<T> runInContext<T>(
|
||||
platform: globals.platform,
|
||||
fileSystem: globals.fs,
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
@@ -505,7 +505,7 @@ class IOSDevice extends Device {
|
||||
);
|
||||
if (!buildResult.success) {
|
||||
_logger.printError('Could not build the precompiled application for the device.');
|
||||
await diagnoseXcodeBuildFailure(buildResult, globals.flutterUsage, _logger);
|
||||
await diagnoseXcodeBuildFailure(buildResult, globals.flutterUsage, _logger, globals.analytics);
|
||||
_logger.printError('');
|
||||
return LaunchResult.failed();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:process/process.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
|
||||
import '../artifacts.dart';
|
||||
import '../base/file_system.dart';
|
||||
@@ -581,17 +582,35 @@ return result.exitCode != 0 &&
|
||||
result.stdout.contains(kConcurrentRunFailureMessage2);
|
||||
}
|
||||
|
||||
Future<void> diagnoseXcodeBuildFailure(XcodeBuildResult result, Usage flutterUsage, Logger logger) async {
|
||||
Future<void> diagnoseXcodeBuildFailure(
|
||||
XcodeBuildResult result,
|
||||
Usage flutterUsage,
|
||||
Logger logger,
|
||||
Analytics analytics,
|
||||
) async {
|
||||
final XcodeBuildExecution? xcodeBuildExecution = result.xcodeBuildExecution;
|
||||
if (xcodeBuildExecution != null
|
||||
&& xcodeBuildExecution.environmentType == EnvironmentType.physical
|
||||
&& (result.stdout?.toUpperCase().contains('BITCODE') ?? false)) {
|
||||
BuildEvent('xcode-bitcode-failure',
|
||||
type: 'ios',
|
||||
command: xcodeBuildExecution.buildCommands.toString(),
|
||||
settings: xcodeBuildExecution.buildSettings.toString(),
|
||||
|
||||
const String label = 'xcode-bitcode-failure';
|
||||
const String buildType = 'ios';
|
||||
final String command = xcodeBuildExecution.buildCommands.toString();
|
||||
final String settings = xcodeBuildExecution.buildSettings.toString();
|
||||
|
||||
BuildEvent(
|
||||
label,
|
||||
type: buildType,
|
||||
command: command,
|
||||
settings: settings,
|
||||
flutterUsage: flutterUsage,
|
||||
).send();
|
||||
analytics.send(Event.flutterBuildInfo(
|
||||
label: label,
|
||||
buildType: buildType,
|
||||
command: command,
|
||||
settings: settings,
|
||||
));
|
||||
}
|
||||
|
||||
// Handle errors.
|
||||
|
||||
@@ -567,7 +567,7 @@ class IOSSimulator extends Device {
|
||||
deviceID: id,
|
||||
);
|
||||
if (!buildResult.success) {
|
||||
await diagnoseXcodeBuildFailure(buildResult, globals.flutterUsage, globals.logger);
|
||||
await diagnoseXcodeBuildFailure(buildResult, globals.flutterUsage, globals.logger, globals.analytics);
|
||||
throwToolExit('Could not build the application for the simulator.');
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:process/process.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
@@ -30,6 +31,7 @@ class XcodeProjectInterpreter {
|
||||
required Logger logger,
|
||||
required FileSystem fileSystem,
|
||||
required Usage usage,
|
||||
required Analytics analytics,
|
||||
}) {
|
||||
return XcodeProjectInterpreter._(
|
||||
platform: platform,
|
||||
@@ -37,6 +39,7 @@ class XcodeProjectInterpreter {
|
||||
logger: logger,
|
||||
fileSystem: fileSystem,
|
||||
usage: usage,
|
||||
analytics: analytics,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,6 +49,7 @@ class XcodeProjectInterpreter {
|
||||
required Logger logger,
|
||||
required FileSystem fileSystem,
|
||||
required Usage usage,
|
||||
required Analytics analytics,
|
||||
Version? version,
|
||||
String? build,
|
||||
}) : _platform = platform,
|
||||
@@ -61,7 +65,8 @@ class XcodeProjectInterpreter {
|
||||
_version = version,
|
||||
_build = build,
|
||||
_versionText = version?.toString(),
|
||||
_usage = usage;
|
||||
_usage = usage,
|
||||
_analytics = analytics;
|
||||
|
||||
/// Create an [XcodeProjectInterpreter] for testing.
|
||||
///
|
||||
@@ -73,6 +78,7 @@ class XcodeProjectInterpreter {
|
||||
required ProcessManager processManager,
|
||||
Version? version = const Version.withText(1000, 0, 0, '1000.0.0'),
|
||||
String? build = '13C100',
|
||||
Analytics? analytics,
|
||||
}) {
|
||||
final Platform platform = FakePlatform(
|
||||
operatingSystem: 'macos',
|
||||
@@ -86,6 +92,7 @@ class XcodeProjectInterpreter {
|
||||
logger: BufferLogger.test(),
|
||||
version: version,
|
||||
build: build,
|
||||
analytics: analytics ?? NoOpAnalytics(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,6 +102,7 @@ class XcodeProjectInterpreter {
|
||||
final OperatingSystemUtils _operatingSystemUtils;
|
||||
final Logger _logger;
|
||||
final Usage _usage;
|
||||
final Analytics _analytics;
|
||||
static final RegExp _versionRegex = RegExp(r'Xcode ([0-9.]+).*Build version (\w+)');
|
||||
|
||||
void _updateVersion() {
|
||||
@@ -235,6 +243,11 @@ class XcodeProjectInterpreter {
|
||||
command: showBuildSettingsCommand.join(' '),
|
||||
flutterUsage: _usage,
|
||||
).send();
|
||||
_analytics.send(Event.flutterBuildInfo(
|
||||
label: 'xcode-show-build-settings-timeout',
|
||||
buildType: 'ios',
|
||||
command: showBuildSettingsCommand.join(' '),
|
||||
));
|
||||
}
|
||||
_logger.printTrace('Unexpected failure to get Xcode build settings: $error.');
|
||||
return const <String, String>{};
|
||||
@@ -290,6 +303,11 @@ class XcodeProjectInterpreter {
|
||||
command: showBuildSettingsCommand.join(' '),
|
||||
flutterUsage: _usage,
|
||||
).send();
|
||||
_analytics.send(Event.flutterBuildInfo(
|
||||
label: 'xcode-show-build-settings-timeout',
|
||||
buildType: 'ios',
|
||||
command: showBuildSettingsCommand.join(' '),
|
||||
));
|
||||
}
|
||||
_logger.printTrace('Unexpected failure to get Pod Xcode project build settings: $error.');
|
||||
return null;
|
||||
|
||||
@@ -322,6 +322,7 @@ Please provide a valid TCP port (an integer between 0 and 65535, inclusive).
|
||||
fileSystem: _fileSystem,
|
||||
flutterVersion: globals.flutterVersion,
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
);
|
||||
await webBuilder.buildWeb(
|
||||
flutterProject,
|
||||
@@ -400,6 +401,7 @@ Please provide a valid TCP port (an integer between 0 and 65535, inclusive).
|
||||
fileSystem: _fileSystem,
|
||||
flutterVersion: globals.flutterVersion,
|
||||
usage: globals.flutterUsage,
|
||||
analytics: globals.analytics,
|
||||
);
|
||||
await webBuilder.buildWeb(
|
||||
flutterProject,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
import 'package:xml/xml.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
@@ -761,8 +762,19 @@ The detected reason was:
|
||||
''');
|
||||
if (deprecationBehavior == DeprecationBehavior.ignore) {
|
||||
BuildEvent('deprecated-v1-android-embedding-ignored', type: 'gradle', flutterUsage: globals.flutterUsage).send();
|
||||
globals.analytics.send(
|
||||
Event.flutterBuildInfo(
|
||||
label: 'deprecated-v1-android-embedding-ignored',
|
||||
buildType: 'gradle',
|
||||
));
|
||||
|
||||
} else { // DeprecationBehavior.exit
|
||||
BuildEvent('deprecated-v1-android-embedding-failed', type: 'gradle', flutterUsage: globals.flutterUsage).send();
|
||||
globals.analytics.send(
|
||||
Event.flutterBuildInfo(
|
||||
label: 'deprecated-v1-android-embedding-failed',
|
||||
buildType: 'gradle',
|
||||
));
|
||||
|
||||
throwToolExit(
|
||||
'Build failed due to use of deprecated Android v1 embedding.',
|
||||
exitCode: 1,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:process/process.dart';
|
||||
import 'package:unified_analytics/unified_analytics.dart';
|
||||
|
||||
import '../artifacts.dart';
|
||||
import '../base/common.dart';
|
||||
@@ -34,12 +35,14 @@ class WebBuilder {
|
||||
required ProcessManager processManager,
|
||||
required BuildSystem buildSystem,
|
||||
required Usage usage,
|
||||
required Analytics analytics,
|
||||
required FlutterVersion flutterVersion,
|
||||
required FileSystem fileSystem,
|
||||
}) : _logger = logger,
|
||||
_processManager = processManager,
|
||||
_buildSystem = buildSystem,
|
||||
_flutterUsage = usage,
|
||||
_analytics = analytics,
|
||||
_flutterVersion = flutterVersion,
|
||||
_fileSystem = fileSystem;
|
||||
|
||||
@@ -47,6 +50,7 @@ class WebBuilder {
|
||||
final ProcessManager _processManager;
|
||||
final BuildSystem _buildSystem;
|
||||
final Usage _flutterUsage;
|
||||
final Analytics _analytics;
|
||||
final FlutterVersion _flutterVersion;
|
||||
final FileSystem _fileSystem;
|
||||
|
||||
@@ -127,15 +131,23 @@ class WebBuilder {
|
||||
} finally {
|
||||
status.stop();
|
||||
}
|
||||
|
||||
final String buildSettingsString = _buildEventAnalyticsSettings(
|
||||
config: compilerConfig,
|
||||
buildInfo: buildInfo,
|
||||
);
|
||||
|
||||
BuildEvent(
|
||||
'web-compile',
|
||||
type: 'web',
|
||||
settings: _buildEventAnalyticsSettings(
|
||||
config: compilerConfig,
|
||||
buildInfo: buildInfo,
|
||||
),
|
||||
settings: buildSettingsString,
|
||||
flutterUsage: _flutterUsage,
|
||||
).send();
|
||||
_analytics.send(Event.flutterBuildInfo(
|
||||
label: 'web-compile',
|
||||
buildType: 'web',
|
||||
settings: buildSettingsString,
|
||||
));
|
||||
|
||||
_flutterUsage.sendTiming(
|
||||
'build',
|
||||
|
||||
Reference in New Issue
Block a user