@@ -516,6 +516,9 @@ export class ArduinoApp {
516
516
}
517
517
const boardDescriptor = this . boardManager . currentBoard . getBuildConfig ( ) ;
518
518
519
+ if ( mode === BuildMode . Analyze ) {
520
+ args . push ( "compile" ) ;
521
+ }
519
522
this . _settings . useArduinoCli ? args . push ( "-b" , boardDescriptor ) : args . push ( "--board" , boardDescriptor ) ;
520
523
521
524
if ( ! ArduinoWorkspace . rootPath ) {
@@ -626,9 +629,8 @@ export class ArduinoApp {
626
629
}
627
630
628
631
// We always build verbosely but filter the output based on the settings
629
- if ( ! this . _settings . useArduinoCli ) {
630
- args . push ( "--verbose-build" ) ;
631
- }
632
+
633
+ this . _settings . useArduinoCli ? args . push ( "--verbose" ) : args . push ( "--verbose-build" ) ;
632
634
633
635
if ( verbose ) {
634
636
this . _settings . useArduinoCli ? args . push ( "--verbose" ) : args . push ( "--verbose-upload" ) ;
@@ -675,13 +677,16 @@ export class ArduinoApp {
675
677
// TODO EW: What should we do with pre-/post build commands when running
676
678
// analysis? Some could use it to generate/manipulate code which could
677
679
// be a prerequisite for a successful build
678
- if ( ! await this . runPrePostBuildCommand ( dc , env , "pre" ) ) {
680
+ if ( dc . prebuild && ! await this . runPrePostBuildCommand ( dc , env , "pre" ) ) {
679
681
return false ;
680
682
}
681
683
682
684
// stop serial monitor when everything is prepared and good
683
685
// what makes restoring of its previous state easier
684
- if ( mode === BuildMode . Upload || mode === BuildMode . UploadProgrammer ) {
686
+ if ( mode === BuildMode . Upload ||
687
+ mode === BuildMode . UploadProgrammer ||
688
+ mode === BuildMode . CliUpload ||
689
+ mode === BuildMode . CliUploadProgrammer ) {
685
690
restoreSerialMonitor = await SerialMonitor . getInstance ( ) . closeSerialMonitor ( dc . port ) ;
686
691
UsbDetector . getInstance ( ) . pauseListening ( ) ;
687
692
}
@@ -744,7 +749,7 @@ export class ArduinoApp {
744
749
this . _settings . commandPath ,
745
750
args ,
746
751
undefined ,
747
- { stdout : stdoutcb , stderr : stderrcb } ,
752
+ { channel : arduinoChannel . channel , stdout : stdoutcb , stderr : stderrcb } ,
748
753
) . then ( async ( ) => {
749
754
const ret = await cleanup ( "ok" ) ;
750
755
if ( ret ) {
0 commit comments