Commit 2f4824e
committed
Add utils.FindFilesInFolder
This is a new helper function that takes care of listing files with
given extensions in a directory, recursively or non-recursively. This
functionality was previously duplicated in a few places. This new helper
function now replaces some duplicate code in SketchLoader and
CollectAllSourcesFilesFromFoldersWithSources. Compilation of code in the
core and libraries still uses two other mechanisms for listing files (in
builder_utils), which will later be converted to use this new helper
function too.
This new helper function has some subtle differences compared to the
previous code:
- The new code raises an error when the root directory does not exist,
which the CollectAllSourcesFilesFromFoldersWithSources code did not
do. To compensate for this, LibraryToSourceFolder will only return
the "utility" folder when it exists.
- The new code completely ignores any hidden or source control folders
or files. Originally, arduino-builder showed a warning when source
control or hidden folders were present, and then compiled files
inside of them anyway. Since f5edd23 (Avoid warning about SCCS folders
in libraries, just ignore them) this warning is no longer shown in
most cases, but the files themselves are still included in
compilation. With this commit, they are just completely ignored
instead (for sketch compilation and include detection, for core and
library compilation they will are still used). See also arduino#139.
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>1 parent f2d04ca commit 2f4824e
File tree
5 files changed
+34
-58
lines changed- src/arduino.cc/builder
- test
- types
- utils
5 files changed
+34
-58
lines changedLines changed: 2 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
| 43 | + | |
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 48 | + | |
58 | 49 | | |
59 | 50 | | |
60 | 51 | | |
| |||
66 | 57 | | |
67 | 58 | | |
68 | 59 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 91 | + | |
| 92 | + | |
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | | - | |
310 | | - | |
| 309 | + | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
316 | 320 | | |
317 | 321 | | |
318 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
319 | 335 | | |
320 | 336 | | |
321 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
322 | 340 | | |
323 | 341 | | |
324 | 342 | | |
325 | 343 | | |
326 | 344 | | |
327 | | - | |
| 345 | + | |
328 | 346 | | |
329 | 347 | | |
330 | | - | |
| 348 | + | |
331 | 349 | | |
332 | 350 | | |
333 | 351 | | |
| |||
0 commit comments