@@ -18,6 +18,7 @@ package builder
18
18
import (
19
19
"errors"
20
20
"fmt"
21
+ "io"
21
22
22
23
"github.com/arduino/arduino-cli/arduino/builder/internal/compilation"
23
24
"github.com/arduino/arduino-cli/arduino/builder/internal/detector"
@@ -27,6 +28,7 @@ import (
27
28
"github.com/arduino/arduino-cli/arduino/libraries"
28
29
"github.com/arduino/arduino-cli/arduino/libraries/librariesmanager"
29
30
"github.com/arduino/arduino-cli/arduino/sketch"
31
+ rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
30
32
"github.com/arduino/go-paths-helper"
31
33
"github.com/arduino/go-properties-orderedmap"
32
34
)
@@ -117,8 +119,8 @@ func NewBuilder(
117
119
useCachedLibrariesResolution bool ,
118
120
librariesManager * librariesmanager.LibrariesManager ,
119
121
libraryDirs paths.PathList ,
120
- logger * logger. BuilderLogger ,
121
- progressStats * progress. Struct ,
122
+ stdout , stderr io. Writer , verbose bool , warningsLevel string ,
123
+ progresCB rpc. TaskProgressCB ,
122
124
) (* Builder , error ) {
123
125
buildProperties := properties .NewMap ()
124
126
if boardBuildProperties != nil {
@@ -167,10 +169,7 @@ func NewBuilder(
167
169
return nil , ErrSketchCannotBeLocatedInBuildPath
168
170
}
169
171
170
- if progressStats == nil {
171
- progressStats = progress .New (nil )
172
- }
173
-
172
+ logger := logger .New (stdout , stderr , verbose , warningsLevel )
174
173
libsManager , libsResolver , verboseOut , err := detector .LibrariesLoader (
175
174
useCachedLibrariesResolution , librariesManager ,
176
175
builtInLibrariesDirs , libraryDirs , otherLibrariesDirs ,
@@ -198,7 +197,7 @@ func NewBuilder(
198
197
sourceOverrides : sourceOverrides ,
199
198
onlyUpdateCompilationDatabase : onlyUpdateCompilationDatabase ,
200
199
compilationDatabase : compilation .NewDatabase (buildPath .Join ("compile_commands.json" )),
201
- Progress : progressStats ,
200
+ Progress : progress . New ( progresCB ) ,
202
201
executableSectionsSize : []ExecutableSectionSize {},
203
202
buildArtifacts : & buildArtifacts {},
204
203
targetPlatform : targetPlatform ,
0 commit comments