[gen_l10n] Absolute project path parameter (#63368)
This commit is contained in:
@@ -36,11 +36,13 @@ Future<void> generateLocalizations({
|
||||
'bin',
|
||||
'gen_l10n.dart',
|
||||
);
|
||||
|
||||
final ProcessResult result = await processManager.run(<String>[
|
||||
dartBinaryPath,
|
||||
'--disable-dart-dev',
|
||||
genL10nPath,
|
||||
'--gen-inputs-and-outputs-list=${dependenciesDir.path}',
|
||||
'--project-dir=${projectDir.path}',
|
||||
if (options.arbDirectory != null)
|
||||
'--arb-dir=${options.arbDirectory.toFilePath()}',
|
||||
if (options.templateArbFile != null)
|
||||
|
||||
@@ -17,13 +17,15 @@ void main() {
|
||||
testWithoutContext('generateLocalizations forwards arguments correctly', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final Logger logger = BufferLogger.test();
|
||||
final String projectDir = fileSystem.path.join('path', 'to', 'flutter_project');
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
FakeCommand(
|
||||
command: <String>[
|
||||
'dart',
|
||||
'--disable-dart-dev',
|
||||
'dev/tools/localization/bin/gen_l10n.dart',
|
||||
'--gen-inputs-and-outputs-list=/',
|
||||
'--project-dir=$projectDir',
|
||||
'--arb-dir=arb',
|
||||
'--template-arb-file=example.arb',
|
||||
'--output-localization-file=bar',
|
||||
@@ -36,7 +38,11 @@ void main() {
|
||||
],
|
||||
),
|
||||
]);
|
||||
final Directory arbDirectory = fileSystem.directory('arb')
|
||||
final Directory flutterProjectDirectory = fileSystem
|
||||
.directory(fileSystem.path.join('path', 'to', 'flutter_project'))
|
||||
..createSync(recursive: true);
|
||||
final Directory arbDirectory = flutterProjectDirectory
|
||||
.childDirectory('arb')
|
||||
..createSync();
|
||||
arbDirectory.childFile('foo.arb').createSync();
|
||||
arbDirectory.childFile('bar.arb').createSync();
|
||||
@@ -57,7 +63,7 @@ void main() {
|
||||
logger: logger,
|
||||
fileSystem: fileSystem,
|
||||
processManager: processManager,
|
||||
projectDir: fileSystem.currentDirectory,
|
||||
projectDir: flutterProjectDirectory,
|
||||
dartBinaryPath: 'dart',
|
||||
flutterRoot: '',
|
||||
dependenciesDir: fileSystem.currentDirectory,
|
||||
|
||||
@@ -1189,6 +1189,7 @@ void main() {
|
||||
'--disable-dart-dev',
|
||||
globals.fs.path.join(Cache.flutterRoot, 'dev', 'tools', 'localization', 'bin', 'gen_l10n.dart'),
|
||||
'--gen-inputs-and-outputs-list=${dependencies.absolute.path}',
|
||||
'--project-dir=${globals.fs.currentDirectory.path}',
|
||||
],
|
||||
onRun: () {
|
||||
dependencies
|
||||
@@ -1218,6 +1219,7 @@ void main() {
|
||||
'--disable-dart-dev',
|
||||
globals.fs.path.join(Cache.flutterRoot, 'dev', 'tools', 'localization', 'bin', 'gen_l10n.dart'),
|
||||
'--gen-inputs-and-outputs-list=${dependencies.absolute.path}',
|
||||
'--project-dir=${globals.fs.currentDirectory.path}',
|
||||
],
|
||||
exitCode: 1,
|
||||
stderr: 'stderr'
|
||||
|
||||
Reference in New Issue
Block a user