Unverified Commit bce36620 authored by Sigurd Meldgaard's avatar Sigurd Meldgaard Committed by GitHub

Stop calling top level pub (#89032)

* Use `dart __deprecated_pub` instead of `pub` to invoke pub from tools

The top level `pub` commmand has been deprecated and will print
a message. It is however implemented via the __deprecated_pub command
that prints no message.
parent 0b41698c
...@@ -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; pub get) - (cd packages/flutter_tools; dart __deprecated_pub get)
- (cd packages/flutter_tools/test/data/asset_test/main; pub get) - (cd packages/flutter_tools/test/data/asset_test/main; dart __deprecated_pub get)
- (cd packages/flutter_tools/test/data/asset_test/font; pub get) - (cd packages/flutter_tools/test/data/asset_test/font; dart __deprecated_pub get)
- (cd dev/bots; pub get) - (cd dev/bots; dart __deprecated_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; pub get) - (cd packages/flutter_tools; dart __deprecated_pub get)
- (cd dev/bots; pub get) - (cd dev/bots; dart __deprecated_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
...@@ -168,7 +168,7 @@ task: ...@@ -168,7 +168,7 @@ task:
- flutter config --enable-web - flutter config --enable-web
- git clone https://github.com/flutter/web_installers.git - git clone https://github.com/flutter/web_installers.git
- cd web_installers/packages/web_drivers/ - cd web_installers/packages/web_drivers/
- pub get - dart __deprecated_pub get
- dart lib/web_driver_installer.dart chromedriver --install-only - dart lib/web_driver_installer.dart chromedriver --install-only
- chromedriver/chromedriver --port=4444 & - chromedriver/chromedriver --port=4444 &
- sleep 1 - sleep 1
......
...@@ -24,7 +24,6 @@ SET engine_version_path=%FLUTTER_ROOT%\bin\internal\engine.version ...@@ -24,7 +24,6 @@ SET engine_version_path=%FLUTTER_ROOT%\bin\internal\engine.version
SET pub_cache_path=%FLUTTER_ROOT%\.pub-cache SET pub_cache_path=%FLUTTER_ROOT%\.pub-cache
SET dart=%dart_sdk_path%\bin\dart.exe SET dart=%dart_sdk_path%\bin\dart.exe
SET pub=%dart_sdk_path%\bin\pub.bat
REM Detect which PowerShell executable is available on the Host REM Detect which PowerShell executable is available on the Host
REM PowerShell version <= 5: PowerShell.exe REM PowerShell version <= 5: PowerShell.exe
...@@ -139,7 +138,7 @@ GOTO :after_subroutine ...@@ -139,7 +138,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
CALL "%pub%" upgrade "%VERBOSITY%" --no-precompile "%dart%" __deprecated_pub upgrade "%VERBOSITY%" --no-precompile
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 retry_upgrade { ...@@ -21,7 +21,7 @@ function retry_upgrade {
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" && "$PUB" upgrade "$VERBOSITY" --no-precompile) && break (cd "$FLUTTER_TOOLS_DIR" && "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile) && 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
...@@ -180,14 +180,12 @@ function shared::execute() { ...@@ -180,14 +180,12 @@ function shared::execute() {
DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk" DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
DART="$DART_SDK_PATH/bin/dart" DART="$DART_SDK_PATH/bin/dart"
PUB="$DART_SDK_PATH/bin/pub"
# If running over git-bash, overrides the default UNIX executables with win32 # If running over git-bash, overrides the default UNIX executables with win32
# executables # executables
case "$(uname -s)" in case "$(uname -s)" in
MINGW*) MINGW*)
DART="$DART.exe" DART="$DART.exe"
PUB="$PUB.bat"
;; ;;
esac esac
......
...@@ -8,9 +8,9 @@ REM This should match the ci.sh file in this directory. ...@@ -8,9 +8,9 @@ REM This should match the ci.sh file in this directory.
REM This is called from the LUCI recipes: REM This is called from the LUCI recipes:
REM https://flutter.googlesource.com/recipes/+/refs/heads/master/recipe_modules/adhoc_validation/resources/customer_testing.bat REM https://flutter.googlesource.com/recipes/+/refs/heads/master/recipe_modules/adhoc_validation/resources/customer_testing.bat
pub get dart __deprecated_pub get
CD ..\tools CD ..\tools
pub get dart __deprecated_pub get
CD ..\customer_testing CD ..\customer_testing
CMD /S /C "IF EXIST "..\..\bin\cache\pkg\tests\" RMDIR /S /Q ..\..\bin\cache\pkg\tests" CMD /S /C "IF EXIST "..\..\bin\cache\pkg\tests\" RMDIR /S /Q ..\..\bin\cache\pkg\tests"
......
...@@ -15,8 +15,8 @@ set -ex ...@@ -15,8 +15,8 @@ set -ex
# largely not needed to run the flutter/tests tests. # largely not needed to run the flutter/tests tests.
# #
# However, we do need to update this directory and the tools directory. # However, we do need to update this directory and the tools directory.
pub get dart __deprecated_pub get
(cd ../tools; pub get) # used for find_commit.dart below (cd ../tools; dart __deprecated_pub get) # used for find_commit.dart below
# Next we need to update the flutter/tests checkout. # Next we need to update the flutter/tests checkout.
# #
......
...@@ -109,7 +109,7 @@ Future<void> main(List<String> args) async { ...@@ -109,7 +109,7 @@ Future<void> main(List<String> args) async {
DevtoolsLauncher: () => DevtoolsServerLauncher( DevtoolsLauncher: () => DevtoolsServerLauncher(
processManager: globals.processManager, processManager: globals.processManager,
fileSystem: globals.fs, fileSystem: globals.fs,
pubExecutable: globals.artifacts.getHostArtifact(HostArtifact.pubExecutable).path, dartExecutable: globals.artifacts.getHostArtifact(HostArtifact.engineDartBinary).path,
logger: globals.logger, logger: globals.logger,
platform: globals.platform, platform: globals.platform,
persistentToolState: globals.persistentToolState, persistentToolState: globals.persistentToolState,
......
...@@ -101,9 +101,6 @@ enum HostArtifact { ...@@ -101,9 +101,6 @@ enum HostArtifact {
iproxy, iproxy,
/// The root of the sky_engine package. /// The root of the sky_engine package.
skyEnginePath, skyEnginePath,
/// The pub or pub.bat executable
pubExecutable,
} }
// TODO(knopp): Remove once darwin artifacts are universal and moved out of darwin-x64 // TODO(knopp): Remove once darwin artifacts are universal and moved out of darwin-x64
...@@ -263,11 +260,6 @@ String _hostArtifactToFileName(HostArtifact artifact, bool windows) { ...@@ -263,11 +260,6 @@ String _hostArtifactToFileName(HostArtifact artifact, bool windows) {
case HostArtifact.webPrecompiledCanvaskitSoundSdkSourcemaps: case HostArtifact.webPrecompiledCanvaskitSoundSdkSourcemaps:
case HostArtifact.webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps: case HostArtifact.webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps:
return 'dart_sdk.js.map'; return 'dart_sdk.js.map';
case HostArtifact.pubExecutable:
if (windows) {
return 'pub.bat';
}
return 'pub';
} }
} }
...@@ -405,9 +397,6 @@ class CachedArtifacts implements Artifacts { ...@@ -405,9 +397,6 @@ class CachedArtifacts implements Artifacts {
final Directory dartPackageDirectory = _cache.getCacheDir('pkg'); final Directory dartPackageDirectory = _cache.getCacheDir('pkg');
final String path = _fileSystem.path.join(dartPackageDirectory.path, _hostArtifactToFileName(artifact, _platform.isWindows)); final String path = _fileSystem.path.join(dartPackageDirectory.path, _hostArtifactToFileName(artifact, _platform.isWindows));
return _fileSystem.directory(path); return _fileSystem.directory(path);
case HostArtifact.pubExecutable:
final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', _hostArtifactToFileName(artifact, _platform.isWindows));
return _fileSystem.file(path);
case HostArtifact.dart2jsSnapshot: case HostArtifact.dart2jsSnapshot:
case HostArtifact.dartdevcSnapshot: case HostArtifact.dartdevcSnapshot:
case HostArtifact.kernelWorkerSnapshot: case HostArtifact.kernelWorkerSnapshot:
...@@ -791,9 +780,6 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts { ...@@ -791,9 +780,6 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
final Directory dartPackageDirectory = _cache.getCacheDir('pkg'); final Directory dartPackageDirectory = _cache.getCacheDir('pkg');
final String path = _fileSystem.path.join(dartPackageDirectory.path, _hostArtifactToFileName(artifact, _platform.isWindows)); final String path = _fileSystem.path.join(dartPackageDirectory.path, _hostArtifactToFileName(artifact, _platform.isWindows));
return _fileSystem.directory(path); return _fileSystem.directory(path);
case HostArtifact.pubExecutable:
final String path = _fileSystem.path.join(_hostEngineOutPath, 'dart-sdk', 'bin', _hostArtifactToFileName(artifact, _platform.isWindows));
return _fileSystem.file(path);
case HostArtifact.iosDeploy: case HostArtifact.iosDeploy:
final String artifactFileName = _hostArtifactToFileName(artifact, _platform.isWindows); final String artifactFileName = _hostArtifactToFileName(artifact, _platform.isWindows);
return _cache.getArtifactDirectory('ios-deploy').childFile(artifactFileName); return _cache.getArtifactDirectory('ios-deploy').childFile(artifactFileName);
......
...@@ -216,7 +216,7 @@ Future<T> runInContext<T>( ...@@ -216,7 +216,7 @@ Future<T> runInContext<T>(
DevtoolsLauncher: () => DevtoolsServerLauncher( DevtoolsLauncher: () => DevtoolsServerLauncher(
processManager: globals.processManager, processManager: globals.processManager,
fileSystem: globals.fs, fileSystem: globals.fs,
pubExecutable: globals.artifacts.getHostArtifact(HostArtifact.pubExecutable).path, dartExecutable: globals.artifacts.getHostArtifact(HostArtifact.engineDartBinary).path,
logger: globals.logger, logger: globals.logger,
platform: globals.platform, platform: globals.platform,
persistentToolState: globals.persistentToolState, persistentToolState: globals.persistentToolState,
......
...@@ -419,7 +419,7 @@ class _DefaultPub implements Pub { ...@@ -419,7 +419,7 @@ class _DefaultPub implements Pub {
'cache', 'cache',
'dart-sdk', 'dart-sdk',
'bin', 'bin',
'pub', 'dart',
]); ]);
if (!_processManager.canRun(sdkPath)) { if (!_processManager.canRun(sdkPath)) {
throwToolExit( throwToolExit(
...@@ -428,7 +428,7 @@ class _DefaultPub implements Pub { ...@@ -428,7 +428,7 @@ class _DefaultPub implements Pub {
'permissions for the current user.' 'permissions for the current user.'
); );
} }
return <String>[sdkPath, ...arguments]; return <String>[sdkPath, '__deprecated_pub', ...arguments];
} }
// Returns the environment value that should be used when running pub. // Returns the environment value that should be used when running pub.
......
...@@ -25,13 +25,13 @@ class DevtoolsServerLauncher extends DevtoolsLauncher { ...@@ -25,13 +25,13 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
@required Platform platform, @required Platform platform,
@required ProcessManager processManager, @required ProcessManager processManager,
@required FileSystem fileSystem, @required FileSystem fileSystem,
@required String pubExecutable, @required String dartExecutable,
@required Logger logger, @required Logger logger,
@required PersistentToolState persistentToolState, @required PersistentToolState persistentToolState,
@visibleForTesting io.HttpClient httpClient, @visibleForTesting io.HttpClient httpClient,
}) : _processManager = processManager, }) : _processManager = processManager,
_fileSystem = fileSystem, _fileSystem = fileSystem,
_pubExecutable = pubExecutable, _dartExecutable = dartExecutable,
_logger = logger, _logger = logger,
_platform = platform, _platform = platform,
_persistentToolState = persistentToolState, _persistentToolState = persistentToolState,
...@@ -39,7 +39,7 @@ class DevtoolsServerLauncher extends DevtoolsLauncher { ...@@ -39,7 +39,7 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
final ProcessManager _processManager; final ProcessManager _processManager;
final FileSystem _fileSystem; final FileSystem _fileSystem;
final String _pubExecutable; final String _dartExecutable;
final Logger _logger; final Logger _logger;
final Platform _platform; final Platform _platform;
final PersistentToolState _persistentToolState; final PersistentToolState _persistentToolState;
...@@ -118,7 +118,8 @@ class DevtoolsServerLauncher extends DevtoolsLauncher { ...@@ -118,7 +118,8 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
} }
_devToolsProcess = await _processManager.start(<String>[ _devToolsProcess = await _processManager.start(<String>[
_pubExecutable, _dartExecutable,
'pub',
'global', 'global',
'run', 'run',
'devtools', 'devtools',
...@@ -153,7 +154,7 @@ class DevtoolsServerLauncher extends DevtoolsLauncher { ...@@ -153,7 +154,7 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
/// Check if the DevTools package is already active by running "pub global list". /// Check if the DevTools package is already active by running "pub global list".
Future<bool> _checkForActiveDevTools() async { Future<bool> _checkForActiveDevTools() async {
final io.ProcessResult _pubGlobalListProcess = await _processManager.run( final io.ProcessResult _pubGlobalListProcess = await _processManager.run(
<String>[ _pubExecutable, 'global', 'list' ], <String>[ _dartExecutable, 'pub', 'global', 'list' ],
); );
return _pubGlobalListProcess.stdout.toString().contains(_devToolsInstalledPattern); return _pubGlobalListProcess.stdout.toString().contains(_devToolsInstalledPattern);
} }
...@@ -179,7 +180,8 @@ class DevtoolsServerLauncher extends DevtoolsLauncher { ...@@ -179,7 +180,8 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
try { try {
final io.ProcessResult _devToolsActivateProcess = await _processManager final io.ProcessResult _devToolsActivateProcess = await _processManager
.run(<String>[ .run(<String>[
_pubExecutable, _dartExecutable,
'pub',
'global', 'global',
'activate', 'activate',
'devtools', 'devtools',
......
...@@ -1729,7 +1729,7 @@ void main() { ...@@ -1729,7 +1729,7 @@ void main() {
final CommandRunner<void> runner = createTestCommandRunner(command); final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['create', '--pub', '--offline', projectDir.path]); await runner.run(<String>['create', '--pub', '--offline', projectDir.path]);
expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]pub'))); expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]dart')));
expect(loggingProcessManager.commands.first, contains('--offline')); expect(loggingProcessManager.commands.first, contains('--offline'));
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
...@@ -1754,7 +1754,7 @@ void main() { ...@@ -1754,7 +1754,7 @@ void main() {
final CommandRunner<void> runner = createTestCommandRunner(command); final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['create', '--pub', projectDir.path]); await runner.run(<String>['create', '--pub', projectDir.path]);
expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]pub'))); expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]dart')));
expect(loggingProcessManager.commands.first, isNot(contains('--offline'))); expect(loggingProcessManager.commands.first, isNot(contains('--offline')));
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
......
...@@ -451,7 +451,7 @@ void main() { ...@@ -451,7 +451,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/pub', 'run', 'test']), const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', '__deprecated_pub', 'run', 'test']),
); );
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']);
...@@ -476,7 +476,7 @@ void main() { ...@@ -476,7 +476,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/pub', '--trace', 'run', 'test']), const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/dart', '__deprecated_pub', '--trace', 'run', 'test']),
); );
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']);
...@@ -503,7 +503,7 @@ void main() { ...@@ -503,7 +503,7 @@ void main() {
final IOSink stdin = IOSink(StreamController<List<int>>().sink); final IOSink stdin = IOSink(StreamController<List<int>>().sink);
processManager.addCommand( processManager.addCommand(
FakeCommand(command: const <String>[ FakeCommand(command: const <String>[
'/bin/cache/dart-sdk/bin/pub', 'run', '--foo', 'bar'], '/bin/cache/dart-sdk/bin/dart', '__deprecated_pub', 'run', '--foo', 'bar'],
stdin: stdin, stdin: stdin,
), ),
); );
...@@ -529,7 +529,7 @@ void main() { ...@@ -529,7 +529,7 @@ void main() {
Cache.flutterRoot = ''; Cache.flutterRoot = '';
processManager.addCommand( processManager.addCommand(
FakeCommand(command: const <String>[ FakeCommand(command: const <String>[
'/bin/cache/dart-sdk/bin/pub', 'upgrade', '-h'], '/bin/cache/dart-sdk/bin/dart', '__deprecated_pub', 'upgrade', '-h'],
stdin: IOSink(StreamController<List<int>>().sink), stdin: IOSink(StreamController<List<int>>().sink),
), ),
); );
......
...@@ -26,7 +26,7 @@ void main() { ...@@ -26,7 +26,7 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.empty(); final FakeProcessManager processManager = FakeProcessManager.empty();
final BufferLogger logger = BufferLogger.test(); final BufferLogger logger = BufferLogger.test();
final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final MemoryFileSystem fileSystem = MemoryFileSystem.test();
processManager.excludedExecutables.add('bin/cache/dart-sdk/bin/pub'); processManager.excludedExecutables.add('bin/cache/dart-sdk/bin/dart');
fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('pubspec.yaml').createSync();
...@@ -51,7 +51,8 @@ void main() { ...@@ -51,7 +51,8 @@ void main() {
testWithoutContext('does not skip pub get the parameter is false', () async { testWithoutContext('does not skip pub get the parameter is false', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -99,7 +100,8 @@ void main() { ...@@ -99,7 +100,8 @@ void main() {
testWithoutContext('does not skip pub get if package_config.json has "generator": "pub"', () async { testWithoutContext('does not skip pub get if package_config.json has "generator": "pub"', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -147,7 +149,8 @@ void main() { ...@@ -147,7 +149,8 @@ void main() {
testWithoutContext('does not skip pub get if package_config.json has "generator": "pub"', () async { testWithoutContext('does not skip pub get if package_config.json has "generator": "pub"', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -262,10 +265,11 @@ void main() { ...@@ -262,10 +265,11 @@ void main() {
'but the current framework version is not the same as the last version', () async { 'but the current framework version is not the same as the last version', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
]) ])
]); ]);
final BufferLogger logger = BufferLogger.test(); final BufferLogger logger = BufferLogger.test();
...@@ -301,10 +305,11 @@ void main() { ...@@ -301,10 +305,11 @@ void main() {
'but the current framework version does not exist yet', () async { 'but the current framework version does not exist yet', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
]) ])
]); ]);
final BufferLogger logger = BufferLogger.test(); final BufferLogger logger = BufferLogger.test();
...@@ -339,10 +344,11 @@ void main() { ...@@ -339,10 +344,11 @@ void main() {
final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final MemoryFileSystem fileSystem = MemoryFileSystem.test();
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/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
], onRun: () { ], onRun: () {
fileSystem.file('.dart_tool/package_config.json').createSync(recursive: true); fileSystem.file('.dart_tool/package_config.json').createSync(recursive: true);
}) })
...@@ -377,10 +383,11 @@ void main() { ...@@ -377,10 +383,11 @@ void main() {
final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final MemoryFileSystem fileSystem = MemoryFileSystem.test();
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/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
]), ]),
]); ]);
final BufferLogger logger = BufferLogger.test(); final BufferLogger logger = BufferLogger.test();
...@@ -413,10 +420,11 @@ void main() { ...@@ -413,10 +420,11 @@ void main() {
testWithoutContext('checkUpToDate does not skip pub get if the package config is older that the pubspec', () async { testWithoutContext('checkUpToDate does not skip pub get if the package config is older that the pubspec', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
]) ])
]); ]);
final BufferLogger logger = BufferLogger.test(); final BufferLogger logger = BufferLogger.test();
...@@ -452,10 +460,11 @@ void main() { ...@@ -452,10 +460,11 @@ void main() {
testWithoutContext('checkUpToDate does not skip pub get if the pubspec.lock is older that the pubspec', () async { testWithoutContext('checkUpToDate does not skip pub get if the pubspec.lock is older that the pubspec', () async {
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/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
]) ])
]); ]);
final BufferLogger logger = BufferLogger.test(); final BufferLogger logger = BufferLogger.test();
...@@ -495,10 +504,11 @@ void main() { ...@@ -495,10 +504,11 @@ void main() {
const FakeCommand pubGetCommand = FakeCommand( const FakeCommand pubGetCommand = FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'--verbosity=warning', '__deprecated_pub',
'get', '--verbosity=warning',
'--no-precompile', 'get',
'--no-precompile',
], ],
exitCode: 69, exitCode: 69,
environment: <String, String>{'FLUTTER_ROOT': '', 'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests'}, environment: <String, String>{'FLUTTER_ROOT': '', 'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests'},
...@@ -591,7 +601,8 @@ void main() { ...@@ -591,7 +601,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -636,7 +647,8 @@ void main() { ...@@ -636,7 +647,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -677,7 +689,8 @@ void main() { ...@@ -677,7 +689,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -799,7 +812,8 @@ void main() { ...@@ -799,7 +812,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -840,7 +854,8 @@ void main() { ...@@ -840,7 +854,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -882,7 +897,8 @@ void main() { ...@@ -882,7 +897,8 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -894,7 +910,8 @@ void main() { ...@@ -894,7 +910,8 @@ void main() {
), ),
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -902,7 +919,8 @@ void main() { ...@@ -902,7 +919,8 @@ void main() {
), ),
FakeCommand( FakeCommand(
command: const <String>[ command: const <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
...@@ -914,7 +932,8 @@ void main() { ...@@ -914,7 +932,8 @@ void main() {
), ),
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'bin/cache/dart-sdk/bin/pub', 'bin/cache/dart-sdk/bin/dart',
'__deprecated_pub',
'--verbosity=warning', '--verbosity=warning',
'get', 'get',
'--no-precompile', '--no-precompile',
......
...@@ -111,7 +111,7 @@ void main() { ...@@ -111,7 +111,7 @@ void main() {
final DevtoolsServerLauncher launcher = DevtoolsServerLauncher( final DevtoolsServerLauncher launcher = DevtoolsServerLauncher(
processManager: FakeProcessManager.empty(), processManager: FakeProcessManager.empty(),
fileSystem: fakefs, fileSystem: fakefs,
pubExecutable: 'pub', dartExecutable: 'dart',
logger: BufferLogger.test(), logger: BufferLogger.test(),
platform: FakePlatform(), platform: FakePlatform(),
persistentToolState: null, persistentToolState: null,
......
...@@ -508,9 +508,7 @@ void main() { ...@@ -508,9 +508,7 @@ void main() {
logging: false, logging: false,
); );
expect(result.exitCode, 0); expect(result.exitCode, 0);
// TODO(sigurdm): Remove the filter when expect(result.stdout, <Object>[
// https://github.com/flutter/flutter/pull/88792 is relanded.
expect(result.stdout.where((String line) => !line.startsWith('"The top level `pub.bat` command is deprecated.')), <Object>[
startsWith('Performing hot reload...'), startsWith('Performing hot reload...'),
'', '',
'══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════', '══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════',
......
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