@@ -515,6 +515,10 @@ export class ArduinoApp {
515
515
}
516
516
const boardDescriptor = this . boardManager . currentBoard . getBuildConfig ( ) ;
517
517
518
+ if ( buildMode === BuildMode . Analyze ) {
519
+ args . push ( "compile" ) ;
520
+ }
521
+
518
522
if ( this . useArduinoCli ( ) ) {
519
523
args . push ( "-b" , boardDescriptor ) ;
520
524
} else {
@@ -636,7 +640,9 @@ export class ArduinoApp {
636
640
}
637
641
638
642
// We always build verbosely but filter the output based on the settings
639
- args . push ( "--verbose-build" ) ;
643
+
644
+ this . _settings . useArduinoCli ? args . push ( "--verbose" ) : args . push ( "--verbose-build" ) ;
645
+
640
646
if ( verbose ) {
641
647
args . push ( "--verbose-upload" ) ;
642
648
}
@@ -689,13 +695,16 @@ export class ArduinoApp {
689
695
// TODO EW: What should we do with pre-/post build commands when running
690
696
// analysis? Some could use it to generate/manipulate code which could
691
697
// be a prerequisite for a successful build
692
- if ( ! await this . runPrePostBuildCommand ( dc , env , "pre" ) ) {
698
+ if ( dc . prebuild && ! await this . runPrePostBuildCommand ( dc , env , "pre" ) ) {
693
699
return false ;
694
700
}
695
701
696
702
// stop serial monitor when everything is prepared and good
697
703
// what makes restoring of its previous state easier
698
- if ( buildMode === BuildMode . Upload || buildMode === BuildMode . UploadProgrammer ) {
704
+ if ( buildMode === BuildMode . Upload ||
705
+ buildMode === BuildMode . UploadProgrammer ||
706
+ buildMode === BuildMode . CliUpload ||
707
+ buildMode === BuildMode . CliUploadProgrammer ) {
699
708
restoreSerialMonitor = await SerialMonitor . getInstance ( ) . closeSerialMonitor ( dc . port ) ;
700
709
UsbDetector . getInstance ( ) . pauseListening ( ) ;
701
710
}
@@ -758,7 +767,7 @@ export class ArduinoApp {
758
767
this . _settings . commandPath ,
759
768
args ,
760
769
undefined ,
761
- { stdout : stdoutcb , stderr : stderrcb } ,
770
+ { channel : arduinoChannel . channel , stdout : stdoutcb , stderr : stderrcb } ,
762
771
) . then ( async ( ) => {
763
772
const ret = await cleanup ( "ok" ) ;
764
773
if ( ret ) {
0 commit comments