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:
MEMORY: 10G
SHOULD_UPDATE_PACKAGES: "FALSE"
script:
- (cd packages/flutter_tools; dart __deprecated_pub get)
- (cd packages/flutter_tools/test/data/asset_test/main; dart __deprecated_pub get)
- (cd packages/flutter_tools/test/data/asset_test/font; dart __deprecated_pub get)
- (cd dev/bots; dart __deprecated_pub get)
- (cd packages/flutter_tools; dart pub get)
- (cd packages/flutter_tools/test/data/asset_test/main; dart pub get)
- (cd packages/flutter_tools/test/data/asset_test/font; dart pub get)
- (cd dev/bots; dart pub get)
- dart --enable-asserts ./dev/bots/test.dart
- name: tool_tests-commands-linux
......@@ -131,8 +131,8 @@ task:
MEMORY: 10G
SHOULD_UPDATE_PACKAGES: "FALSE"
script:
- (cd packages/flutter_tools; dart __deprecated_pub get)
- (cd dev/bots; dart __deprecated_pub get)
- (cd packages/flutter_tools; dart pub get)
- (cd dev/bots; dart pub get)
- dart --enable-asserts ./dev/bots/test.dart
- name: docs-linux # linux-only
......
......@@ -136,7 +136,6 @@ GOTO :after_subroutine
REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL
SETLOCAL
SET VERBOSITY=--verbosity=error
IF "%CI%" == "true" GOTO on_bot
IF "%BOT%" == "true" GOTO on_bot
IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot
......@@ -144,8 +143,8 @@ GOTO :after_subroutine
GOTO not_on_bot
:on_bot
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot
SET VERBOSITY=--verbosity=normal
:not_on_bot
SET PUB_SUMMARY_ONLY=1
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_install
IF "%PUB_CACHE%" == "" (
IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path%
......@@ -155,7 +154,7 @@ GOTO :after_subroutine
SET /A remaining_tries=%total_tries%-1
:retry_pub_upgrade
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
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
......
......@@ -21,7 +21,7 @@ function pub_upgrade_with_retry {
local total_tries="10"
local remaining_tries=$((total_tries - 1))
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)"
remaining_tries=$((remaining_tries - 1))
sleep 5
......@@ -143,10 +143,10 @@ function upgrade_flutter () (
>&2 echo Building flutter tool...
# Prepare packages...
VERBOSITY="--verbosity=error"
if [[ "$CI" == "true" || "$BOT" == "true" || "$CONTINUOUS_INTEGRATION" == "true" || "$CHROME_HEADLESS" == "1" ]]; then
PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_bot"
VERBOSITY="--verbosity=normal"
else
export PUB_SUMMARY_ONLY=1
fi
export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_install"
if [[ -d "$FLUTTER_ROOT/.pub-cache" ]]; then
......
......@@ -607,7 +607,7 @@ class _DefaultPub implements Pub {
'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.
......
......@@ -1950,14 +1950,14 @@ void main() {
await runner.run(<String>['create', '--pub', projectDir.path]);
final RegExp dartCommand = RegExp(r'dart-sdk[\\/]bin[\\/]dart');
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.
loggingProcessManager.clear();
await runner.run(<String>['create', '--pub', '--offline', projectDir.path]);
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>{
......
......@@ -488,7 +488,7 @@ void main() {
globals.fs.directory('/packages/flutter_tools').createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
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']);
......@@ -514,7 +514,7 @@ void main() {
Cache.flutterRoot = '';
globals.fs.file('pubspec.yaml').createSync();
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']);
......@@ -543,7 +543,7 @@ void main() {
processManager.addCommand(
FakeCommand(
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,
),
......@@ -574,7 +574,7 @@ void main() {
processManager.addCommand(
FakeCommand(
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,
),
......@@ -603,7 +603,7 @@ void main() {
processManager.addCommand(
FakeCommand(
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),
),
......
......@@ -55,7 +55,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -105,7 +106,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -155,7 +157,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -272,7 +275,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -313,7 +317,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -353,7 +358,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: const <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -393,7 +399,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -431,7 +438,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -472,7 +480,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -519,7 +528,8 @@ void main() {
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -543,7 +553,7 @@ void main() {
);
const String toolExitMessage = '''
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: {
"FLUTTER_ROOT": "",
"PUB_ENVIRONMENT": "flutter_cli:flutter_tests",
......@@ -582,7 +592,8 @@ exit code: 66
FakeCommand(
command: const <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -592,7 +603,8 @@ exit code: 66
throw const ProcessException(
'bin/cache/dart-sdk/bin/dart',
<String>[
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -649,7 +661,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -699,7 +712,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -769,7 +783,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -822,7 +837,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -957,7 +973,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -1002,7 +1019,8 @@ exit code: 66
FakeCommand(
command: const <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -1016,7 +1034,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -1026,7 +1045,8 @@ exit code: 66
FakeCommand(
command: const <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'get',
......@@ -1040,7 +1060,8 @@ exit code: 66
const FakeCommand(
command: <String>[
'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--no-analytics',
'pub',
'--directory',
'.',
'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