@@ -14,7 +14,6 @@ import '../locking/locking.dart';
14
14
import '../model/build_dry_run_result.dart' ;
15
15
import '../model/build_result.dart' ;
16
16
import '../model/hook_result.dart' ;
17
- import '../model/link_dry_run_result.dart' ;
18
17
import '../model/link_result.dart' ;
19
18
import '../package_layout/package_layout.dart' ;
20
19
import '../utils/file.dart' ;
@@ -379,66 +378,12 @@ class NativeAssetsBuildRunner {
379
378
PackageLayout ? packageLayout,
380
379
String ? runPackageName,
381
380
Iterable <String >? supportedAssetTypes,
382
- }) =>
383
- _runDryRun (
384
- hook: Hook .build,
385
- linkModePreference: linkModePreference,
386
- targetOS: targetOS,
387
- workingDirectory: workingDirectory,
388
- includeParentEnvironment: includeParentEnvironment,
389
- packageLayout: packageLayout,
390
- runPackageName: runPackageName,
391
- supportedAssetTypes: supportedAssetTypes,
392
- linkingEnabled: linkingEnabled,
393
- );
394
-
395
- /// [workingDirectory] is expected to contain `.dart_tool` .
396
- ///
397
- /// This method is invoked by launchers such as dartdev (for `dart run` ) and
398
- /// flutter_tools (for `flutter run` and `flutter build` ).
399
- ///
400
- /// If provided, only native assets of all transitive dependencies of
401
- /// [runPackageName] are built.
402
- Future <LinkDryRunResult > linkDryRun ({
403
- required LinkModePreferenceImpl linkModePreference,
404
- required OSImpl targetOS,
405
- required Uri workingDirectory,
406
- required bool includeParentEnvironment,
407
- PackageLayout ? packageLayout,
408
- String ? runPackageName,
409
- Iterable <String >? supportedAssetTypes,
410
- required BuildDryRunResult buildDryRunResult,
411
- }) =>
412
- _runDryRun (
413
- hook: Hook .link,
414
- linkModePreference: linkModePreference,
415
- targetOS: targetOS,
416
- workingDirectory: workingDirectory,
417
- includeParentEnvironment: includeParentEnvironment,
418
- packageLayout: packageLayout,
419
- runPackageName: runPackageName,
420
- supportedAssetTypes: supportedAssetTypes,
421
- buildDryRunResult: buildDryRunResult,
422
- linkingEnabled: null ,
423
- );
424
-
425
- Future <HookResult > _runDryRun ({
426
- required LinkModePreferenceImpl linkModePreference,
427
- required OSImpl targetOS,
428
- required Uri workingDirectory,
429
- required bool includeParentEnvironment,
430
- PackageLayout ? packageLayout,
431
- String ? runPackageName,
432
- Iterable <String >? supportedAssetTypes,
433
- required Hook hook,
434
- BuildDryRunResult ? buildDryRunResult,
435
- required bool ? linkingEnabled,
436
381
}) async {
382
+ const hook = Hook .build;
437
383
packageLayout ?? = await PackageLayout .fromRootPackageRoot (workingDirectory);
438
384
final (buildPlan, _, planSuccess) = await _makePlan (
439
385
hook: hook,
440
386
packageLayout: packageLayout,
441
- buildDryRunResult: buildDryRunResult,
442
387
runPackageName: runPackageName,
443
388
);
444
389
if (! planSuccess) {
@@ -455,8 +400,6 @@ class NativeAssetsBuildRunner {
455
400
linkMode: linkModePreference,
456
401
buildParentDir: packageLayout.dartToolNativeAssetsBuilder,
457
402
supportedAssetTypes: supportedAssetTypes,
458
- hook: hook,
459
- buildDryRunResult: buildDryRunResult,
460
403
linkingEnabled: linkingEnabled,
461
404
);
462
405
final packageConfigUri = packageLayout.packageConfigUri;
@@ -820,11 +763,10 @@ ${compileResult.stdout}
820
763
required OSImpl targetOS,
821
764
required LinkModePreferenceImpl linkMode,
822
765
required Uri buildParentDir,
823
- required Hook hook,
824
- BuildDryRunResult ? buildDryRunResult,
825
766
Iterable <String >? supportedAssetTypes,
826
767
required bool ? linkingEnabled,
827
768
}) async {
769
+ const hook = Hook .build;
828
770
final buildDirName = HookConfigImpl .checksumDryRun (
829
771
packageName: package.name,
830
772
packageRoot: package.root,
@@ -850,30 +792,16 @@ ${compileResult.stdout}
850
792
await outDirShared.create (recursive: true );
851
793
}
852
794
853
- switch (hook) {
854
- case Hook .build:
855
- return BuildConfigImpl .dryRun (
856
- outputDirectory: outDirUri,
857
- outputDirectoryShared: outputDirectoryShared,
858
- packageName: packageName,
859
- packageRoot: packageRoot,
860
- targetOS: targetOS,
861
- linkModePreference: linkMode,
862
- supportedAssetTypes: supportedAssetTypes,
863
- linkingEnabled: linkingEnabled,
864
- );
865
- case Hook .link:
866
- return LinkConfigImpl .dryRun (
867
- outputDirectory: outDirUri,
868
- outputDirectoryShared: outputDirectoryShared,
869
- packageName: packageName,
870
- packageRoot: packageRoot,
871
- targetOS: targetOS,
872
- assets: buildDryRunResult! .assetsForLinking[packageName] ?? [],
873
- supportedAssetTypes: supportedAssetTypes,
874
- linkModePreference: linkMode,
875
- );
876
- }
795
+ return BuildConfigImpl .dryRun (
796
+ outputDirectory: outDirUri,
797
+ outputDirectoryShared: outputDirectoryShared,
798
+ packageName: packageName,
799
+ packageRoot: packageRoot,
800
+ targetOS: targetOS,
801
+ linkModePreference: linkMode,
802
+ supportedAssetTypes: supportedAssetTypes,
803
+ linkingEnabled: linkingEnabled,
804
+ );
877
805
}
878
806
879
807
DependencyMetadata ? _metadataForPackage ({
@@ -926,7 +854,6 @@ ${compileResult.stdout}
926
854
required Hook hook,
927
855
// TODO(dacoharkes): How to share these two? Make them extend each other?
928
856
BuildResult ? buildResult,
929
- BuildDryRunResult ? buildDryRunResult,
930
857
}) async {
931
858
final packagesWithHook = await packageLayout.packagesWithAssets (hook);
932
859
final List <Package > buildPlan;
@@ -956,8 +883,7 @@ ${compileResult.stdout}
956
883
// Link hooks are skipped if no assets for linking are provided.
957
884
buildPlan = [];
958
885
final skipped = < String > [];
959
- final assetsForLinking = buildResult? .assetsForLinking ??
960
- buildDryRunResult? .assetsForLinking;
886
+ final assetsForLinking = buildResult? .assetsForLinking;
961
887
for (final package in packagesWithHook) {
962
888
if (assetsForLinking! [package.name]? .isNotEmpty ?? false ) {
963
889
buildPlan.add (package);
0 commit comments