30
30
package builder
31
31
32
32
import (
33
+ bldr "github.com/arduino/arduino-cli/arduino/builder"
33
34
"github.com/arduino/arduino-cli/legacy/builder/builder_utils"
34
35
"github.com/arduino/arduino-cli/legacy/builder/i18n"
35
36
"github.com/arduino/arduino-cli/legacy/builder/types"
37
+ "github.com/arduino/go-paths-helper"
36
38
)
37
39
38
40
type ContainerSetupHardwareToolsLibsSketchAndProps struct {}
@@ -48,7 +50,34 @@ func (s *ContainerSetupHardwareToolsLibsSketchAndProps) Run(ctx *types.Context)
48
50
& ToolsLoader {},
49
51
& AddBuildBoardPropertyIfMissing {},
50
52
& LibrariesLoader {},
51
- & SketchLoader {},
53
+ }
54
+
55
+ ctx .Progress .Steps = ctx .Progress .Steps / float64 (len (commands ))
56
+
57
+ for _ , command := range commands {
58
+ builder_utils .PrintProgressIfProgressEnabledAndMachineLogger (ctx )
59
+ PrintRingNameIfDebug (ctx , command )
60
+ err := command .Run (ctx )
61
+ if err != nil {
62
+ return i18n .WrapError (err )
63
+ }
64
+ }
65
+
66
+ // get abs path to sketch
67
+ sketchLocation , err := ctx .SketchLocation .Abs ()
68
+ if err != nil {
69
+ return i18n .WrapError (err )
70
+ }
71
+
72
+ // load sketch
73
+ sketch , err := bldr .LoadSketch (sketchLocation .String (), ctx .BuildPath .String ())
74
+ if err != nil {
75
+ return i18n .WrapError (err )
76
+ }
77
+ ctx .SketchLocation = paths .New (sketch .MainFile .Path )
78
+ ctx .Sketch = types .SketchToLegacy (sketch )
79
+
80
+ commands = []types.Command {
52
81
& SetupBuildProperties {},
53
82
& LoadVIDPIDSpecificProperties {},
54
83
& SetCustomBuildProperties {},
0 commit comments