[reland] delete FlutterCommand.usageValues
(#162550)
Relands https://github.com/flutter/flutter/pull/162468 The original PR broke g3 postsubmit, because there was an override of `FlutterCommand.usageValues`. This was since deleted. ## Original PR description toward https://github.com/flutter/flutter/issues/150575. More simple deletes. <details> <summary> Pre-launch checklist </summary> - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. </details> <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This commit is contained in:
parent
a612fda649
commit
2f2bda3504
@ -627,7 +627,6 @@ end
|
|||||||
swiftHostApp,
|
swiftHostApp,
|
||||||
);
|
);
|
||||||
|
|
||||||
final File swiftAnalyticsOutputFile = File(path.join(tempDir.path, 'analytics-swift.log'));
|
|
||||||
final Directory swiftBuildDirectory = Directory(path.join(tempDir.path, 'build-swift'));
|
final Directory swiftBuildDirectory = Directory(path.join(tempDir.path, 'build-swift'));
|
||||||
|
|
||||||
await inDirectory(swiftHostApp, () async {
|
await inDirectory(swiftHostApp, () async {
|
||||||
@ -652,9 +651,7 @@ end
|
|||||||
'BUILD_DIR=${swiftBuildDirectory.path}',
|
'BUILD_DIR=${swiftBuildDirectory.path}',
|
||||||
'COMPILER_INDEX_STORE_ENABLE=NO',
|
'COMPILER_INDEX_STORE_ENABLE=NO',
|
||||||
],
|
],
|
||||||
environment: <String, String>{
|
environment: <String, String>{'FLUTTER_SUPPRESS_ANALYTICS': 'true'},
|
||||||
'FLUTTER_ANALYTICS_LOG_FILE': swiftAnalyticsOutputFile.path,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -665,16 +662,6 @@ end
|
|||||||
return TaskResult.failure('Failed to build existing Swift app .app');
|
return TaskResult.failure('Failed to build existing Swift app .app');
|
||||||
}
|
}
|
||||||
|
|
||||||
final String swiftAnalyticsOutput = swiftAnalyticsOutputFile.readAsStringSync();
|
|
||||||
if (!swiftAnalyticsOutput.contains('cd24: ios') ||
|
|
||||||
!swiftAnalyticsOutput.contains('cd25: true') ||
|
|
||||||
!swiftAnalyticsOutput.contains('viewName: assemble')) {
|
|
||||||
return TaskResult.failure(
|
|
||||||
'Building outer Swift app produced the following analytics: "$swiftAnalyticsOutput" '
|
|
||||||
'but not the expected strings: "cd24: ios", "cd25: true", "viewName: assemble"',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TaskResult.success(null);
|
return TaskResult.success(null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return TaskResult.failure(e.toString());
|
return TaskResult.failure(e.toString());
|
||||||
|
@ -24,7 +24,6 @@ import '../cache.dart';
|
|||||||
import '../convert.dart';
|
import '../convert.dart';
|
||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart';
|
import '../runner/flutter_command.dart';
|
||||||
|
|
||||||
/// All currently implemented targets.
|
/// All currently implemented targets.
|
||||||
@ -163,12 +162,6 @@ class AssembleCommand extends FlutterCommand {
|
|||||||
@override
|
@override
|
||||||
String get category => FlutterCommandCategory.project;
|
String get category => FlutterCommandCategory.project;
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async => CustomDimensions(
|
|
||||||
commandBuildBundleTargetPlatform: _environment.defines[kTargetPlatform],
|
|
||||||
commandBuildBundleIsModule: _flutterProject.isModule,
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async => Event.commandUsageValues(
|
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async => Event.commandUsageValues(
|
||||||
workflow: commandPath,
|
workflow: commandPath,
|
||||||
|
@ -14,7 +14,6 @@ import '../build_info.dart';
|
|||||||
import '../cache.dart';
|
import '../cache.dart';
|
||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
||||||
import 'build.dart';
|
import 'build.dart';
|
||||||
|
|
||||||
@ -76,23 +75,6 @@ class BuildAarCommand extends BuildSubCommand {
|
|||||||
@override
|
@override
|
||||||
late final FlutterProject project = _getProject();
|
late final FlutterProject project = _getProject();
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
final String projectType;
|
|
||||||
if (project.manifest.isModule) {
|
|
||||||
projectType = 'module';
|
|
||||||
} else if (project.manifest.isPlugin) {
|
|
||||||
projectType = 'plugin';
|
|
||||||
} else {
|
|
||||||
projectType = 'app';
|
|
||||||
}
|
|
||||||
|
|
||||||
return CustomDimensions(
|
|
||||||
commandBuildAarProjectType: projectType,
|
|
||||||
commandBuildAarTargetPlatform: stringsArg('target-platform').join(','),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
||||||
final String projectType;
|
final String projectType;
|
||||||
|
@ -11,7 +11,6 @@ import '../build_info.dart';
|
|||||||
import '../cache.dart';
|
import '../cache.dart';
|
||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
||||||
import 'build.dart';
|
import 'build.dart';
|
||||||
|
|
||||||
@ -115,15 +114,6 @@ class BuildApkCommand extends BuildSubCommand {
|
|||||||
' * https://developer.android.com/guide/app-bundle\n'
|
' * https://developer.android.com/guide/app-bundle\n'
|
||||||
' * https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split';
|
' * https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split';
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
return CustomDimensions(
|
|
||||||
commandBuildApkTargetPlatform: _targetArchs.join(','),
|
|
||||||
commandBuildApkBuildMode: _buildMode.cliName,
|
|
||||||
commandBuildApkSplitPerAbi: boolArg('split-per-abi'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
||||||
return Event.commandUsageValues(
|
return Event.commandUsageValues(
|
||||||
|
@ -14,7 +14,6 @@ import '../build_info.dart';
|
|||||||
import '../cache.dart';
|
import '../cache.dart';
|
||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
import '../runner/flutter_command.dart' show FlutterCommandResult;
|
||||||
import 'build.dart';
|
import 'build.dart';
|
||||||
|
|
||||||
@ -92,27 +91,6 @@ class BuildAppBundleCommand extends BuildSubCommand {
|
|||||||
"debugging and a quick development cycle. 'release' builds don't support debugging and are "
|
"debugging and a quick development cycle. 'release' builds don't support debugging and are "
|
||||||
'suitable for deploying to app stores. \n app bundle improves your app size';
|
'suitable for deploying to app stores. \n app bundle improves your app size';
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
String buildMode;
|
|
||||||
|
|
||||||
if (boolArg('release')) {
|
|
||||||
buildMode = 'release';
|
|
||||||
} else if (boolArg('debug')) {
|
|
||||||
buildMode = 'debug';
|
|
||||||
} else if (boolArg('profile')) {
|
|
||||||
buildMode = 'profile';
|
|
||||||
} else {
|
|
||||||
// The build defaults to release.
|
|
||||||
buildMode = 'release';
|
|
||||||
}
|
|
||||||
|
|
||||||
return CustomDimensions(
|
|
||||||
commandBuildAppBundleTargetPlatform: stringsArg('target-platform').join(','),
|
|
||||||
commandBuildAppBundleBuildMode: buildMode,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
||||||
final String buildMode;
|
final String buildMode;
|
||||||
|
@ -11,7 +11,6 @@ import '../bundle_builder.dart';
|
|||||||
import '../features.dart';
|
import '../features.dart';
|
||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart';
|
import '../runner/flutter_command.dart';
|
||||||
import 'build.dart';
|
import 'build.dart';
|
||||||
|
|
||||||
@ -83,18 +82,6 @@ class BuildBundleCommand extends BuildSubCommand {
|
|||||||
'application code and resources; they are used by some Flutter Android and'
|
'application code and resources; they are used by some Flutter Android and'
|
||||||
' iOS runtimes.';
|
' iOS runtimes.';
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
final String projectDir = globals.fs.file(targetFile).parent.parent.path;
|
|
||||||
final FlutterProject flutterProject = FlutterProject.fromDirectory(
|
|
||||||
globals.fs.directory(projectDir),
|
|
||||||
);
|
|
||||||
return CustomDimensions(
|
|
||||||
commandBuildBundleTargetPlatform: stringArg('target-platform'),
|
|
||||||
commandBuildBundleIsModule: flutterProject.isModule,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
||||||
final String projectDir = globals.fs.file(targetFile).parent.parent.path;
|
final String projectDir = globals.fs.file(targetFile).parent.parent.path;
|
||||||
|
@ -24,7 +24,6 @@ import '../ios/code_signing.dart';
|
|||||||
import '../macos/swift_package_manager.dart';
|
import '../macos/swift_package_manager.dart';
|
||||||
import '../macos/swift_packages.dart';
|
import '../macos/swift_packages.dart';
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart';
|
import '../runner/flutter_command.dart';
|
||||||
import 'create_base.dart';
|
import 'create_base.dart';
|
||||||
|
|
||||||
@ -155,15 +154,6 @@ class CreateCommand extends FlutterCommand with CreateBase {
|
|||||||
@override
|
@override
|
||||||
String get invocation => '${runner?.executableName} $name <output directory>';
|
String get invocation => '${runner?.executableName} $name <output directory>';
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
return CustomDimensions(
|
|
||||||
commandCreateProjectType: stringArg('template'),
|
|
||||||
commandCreateAndroidLanguage: stringArg('android-language'),
|
|
||||||
commandCreateIosLanguage: stringArg('ios-language'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async => Event.commandUsageValues(
|
Future<Event> unifiedAnalyticsUsageValues(String commandPath) async => Event.commandUsageValues(
|
||||||
workflow: commandPath,
|
workflow: commandPath,
|
||||||
|
@ -19,7 +19,6 @@ import '../flutter_plugins.dart';
|
|||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../plugins.dart';
|
import '../plugins.dart';
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../runner/flutter_command.dart';
|
import '../runner/flutter_command.dart';
|
||||||
|
|
||||||
class PackagesCommand extends FlutterCommand {
|
class PackagesCommand extends FlutterCommand {
|
||||||
@ -397,36 +396,6 @@ class PackagesGetCommand extends FlutterCommand {
|
|||||||
late final String? _androidEmbeddingVersion =
|
late final String? _androidEmbeddingVersion =
|
||||||
_rootProject?.android.getEmbeddingVersion().toString().split('.').last;
|
_rootProject?.android.getEmbeddingVersion().toString().split('.').last;
|
||||||
|
|
||||||
/// The pub packages usage values are incorrect since these are calculated/sent
|
|
||||||
/// before pub get completes. This needs to be performed after dependency resolution.
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
final FlutterProject? rootProject = _rootProject;
|
|
||||||
if (rootProject == null) {
|
|
||||||
return const CustomDimensions();
|
|
||||||
}
|
|
||||||
|
|
||||||
int numberPlugins;
|
|
||||||
// Do not send plugin analytics if pub has not run before.
|
|
||||||
final bool hasPlugins =
|
|
||||||
rootProject.flutterPluginsDependenciesFile.existsSync() &&
|
|
||||||
findPackageConfigFile(rootProject.directory) != null;
|
|
||||||
if (hasPlugins) {
|
|
||||||
// Do not fail pub get if package config files are invalid before pub has
|
|
||||||
// had a chance to run.
|
|
||||||
final List<Plugin> plugins = await _pluginsFound;
|
|
||||||
numberPlugins = plugins.length;
|
|
||||||
} else {
|
|
||||||
numberPlugins = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CustomDimensions(
|
|
||||||
commandPackagesNumberPlugins: numberPlugins,
|
|
||||||
commandPackagesProjectModule: rootProject.isModule,
|
|
||||||
commandPackagesAndroidEmbeddingVersion: _androidEmbeddingVersion,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The pub packages usage values are incorrect since these are calculated/sent
|
/// The pub packages usage values are incorrect since these are calculated/sent
|
||||||
/// before pub get completes. This needs to be performed after dependency resolution.
|
/// before pub get completes. This needs to be performed after dependency resolution.
|
||||||
@override
|
@override
|
||||||
|
@ -20,7 +20,6 @@ import '../features.dart';
|
|||||||
import '../globals.dart' as globals;
|
import '../globals.dart' as globals;
|
||||||
import '../ios/devices.dart';
|
import '../ios/devices.dart';
|
||||||
import '../project.dart';
|
import '../project.dart';
|
||||||
import '../reporting/reporting.dart';
|
|
||||||
import '../resident_runner.dart';
|
import '../resident_runner.dart';
|
||||||
import '../run_cold.dart';
|
import '../run_cold.dart';
|
||||||
import '../run_hot.dart';
|
import '../run_hot.dart';
|
||||||
@ -532,24 +531,6 @@ class RunCommand extends RunCommandBase {
|
|||||||
return '$command/${getNameForTargetPlatform(await devices![0].targetPlatform)}';
|
return '$command/${getNameForTargetPlatform(await devices![0].targetPlatform)}';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CustomDimensions> get usageValues async {
|
|
||||||
final AnalyticsUsageValuesRecord record = await _sharedAnalyticsUsageValues;
|
|
||||||
|
|
||||||
return CustomDimensions(
|
|
||||||
commandRunIsEmulator: record.runIsEmulator,
|
|
||||||
commandRunTargetName: record.runTargetName,
|
|
||||||
commandRunTargetOsVersion: record.runTargetOsVersion,
|
|
||||||
commandRunModeName: record.runModeName,
|
|
||||||
commandRunProjectModule: record.runProjectModule,
|
|
||||||
commandRunProjectHostLanguage: record.runProjectHostLanguage,
|
|
||||||
commandRunAndroidEmbeddingVersion: record.runAndroidEmbeddingVersion,
|
|
||||||
commandRunEnableImpeller: record.runEnableImpeller,
|
|
||||||
commandRunIOSInterfaceType: record.runIOSInterfaceType,
|
|
||||||
commandRunIsTest: record.runIsTest,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<analytics.Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
Future<analytics.Event> unifiedAnalyticsUsageValues(String commandPath) async {
|
||||||
final AnalyticsUsageValuesRecord record = await _sharedAnalyticsUsageValues;
|
final AnalyticsUsageValuesRecord record = await _sharedAnalyticsUsageValues;
|
||||||
|
@ -1518,9 +1518,6 @@ abstract class FlutterCommand extends Command<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Additional usage values to be sent with the usage ping.
|
|
||||||
Future<CustomDimensions> get usageValues async => const CustomDimensions();
|
|
||||||
|
|
||||||
/// Additional usage values to be sent with the usage ping for
|
/// Additional usage values to be sent with the usage ping for
|
||||||
/// package:unified_analytics.
|
/// package:unified_analytics.
|
||||||
///
|
///
|
||||||
@ -1915,20 +1912,7 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
|
|||||||
setupApplicationPackages();
|
setupApplicationPackages();
|
||||||
|
|
||||||
if (commandPath != null) {
|
if (commandPath != null) {
|
||||||
// Until the GA4 migration is complete, we will continue to send to the GA3 instance
|
analytics.send(await unifiedAnalyticsUsageValues(commandPath));
|
||||||
// as well as GA4. Once migration is complete, we will only make a call for GA4 values
|
|
||||||
final List<Object> pairOfUsageValues = await Future.wait<Object>(<Future<Object>>[
|
|
||||||
usageValues,
|
|
||||||
unifiedAnalyticsUsageValues(commandPath),
|
|
||||||
]);
|
|
||||||
|
|
||||||
Usage.command(
|
|
||||||
commandPath,
|
|
||||||
parameters: CustomDimensions(
|
|
||||||
commandHasTerminal: hasTerminal,
|
|
||||||
).merge(pairOfUsageValues[0] as CustomDimensions),
|
|
||||||
);
|
|
||||||
analytics.send(pairOfUsageValues[1] as Event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return runCommand();
|
return runCommand();
|
||||||
|
@ -188,22 +188,35 @@ void main() {
|
|||||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||||
|
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=module', 'testy']);
|
await runner.run(<String>['create', '--no-pub', '--template=module', 'testy']);
|
||||||
expect((await command.usageValues).commandCreateProjectType, 'module');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createProjectType'],
|
||||||
|
'module',
|
||||||
|
);
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=app', 'testy1']);
|
await runner.run(<String>['create', '--no-pub', '--template=app', 'testy1']);
|
||||||
expect((await command.usageValues).commandCreateProjectType, 'app');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createProjectType'],
|
||||||
|
'app',
|
||||||
|
);
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=package', 'testy3']);
|
await runner.run(<String>['create', '--no-pub', '--template=package', 'testy3']);
|
||||||
expect((await command.usageValues).commandCreateProjectType, 'package');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createProjectType'],
|
||||||
|
'package',
|
||||||
|
);
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=plugin', 'testy4']);
|
await runner.run(<String>['create', '--no-pub', '--template=plugin', 'testy4']);
|
||||||
expect((await command.usageValues).commandCreateProjectType, 'plugin');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createProjectType'],
|
||||||
|
'plugin',
|
||||||
|
);
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=plugin_ffi', 'testy5']);
|
await runner.run(<String>['create', '--no-pub', '--template=plugin_ffi', 'testy5']);
|
||||||
expect((await command.usageValues).commandCreateProjectType, 'plugin_ffi');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createProjectType'],
|
||||||
|
'plugin_ffi',
|
||||||
|
);
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=package_ffi', 'testy6']);
|
await runner.run(<String>['create', '--no-pub', '--template=package_ffi', 'testy6']);
|
||||||
expect((await command.usageValues).commandCreateProjectType, 'package_ffi');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createProjectType'],
|
||||||
|
'package_ffi',
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
overrides: <Type, Generator>{Java: () => FakeJava()},
|
overrides: <Type, Generator>{Java: () => FakeJava()},
|
||||||
);
|
);
|
||||||
@ -215,7 +228,10 @@ void main() {
|
|||||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||||
|
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=app', 'testy']);
|
await runner.run(<String>['create', '--no-pub', '--template=app', 'testy']);
|
||||||
expect((await command.usageValues).commandCreateIosLanguage, 'swift');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createIosLanguage'],
|
||||||
|
'swift',
|
||||||
|
);
|
||||||
|
|
||||||
await runner.run(<String>[
|
await runner.run(<String>[
|
||||||
'create',
|
'create',
|
||||||
@ -224,7 +240,10 @@ void main() {
|
|||||||
'--ios-language=objc',
|
'--ios-language=objc',
|
||||||
'testy',
|
'testy',
|
||||||
]);
|
]);
|
||||||
expect((await command.usageValues).commandCreateIosLanguage, 'objc');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createIosLanguage'],
|
||||||
|
'objc',
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
overrides: <Type, Generator>{Java: () => FakeJava()},
|
overrides: <Type, Generator>{Java: () => FakeJava()},
|
||||||
);
|
);
|
||||||
@ -236,7 +255,10 @@ void main() {
|
|||||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||||
|
|
||||||
await runner.run(<String>['create', '--no-pub', '--template=app', 'testy']);
|
await runner.run(<String>['create', '--no-pub', '--template=app', 'testy']);
|
||||||
expect((await command.usageValues).commandCreateAndroidLanguage, 'kotlin');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createAndroidLanguage'],
|
||||||
|
'kotlin',
|
||||||
|
);
|
||||||
|
|
||||||
await runner.run(<String>[
|
await runner.run(<String>[
|
||||||
'create',
|
'create',
|
||||||
@ -245,7 +267,10 @@ void main() {
|
|||||||
'--android-language=java',
|
'--android-language=java',
|
||||||
'testy',
|
'testy',
|
||||||
]);
|
]);
|
||||||
expect((await command.usageValues).commandCreateAndroidLanguage, 'java');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('create')).eventData['createAndroidLanguage'],
|
||||||
|
'java',
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
overrides: <Type, Generator>{Java: () => FakeJava()},
|
overrides: <Type, Generator>{Java: () => FakeJava()},
|
||||||
);
|
);
|
||||||
|
@ -11,9 +11,9 @@ import 'package:flutter_tools/src/commands/packages.dart';
|
|||||||
import 'package:flutter_tools/src/dart/pub.dart';
|
import 'package:flutter_tools/src/dart/pub.dart';
|
||||||
import 'package:flutter_tools/src/features.dart';
|
import 'package:flutter_tools/src/features.dart';
|
||||||
import 'package:flutter_tools/src/project.dart';
|
import 'package:flutter_tools/src/project.dart';
|
||||||
import 'package:flutter_tools/src/reporting/reporting.dart';
|
|
||||||
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
||||||
import 'package:test/fake.dart';
|
import 'package:test/fake.dart';
|
||||||
|
import 'package:unified_analytics/unified_analytics.dart';
|
||||||
|
|
||||||
import '../../src/context.dart';
|
import '../../src/context.dart';
|
||||||
import '../../src/fake_pub_deps.dart';
|
import '../../src/fake_pub_deps.dart';
|
||||||
@ -86,11 +86,13 @@ void main() {
|
|||||||
await commandRunner.run(<String>['get']);
|
await commandRunner.run(<String>['get']);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
await command.usageValues,
|
await command.unifiedAnalyticsUsageValues('pub'),
|
||||||
const CustomDimensions(
|
Event.commandUsageValues(
|
||||||
commandPackagesNumberPlugins: 0,
|
workflow: 'pub',
|
||||||
commandPackagesProjectModule: false,
|
commandHasTerminal: false,
|
||||||
commandPackagesAndroidEmbeddingVersion: 'v2',
|
packagesNumberPlugins: 0,
|
||||||
|
packagesProjectModule: false,
|
||||||
|
packagesAndroidEmbeddingVersion: 'v2',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -120,11 +122,13 @@ void main() {
|
|||||||
await commandRunner.run(<String>['get']);
|
await commandRunner.run(<String>['get']);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
await command.usageValues,
|
await command.unifiedAnalyticsUsageValues('pub'),
|
||||||
const CustomDimensions(
|
Event.commandUsageValues(
|
||||||
commandPackagesNumberPlugins: 0,
|
workflow: 'pub',
|
||||||
commandPackagesProjectModule: false,
|
commandHasTerminal: false,
|
||||||
commandPackagesAndroidEmbeddingVersion: 'v2',
|
packagesNumberPlugins: 0,
|
||||||
|
packagesProjectModule: false,
|
||||||
|
packagesAndroidEmbeddingVersion: 'v2',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -239,11 +243,13 @@ void main() {
|
|||||||
await commandRunner.run(<String>['get']);
|
await commandRunner.run(<String>['get']);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
await command.usageValues,
|
await command.unifiedAnalyticsUsageValues('pub'),
|
||||||
const CustomDimensions(
|
Event.commandUsageValues(
|
||||||
commandPackagesNumberPlugins: 0,
|
workflow: 'pub',
|
||||||
commandPackagesProjectModule: false,
|
commandHasTerminal: false,
|
||||||
commandPackagesAndroidEmbeddingVersion: 'v2',
|
packagesNumberPlugins: 0,
|
||||||
|
packagesProjectModule: false,
|
||||||
|
packagesAndroidEmbeddingVersion: 'v2',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,6 @@ import 'package:flutter_tools/src/device.dart';
|
|||||||
import 'package:flutter_tools/src/globals.dart' as globals;
|
import 'package:flutter_tools/src/globals.dart' as globals;
|
||||||
import 'package:flutter_tools/src/ios/devices.dart';
|
import 'package:flutter_tools/src/ios/devices.dart';
|
||||||
import 'package:flutter_tools/src/project.dart';
|
import 'package:flutter_tools/src/project.dart';
|
||||||
import 'package:flutter_tools/src/reporting/reporting.dart';
|
|
||||||
import 'package:flutter_tools/src/resident_runner.dart';
|
import 'package:flutter_tools/src/resident_runner.dart';
|
||||||
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
||||||
import 'package:flutter_tools/src/web/compile.dart';
|
import 'package:flutter_tools/src/web/compile.dart';
|
||||||
@ -220,7 +219,6 @@ void main() {
|
|||||||
group('run app', () {
|
group('run app', () {
|
||||||
late MemoryFileSystem fs;
|
late MemoryFileSystem fs;
|
||||||
late Artifacts artifacts;
|
late Artifacts artifacts;
|
||||||
late TestUsage usage;
|
|
||||||
late FakeAnsiTerminal fakeTerminal;
|
late FakeAnsiTerminal fakeTerminal;
|
||||||
late analytics.FakeAnalytics fakeAnalytics;
|
late analytics.FakeAnalytics fakeAnalytics;
|
||||||
|
|
||||||
@ -231,7 +229,6 @@ void main() {
|
|||||||
setUp(() {
|
setUp(() {
|
||||||
fakeTerminal = FakeAnsiTerminal();
|
fakeTerminal = FakeAnsiTerminal();
|
||||||
artifacts = Artifacts.test();
|
artifacts = Artifacts.test();
|
||||||
usage = TestUsage();
|
|
||||||
fs = MemoryFileSystem.test();
|
fs = MemoryFileSystem.test();
|
||||||
|
|
||||||
fs.currentDirectory.childFile('pubspec.yaml').writeAsStringSync('name: flutter_app');
|
fs.currentDirectory.childFile('pubspec.yaml').writeAsStringSync('name: flutter_app');
|
||||||
@ -474,7 +471,6 @@ void main() {
|
|||||||
DeviceManager: () => testDeviceManager,
|
DeviceManager: () => testDeviceManager,
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
ProcessManager: () => FakeProcessManager.any(),
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
Usage: () => usage,
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -524,7 +520,6 @@ void main() {
|
|||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
ProcessManager: () => FakeProcessManager.any(),
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
Stdio: () => FakeStdio(),
|
Stdio: () => FakeStdio(),
|
||||||
Usage: () => usage,
|
|
||||||
analytics.Analytics: () => fakeAnalytics,
|
analytics.Analytics: () => fakeAnalytics,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -579,7 +574,6 @@ void main() {
|
|||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
ProcessManager: () => FakeProcessManager.any(),
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
Stdio: () => FakeStdio(),
|
Stdio: () => FakeStdio(),
|
||||||
Usage: () => usage,
|
|
||||||
analytics.Analytics: () => fakeAnalytics,
|
analytics.Analytics: () => fakeAnalytics,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -612,7 +606,6 @@ void main() {
|
|||||||
DeviceManager: () => testDeviceManager,
|
DeviceManager: () => testDeviceManager,
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
ProcessManager: () => FakeProcessManager.any(),
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
Usage: () => usage,
|
|
||||||
Stdio: () => FakeStdio(),
|
Stdio: () => FakeStdio(),
|
||||||
Logger: () => AppRunLogger(parent: logger),
|
Logger: () => AppRunLogger(parent: logger),
|
||||||
},
|
},
|
||||||
@ -639,7 +632,6 @@ void main() {
|
|||||||
DeviceManager: () => testDeviceManager,
|
DeviceManager: () => testDeviceManager,
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
ProcessManager: () => FakeProcessManager.any(),
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
Usage: () => usage,
|
|
||||||
Stdio: () => FakeStdio(),
|
Stdio: () => FakeStdio(),
|
||||||
Logger: () => AppRunLogger(parent: logger),
|
Logger: () => AppRunLogger(parent: logger),
|
||||||
},
|
},
|
||||||
@ -819,18 +811,22 @@ void main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final CustomDimensions dimensions = await command.usageValues;
|
final analytics.Event usageValues = await command.unifiedAnalyticsUsageValues('run');
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
dimensions,
|
usageValues,
|
||||||
const CustomDimensions(
|
equals(
|
||||||
commandRunIsEmulator: false,
|
analytics.Event.commandUsageValues(
|
||||||
commandRunTargetName: 'android-arm',
|
workflow: 'run',
|
||||||
commandRunTargetOsVersion: '',
|
commandHasTerminal: false,
|
||||||
commandRunModeName: 'debug',
|
runIsEmulator: false,
|
||||||
commandRunProjectModule: false,
|
runTargetName: 'android-arm',
|
||||||
commandRunProjectHostLanguage: '',
|
runTargetOsVersion: '',
|
||||||
commandRunIsTest: false,
|
runModeName: 'debug',
|
||||||
|
runProjectModule: false,
|
||||||
|
runProjectHostLanguage: '',
|
||||||
|
runIsTest: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -866,19 +862,23 @@ void main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final CustomDimensions dimensions = await command.usageValues;
|
final analytics.Event usageValues = await command.unifiedAnalyticsUsageValues('run');
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
dimensions,
|
usageValues,
|
||||||
const CustomDimensions(
|
equals(
|
||||||
commandRunIsEmulator: false,
|
analytics.Event.commandUsageValues(
|
||||||
commandRunTargetName: 'ios',
|
workflow: 'run',
|
||||||
commandRunTargetOsVersion: 'iOS 16.2',
|
commandHasTerminal: false,
|
||||||
commandRunModeName: 'debug',
|
runIsEmulator: false,
|
||||||
commandRunProjectModule: false,
|
runTargetName: 'ios',
|
||||||
commandRunProjectHostLanguage: '',
|
runTargetOsVersion: 'iOS 16.2',
|
||||||
commandRunIOSInterfaceType: 'usb',
|
runModeName: 'debug',
|
||||||
commandRunIsTest: false,
|
runProjectModule: false,
|
||||||
|
runProjectHostLanguage: '',
|
||||||
|
runIOSInterfaceType: 'usb',
|
||||||
|
runIsTest: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -919,19 +919,23 @@ void main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final CustomDimensions dimensions = await command.usageValues;
|
final analytics.Event usageValues = await command.unifiedAnalyticsUsageValues('run');
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
dimensions,
|
usageValues,
|
||||||
const CustomDimensions(
|
equals(
|
||||||
commandRunIsEmulator: false,
|
analytics.Event.commandUsageValues(
|
||||||
commandRunTargetName: 'ios',
|
workflow: 'run',
|
||||||
commandRunTargetOsVersion: 'iOS 16.2',
|
commandHasTerminal: false,
|
||||||
commandRunModeName: 'debug',
|
runIsEmulator: false,
|
||||||
commandRunProjectModule: false,
|
runTargetName: 'ios',
|
||||||
commandRunProjectHostLanguage: '',
|
runTargetOsVersion: 'iOS 16.2',
|
||||||
commandRunIOSInterfaceType: 'wireless',
|
runModeName: 'debug',
|
||||||
commandRunIsTest: false,
|
runProjectModule: false,
|
||||||
|
runProjectHostLanguage: '',
|
||||||
|
runIOSInterfaceType: 'wireless',
|
||||||
|
runIsTest: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -972,19 +976,24 @@ void main() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final CustomDimensions dimensions = await command.usageValues;
|
|
||||||
|
final analytics.Event usageValues = await command.unifiedAnalyticsUsageValues('run');
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
dimensions,
|
usageValues,
|
||||||
const CustomDimensions(
|
equals(
|
||||||
commandRunIsEmulator: false,
|
analytics.Event.commandUsageValues(
|
||||||
commandRunTargetName: 'multiple',
|
workflow: 'run',
|
||||||
commandRunTargetOsVersion: 'multiple',
|
commandHasTerminal: false,
|
||||||
commandRunModeName: 'debug',
|
runIsEmulator: false,
|
||||||
commandRunProjectModule: false,
|
runTargetName: 'multiple',
|
||||||
commandRunProjectHostLanguage: '',
|
runTargetOsVersion: 'multiple',
|
||||||
commandRunIOSInterfaceType: 'wireless',
|
runModeName: 'debug',
|
||||||
commandRunIsTest: false,
|
runProjectModule: false,
|
||||||
|
runProjectHostLanguage: '',
|
||||||
|
runIOSInterfaceType: 'wireless',
|
||||||
|
runIsTest: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -16,8 +16,8 @@ import 'package:flutter_tools/src/commands/build_aar.dart';
|
|||||||
import 'package:flutter_tools/src/features.dart';
|
import 'package:flutter_tools/src/features.dart';
|
||||||
import 'package:flutter_tools/src/globals.dart' as globals;
|
import 'package:flutter_tools/src/globals.dart' as globals;
|
||||||
import 'package:flutter_tools/src/project.dart';
|
import 'package:flutter_tools/src/project.dart';
|
||||||
import 'package:flutter_tools/src/reporting/reporting.dart';
|
|
||||||
import 'package:test/fake.dart';
|
import 'package:test/fake.dart';
|
||||||
|
import 'package:unified_analytics/testing.dart';
|
||||||
import 'package:unified_analytics/unified_analytics.dart';
|
import 'package:unified_analytics/unified_analytics.dart';
|
||||||
|
|
||||||
import '../../src/android_common.dart';
|
import '../../src/android_common.dart';
|
||||||
@ -44,10 +44,13 @@ void main() {
|
|||||||
|
|
||||||
group('Usage', () {
|
group('Usage', () {
|
||||||
late Directory tempDir;
|
late Directory tempDir;
|
||||||
late TestUsage testUsage;
|
late FakeAnalytics analytics;
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
testUsage = TestUsage();
|
analytics = getInitializedFakeAnalyticsInstance(
|
||||||
|
fs: MemoryFileSystem.test(),
|
||||||
|
fakeFlutterVersion: FakeFlutterVersion(),
|
||||||
|
);
|
||||||
tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_tools_packages_test.');
|
tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_tools_packages_test.');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -63,10 +66,23 @@ void main() {
|
|||||||
arguments: <String>['--no-pub', '--template=module'],
|
arguments: <String>['--no-pub', '--template=module'],
|
||||||
);
|
);
|
||||||
|
|
||||||
final BuildAarCommand command = await runCommandIn(projectPath);
|
await runCommandIn(projectPath);
|
||||||
expect((await command.usageValues).commandBuildAarProjectType, 'module');
|
expect(
|
||||||
|
analytics.sentEvents,
|
||||||
|
contains(
|
||||||
|
Event.commandUsageValues(
|
||||||
|
workflow: 'aar',
|
||||||
|
buildAarProjectType: 'module',
|
||||||
|
buildAarTargetPlatform: 'android-arm,android-arm64,android-x64',
|
||||||
|
commandHasTerminal: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
overrides: <Type, Generator>{
|
||||||
|
AndroidBuilder: () => FakeAndroidBuilder(),
|
||||||
|
Analytics: () => analytics,
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{AndroidBuilder: () => FakeAndroidBuilder()},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
testUsingContext(
|
testUsingContext(
|
||||||
@ -77,13 +93,23 @@ void main() {
|
|||||||
arguments: <String>['--no-pub', '--template=module'],
|
arguments: <String>['--no-pub', '--template=module'],
|
||||||
);
|
);
|
||||||
|
|
||||||
final BuildAarCommand command = await runCommandIn(
|
await runCommandIn(projectPath, arguments: <String>['--target-platform=android-arm']);
|
||||||
projectPath,
|
expect(
|
||||||
arguments: <String>['--target-platform=android-arm'],
|
analytics.sentEvents,
|
||||||
|
contains(
|
||||||
|
Event.commandUsageValues(
|
||||||
|
workflow: 'aar',
|
||||||
|
buildAarProjectType: 'module',
|
||||||
|
buildAarTargetPlatform: 'android-arm',
|
||||||
|
commandHasTerminal: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
expect((await command.usageValues).commandBuildAarTargetPlatform, 'android-arm');
|
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{AndroidBuilder: () => FakeAndroidBuilder()},
|
overrides: <Type, Generator>{
|
||||||
|
AndroidBuilder: () => FakeAndroidBuilder(),
|
||||||
|
Analytics: () => analytics,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
testUsingContext(
|
testUsingContext(
|
||||||
@ -96,14 +122,17 @@ void main() {
|
|||||||
|
|
||||||
await runCommandIn(projectPath, arguments: <String>['--target-platform=android-arm']);
|
await runCommandIn(projectPath, arguments: <String>['--target-platform=android-arm']);
|
||||||
|
|
||||||
expect(
|
final Iterable<Event> successEvent = analytics.sentEvents.where(
|
||||||
testUsage.events,
|
(Event e) =>
|
||||||
contains(const TestUsageEvent('tool-command-result', 'aar', label: 'success')),
|
e.eventName == DashEvent.flutterCommandResult &&
|
||||||
|
e.eventData['commandPath'] == 'create' &&
|
||||||
|
e.eventData['result'] == 'success',
|
||||||
);
|
);
|
||||||
|
expect(successEvent, isNotEmpty, reason: 'Tool should send create success event');
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{
|
overrides: <Type, Generator>{
|
||||||
AndroidBuilder: () => FakeAndroidBuilder(),
|
AndroidBuilder: () => FakeAndroidBuilder(),
|
||||||
Usage: () => testUsage,
|
Analytics: () => analytics,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -99,9 +99,8 @@ void main() {
|
|||||||
arguments: <String>['--no-pub', '--template=app'],
|
arguments: <String>['--no-pub', '--template=app'],
|
||||||
);
|
);
|
||||||
|
|
||||||
final BuildBundleCommand command = await runCommandIn(projectPath);
|
await runCommandIn(projectPath);
|
||||||
|
|
||||||
expect((await command.usageValues).commandBuildBundleIsModule, false);
|
|
||||||
expect(
|
expect(
|
||||||
fakeAnalytics.sentEvents,
|
fakeAnalytics.sentEvents,
|
||||||
contains(
|
contains(
|
||||||
@ -125,7 +124,10 @@ void main() {
|
|||||||
|
|
||||||
final BuildBundleCommand command = await runCommandIn(projectPath);
|
final BuildBundleCommand command = await runCommandIn(projectPath);
|
||||||
|
|
||||||
expect((await command.usageValues).commandBuildBundleTargetPlatform, 'android-arm');
|
expect(
|
||||||
|
(await command.unifiedAnalyticsUsageValues('bundle')).eventData['buildBundleTargetPlatform'],
|
||||||
|
'android-arm',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext(
|
testUsingContext(
|
||||||
|
@ -496,7 +496,6 @@ flutter:
|
|||||||
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
||||||
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
||||||
|
|
||||||
expect((await getCommand.usageValues).commandPackagesNumberPlugins, 0);
|
|
||||||
expect(
|
expect(
|
||||||
(await getCommand.unifiedAnalyticsUsageValues(
|
(await getCommand.unifiedAnalyticsUsageValues(
|
||||||
'pub/get',
|
'pub/get',
|
||||||
@ -535,7 +534,6 @@ flutter:
|
|||||||
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
||||||
|
|
||||||
// A plugin example depends on the plugin itself, and integration_test.
|
// A plugin example depends on the plugin itself, and integration_test.
|
||||||
expect((await getCommand.usageValues).commandPackagesNumberPlugins, 2);
|
|
||||||
expect(
|
expect(
|
||||||
(await getCommand.unifiedAnalyticsUsageValues(
|
(await getCommand.unifiedAnalyticsUsageValues(
|
||||||
'pub/get',
|
'pub/get',
|
||||||
@ -566,7 +564,6 @@ flutter:
|
|||||||
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
||||||
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
||||||
|
|
||||||
expect((await getCommand.usageValues).commandPackagesProjectModule, false);
|
|
||||||
expect(
|
expect(
|
||||||
(await getCommand.unifiedAnalyticsUsageValues(
|
(await getCommand.unifiedAnalyticsUsageValues(
|
||||||
'pub/get',
|
'pub/get',
|
||||||
@ -600,7 +597,6 @@ flutter:
|
|||||||
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
||||||
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
||||||
|
|
||||||
expect((await getCommand.usageValues).commandPackagesProjectModule, true);
|
|
||||||
expect(
|
expect(
|
||||||
(await getCommand.unifiedAnalyticsUsageValues(
|
(await getCommand.unifiedAnalyticsUsageValues(
|
||||||
'pub/get',
|
'pub/get',
|
||||||
@ -631,7 +627,6 @@ flutter:
|
|||||||
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
final PackagesCommand command = await runCommandIn(projectPath, 'get');
|
||||||
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
final PackagesGetCommand getCommand = command.subcommands['get']! as PackagesGetCommand;
|
||||||
|
|
||||||
expect((await getCommand.usageValues).commandPackagesAndroidEmbeddingVersion, 'v2');
|
|
||||||
expect(
|
expect(
|
||||||
(await getCommand.unifiedAnalyticsUsageValues(
|
(await getCommand.unifiedAnalyticsUsageValues(
|
||||||
'pub/get',
|
'pub/get',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user