blob: 1305da4bbf7a47665339b8005a3fcb95c220e020 [file] [log] [blame]
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:nnbd_migration/migration_cli.dart';
const String migratedAlready =
"Seem to be migrating code that's already migrated";
const String nnbdExperimentOff =
'Analyzer seems to need the nnbd experiment on in the SDK.';
const String sdkNnbdOff = 'Analysis seems to have an SDK without NNBD enabled.';
const String sdkPathEnvironmentVariableSet =
r'Note: $SDK_PATH environment variable is set and may point to outdated '
'dart:core sources';
const String _skipImportCheckFlag =
'--${CommandLineOptions.skipImportCheckFlag}';
const String unmigratedDependenciesWarning = '''
Warning: package has unmigrated dependencies.
Continuing due to the presence of `$_skipImportCheckFlag`. To see a complete
list of these libraries, re-run without the `$_skipImportCheckFlag` flag.
''';
String unmigratedDependenciesError(List<String> uris) => '''
Error: package has unmigrated dependencies.
Before migrating your package, we recommend ensuring that every library it
imports (either directly or indirectly) has been migrated to null safety, so
that you will be able to run your unit tests in sound null checking mode. You
are currently importing the following non-null-safe libraries:
${uris.join('\n ')}
Please upgrade the packages containing these libraries to null safe versions
before continuing. To see what null safe package versions are available, run
the following command: `dart pub outdated --mode=null-safety --prereleases`.
To skip this check and try to migrate anyway, re-run with the flag
`$_skipImportCheckFlag`.
''';