Unverified Commit 7a280785 authored by Sigurd Meldgaard's avatar Sigurd Meldgaard Committed by GitHub

Use `dart pub` instead of `dart __deprecated pub` (#121605)

parent d940ec1f
...@@ -115,10 +115,10 @@ task: ...@@ -115,10 +115,10 @@ task:
MEMORY: 10G MEMORY: 10G
SHOULD_UPDATE_PACKAGES: "FALSE" SHOULD_UPDATE_PACKAGES: "FALSE"
script: script:
- (cd packages/flutter_tools; dart __deprecated_pub get) - (cd packages/flutter_tools; dart pub get)
- (cd packages/flutter_tools/test/data/asset_test/main; dart __deprecated_pub get) - (cd packages/flutter_tools/test/data/asset_test/main; dart pub get)
- (cd packages/flutter_tools/test/data/asset_test/font; dart __deprecated_pub get) - (cd packages/flutter_tools/test/data/asset_test/font; dart pub get)
- (cd dev/bots; dart __deprecated_pub get) - (cd dev/bots; dart pub get)
- dart --enable-asserts ./dev/bots/test.dart - dart --enable-asserts ./dev/bots/test.dart
- name: tool_tests-commands-linux - name: tool_tests-commands-linux
...@@ -131,8 +131,8 @@ task: ...@@ -131,8 +131,8 @@ task:
MEMORY: 10G MEMORY: 10G
SHOULD_UPDATE_PACKAGES: "FALSE" SHOULD_UPDATE_PACKAGES: "FALSE"
script: script:
- (cd packages/flutter_tools; dart __deprecated_pub get) - (cd packages/flutter_tools; dart pub get)
- (cd dev/bots; dart __deprecated_pub get) - (cd dev/bots; dart pub get)
- dart --enable-asserts ./dev/bots/test.dart - dart --enable-asserts ./dev/bots/test.dart
- name: docs-linux # linux-only - name: docs-linux # linux-only
......
...@@ -136,7 +136,6 @@ GOTO :after_subroutine ...@@ -136,7 +136,6 @@ GOTO :after_subroutine
REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL
SETLOCAL SETLOCAL
SET VERBOSITY=--verbosity=error
IF "%CI%" == "true" GOTO on_bot IF "%CI%" == "true" GOTO on_bot
IF "%BOT%" == "true" GOTO on_bot IF "%BOT%" == "true" GOTO on_bot
IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot
...@@ -144,8 +143,8 @@ GOTO :after_subroutine ...@@ -144,8 +143,8 @@ GOTO :after_subroutine
GOTO not_on_bot GOTO not_on_bot
:on_bot :on_bot
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot
SET VERBOSITY=--verbosity=normal
:not_on_bot :not_on_bot
SET PUB_SUMMARY_ONLY=1
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_install SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_install
IF "%PUB_CACHE%" == "" ( IF "%PUB_CACHE%" == "" (
IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path% IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path%
...@@ -155,7 +154,7 @@ GOTO :after_subroutine ...@@ -155,7 +154,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%" __deprecated_pub upgrade "%VERBOSITY%" --no-precompile "%dart%" --no-analytics pub upgrade
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" __deprecated_pub upgrade "$VERBOSITY" --no-precompile) && break (cd "$FLUTTER_TOOLS_DIR" && "$DART" --no-analytics pub upgrade) && 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
...@@ -143,10 +143,10 @@ function upgrade_flutter () ( ...@@ -143,10 +143,10 @@ function upgrade_flutter () (
>&2 echo Building flutter tool... >&2 echo Building flutter tool...
# Prepare packages... # Prepare packages...
VERBOSITY="--verbosity=error"
if [[ "$CI" == "true" || "$BOT" == "true" || "$CONTINUOUS_INTEGRATION" == "true" || "$CHROME_HEADLESS" == "1" ]]; then if [[ "$CI" == "true" || "$BOT" == "true" || "$CONTINUOUS_INTEGRATION" == "true" || "$CHROME_HEADLESS" == "1" ]]; then
PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_bot" PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_bot"
VERBOSITY="--verbosity=normal" else
export PUB_SUMMARY_ONLY=1
fi fi
export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_install" export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_install"
if [[ -d "$FLUTTER_ROOT/.pub-cache" ]]; then if [[ -d "$FLUTTER_ROOT/.pub-cache" ]]; then
......
...@@ -607,7 +607,7 @@ class _DefaultPub implements Pub { ...@@ -607,7 +607,7 @@ class _DefaultPub implements Pub {
'permissions for the current user.' 'permissions for the current user.'
); );
} }
return <String>[sdkPath, '__deprecated_pub', ...arguments]; return <String>[sdkPath, '--no-analytics', 'pub', ...arguments];
} }
// 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[1].contains('pub') && !c.contains('--offline') (List<String> c) => dartCommand.hasMatch(c[0]) && c[2].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[1].contains('pub') && c.contains('--offline') (List<String> c) => dartCommand.hasMatch(c[0]) && c[2].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', '__deprecated_pub', 'run', 'test']), const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', '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', '__deprecated_pub', '--trace', 'run', 'test']), const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', '--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', '__deprecated_pub', 'run', '--foo', 'bar', '/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', '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', '__deprecated_pub', 'token', 'list', '/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', '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', '__deprecated_pub', 'upgrade', '-h', '/bin/cache/dart-sdk/bin/dart', '--no-analytics', 'pub', 'upgrade', '-h',
], ],
stdin: IOSink(StreamController<List<int>>().sink), stdin: IOSink(StreamController<List<int>>().sink),
), ),
......
...@@ -55,7 +55,8 @@ void main() { ...@@ -55,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -105,7 +106,8 @@ void main() { ...@@ -105,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -155,7 +157,8 @@ void main() { ...@@ -155,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -272,7 +275,8 @@ void main() { ...@@ -272,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -313,7 +317,8 @@ void main() { ...@@ -313,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -353,7 +358,8 @@ void main() { ...@@ -353,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -393,7 +399,8 @@ void main() { ...@@ -393,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -431,7 +438,8 @@ void main() { ...@@ -431,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -472,7 +480,8 @@ void main() { ...@@ -472,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -519,7 +528,8 @@ void main() { ...@@ -519,7 +528,8 @@ void main() {
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -543,7 +553,7 @@ void main() { ...@@ -543,7 +553,7 @@ void main() {
); );
const String toolExitMessage = ''' const String toolExitMessage = '''
pub get failed pub get failed
command: "bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example" command: "bin/cache/dart-sdk/bin/dart --no-analytics pub --directory . get --example"
pub env: { pub env: {
"FLUTTER_ROOT": "", "FLUTTER_ROOT": "",
"PUB_ENVIRONMENT": "flutter_cli:flutter_tests", "PUB_ENVIRONMENT": "flutter_cli:flutter_tests",
...@@ -582,7 +592,8 @@ exit code: 66 ...@@ -582,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -592,7 +603,8 @@ exit code: 66 ...@@ -592,7 +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>[
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -649,7 +661,8 @@ exit code: 66 ...@@ -649,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -699,7 +712,8 @@ exit code: 66 ...@@ -699,7 +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',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -769,7 +783,8 @@ exit code: 66 ...@@ -769,7 +783,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -822,7 +837,8 @@ exit code: 66 ...@@ -822,7 +837,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -957,7 +973,8 @@ exit code: 66 ...@@ -957,7 +973,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1002,7 +1019,8 @@ exit code: 66 ...@@ -1002,7 +1019,8 @@ exit code: 66
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1016,7 +1034,8 @@ exit code: 66 ...@@ -1016,7 +1034,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1026,7 +1045,8 @@ exit code: 66 ...@@ -1026,7 +1045,8 @@ exit code: 66
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--directory', '--directory',
'.', '.',
'get', 'get',
...@@ -1040,7 +1060,8 @@ exit code: 66 ...@@ -1040,7 +1060,8 @@ exit code: 66
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/dart', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub', '--no-analytics',
'pub',
'--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