@@ -29,7 +29,6 @@ import '../convert.dart';
29
29
import '../flutter_manifest.dart' ;
30
30
import '../globals.dart' as globals;
31
31
import '../project.dart' ;
32
- import '../reporting/reporting.dart' ;
33
32
import 'android_builder.dart' ;
34
33
import 'android_studio.dart' ;
35
34
import 'gradle_errors.dart' ;
@@ -149,7 +148,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
149
148
required ProcessManager processManager,
150
149
required FileSystem fileSystem,
151
150
required Artifacts artifacts,
152
- required Usage usage,
153
151
required Analytics analytics,
154
152
required GradleUtils gradleUtils,
155
153
required Platform platform,
@@ -158,7 +156,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
158
156
_logger = logger,
159
157
_fileSystem = fileSystem,
160
158
_artifacts = artifacts,
161
- _usage = usage,
162
159
_analytics = analytics,
163
160
_gradleUtils = gradleUtils,
164
161
_androidStudio = androidStudio,
@@ -170,7 +167,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
170
167
final ProcessUtils _processUtils;
171
168
final FileSystem _fileSystem;
172
169
final Artifacts _artifacts;
173
- final Usage _usage;
174
170
final Analytics _analytics;
175
171
final GradleUtils _gradleUtils;
176
172
final FileSystemUtils _fileSystemUtils;
@@ -304,7 +300,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
304
300
@visibleForTesting int ? maxRetries,
305
301
}) async {
306
302
if (! project.android.isSupportedVersion) {
307
- _exitWithUnsupportedProjectMessage (_usage, _logger.terminal, analytics : _analytics);
303
+ _exitWithUnsupportedProjectMessage (_logger.terminal, _analytics);
308
304
}
309
305
310
306
final List <ProjectMigrator > migrators = < ProjectMigrator > [
@@ -322,10 +318,8 @@ class AndroidGradleBuilder implements AndroidBuilder {
322
318
323
319
final bool usesAndroidX = isAppUsingAndroidX (project.android.hostAppGradleRoot);
324
320
if (usesAndroidX) {
325
- BuildEvent ('app-using-android-x' , type: 'gradle' , flutterUsage: _usage).send ();
326
321
_analytics.send (Event .flutterBuildInfo (label: 'app-using-android-x' , buildType: 'gradle' ));
327
322
} else if (! usesAndroidX) {
328
- BuildEvent ('app-not-using-android-x' , type: 'gradle' , flutterUsage: _usage).send ();
329
323
_analytics.send (Event .flutterBuildInfo (label: 'app-not-using-android-x' , buildType: 'gradle' ));
330
324
331
325
_logger.printStatus ("${_logger .terminal .warningMark } Your app isn't using AndroidX." , emphasis: true );
@@ -485,7 +479,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
485
479
}
486
480
487
481
final Duration elapsedDuration = sw.elapsed;
488
- _usage.sendTiming ('build' , 'gradle' , elapsedDuration);
489
482
_analytics.send (Event .timing (
490
483
workflow: 'build' ,
491
484
variableName: 'gradle' ,
@@ -494,7 +487,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
494
487
495
488
if (exitCode != 0 ) {
496
489
if (detectedGradleError == null ) {
497
- BuildEvent ('gradle-unknown-failure' , type: 'gradle' , flutterUsage: _usage).send ();
498
490
_analytics.send (Event .flutterBuildInfo (label: 'gradle-unknown-failure' , buildType: 'gradle' ));
499
491
500
492
throwToolExit (
@@ -529,7 +521,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
529
521
);
530
522
final String successEventLabel = 'gradle-${detectedGradleError !.eventLabel }-success' ;
531
523
532
- BuildEvent (successEventLabel, type: 'gradle' , flutterUsage: _usage).send ();
533
524
_analytics.send (Event .flutterBuildInfo (label: successEventLabel, buildType: 'gradle' ));
534
525
535
526
return ;
@@ -538,7 +529,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
538
529
}
539
530
}
540
531
final String usageLabel = 'gradle-${detectedGradleError ?.eventLabel }-failure' ;
541
- BuildEvent (usageLabel, type: 'gradle' , flutterUsage: _usage).send ();
542
532
_analytics.send (Event .flutterBuildInfo (label: usageLabel, buildType: 'gradle' ));
543
533
544
534
throwToolExit (
@@ -548,7 +538,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
548
538
}
549
539
550
540
if (isBuildingBundle) {
551
- final File bundleFile = findBundleFile (project, buildInfo, _logger, _usage, _analytics);
541
+ final File bundleFile = findBundleFile (project, buildInfo, _logger, _analytics);
552
542
final String appSize = (buildInfo.mode == BuildMode .debug)
553
543
? '' // Don't display the size when building a debug variant.
554
544
: ' (${getSizeAsPlatformMB (bundleFile .lengthSync ())})' ;
@@ -566,7 +556,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
566
556
}
567
557
// Gradle produced APKs.
568
558
final Iterable <String > apkFilesPaths = project.isModule
569
- ? findApkFilesModule (project, androidBuildInfo, _logger, _usage, _analytics)
559
+ ? findApkFilesModule (project, androidBuildInfo, _logger, _analytics)
570
560
: listApkPaths (androidBuildInfo);
571
561
final Directory apkDirectory = getApkDirectory (project);
572
562
@@ -577,7 +567,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
577
567
project: project,
578
568
fileExtension: '.apk' ,
579
569
logger: _logger,
580
- usage: _usage,
581
570
analytics: _analytics,
582
571
);
583
572
}
@@ -608,7 +597,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
608
597
final SizeAnalyzer sizeAnalyzer = SizeAnalyzer (
609
598
fileSystem: _fileSystem,
610
599
logger: _logger,
611
- flutterUsage: _usage,
612
600
analytics: _analytics,
613
601
);
614
602
final String archName = androidBuildInfo.targetArchs.single.archName;
@@ -759,7 +747,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
759
747
status.stop ();
760
748
}
761
749
final Duration elapsedDuration = sw.elapsed;
762
- _usage.sendTiming ('build' , 'gradle-aar' , elapsedDuration);
763
750
_analytics.send (Event .timing (
764
751
workflow: 'build' ,
765
752
variableName: 'gradle-aar' ,
@@ -801,7 +788,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
801
788
);
802
789
803
790
final Duration elapsedDuration = sw.elapsed;
804
- _usage.sendTiming ('print' , 'android build variants' , elapsedDuration);
805
791
_analytics.send (Event .timing (
806
792
workflow: 'print' ,
807
793
variableName: 'android build variants' ,
@@ -840,7 +826,6 @@ class AndroidGradleBuilder implements AndroidBuilder {
840
826
project: project,
841
827
);
842
828
final Duration elapsedDuration = sw.elapsed;
843
- _usage.sendTiming ('outputs' , 'app link settings' , elapsedDuration);
844
829
_analytics.send (Event .timing (
845
830
workflow: 'outputs' ,
846
831
variableName: 'app link settings' ,
@@ -927,8 +912,7 @@ String _calculateSha(File file) {
927
912
return _hex (sha1.convert (bytes).bytes);
928
913
}
929
914
930
- void _exitWithUnsupportedProjectMessage (Usage usage, Terminal terminal, {required Analytics analytics}) {
931
- BuildEvent ('unsupported-project' , type: 'gradle' , eventError: 'gradle-plugin' , flutterUsage: usage).send ();
915
+ void _exitWithUnsupportedProjectMessage (Terminal terminal, Analytics analytics) {
932
916
analytics.send (Event .flutterBuildInfo (
933
917
label: 'unsupported-project' ,
934
918
buildType: 'gradle' ,
@@ -959,7 +943,6 @@ Iterable<String> findApkFilesModule(
959
943
FlutterProject project,
960
944
AndroidBuildInfo androidBuildInfo,
961
945
Logger logger,
962
- Usage usage,
963
946
Analytics analytics,
964
947
) {
965
948
final Iterable <String > apkFileNames = _apkFilesFor (androidBuildInfo);
@@ -995,7 +978,6 @@ Iterable<String> findApkFilesModule(
995
978
project: project,
996
979
fileExtension: '.apk' ,
997
980
logger: logger,
998
- usage: usage,
999
981
analytics: analytics,
1000
982
);
1001
983
}
@@ -1035,7 +1017,12 @@ Iterable<String> listApkPaths(
1035
1017
}
1036
1018
1037
1019
@visibleForTesting
1038
- File findBundleFile (FlutterProject project, BuildInfo buildInfo, Logger logger, Usage usage, Analytics analytics) {
1020
+ File findBundleFile (
1021
+ FlutterProject project,
1022
+ BuildInfo buildInfo,
1023
+ Logger logger,
1024
+ Analytics analytics,
1025
+ ) {
1039
1026
final List <File > fileCandidates = < File > [
1040
1027
getBundleDirectory (project)
1041
1028
.childDirectory (camelCase (buildInfo.modeName))
@@ -1091,7 +1078,6 @@ File findBundleFile(FlutterProject project, BuildInfo buildInfo, Logger logger,
1091
1078
project: project,
1092
1079
fileExtension: '.aab' ,
1093
1080
logger: logger,
1094
- usage: usage,
1095
1081
analytics: analytics,
1096
1082
);
1097
1083
}
@@ -1101,7 +1087,6 @@ Never _exitWithExpectedFileNotFound({
1101
1087
required FlutterProject project,
1102
1088
required String fileExtension,
1103
1089
required Logger logger,
1104
- required Usage usage,
1105
1090
required Analytics analytics,
1106
1091
}) {
1107
1092
@@ -1110,11 +1095,6 @@ Never _exitWithExpectedFileNotFound({
1110
1095
final String gradleBuildSettings = 'androidGradlePluginVersion: $androidGradlePluginVersion , '
1111
1096
'fileExtension: $fileExtension ' ;
1112
1097
1113
- BuildEvent ('gradle-expected-file-not-found' ,
1114
- type: 'gradle' ,
1115
- settings: gradleBuildSettings,
1116
- flutterUsage: usage,
1117
- ).send ();
1118
1098
analytics.send (Event .flutterBuildInfo (
1119
1099
label: 'gradle-expected-file-not-found' ,
1120
1100
buildType: 'gradle' ,
0 commit comments