mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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.
This commit is contained in:
parent
0b41698cc6
commit
bce366203a
14
.cirrus.yml
14
.cirrus.yml
@ -115,10 +115,10 @@ task:
|
||||
MEMORY: 10G
|
||||
SHOULD_UPDATE_PACKAGES: "FALSE"
|
||||
script:
|
||||
- (cd packages/flutter_tools; pub get)
|
||||
- (cd packages/flutter_tools/test/data/asset_test/main; pub get)
|
||||
- (cd packages/flutter_tools/test/data/asset_test/font; pub get)
|
||||
- (cd dev/bots; pub get)
|
||||
- (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)
|
||||
- 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; pub get)
|
||||
- (cd dev/bots; pub get)
|
||||
- (cd packages/flutter_tools; dart __deprecated_pub get)
|
||||
- (cd dev/bots; dart __deprecated_pub get)
|
||||
- dart --enable-asserts ./dev/bots/test.dart
|
||||
|
||||
- name: docs-linux # linux-only
|
||||
@ -168,7 +168,7 @@ task:
|
||||
- flutter config --enable-web
|
||||
- git clone https://github.com/flutter/web_installers.git
|
||||
- cd web_installers/packages/web_drivers/
|
||||
- pub get
|
||||
- dart __deprecated_pub get
|
||||
- dart lib/web_driver_installer.dart chromedriver --install-only
|
||||
- chromedriver/chromedriver --port=4444 &
|
||||
- sleep 1
|
||||
|
@ -24,7 +24,6 @@ SET engine_version_path=%FLUTTER_ROOT%\bin\internal\engine.version
|
||||
SET pub_cache_path=%FLUTTER_ROOT%\.pub-cache
|
||||
|
||||
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 PowerShell version <= 5: PowerShell.exe
|
||||
@ -139,7 +138,7 @@ GOTO :after_subroutine
|
||||
SET /A remaining_tries=%total_tries%-1
|
||||
:retry_pub_upgrade
|
||||
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
|
||||
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 retry_upgrade {
|
||||
local total_tries="10"
|
||||
local remaining_tries=$((total_tries - 1))
|
||||
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)"
|
||||
remaining_tries=$((remaining_tries - 1))
|
||||
sleep 5
|
||||
@ -180,14 +180,12 @@ function shared::execute() {
|
||||
DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
|
||||
|
||||
DART="$DART_SDK_PATH/bin/dart"
|
||||
PUB="$DART_SDK_PATH/bin/pub"
|
||||
|
||||
# If running over git-bash, overrides the default UNIX executables with win32
|
||||
# executables
|
||||
case "$(uname -s)" in
|
||||
MINGW*)
|
||||
DART="$DART.exe"
|
||||
PUB="$PUB.bat"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -8,9 +8,9 @@ REM This should match the ci.sh file in this directory.
|
||||
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
|
||||
|
||||
pub get
|
||||
dart __deprecated_pub get
|
||||
CD ..\tools
|
||||
pub get
|
||||
dart __deprecated_pub get
|
||||
CD ..\customer_testing
|
||||
|
||||
CMD /S /C "IF EXIST "..\..\bin\cache\pkg\tests\" RMDIR /S /Q ..\..\bin\cache\pkg\tests"
|
||||
|
@ -15,8 +15,8 @@ set -ex
|
||||
# largely not needed to run the flutter/tests tests.
|
||||
#
|
||||
# However, we do need to update this directory and the tools directory.
|
||||
pub get
|
||||
(cd ../tools; pub get) # used for find_commit.dart below
|
||||
dart __deprecated_pub get
|
||||
(cd ../tools; dart __deprecated_pub get) # used for find_commit.dart below
|
||||
|
||||
# Next we need to update the flutter/tests checkout.
|
||||
#
|
||||
|
@ -109,7 +109,7 @@ Future<void> main(List<String> args) async {
|
||||
DevtoolsLauncher: () => DevtoolsServerLauncher(
|
||||
processManager: globals.processManager,
|
||||
fileSystem: globals.fs,
|
||||
pubExecutable: globals.artifacts.getHostArtifact(HostArtifact.pubExecutable).path,
|
||||
dartExecutable: globals.artifacts.getHostArtifact(HostArtifact.engineDartBinary).path,
|
||||
logger: globals.logger,
|
||||
platform: globals.platform,
|
||||
persistentToolState: globals.persistentToolState,
|
||||
|
@ -101,9 +101,6 @@ enum HostArtifact {
|
||||
iproxy,
|
||||
/// The root of the sky_engine package.
|
||||
skyEnginePath,
|
||||
|
||||
/// The pub or pub.bat executable
|
||||
pubExecutable,
|
||||
}
|
||||
|
||||
// TODO(knopp): Remove once darwin artifacts are universal and moved out of darwin-x64
|
||||
@ -263,11 +260,6 @@ String _hostArtifactToFileName(HostArtifact artifact, bool windows) {
|
||||
case HostArtifact.webPrecompiledCanvaskitSoundSdkSourcemaps:
|
||||
case HostArtifact.webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps:
|
||||
return 'dart_sdk.js.map';
|
||||
case HostArtifact.pubExecutable:
|
||||
if (windows) {
|
||||
return 'pub.bat';
|
||||
}
|
||||
return 'pub';
|
||||
}
|
||||
}
|
||||
|
||||
@ -405,9 +397,6 @@ class CachedArtifacts implements Artifacts {
|
||||
final Directory dartPackageDirectory = _cache.getCacheDir('pkg');
|
||||
final String path = _fileSystem.path.join(dartPackageDirectory.path, _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
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.dartdevcSnapshot:
|
||||
case HostArtifact.kernelWorkerSnapshot:
|
||||
@ -791,9 +780,6 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
|
||||
final Directory dartPackageDirectory = _cache.getCacheDir('pkg');
|
||||
final String path = _fileSystem.path.join(dartPackageDirectory.path, _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
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:
|
||||
final String artifactFileName = _hostArtifactToFileName(artifact, _platform.isWindows);
|
||||
return _cache.getArtifactDirectory('ios-deploy').childFile(artifactFileName);
|
||||
|
@ -216,7 +216,7 @@ Future<T> runInContext<T>(
|
||||
DevtoolsLauncher: () => DevtoolsServerLauncher(
|
||||
processManager: globals.processManager,
|
||||
fileSystem: globals.fs,
|
||||
pubExecutable: globals.artifacts.getHostArtifact(HostArtifact.pubExecutable).path,
|
||||
dartExecutable: globals.artifacts.getHostArtifact(HostArtifact.engineDartBinary).path,
|
||||
logger: globals.logger,
|
||||
platform: globals.platform,
|
||||
persistentToolState: globals.persistentToolState,
|
||||
|
@ -419,7 +419,7 @@ class _DefaultPub implements Pub {
|
||||
'cache',
|
||||
'dart-sdk',
|
||||
'bin',
|
||||
'pub',
|
||||
'dart',
|
||||
]);
|
||||
if (!_processManager.canRun(sdkPath)) {
|
||||
throwToolExit(
|
||||
@ -428,7 +428,7 @@ class _DefaultPub implements Pub {
|
||||
'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.
|
||||
|
@ -25,13 +25,13 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
|
||||
@required Platform platform,
|
||||
@required ProcessManager processManager,
|
||||
@required FileSystem fileSystem,
|
||||
@required String pubExecutable,
|
||||
@required String dartExecutable,
|
||||
@required Logger logger,
|
||||
@required PersistentToolState persistentToolState,
|
||||
@visibleForTesting io.HttpClient httpClient,
|
||||
}) : _processManager = processManager,
|
||||
_fileSystem = fileSystem,
|
||||
_pubExecutable = pubExecutable,
|
||||
_dartExecutable = dartExecutable,
|
||||
_logger = logger,
|
||||
_platform = platform,
|
||||
_persistentToolState = persistentToolState,
|
||||
@ -39,7 +39,7 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
|
||||
|
||||
final ProcessManager _processManager;
|
||||
final FileSystem _fileSystem;
|
||||
final String _pubExecutable;
|
||||
final String _dartExecutable;
|
||||
final Logger _logger;
|
||||
final Platform _platform;
|
||||
final PersistentToolState _persistentToolState;
|
||||
@ -118,7 +118,8 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
|
||||
}
|
||||
|
||||
_devToolsProcess = await _processManager.start(<String>[
|
||||
_pubExecutable,
|
||||
_dartExecutable,
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
'devtools',
|
||||
@ -153,7 +154,7 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
|
||||
/// Check if the DevTools package is already active by running "pub global list".
|
||||
Future<bool> _checkForActiveDevTools() async {
|
||||
final io.ProcessResult _pubGlobalListProcess = await _processManager.run(
|
||||
<String>[ _pubExecutable, 'global', 'list' ],
|
||||
<String>[ _dartExecutable, 'pub', 'global', 'list' ],
|
||||
);
|
||||
return _pubGlobalListProcess.stdout.toString().contains(_devToolsInstalledPattern);
|
||||
}
|
||||
@ -179,7 +180,8 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
|
||||
try {
|
||||
final io.ProcessResult _devToolsActivateProcess = await _processManager
|
||||
.run(<String>[
|
||||
_pubExecutable,
|
||||
_dartExecutable,
|
||||
'pub',
|
||||
'global',
|
||||
'activate',
|
||||
'devtools',
|
||||
|
@ -1729,7 +1729,7 @@ void main() {
|
||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||
|
||||
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'));
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
@ -1754,7 +1754,7 @@ void main() {
|
||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||
|
||||
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')));
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
|
@ -451,7 +451,7 @@ void main() {
|
||||
Cache.flutterRoot = '';
|
||||
globals.fs.file('pubspec.yaml').createSync();
|
||||
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']);
|
||||
|
||||
@ -476,7 +476,7 @@ void main() {
|
||||
Cache.flutterRoot = '';
|
||||
globals.fs.file('pubspec.yaml').createSync();
|
||||
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']);
|
||||
|
||||
@ -503,7 +503,7 @@ void main() {
|
||||
final IOSink stdin = IOSink(StreamController<List<int>>().sink);
|
||||
processManager.addCommand(
|
||||
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,
|
||||
),
|
||||
);
|
||||
@ -529,7 +529,7 @@ void main() {
|
||||
Cache.flutterRoot = '';
|
||||
processManager.addCommand(
|
||||
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),
|
||||
),
|
||||
);
|
||||
|
@ -26,7 +26,7 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.empty();
|
||||
final BufferLogger logger = BufferLogger.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();
|
||||
|
||||
@ -51,7 +51,8 @@ void main() {
|
||||
testWithoutContext('does not skip pub get the parameter is false', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -99,7 +100,8 @@ void main() {
|
||||
testWithoutContext('does not skip pub get if package_config.json has "generator": "pub"', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -147,7 +149,8 @@ void main() {
|
||||
testWithoutContext('does not skip pub get if package_config.json has "generator": "pub"', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -262,10 +265,11 @@ void main() {
|
||||
'but the current framework version is not the same as the last version', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
])
|
||||
]);
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
@ -301,10 +305,11 @@ void main() {
|
||||
'but the current framework version does not exist yet', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
])
|
||||
]);
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
@ -339,10 +344,11 @@ void main() {
|
||||
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: const <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
], onRun: () {
|
||||
fileSystem.file('.dart_tool/package_config.json').createSync(recursive: true);
|
||||
})
|
||||
@ -377,10 +383,11 @@ void main() {
|
||||
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
]),
|
||||
]);
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
@ -413,10 +420,11 @@ void main() {
|
||||
testWithoutContext('checkUpToDate does not skip pub get if the package config is older that the pubspec', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
])
|
||||
]);
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
@ -452,10 +460,11 @@ void main() {
|
||||
testWithoutContext('checkUpToDate does not skip pub get if the pubspec.lock is older that the pubspec', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
])
|
||||
]);
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
@ -495,10 +504,11 @@ void main() {
|
||||
|
||||
const FakeCommand pubGetCommand = FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
],
|
||||
exitCode: 69,
|
||||
environment: <String, String>{'FLUTTER_ROOT': '', 'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests'},
|
||||
@ -591,7 +601,8 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -636,7 +647,8 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -677,7 +689,8 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -799,7 +812,8 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -840,7 +854,8 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -882,7 +897,8 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -894,7 +910,8 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -902,7 +919,8 @@ void main() {
|
||||
),
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
@ -914,7 +932,8 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'bin/cache/dart-sdk/bin/pub',
|
||||
'bin/cache/dart-sdk/bin/dart',
|
||||
'__deprecated_pub',
|
||||
'--verbosity=warning',
|
||||
'get',
|
||||
'--no-precompile',
|
||||
|
@ -46,7 +46,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher does not launch devtools if unable to reach pub.dev and there is no activated package', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -61,6 +61,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -77,7 +78,7 @@ void main() {
|
||||
testWithoutContext('DevtoolsLauncher launches devtools if unable to reach pub.dev but there is an activated package', () async {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -92,6 +93,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -100,6 +102,7 @@ void main() {
|
||||
),
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -119,7 +122,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher pings PUB_HOSTED_URL instead of pub.dev for online check', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: FakePlatform(environment: <String, String>{
|
||||
@ -136,6 +139,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -151,7 +155,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher handles an invalid PUB_HOSTED_URL', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: FakePlatform(environment: <String, String>{
|
||||
@ -162,6 +166,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -179,7 +184,7 @@ void main() {
|
||||
testWithoutContext('DevtoolsLauncher launches DevTools through pub and saves the URI', () async {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -188,6 +193,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -196,6 +202,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'activate',
|
||||
@ -206,6 +213,7 @@ void main() {
|
||||
),
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -226,7 +234,7 @@ void main() {
|
||||
testWithoutContext('DevtoolsLauncher launches DevTools in browser', () async {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -235,6 +243,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -243,6 +252,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'activate',
|
||||
@ -253,6 +263,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -261,6 +272,7 @@ void main() {
|
||||
),
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -281,7 +293,7 @@ void main() {
|
||||
testWithoutContext('DevtoolsLauncher does not launch a new DevTools instance if one is already active', () async {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -290,6 +302,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -298,6 +311,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'activate',
|
||||
@ -308,6 +322,7 @@ void main() {
|
||||
),
|
||||
FakeCommand(
|
||||
command: const <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -333,7 +348,7 @@ void main() {
|
||||
testWithoutContext('DevtoolsLauncher does not activate DevTools if it was recently activated', () async {
|
||||
persistentToolState.lastDevToolsActivation = DateTime.now();
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -342,6 +357,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -350,6 +366,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -369,6 +386,7 @@ void main() {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -377,6 +395,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -389,7 +408,7 @@ void main() {
|
||||
),
|
||||
]);
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -406,7 +425,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher prints error if exception is thrown during activate', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -415,6 +434,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -423,6 +443,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'activate',
|
||||
@ -434,6 +455,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -453,7 +475,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher prints error if exception is thrown during launch', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -462,6 +484,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -470,6 +493,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'activate',
|
||||
@ -480,6 +504,7 @@ void main() {
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'run',
|
||||
@ -499,7 +524,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher prints trace if connecting to pub.dev throws', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -514,6 +539,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
@ -530,7 +556,7 @@ void main() {
|
||||
|
||||
testWithoutContext('DevtoolsLauncher prints trace if connecting to pub.dev returns non-OK status code', () async {
|
||||
final DevtoolsLauncher launcher = DevtoolsServerLauncher(
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
fileSystem: fakefs,
|
||||
logger: logger,
|
||||
platform: platform,
|
||||
@ -547,6 +573,7 @@ void main() {
|
||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'pub',
|
||||
'global',
|
||||
'list',
|
||||
|
@ -111,7 +111,7 @@ void main() {
|
||||
final DevtoolsServerLauncher launcher = DevtoolsServerLauncher(
|
||||
processManager: FakeProcessManager.empty(),
|
||||
fileSystem: fakefs,
|
||||
pubExecutable: 'pub',
|
||||
dartExecutable: 'dart',
|
||||
logger: BufferLogger.test(),
|
||||
platform: FakePlatform(),
|
||||
persistentToolState: null,
|
||||
|
@ -508,9 +508,7 @@ void main() {
|
||||
logging: false,
|
||||
);
|
||||
expect(result.exitCode, 0);
|
||||
// TODO(sigurdm): Remove the filter when
|
||||
// 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>[
|
||||
expect(result.stdout, <Object>[
|
||||
startsWith('Performing hot reload...'),
|
||||
'',
|
||||
'══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════',
|
||||
|
Loading…
Reference in New Issue
Block a user