@@ -363,9 +363,6 @@ class NativeAssetsBuildRunner {
363
363
final (hookKernelFile, hookHashes) = hookCompileResult;
364
364
365
365
final buildOutputFile = _fileSystem.file (input.outputFile);
366
- final buildOutputFileDeprecated = _fileSystem
367
- // ignore: deprecated_member_use
368
- .file (outputDirectory.resolve (hook.outputNameDeprecated));
369
366
370
367
final dependenciesHashFile = buildDirUri.resolve (
371
368
'dependencies.dependencies_hash_file.json' ,
@@ -375,16 +372,10 @@ class NativeAssetsBuildRunner {
375
372
fileUri: dependenciesHashFile,
376
373
);
377
374
final lastModifiedCutoffTime = DateTime .now ();
378
- if ((buildOutputFile.existsSync () ||
379
- buildOutputFileDeprecated.existsSync ()) &&
380
- await dependenciesHashes.exists ()) {
375
+ if ((buildOutputFile.existsSync ()) && await dependenciesHashes.exists ()) {
381
376
late final HookOutput output;
382
377
try {
383
- output = _readHookOutputFromUri (
384
- hook,
385
- buildOutputFile,
386
- buildOutputFileDeprecated,
387
- );
378
+ output = _readHookOutputFromUri (hook, buildOutputFile);
388
379
} on FormatException catch (e) {
389
380
logger.severe ('''
390
381
Building assets for package:${input .packageName } failed.
@@ -488,14 +479,6 @@ ${e.message}
488
479
// Ensure we'll never read outdated build results.
489
480
await hookOutputFile.delete ();
490
481
}
491
- final hookOutputUriDeprecated =
492
- // ignore: deprecated_member_use
493
- outputDirectory.resolve (hook.outputNameDeprecated);
494
- final hookOutputFileDeprecated = _fileSystem.file (hookOutputUriDeprecated);
495
- if (await hookOutputFileDeprecated.exists ()) {
496
- // Ensure we'll never read outdated build results.
497
- await hookOutputFileDeprecated.delete ();
498
- }
499
482
500
483
final arguments = [
501
484
'--packages=${packageLayout .packageConfigUri .toFilePath ()}' ,
@@ -540,11 +523,7 @@ ${e.message}
540
523
return null ;
541
524
}
542
525
543
- final output = _readHookOutputFromUri (
544
- hook,
545
- hookOutputFile,
546
- hookOutputFileDeprecated,
547
- );
526
+ final output = _readHookOutputFromUri (hook, hookOutputFile);
548
527
final errors = await _validate (input, output, validator);
549
528
if (errors.isNotEmpty) {
550
529
_printErrors (
@@ -852,14 +831,8 @@ ${compileResult.stdout}
852
831
return (buildPlan, packageGraph);
853
832
}
854
833
855
- HookOutput _readHookOutputFromUri (
856
- Hook hook,
857
- File hookOutputFile,
858
- // TODO(dcharkes): Remove when hooks with 1.7.0 are no longer supported.
859
- File hookOutputFileDeprecated,
860
- ) {
861
- final file =
862
- hookOutputFile.existsSync () ? hookOutputFile : hookOutputFileDeprecated;
834
+ HookOutput _readHookOutputFromUri (Hook hook, File hookOutputFile) {
835
+ final file = hookOutputFile;
863
836
final fileContents = file.readAsStringSync ();
864
837
logger.info ('output.json contents:\n $fileContents ' );
865
838
final hookOutputJson = jsonDecode (fileContents) as Map <String , Object ?>;
0 commit comments