@@ -24,6 +24,7 @@ import (
24
24
"github.com/arduino/arduino-cli/arduino/builder/logger"
25
25
"github.com/arduino/arduino-cli/arduino/builder/progress"
26
26
"github.com/arduino/arduino-cli/arduino/cores"
27
+ "github.com/arduino/arduino-cli/arduino/libraries"
27
28
"github.com/arduino/arduino-cli/arduino/libraries/librariesmanager"
28
29
"github.com/arduino/arduino-cli/arduino/sketch"
29
30
"github.com/arduino/go-paths-helper"
@@ -81,7 +82,7 @@ type Builder struct {
81
82
82
83
buildOptions * buildOptions
83
84
84
- * detector.SketchLibrariesDetector
85
+ libsDetector * detector.SketchLibrariesDetector
85
86
}
86
87
87
88
// BuildArtifacts contains the result of various build
@@ -202,7 +203,7 @@ func NewBuilder(
202
203
buildArtifacts : & BuildArtifacts {},
203
204
targetPlatform : targetPlatform ,
204
205
actualPlatform : actualPlatform ,
205
- SketchLibrariesDetector : detector .NewSketchLibrariesDetector (
206
+ libsDetector : detector .NewSketchLibrariesDetector (
206
207
libsManager , libsResolver ,
207
208
useCachedLibrariesResolution ,
208
209
onlyUpdateCompilationDatabase ,
@@ -237,6 +238,11 @@ func (b *Builder) ExecutableSectionsSize() ExecutablesFileSections {
237
238
return b .executableSectionsSize
238
239
}
239
240
241
+ // ImportedLibraries fixdoc
242
+ func (b * Builder ) ImportedLibraries () libraries.List {
243
+ return b .libsDetector .ImportedLibraries ()
244
+ }
245
+
240
246
// Preprocess fixdoc
241
247
func (b * Builder ) Preprocess () error {
242
248
b .Progress .AddSubSteps (6 )
@@ -271,7 +277,7 @@ func (b *Builder) preprocess() error {
271
277
b .Progress .PushProgress ()
272
278
273
279
b .logIfVerbose (false , tr ("Detecting libraries used..." ))
274
- err := b .SketchLibrariesDetector .FindIncludes (
280
+ err := b .libsDetector .FindIncludes (
275
281
b .buildPath ,
276
282
b .buildProperties .GetPath ("build.core.path" ),
277
283
b .buildProperties .GetPath ("build.variant.path" ),
@@ -287,12 +293,12 @@ func (b *Builder) preprocess() error {
287
293
b .Progress .CompleteStep ()
288
294
b .Progress .PushProgress ()
289
295
290
- b .warnAboutArchIncompatibleLibraries (b .SketchLibrariesDetector .ImportedLibraries ())
296
+ b .warnAboutArchIncompatibleLibraries (b .libsDetector .ImportedLibraries ())
291
297
b .Progress .CompleteStep ()
292
298
b .Progress .PushProgress ()
293
299
294
300
b .logIfVerbose (false , tr ("Generating function prototypes..." ))
295
- if err := b .preprocessSketch (b .SketchLibrariesDetector .IncludeFolders ()); err != nil {
301
+ if err := b .preprocessSketch (b .libsDetector .IncludeFolders ()); err != nil {
296
302
return err
297
303
}
298
304
b .Progress .CompleteStep ()
@@ -330,18 +336,18 @@ func (b *Builder) Build() error {
330
336
331
337
buildErr := b .build ()
332
338
333
- b .SketchLibrariesDetector .PrintUsedAndNotUsedLibraries (buildErr != nil )
339
+ b .libsDetector .PrintUsedAndNotUsedLibraries (buildErr != nil )
334
340
b .Progress .CompleteStep ()
335
341
b .Progress .PushProgress ()
336
342
337
- b .printUsedLibraries (b .SketchLibrariesDetector .ImportedLibraries ())
343
+ b .printUsedLibraries (b .libsDetector .ImportedLibraries ())
338
344
b .Progress .CompleteStep ()
339
345
b .Progress .PushProgress ()
340
346
341
347
if buildErr != nil {
342
348
return buildErr
343
349
}
344
- if err := b .exportProjectCMake (b .SketchLibrariesDetector .ImportedLibraries (), b .SketchLibrariesDetector .IncludeFolders ()); err != nil {
350
+ if err := b .exportProjectCMake (b .libsDetector .ImportedLibraries (), b .libsDetector .IncludeFolders ()); err != nil {
345
351
return err
346
352
}
347
353
b .Progress .CompleteStep ()
@@ -365,7 +371,7 @@ func (b *Builder) build() error {
365
371
b .Progress .CompleteStep ()
366
372
b .Progress .PushProgress ()
367
373
368
- if err := b .BuildSketch (b .SketchLibrariesDetector .IncludeFolders ()); err != nil {
374
+ if err := b .BuildSketch (b .libsDetector .IncludeFolders ()); err != nil {
369
375
return err
370
376
}
371
377
b .Progress .CompleteStep ()
@@ -384,13 +390,13 @@ func (b *Builder) build() error {
384
390
b .Progress .CompleteStep ()
385
391
b .Progress .PushProgress ()
386
392
387
- if err := b .removeUnusedCompiledLibraries (b .SketchLibrariesDetector .ImportedLibraries ()); err != nil {
393
+ if err := b .removeUnusedCompiledLibraries (b .libsDetector .ImportedLibraries ()); err != nil {
388
394
return err
389
395
}
390
396
b .Progress .CompleteStep ()
391
397
b .Progress .PushProgress ()
392
398
393
- if err := b .buildLibraries (b .SketchLibrariesDetector .IncludeFolders (), b .SketchLibrariesDetector .ImportedLibraries ()); err != nil {
399
+ if err := b .buildLibraries (b .libsDetector .IncludeFolders (), b .libsDetector .ImportedLibraries ()); err != nil {
394
400
return err
395
401
}
396
402
b .Progress .CompleteStep ()
0 commit comments