Commit 8d3cca4
authored
use root directory as the default for rootOverride in Cache.test constructor (#158201)
While doing some hacking on `Cache` in flutter/flutter#158081, I noticed that [`Cache.test`](https://github.com/flutter/flutter/blob/de9318275391a6d2f10ae33c576f4113b25fd156/packages/flutter_tools/lib/src/cache.dart#L139) allows the caller to tell Cache to use some given directory as the flutter root (instead of depending on the static global [`Cache.flutterRoot`](https://github.com/flutter/flutter/blob/4f3976a4f2b722d26c3353158dcd26590859dde0/packages/flutter_tools/lib/src/cache.dart#L206)). This has a default value, `/cache`. However, `/cache` is an unintuitive name for the root directory of a Flutter installation.
This led to confusion when updating some tests. I wanted to create `/bin/cache/engine-dart-sdk.stamp` for tests, but in reality I needed to create `/cache/bin/cache/engine-dart-sdk.stamp`.
This PR changes this default to the current directory of the file system (which I'm guessing is `/` for all intents and purposes).
<details>
<summary> Pre-launch checklist </summary>
</details>1 parent b6fef5c commit 8d3cca4
File tree
3 files changed
+15
-9
lines changed- packages/flutter_tools
- lib/src
- test/general.shard
- android
3 files changed
+15
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
151 | | - | |
| 160 | + | |
152 | 161 | | |
153 | 162 | | |
154 | 163 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
| |||
803 | 802 | | |
804 | 803 | | |
805 | 804 | | |
806 | | - | |
807 | 805 | | |
808 | 806 | | |
809 | 807 | | |
| |||
842 | 840 | | |
843 | 841 | | |
844 | 842 | | |
845 | | - | |
| 843 | + | |
846 | 844 | | |
847 | 845 | | |
848 | 846 | | |
| |||
852 | 850 | | |
853 | 851 | | |
854 | 852 | | |
855 | | - | |
856 | 853 | | |
857 | 854 | | |
858 | 855 | | |
| |||
909 | 906 | | |
910 | 907 | | |
911 | 908 | | |
912 | | - | |
| 909 | + | |
913 | 910 | | |
914 | 911 | | |
915 | 912 | | |
| |||
1108 | 1105 | | |
1109 | 1106 | | |
1110 | 1107 | | |
1111 | | - | |
| 1108 | + | |
1112 | 1109 | | |
1113 | 1110 | | |
1114 | 1111 | | |
1115 | | - | |
| 1112 | + | |
1116 | 1113 | | |
1117 | 1114 | | |
1118 | 1115 | | |
| |||
0 commit comments