Unverified Commit 7d767270 authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

[flutter_tools] replace --no-analytics with --suppress-analytics (#123133)

[flutter_tools] replace --no-analytics with --suppress-analytics
parent 4695fcc7
...@@ -152,7 +152,7 @@ GOTO :after_subroutine ...@@ -152,7 +152,7 @@ GOTO :after_subroutine
SET /A remaining_tries=%total_tries%-1 SET /A remaining_tries=%total_tries%-1
:retry_pub_upgrade :retry_pub_upgrade
ECHO Running pub upgrade... 1>&2 ECHO Running pub upgrade... 1>&2
"%dart%" --no-analytics pub upgrade "%dart%" pub upgrade --suppress-analytics
IF "%ERRORLEVEL%" EQU "0" goto :upgrade_succeeded IF "%ERRORLEVEL%" EQU "0" goto :upgrade_succeeded
ECHO Error (%ERRORLEVEL%): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (%remaining_tries% tries left) 1>&2 ECHO Error (%ERRORLEVEL%): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (%remaining_tries% tries left) 1>&2
timeout /t 5 /nobreak 2>NUL timeout /t 5 /nobreak 2>NUL
......
...@@ -21,7 +21,7 @@ function pub_upgrade_with_retry { ...@@ -21,7 +21,7 @@ function pub_upgrade_with_retry {
local total_tries="10" local total_tries="10"
local remaining_tries=$((total_tries - 1)) local remaining_tries=$((total_tries - 1))
while [[ "$remaining_tries" -gt 0 ]]; do while [[ "$remaining_tries" -gt 0 ]]; do
(cd "$FLUTTER_TOOLS_DIR" && "$DART" --no-analytics pub upgrade) && break (cd "$FLUTTER_TOOLS_DIR" && "$DART" pub upgrade --suppress-analytics) && break
>&2 echo "Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... ($remaining_tries tries left)" >&2 echo "Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... ($remaining_tries tries left)"
remaining_tries=$((remaining_tries - 1)) remaining_tries=$((remaining_tries - 1))
sleep 5 sleep 5
......
...@@ -581,7 +581,7 @@ class _DefaultPub implements Pub { ...@@ -581,7 +581,7 @@ class _DefaultPub implements Pub {
'permissions for the current user.' 'permissions for the current user.'
); );
} }
return <String>[sdkPath, '--no-analytics', 'pub']; return <String>[sdkPath, 'pub', '--suppress-analytics'];
} }
// Returns the environment value that should be used when running pub. // Returns the environment value that should be used when running pub.
......
...@@ -1950,14 +1950,14 @@ void main() { ...@@ -1950,14 +1950,14 @@ void main() {
await runner.run(<String>['create', '--pub', projectDir.path]); await runner.run(<String>['create', '--pub', projectDir.path]);
final RegExp dartCommand = RegExp(r'dart-sdk[\\/]bin[\\/]dart'); final RegExp dartCommand = RegExp(r'dart-sdk[\\/]bin[\\/]dart');
expect(loggingProcessManager.commands, contains(predicate( expect(loggingProcessManager.commands, contains(predicate(
(List<String> c) => dartCommand.hasMatch(c[0]) && c[2].contains('pub') && !c.contains('--offline') (List<String> c) => dartCommand.hasMatch(c[0]) && c[1].contains('pub') && !c.contains('--offline')
))); )));
// Run pub offline. // Run pub offline.
loggingProcessManager.clear(); loggingProcessManager.clear();
await runner.run(<String>['create', '--pub', '--offline', projectDir.path]); await runner.run(<String>['create', '--pub', '--offline', projectDir.path]);
expect(loggingProcessManager.commands, contains(predicate( expect(loggingProcessManager.commands, contains(predicate(
(List<String> c) => dartCommand.hasMatch(c[0]) && c[2].contains('pub') && c.contains('--offline') (List<String> c) => dartCommand.hasMatch(c[0]) && c[1].contains('pub') && c.contains('--offline'),
))); )));
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
......
...@@ -488,7 +488,7 @@ void main() { ...@@ -488,7 +488,7 @@ void main() {
globals.fs.directory('/packages/flutter_tools').createSync(recursive: true); globals.fs.directory('/packages/flutter_tools').createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('pubspec.yaml').createSync();
processManager.addCommand( processManager.addCommand(
const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', 'run', 'test']), const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', 'pub', '--suppress-analytics', 'run', 'test']),
); );
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']);
...@@ -514,7 +514,7 @@ void main() { ...@@ -514,7 +514,7 @@ void main() {
Cache.flutterRoot = ''; Cache.flutterRoot = '';
globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('pubspec.yaml').createSync();
processManager.addCommand( processManager.addCommand(
const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', '--trace', 'run', 'test']), const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', 'pub', '--suppress-analytics', '--trace', 'run', 'test']),
); );
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']);
...@@ -543,7 +543,7 @@ void main() { ...@@ -543,7 +543,7 @@ void main() {
processManager.addCommand( processManager.addCommand(
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', 'run', '--foo', 'bar', '/bin/cache/dart-sdk/bin/dart', 'pub', '--suppress-analytics', 'run', '--foo', 'bar',
], ],
stdin: stdin, stdin: stdin,
), ),
...@@ -574,7 +574,7 @@ void main() { ...@@ -574,7 +574,7 @@ void main() {
processManager.addCommand( processManager.addCommand(
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', 'token', 'list', '/bin/cache/dart-sdk/bin/dart', 'pub', '--suppress-analytics', 'token', 'list',
], ],
stdin: stdin, stdin: stdin,
), ),
...@@ -603,7 +603,7 @@ void main() { ...@@ -603,7 +603,7 @@ void main() {
processManager.addCommand( processManager.addCommand(
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', 'upgrade', '-h', '/bin/cache/dart-sdk/bin/dart', 'pub', '--suppress-analytics', 'upgrade', '-h',
], ],
stdin: IOSink(StreamController<List<int>>().sink), stdin: IOSink(StreamController<List<int>>().sink),
), ),
......
...@@ -55,8 +55,8 @@ void main() { ...@@ -55,8 +55,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -106,8 +106,8 @@ void main() { ...@@ -106,8 +106,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -157,8 +157,8 @@ void main() { ...@@ -157,8 +157,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -275,8 +275,8 @@ void main() { ...@@ -275,8 +275,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -317,8 +317,8 @@ void main() { ...@@ -317,8 +317,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -358,8 +358,8 @@ void main() { ...@@ -358,8 +358,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: const <String>[ FakeCommand(command: const <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -399,8 +399,8 @@ void main() { ...@@ -399,8 +399,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -438,8 +438,8 @@ void main() { ...@@ -438,8 +438,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -480,8 +480,8 @@ void main() { ...@@ -480,8 +480,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -528,8 +528,8 @@ void main() { ...@@ -528,8 +528,8 @@ void main() {
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -553,7 +553,7 @@ void main() { ...@@ -553,7 +553,7 @@ void main() {
); );
const String toolExitMessage = ''' const String toolExitMessage = '''
pub get failed pub get failed
command: "bin/cache/dart-sdk/bin/dart --no-analytics pub --directory . get --example" command: "bin/cache/dart-sdk/bin/dart pub --suppress-analytics --directory . get --example"
pub env: { pub env: {
"FLUTTER_ROOT": "", "FLUTTER_ROOT": "",
"PUB_ENVIRONMENT": "flutter_cli:flutter_tests", "PUB_ENVIRONMENT": "flutter_cli:flutter_tests",
...@@ -592,8 +592,8 @@ exit code: 66 ...@@ -592,8 +592,8 @@ exit code: 66
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -603,8 +603,8 @@ exit code: 66 ...@@ -603,8 +603,8 @@ exit code: 66
throw const ProcessException( throw const ProcessException(
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
<String>[ <String>[
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -661,8 +661,8 @@ exit code: 66 ...@@ -661,8 +661,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -712,8 +712,8 @@ exit code: 66 ...@@ -712,8 +712,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -767,8 +767,8 @@ exit code: 66 ...@@ -767,8 +767,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'cache', 'cache',
'preload', 'preload',
'.pub-preload-cache/a.tar.gz', '.pub-preload-cache/a.tar.gz',
...@@ -778,8 +778,8 @@ exit code: 66 ...@@ -778,8 +778,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -826,8 +826,8 @@ exit code: 66 ...@@ -826,8 +826,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -962,8 +962,8 @@ exit code: 66 ...@@ -962,8 +962,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1008,8 +1008,8 @@ exit code: 66 ...@@ -1008,8 +1008,8 @@ exit code: 66
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1023,8 +1023,8 @@ exit code: 66 ...@@ -1023,8 +1023,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1034,8 +1034,8 @@ exit code: 66 ...@@ -1034,8 +1034,8 @@ exit code: 66
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1049,8 +1049,8 @@ exit code: 66 ...@@ -1049,8 +1049,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'--no-analytics',
'pub', 'pub',
'--suppress-analytics',
'--directory', '--directory',
'.', '.',
'get', 'get',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment