@@ -477,7 +477,7 @@ static public void init(String[] args) {
477477
478478 if (parser .getFilenames ().size () != 1 )
479479 {
480- showError (_ ("Multiple files not supported" ), _ ("Only one file at time suported with --upload option " ), null );
480+ showError (_ ("Multiple files not supported" ), _ ("The --upload option supports only one file at a time " ), null );
481481 }
482482
483483 List <String > warningsAccumulator = new LinkedList <String >();
@@ -498,14 +498,16 @@ static public void init(String[] args) {
498498 // - chiama Sketch.build(verbose=false) che chiama Sketch.ensureExistence(), imposta il progressListener e chiama Compiler.build()
499499 // - chiama Sketch.upload() (cfr. dopo...)
500500 if (!data .getFolder ().exists ()) showError (_ ("No sketch" ), _ ("Can't find the sketch in the specified path" ), null );
501- String suggestedClassName = Compiler .build (data , tempBuildFolder .getAbsolutePath (), tempBuildFolder , null , false );
501+ String suggestedClassName = Compiler .build (data , tempBuildFolder .getAbsolutePath (), tempBuildFolder , null , parser . isDoVerboseBuild () );
502502 if (suggestedClassName == null ) showError (_ ("Error while verifying" ), _ ("An error occurred while verifying the sketch" ), null );
503-
503+ showMessage (_ ("Done compiling" ), _ ("Done compiling" ));
504+
504505 // - chiama Sketch.upload() ... to be continued ...
505- Uploader uploader = Compiler .getUploaderByPreferences ();
506+ Uploader uploader = Compiler .getUploaderByPreferences (parser . isNoUploadPort () );
506507 if (uploader .requiresAuthorization () && !PreferencesData .has (uploader .getAuthorizationKey ())) showError (_ ("..." ), _ ("..." ), null );
507508 try {
508- success = Compiler .upload (data , uploader , tempBuildFolder .getAbsolutePath (), suggestedClassName , false , warningsAccumulator );
509+ success = Compiler .upload (data , uploader , tempBuildFolder .getAbsolutePath (), suggestedClassName , parser .isDoUseProgrammer (), parser .isNoUploadPort (), warningsAccumulator );
510+ showMessage (_ ("Done uploading" ), _ ("Done uploading" ));
509511 } finally {
510512 if (uploader .requiresAuthorization () && !success ) {
511513 PreferencesData .remove (uploader .getAuthorizationKey ());
@@ -543,6 +545,7 @@ static public void init(String[] args) {
543545 if (!data .getFolder ().exists ()) showError (_ ("No sketch" ), _ ("Can't find the sketch in the specified path" ), null );
544546 String suggestedClassName = Compiler .build (data , tempBuildFolder .getAbsolutePath (), tempBuildFolder , null , parser .isDoVerboseBuild ());
545547 if (suggestedClassName == null ) showError (_ ("Error while verifying" ), _ ("An error occurred while verifying the sketch" ), null );
548+ showMessage (_ ("Done compiling" ), _ ("Done compiling" ));
546549 } catch (Exception e ) {
547550 showError (_ ("Error while verifying" ), _ ("An error occurred while verifying the sketch" ), e );
548551 }
@@ -667,6 +670,9 @@ static public String loadFile(File file) throws IOException {
667670 }
668671
669672 static public void main (String args []) throws Exception {
673+ if (args .length == 0 )
674+ showError (_ ("No parameters" ), _ ("No command line parameters found" ), null );
675+
670676 initPlatform ();
671677
672678 initPortableFolder ();
@@ -934,6 +940,10 @@ public static void selectSerialPort(String port) {
934940 PreferencesData .set ("serial.port.file" , port );
935941 }
936942
943+ public static void setBuildFolder (File newBuildFolder ) {
944+ buildFolder = newBuildFolder ;
945+ }
946+
937947 static public void showError (String title , String message , int exit_code ) {
938948 showError (title , message , null , exit_code );
939949 }
0 commit comments