Visual Micro Arduino Command Line Interface

November 2019

A free CLI tool is available: Download VMBuilder.zip 

The tool can compile standard arduino projects or visual studio projects.

  • minimal syntax example:- "[some_path]\vmbuilder.exe" -builder.project_path="D:\MySystem\Documents\Arduino\Test\Test.vcxproj"  -builder.build=true

When compilng a folder or .ino name, only the standard arduino project folder and project\src... folder structure is compiled.

When comping a visual studio project the project governs the files to be compiled (as expected for visual micro). Shared linked external source code, shared code projects and shared library projects are all supported (as normal).

All paramaters can optionally be enclosed with double quotes (speech marks). Paths that contain spaces and other special characters must be enclosed with double quotes!

Examples:

1. Build and upload a visual studio (visual micro) project.  Uses the first board that has a name or id containing the text "2560". Upload using serial port COM3 (verbose enabled)

VMBuild.exe -builder.verbose=true -builder.build=true -builder.upload=true -builder.board_id=2560 -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject\ArduinoProject.vcxproj" -builder.serial_port=COM3

2. Build and upload a simple arduino project via the master .ino name.  Uses the first board that has a name or id containing the text "Uno". Upload using serial port COM3

VMBuild.exe -builder.build=true -builder.upload=true -builder.board_id=Uno -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject1\ArduinoProject1.ino" -builder.serial_port=COM3

3. Build and upload a simple arduino project via the folder name.  Uses the first board that has a name or id containing the text "Uno". Upload using serial port COM3

VMBuild.exe -builder.build=true -builder.upload=true -builder.board_id=Uno -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject\ArduinoProject.vcxproj" -builder.serial_port=COM3

4. Clean the temp build cache for the given project and the Uno board 

VMBuild.exe -builder.clean=true -builder.board_id=Uno -builder.project_path="C:\Users\Test\Documents\ArduinoProject\ArduinoProject.vcxproj" -builder.serial_port=COM3

5. Burn a bootloader using the specified programmer

VMBuild.exe  -builder.board_id=Uno -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject" -builder.burn_bootloaderx=true -builder.programmer=avrispmkii

6. Copy final output files to specified directory.

VMBuild.exe -builder.output_directory="c:\test\output\sketch"  -builder.clean=true -builder.board_id=Uno -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject\ArduinoProject.ino" -builder.serial_port=COM3

7. Print a list of boards for the currently selected ide/configuration

VMBuilder.exe -builder.dump_boards=false

8. Build and upload a visual studio (visual micro) project.  Uses the first board that has a name or id containing the test "2560". Upload using programmer

VMBuild.exe -builder.build=true -builder.upload=true -builder.board_id=2560 -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject\ArduinoProject.vcxprojj" -builder.programmer=avrispmkii

9. Override the Arduino IDE location on-the-fly

VMBuild.exe -builder.ide_path="D:\Arduino\arduino-1.8.1" -builder.build=true -builder.upload=true -builder.board_id=2560 -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject\ArduinoProject.vcxproj" -builder.programmer=avrispmkii

10. Export and combine all code into a sketch zip

VMBuild.exe -builder.project_path="D:\MySystem\Documents\Arduino\Test\Test.vcxproj"  -builder.export_sketch=true -builder.export_delete_if_exists=true -builder.export_dest_file="D:\MySystem\Documents\Arduino\Test\Test.zip"

nb: if builder.export_dest_file is not provided export will be to a unique file name in folder "project\__vm\export"
                    

.........

This initial version supports the following switches along with the ability to override any of the standard build settings:-

All settings are optional apart from board_id and project_path

  • -builder.project_path="C:\Users\Test\Documents\Arduino\ArduinoProject\ArduinoProject.vcxproj" 
  • -builder.board_id=2560 
  • -builder.build=true
  • -builder.upload=true
  • -builder.clean=false 
  • -builder.application_id=arduino16x 
  • -builder.ide_path="D:\Arduino\arduino-1.8.1" 
  • -builder.verbose=true 
  • -builder.verbose_warnings=true 
  • -builder.serial_port=COM3 
  • -builder.dump_props=false 
  • -builder.rebuild=false 
  • -builder.parallel_build=false 
  • -builder.dump_boards=false 
  • -builder.output_directory="c:\test\output\sketch" 
  • -builder.dump_source_list=true 
  • -builder.burn_bootloaderx=true 
  • -builder.programmerx=avrispmkii
  • -builder-close=true (default is false)
  • -builder-closeonerror=true (default is false)
  • -builder.configuration=Release (relevent only if board and port are saved per project configuration)
  • -builder.export_sketch=true
  • -builder.export_delete_if_exists=true (optional)
  • -builder.export_dest_file=file name and path (optional)