@@ -33,6 +33,8 @@ import (
33
33
"github.com/arduino/arduino-cli/commands"
34
34
"github.com/arduino/arduino-cli/configuration"
35
35
"github.com/arduino/arduino-cli/i18n"
36
+ "github.com/arduino/arduino-cli/table"
37
+ "github.com/fatih/color"
36
38
"github.com/sirupsen/logrus"
37
39
38
40
"github.com/arduino/arduino-cli/cli/errorcodes"
@@ -316,6 +318,45 @@ func (r *compileResult) Data() interface{} {
316
318
}
317
319
318
320
func (r * compileResult ) String () string {
319
- // The output is already printed via os.Stdout/os.Stdin
320
- return ""
321
+ titleColor := color .New (color .FgHiGreen )
322
+ nameColor := color .New (color .FgHiYellow )
323
+ pathColor := color .New (color .FgHiBlack )
324
+ build := r .BuilderResult
325
+
326
+ res := "\n "
327
+ libraries := table .New ()
328
+ if len (build .GetUsedLibraries ()) > 0 {
329
+ libraries .SetHeader (
330
+ table .NewCell (tr ("Used library" ), titleColor ),
331
+ table .NewCell (tr ("Version" ), titleColor ),
332
+ table .NewCell (tr ("Path" ), pathColor ))
333
+ for _ , l := range build .GetUsedLibraries () {
334
+ libraries .AddRow (
335
+ table .NewCell (l .GetName (), nameColor ),
336
+ l .GetVersion (),
337
+ table .NewCell (l .GetInstallDir (), pathColor ))
338
+ }
339
+ }
340
+ res += libraries .Render () + "\n "
341
+
342
+ platforms := table .New ()
343
+ platforms .SetHeader (
344
+ table .NewCell (tr ("Used platform" ), titleColor ),
345
+ table .NewCell (tr ("Version" ), titleColor ),
346
+ table .NewCell (tr ("Path" ), pathColor ))
347
+ boardPlatform := build .GetBoardPlatform ()
348
+ platforms .AddRow (
349
+ table .NewCell (boardPlatform .GetId (), nameColor ),
350
+ boardPlatform .GetVersion (),
351
+ table .NewCell (boardPlatform .GetInstallDir (), pathColor ))
352
+ if buildPlatform := build .GetBuildPlatform (); buildPlatform != nil &&
353
+ buildPlatform .Id != boardPlatform .Id &&
354
+ buildPlatform .Version != boardPlatform .Version {
355
+ platforms .AddRow (
356
+ table .NewCell (buildPlatform .GetId (), nameColor ),
357
+ buildPlatform .GetVersion (),
358
+ table .NewCell (buildPlatform .GetInstallDir (), pathColor ))
359
+ }
360
+ res += platforms .Render ()
361
+ return res
321
362
}
0 commit comments