@@ -20,7 +20,6 @@ import (
20
20
"sort"
21
21
"testing"
22
22
23
- "github.com/arduino/arduino-cli/legacy/builder"
24
23
"github.com/arduino/arduino-cli/legacy/builder/types"
25
24
paths "github.com/arduino/go-paths-helper"
26
25
"github.com/stretchr/testify/require"
@@ -37,7 +36,18 @@ func TestIncludesToIncludeFolders(t *testing.T) {
37
36
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
38
37
return _err
39
38
}),
40
- & builder.ContainerFindIncludes {},
39
+ types .BareCommand (func (ctx * types.Context ) error {
40
+ return ctx .SketchLibrariesDetector .FindIncludes (
41
+ ctx .BuildPath ,
42
+ ctx .BuildProperties .GetPath ("build.core.path" ),
43
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
44
+ ctx .SketchBuildPath ,
45
+ ctx .Sketch ,
46
+ ctx .LibrariesBuildPath ,
47
+ ctx .BuildProperties ,
48
+ ctx .TargetPlatform .Platform .Architecture ,
49
+ )
50
+ }),
41
51
}
42
52
for _ , command := range commands {
43
53
err := command .Run (ctx )
@@ -60,7 +70,18 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) {
60
70
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
61
71
return _err
62
72
}),
63
- & builder.ContainerFindIncludes {},
73
+ types .BareCommand (func (ctx * types.Context ) error {
74
+ return ctx .SketchLibrariesDetector .FindIncludes (
75
+ ctx .BuildPath ,
76
+ ctx .BuildProperties .GetPath ("build.core.path" ),
77
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
78
+ ctx .SketchBuildPath ,
79
+ ctx .Sketch ,
80
+ ctx .LibrariesBuildPath ,
81
+ ctx .BuildProperties ,
82
+ ctx .TargetPlatform .Platform .Architecture ,
83
+ )
84
+ }),
64
85
}
65
86
for _ , command := range commands {
66
87
err := command .Run (ctx )
@@ -82,7 +103,18 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) {
82
103
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
83
104
return _err
84
105
}),
85
- & builder.ContainerFindIncludes {},
106
+ types .BareCommand (func (ctx * types.Context ) error {
107
+ return ctx .SketchLibrariesDetector .FindIncludes (
108
+ ctx .BuildPath ,
109
+ ctx .BuildProperties .GetPath ("build.core.path" ),
110
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
111
+ ctx .SketchBuildPath ,
112
+ ctx .Sketch ,
113
+ ctx .LibrariesBuildPath ,
114
+ ctx .BuildProperties ,
115
+ ctx .TargetPlatform .Platform .Architecture ,
116
+ )
117
+ }),
86
118
}
87
119
for _ , command := range commands {
88
120
err := command .Run (ctx )
@@ -107,7 +139,18 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) {
107
139
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
108
140
return _err
109
141
}),
110
- & builder.ContainerFindIncludes {},
142
+ types .BareCommand (func (ctx * types.Context ) error {
143
+ return ctx .SketchLibrariesDetector .FindIncludes (
144
+ ctx .BuildPath ,
145
+ ctx .BuildProperties .GetPath ("build.core.path" ),
146
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
147
+ ctx .SketchBuildPath ,
148
+ ctx .Sketch ,
149
+ ctx .LibrariesBuildPath ,
150
+ ctx .BuildProperties ,
151
+ ctx .TargetPlatform .Platform .Architecture ,
152
+ )
153
+ }),
111
154
}
112
155
for _ , command := range commands {
113
156
err := command .Run (ctx )
@@ -137,7 +180,18 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) {
137
180
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
138
181
return _err
139
182
}),
140
- & builder.ContainerFindIncludes {},
183
+ types .BareCommand (func (ctx * types.Context ) error {
184
+ return ctx .SketchLibrariesDetector .FindIncludes (
185
+ ctx .BuildPath ,
186
+ ctx .BuildProperties .GetPath ("build.core.path" ),
187
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
188
+ ctx .SketchBuildPath ,
189
+ ctx .Sketch ,
190
+ ctx .LibrariesBuildPath ,
191
+ ctx .BuildProperties ,
192
+ ctx .TargetPlatform .Platform .Architecture ,
193
+ )
194
+ }),
141
195
}
142
196
for _ , command := range commands {
143
197
err := command .Run (ctx )
@@ -168,7 +222,19 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo
168
222
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
169
223
return _err
170
224
}),
171
- & builder.ContainerFindIncludes {},
225
+ types .BareCommand (func (ctx * types.Context ) error {
226
+ return ctx .SketchLibrariesDetector .FindIncludes (
227
+ ctx .BuildPath ,
228
+ ctx .BuildProperties .GetPath ("build.core.path" ),
229
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
230
+ ctx .SketchBuildPath ,
231
+ ctx .Sketch ,
232
+ ctx .LibrariesBuildPath ,
233
+ ctx .BuildProperties ,
234
+ ctx .TargetPlatform .Platform .Architecture ,
235
+ )
236
+
237
+ }),
172
238
}
173
239
for _ , command := range commands {
174
240
err := command .Run (ctx )
@@ -199,7 +265,18 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) {
199
265
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
200
266
return _err
201
267
}),
202
- & builder.ContainerFindIncludes {},
268
+ types .BareCommand (func (ctx * types.Context ) error {
269
+ return ctx .SketchLibrariesDetector .FindIncludes (
270
+ ctx .BuildPath ,
271
+ ctx .BuildProperties .GetPath ("build.core.path" ),
272
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
273
+ ctx .SketchBuildPath ,
274
+ ctx .Sketch ,
275
+ ctx .LibrariesBuildPath ,
276
+ ctx .BuildProperties ,
277
+ ctx .TargetPlatform .Platform .Architecture ,
278
+ )
279
+ }),
203
280
}
204
281
for _ , command := range commands {
205
282
err := command .Run (ctx )
@@ -225,7 +302,18 @@ func TestIncludesToIncludeFoldersSubfolders(t *testing.T) {
225
302
ctx .LineOffset , _err = ctx .Builder .PrepareSketchBuildPath (ctx .SourceOverride , ctx .SketchBuildPath )
226
303
return _err
227
304
}),
228
- & builder.ContainerFindIncludes {},
305
+ types .BareCommand (func (ctx * types.Context ) error {
306
+ return ctx .SketchLibrariesDetector .FindIncludes (
307
+ ctx .BuildPath ,
308
+ ctx .BuildProperties .GetPath ("build.core.path" ),
309
+ ctx .BuildProperties .GetPath ("build.variant.path" ),
310
+ ctx .SketchBuildPath ,
311
+ ctx .Sketch ,
312
+ ctx .LibrariesBuildPath ,
313
+ ctx .BuildProperties ,
314
+ ctx .TargetPlatform .Platform .Architecture ,
315
+ )
316
+ }),
229
317
}
230
318
for _ , command := range commands {
231
319
err := command .Run (ctx )
0 commit comments