Replace --no-implicit-pubspec-resolution with flutter config --explicit-package-dependencies. (#160400)
This was a mistake, and should have already been removed and cleaned up. Part of https://github.com/flutter/flutter/issues/160257.
This commit is contained in:
@@ -8,10 +8,10 @@ import '../artifacts.dart';
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/logger.dart';
|
||||
import '../features.dart';
|
||||
import '../localizations/gen_l10n.dart';
|
||||
import '../localizations/localizations_utils.dart';
|
||||
import '../runner/flutter_command.dart';
|
||||
import '../runner/flutter_command_runner.dart';
|
||||
|
||||
/// A command to generate localizations source files for a Flutter project.
|
||||
///
|
||||
@@ -249,7 +249,7 @@ class GenerateLocalizationsCommand extends FlutterCommand {
|
||||
file: _fileSystem.file('l10n.yaml'),
|
||||
logger: _logger,
|
||||
defaultArbDir: defaultArbDir,
|
||||
defaultSyntheticPackage: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
|
||||
defaultSyntheticPackage: !featureFlags.isExplicitPackageDependenciesEnabled,
|
||||
);
|
||||
_logger.printStatus(
|
||||
'Because l10n.yaml exists, the options defined there will be used '
|
||||
|
||||
@@ -8,8 +8,8 @@ import 'package:yaml/yaml.dart';
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/logger.dart';
|
||||
import '../features.dart';
|
||||
import '../runner/flutter_command.dart';
|
||||
import '../runner/flutter_command_runner.dart';
|
||||
import 'gen_l10n_types.dart';
|
||||
import 'language_subtag_registry.dart';
|
||||
|
||||
@@ -521,8 +521,8 @@ LocalizationOptions parseLocalizationsOptionsFromCommand({
|
||||
// If provided explicitly, use the explicit value.
|
||||
syntheticPackage = command.boolArg('synthetic-package');
|
||||
} else {
|
||||
// Otherwise, inherit from whatever the default of --implicit-pubspec-resolution is.
|
||||
syntheticPackage = command.globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution);
|
||||
// Otherwise, inherit from whatever the reverse of flutter config --explicit-package-dependencies.
|
||||
syntheticPackage = !featureFlags.isExplicitPackageDependenciesEnabled;
|
||||
}
|
||||
return LocalizationOptions(
|
||||
arbDir: command.stringArg('arb-dir') ?? defaultArbDir,
|
||||
|
||||
@@ -33,8 +33,6 @@ abstract final class FlutterGlobalOptions {
|
||||
static const String kLocalEngineSrcPathOption = 'local-engine-src-path';
|
||||
static const String kLocalEngineHostOption = 'local-engine-host';
|
||||
static const String kLocalWebSDKOption = 'local-web-sdk';
|
||||
// TODO(matanlurey): Remove one stable after https://github.com/flutter/flutter/issues/157819.
|
||||
static const String kImplicitPubspecResolution = 'implicit-pubspec-resolution';
|
||||
static const String kMachineFlag = 'machine';
|
||||
static const String kPackagesOption = 'packages';
|
||||
static const String kPrefixedErrorsFlag = 'prefixed-errors';
|
||||
@@ -127,25 +125,6 @@ class FlutterCommandRunner extends CommandRunner<void> {
|
||||
hide: !verboseHelp,
|
||||
);
|
||||
|
||||
// TODO(matanlurey): Remove after the Q2 2025 stable release; this is intended
|
||||
// to give application developers a single stable release where the .flutter-plugins
|
||||
// file is still supported, but is deprecated, and let folks ensure (with CI or local
|
||||
// testing) that their workflows do not depend on the file.
|
||||
//
|
||||
// See https://github.com/flutter/flutter/issues/157532.
|
||||
argParser.addFlag(FlutterGlobalOptions.kImplicitPubspecResolution,
|
||||
defaultsTo: true,
|
||||
help: 'Whether to support (deprecated) implicit pubspec resolution '
|
||||
'features, each of which are slated for removal in a future stable '
|
||||
'release. By setting to "true", the following occurs:\n'
|
||||
' 1. The generation of ".flutter-plugins" (https://flutter.dev/to/flutter-plugins-configuration).\n'
|
||||
' 2. Including plugins registered as "dev_dependencies" in release mode.\n'
|
||||
' 3. Flutter localizations are by default output to synthetic "flutter_gen" package.\n'
|
||||
'\n'
|
||||
'This flag will become "false" by default, and then features removed.',
|
||||
hide: !verboseHelp,
|
||||
);
|
||||
|
||||
if (verboseHelp) {
|
||||
argParser.addSeparator('Local build selection options (not normally required):');
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ flutter:
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('not using synthetic packages (due to --no-implicit-pubspec-resolution)', () async {
|
||||
testUsingContext('not using synthetic packages (due to --explicit-package-dependencies)', () async {
|
||||
final Directory l10nDirectory = fileSystem.directory(
|
||||
fileSystem.path.join('lib', 'l10n'),
|
||||
);
|
||||
@@ -140,7 +140,6 @@ flutter:
|
||||
processManager: processManager,
|
||||
);
|
||||
await createTestCommandRunner(command).run(<String>[
|
||||
'--no-implicit-pubspec-resolution',
|
||||
'gen-l10n',
|
||||
]);
|
||||
|
||||
@@ -152,6 +151,7 @@ flutter:
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
FeatureFlags: enableExplicitPackageDependencies,
|
||||
});
|
||||
|
||||
testUsingContext('throws error when arguments are invalid', () async {
|
||||
|
||||
Reference in New Issue
Block a user