@@ -76,20 +76,21 @@ class Command {
76
76
}
77
77
78
78
static Command adbPrecompiled (
79
- String precompiledRunner ,
79
+ String buildPath ,
80
80
String processTest,
81
81
String testDirectory,
82
82
List <String > arguments,
83
83
bool useBlobs,
84
- bool useElf) {
85
- return AdbPrecompilationCommand ._(precompiledRunner, processTest,
86
- testDirectory, arguments, useBlobs, useElf);
84
+ bool useElf,
85
+ List <String > extraLibs) {
86
+ return AdbPrecompilationCommand ._(buildPath, processTest, testDirectory,
87
+ arguments, useBlobs, useElf, extraLibs);
87
88
}
88
89
89
- static Command adbDartk (String precompiledRunner , String processTest,
90
- String script, List <String > arguments, List <String > extraLibraries) {
90
+ static Command adbDartk (String buildPath , String processTest, String script ,
91
+ List <String > arguments, List <String > extraLibraries) {
91
92
return AdbDartkCommand ._(
92
- precompiledRunner , processTest, script, arguments, extraLibraries);
93
+ buildPath , processTest, script, arguments, extraLibraries);
93
94
}
94
95
95
96
static Command jsCommandLine (
@@ -587,54 +588,72 @@ class VmBatchCommand extends ProcessCommand implements VmCommand {
587
588
}
588
589
}
589
590
590
- class AdbPrecompilationCommand extends Command {
591
- final String precompiledRunnerFilename;
591
+ abstract class AdbCommand {
592
+ String get buildPath;
593
+ List <String > get extraLibraries;
594
+ }
595
+
596
+ class AdbPrecompilationCommand extends Command implements AdbCommand {
597
+ final String buildPath; // Path to the output directory of the build.
592
598
final String processTestFilename;
593
599
final String precompiledTestDirectory;
594
600
final List <String > arguments;
595
601
final bool useBlobs;
596
602
final bool useElf;
603
+ final List <String > extraLibraries;
597
604
598
605
AdbPrecompilationCommand ._(
599
- this .precompiledRunnerFilename ,
606
+ this .buildPath ,
600
607
this .processTestFilename,
601
608
this .precompiledTestDirectory,
602
609
this .arguments,
603
610
this .useBlobs,
604
611
this .useElf,
612
+ this .extraLibraries,
605
613
{int index = 0 })
606
614
: super ._("adb_precompilation" , index: index);
607
615
608
616
AdbPrecompilationCommand indexedCopy (int index) => AdbPrecompilationCommand ._(
609
- precompiledRunnerFilename ,
617
+ buildPath ,
610
618
processTestFilename,
611
619
precompiledTestDirectory,
612
620
arguments,
613
621
useBlobs,
614
622
useElf,
623
+ extraLibraries,
615
624
index: index);
616
625
_buildHashCode (HashCodeBuilder builder) {
617
626
super ._buildHashCode (builder);
618
- builder.add (precompiledRunnerFilename );
627
+ builder.add (buildPath );
619
628
builder.add (precompiledTestDirectory);
620
629
builder.add (arguments);
621
630
builder.add (useBlobs);
622
631
builder.add (useElf);
632
+ extraLibraries.forEach (builder.add);
633
+ }
634
+
635
+ static bool _listEquals (List <String > x, List <String > y) {
636
+ if (x.length != y.length) return false ;
637
+ for (int i = 0 ; i < x.length; ++ i) {
638
+ if (x[i] != y[i]) return false ;
639
+ }
640
+ return true ;
623
641
}
624
642
625
643
bool _equal (AdbPrecompilationCommand other) =>
626
644
super ._equal (other) &&
627
- precompiledRunnerFilename == other.precompiledRunnerFilename &&
645
+ buildPath == other.buildPath &&
628
646
useBlobs == other.useBlobs &&
629
647
useElf == other.useElf &&
630
648
arguments == other.arguments &&
631
- precompiledTestDirectory == other.precompiledTestDirectory;
649
+ precompiledTestDirectory == other.precompiledTestDirectory &&
650
+ _listEquals (extraLibraries, other.extraLibraries);
632
651
633
652
String toString () => 'Steps to push precompiled runner and precompiled code '
634
653
'to an attached device. Uses (and requires) adb.' ;
635
654
}
636
655
637
- class AdbDartkCommand extends Command {
656
+ class AdbDartkCommand extends Command implements AdbCommand {
638
657
final String buildPath;
639
658
final String processTestFilename;
640
659
final String kernelFile;
0 commit comments