├── .editorconfig ├── .github └── FUNDING.yml ├── .gitignore ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── abm ├── abm.html ├── abm.js ├── css │ ├── abmview.css │ ├── editview.css │ ├── infoview.css │ ├── logo.png │ ├── marlin-b.svg │ ├── marlin-w.svg │ └── progress.gif ├── editor.html ├── editor.js ├── format.js ├── img │ ├── abm-tools-32.png │ ├── abm-tools-70.png │ ├── btn-build.svg │ ├── btn-clean.svg │ ├── btn-config.svg │ ├── btn-debug.svg │ ├── btn-monitor.svg │ ├── btn-refresh.svg │ ├── btn-upload.svg │ ├── favicon-dark.svg │ ├── favicon-light.svg │ ├── social-fb.svg │ ├── social-gh.svg │ ├── social-tw.svg │ ├── social-yt.svg │ ├── tool-build.svg │ └── tool-config.svg ├── info.html ├── info.js ├── js │ ├── abmview.js │ ├── editview.js │ ├── grid.js │ ├── infoview.js │ ├── jquery-3.6.0.min.js │ ├── jstepper.js │ ├── marlin.js │ ├── schema.js │ └── vsview.js ├── pane │ ├── geom.html │ ├── lcd.html │ └── sd.html └── prefs.js ├── extension.js ├── icon.png ├── img ├── AB_icon.png ├── AB_menu.png ├── Activity_bar.png ├── B_small.png ├── C_small.png ├── K_small.png ├── T_small.png ├── U_small.png ├── abm-envs.png └── config-editor.png ├── package.json ├── package.nls.json ├── proto.js └── resources ├── AB.svg ├── AB_dark.svg ├── B48x48_dark.svg ├── B48x48_light.svg ├── C48x48_dark.svg ├── C48x48_light.svg ├── K48x48_dark.svg ├── K48x48_light.svg ├── T48x48_dark.svg ├── T48x48_light.svg ├── U48x48_dark.svg └── U48x48_light.svg /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [{*.js,*.css,*.html}] 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | end_of_line = lf 9 | indent_style = space 10 | indent_size = 2 11 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [thinkyhead] 2 | patreon: thinkyhead 3 | custom: ["http://www.thinkyhead.com/donate-to-marlin"] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.vsix 3 | node_modules 4 | .vscode/ 5 | .aider* 6 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | The following enhancements and changes have been made to ***Auto Build Marlin***. 4 | 5 | ## 2.1.74 6 | - Config Editor: Fix int and float value sanitizing 7 | - ABM Panel: Fix parsing of arch list from `pins.h` 8 | 9 | ## 2.1.73 10 | - Config Editor: Fix missing En Driver Type options 11 | - Schema: Fix `HAS_DRIVER` arguments 12 | - Schema: Improve cleanup of expression parentheses 13 | - Ignore Aider files and folders 14 | 15 | ## 2.1.72 16 | - ABM Panel: List all pins files included for `MOTHERBOARD` 17 | - ABM Panel: Provide more space for main content 18 | - Config Editor: Put early items into 'User' group 19 | - Schema: Handle sensor type requirements 20 | - Schema: Define "exclusive" options groups as `ConfigSchema.exclusive[]` 21 | - Move Custom Editor and Info Panel HTML templates to files 22 | - Continuing code refactor for shared schema 23 | 24 | ## 2.1.71 25 | - Fix handling of multi-line value replacement 26 | 27 | ## 2.1.70 28 | - Improve Config Editor layout 29 | - Update Config Editors for external edits 30 | - Fix temp sensor dependent items, add more 31 | 32 | ## 2.1.69 33 | - Fix strict evaluation of empty array 34 | - Fix non-matching SIDs 35 | - Add navigation buttons to show the ABM panel 36 | - Additional code refactoring and cleanup 37 | - Shared schema for Config Editors and Info view 38 | - Preserve basic clone disabled items 39 | - Optimize change messages 40 | - Optimize refresh after edit 41 | 42 | ## 2.1.68 43 | - Fix strict evaluation of empty array 44 | 45 | ## 2.1.67 46 | - Optimize Schema conditionals evaluation 47 | - Use more robust parentheses cleanup method 48 | 49 | ## 2.1.66 50 | - Fix Config Editor changes propagation 51 | - Fix schema evaluation of `ENABLED`/`DISABLED` 52 | - Add schema simple evaluation of `REPEAT` macros 53 | - Add some useful schema iterator parameters 54 | 55 | ## 2.1.65 56 | - Use iterators to simplify config data traversal 57 | - Create serial id index on form creation 58 | 59 | ## 2.1.64 60 | - Fix and improve cleanup for JS evaluation of conditionals 61 | - Clarify that `ConfigSchema` data is grouped by section 62 | - Fix `ConfigSchema.getItems` returning 0 results 63 | - Fix evaluation of mixed-case options (e.g., `DEFAULT_Kp`) 64 | 65 | ## 2.1.63 66 | - Improve Config Editor section pre-ordering and icons 67 | - Better `ConfigSchema` consolidation of define `requires` conditions 68 | - Fix Config Editor handling of underscores in the Filter field 69 | - Show E Sensor IDs in the Auto Build Panel 70 | 71 | ## 2.1.62 72 | - Config Editor: 73 | - Table of Contents navigation 74 | - Iconify Show/Hide filter checkboxes 75 | - Fix save/recall of hidden sections 76 | 77 | ## 2.1.61 78 | - Add commands and buttons to open the Config Editor 79 | - Fix config editor saving 80 | - Update sponsorship URL 81 | 82 | ## 2.1.60 83 | - Config Editor: 84 | - Group sequential items with the same name 85 | - Provide standard options for 'state' and 'dir' types 86 | - More mutual-exclusive checkbox groups 87 | - Preserve collapsed sections on show/hide document 88 | - Clean up and document some code 89 | 90 | ## 2.1.59 91 | - Config Editor: 92 | - Fix handling of `#undef` 93 | - Identify macro defines 94 | - Use checkbox groups for optional distinct items 95 | - Add checkbox groups for like-named items 96 | 97 | ## 2.1.58 98 | - Config Editor: 99 | - Fix filtering options by axis 100 | - Implement radio grouping for LCD items 101 | 102 | ## 2.1.57 103 | - Config Editor: "Show Disabled" checkbox 104 | 105 | ## 2.1.56 106 | - Config Editor: Handle `MB(...)` in schema 107 | 108 | ## 2.1.55 109 | - Update for new `Conditionals-#-abc.h` files 110 | 111 | ## 2.1.54 112 | - Config Editor: Fix parsing of `defined()` in `schema.js` 113 | - Alt/Option changes "Clean" to "Purge" to delete build and libdeps 114 | - Config Editor: Add on-the-fly `log_()` function to `editview.js` 115 | 116 | ## 2.1.53 117 | - Prevent `platformio.ini` from opening by overriding a PlatformIO IDE setting. 118 | Enable "Preserve PIO" in settings to leave PlatformIO IDE settings unchanged. 119 | - Display the version number in the ABM Panel. 120 | - Improve high contrast color schemes. 121 | 122 | ## 2.1.52 123 | - Fix `getItems` handling of `limit` across multiple sections 124 | - Fix the regex that gets the `archs` list from `pins.h` 125 | 126 | ## 2.1.51 127 | - Adjust build command line for different shells (#46) 128 | - Fix init of HIGH / LOW slider custom controls (#68) 129 | - Fix an issue with `//` comments before the first `#define` (#77) 130 | 131 | ## 2.1.50 132 | - Recognize more config sections 133 | - Fix build action button envs 134 | 135 | ## 2.1.49 136 | 137 | - Recognize Chitu firmware with .cbd extension 138 | - Fix schema options set on following settings 139 | - Standardize JSON options cleanup method 140 | - Remove old config parsing borrowed from Configurator 1.0 141 | - Add Formatters information to the README 142 | - Fix formatter debug logging 143 | - Display author and version for a bad config 144 | 145 | ## 2.1.48 146 | 147 | - Fix and extend configuration file parsing 148 | 149 | ## 2.1.47 150 | 151 | - Make the Custom Editor (alpha) hidden by default 152 | - Improve config error handling in Panel View 153 | 154 | ## 2.1.46 155 | 156 | - Custom editor for configuration files (Alpha Preview) 157 | 158 | ## 2.1.45 159 | 160 | - Command to Apply `config.ini` to configurations. 161 | - Command to Export `config.ini`, `schema.json`, `schema.yml` 162 | - Info Panel added (for future use) 163 | 164 | ## 2.1.44 165 | 166 | - Code formatter for pins and general code 167 | - Add categories to settings keys 168 | 169 | ## 2.1.43 170 | 171 | - Show Panel on Startup by default 172 | - Click the Pins file path to open the file 173 | - Auto Reveal Build checkbox, setting 174 | - Light and Dark Marlin SVG for dark/light theme 175 | - Update Sponsor link 176 | - Update jQuery to version 3.6.0 177 | 178 | ## 2.1.42 179 | 180 | - Only init extension for a Marlin folder 181 | - Fix schema @section detection 182 | - Fix build view error 183 | - Run sim/native in fg 184 | 185 | ## 2.1.41 186 | 187 | - Hide 'Run' for incomplete build 188 | 189 | ## 2.1.40 190 | 191 | - Add 'sponsor' field. 192 | 193 | ## 2.1.39 194 | 195 | - Minor code reorganization. 196 | - Fix path escaping for reveal build. 197 | 198 | ## 2.1.38 199 | 200 | - Silent Build setting, with checkbox. 201 | 202 | ## 2.1.37 203 | 204 | - Debuggable postMessage. 205 | - Show STM32F1 chip flash size. 206 | 207 | ## 2.1.36 208 | 209 | - Recognize `.srec` as a complete build. 210 | - Remove `enableProposedApi` from `package.json`. 211 | - Fix debug env detection. 212 | - Add `CHANGELOG.md`. 213 | - Update copyright date. 214 | 215 | ## 2.1.35 216 | 217 | - Fix display of a failed build without a firmware file. 218 | - Enquote the IPC file path, for paths with spaces. 219 | 220 | ## 2.1.34 221 | 222 | - Larger built firmware link with firmware filename. 223 | 224 | ## 2.1.33 225 | 226 | - Fix "Reveal Build" when there are spaces in the path. 227 | - Fix PlatformIO opening `platformio.ini` when "Show on Startup" is enabled. 228 | 229 | ## 2.1.32 230 | 231 | - Display buttons instead of simple links in the sidebar view. 232 | - Fix display of native and simulator build targets. 233 | 234 | ## 2.1.31 235 | 236 | - Keep "Show on Startup" in sync with settings. 237 | 238 | ## 2.1.30 239 | 240 | - Fix the 'Show on Startup' checkbox. 241 | 242 | ## 2.1.29 243 | 244 | - Clarify in error messages that Marlin 2.x is required. 245 | 246 | ## 2.1.28 247 | 248 | - Add a "Show on Startup" option for the impatient. 249 | - Include ***Auto Build Marlin*** commands in the Command Palette. 250 | - Update [YouTube channel URL](https://www.youtube.com/c/MarlinFirmware). 251 | 252 | ## 2.1.27 253 | 254 | - Recognize an `.srec` file as a firmware binary. 255 | 256 | ## 2.1.26 257 | 258 | - Add a 'Monitor' button for quick access to PlatformIO serial monitor. 259 | - Fixed visibility of 'Debug' button during native / simulator build. 260 | - Add helpful parentheses to env type comparisons. 261 | 262 | ## 2.1.25 263 | 264 | - Fix handling of multiple boards in a single `MB(...)` when parsing `pins.h`. 265 | 266 | ## 2.1.24 267 | 268 | - Suppress a warning when the IPC file already exists. 269 | 270 | ## 2.1.23 271 | 272 | - Add the ability to locate the binary in the `.pio/build/{env}/debug` folder 273 | - Add security policy elements to the webView. 274 | 275 | ## 2.1.22 276 | 277 | - Pass `PLATFORMIO_PATH` to the terminal as `PATH` / `Path` so the `platformio` exe is found. 278 | 279 | ## 2.1.21 280 | 281 | - Reveal the latest build if there's more than one. 282 | 283 | ## 2.1.20 284 | 285 | - Find the simulator binary when it's named "`MarlinSimulator`". 286 | 287 | ## 2.1.19 288 | 289 | - Hide the "Run" button during the build. 290 | 291 | ## 2.1.18 292 | 293 | - Remove obsolete command activation events. 294 | - Add "Run" button to start a native target or simulation. 295 | 296 | ## 2.1.17 297 | 298 | - More strict build exists test. 299 | - Support platform-specific native targets. 300 | 301 | ## 2.1.16 302 | 303 | - Improved startup when workspace is not Marlin. 304 | - Minimize SVGs. 305 | - Use gray in SVGs plus CSS blend modes for tool buttons contrast. 306 | 307 | ## 2.1.15 308 | 309 | - Improve reliability of reveal. 310 | 311 | ## 2.1.14 312 | 313 | - Fix startup failsafe. 314 | 315 | ## 2.1.13 316 | 317 | - Hide 'debug' when busy. 318 | 319 | ## 2.1.12 320 | 321 | - Move the model to its own module. 322 | - Add light theme support. 323 | 324 | ## 2.1.11 325 | 326 | - Fix reveal in Windows. 327 | 328 | ## 2.1.10 329 | 330 | - Add `FUNDING.yml`. 331 | - Add link to reveal the build in Explorer / Finder. 332 | - Templated interface. 333 | 334 | ## 2.1.9 335 | 336 | - More robust sensor regex. 337 | 338 | ## 2.1.8 339 | 340 | - Fix reference to missing js. 341 | 342 | ## 2.1.7 343 | 344 | - Look for more `.bin` names. 345 | 346 | ## 2.1.6 347 | 348 | - Basic cleanup, text updates. 349 | 350 | ## 2.1.5 351 | 352 | - Add a Welcome View with messages for different contexts. 353 | - Activate the extension early to keep contexts up to date. 354 | - Only display buttons relevant to environments / build states. 355 | - Load the new pins file when `MOTHERBOARD` changes. 356 | 357 | ## 2.1.4 358 | 359 | - Cleaned up code. 360 | - Updated `README.md`. 361 | 362 | ## 2.1.3 363 | 364 | - Only show Traceback option for "debug" environments. 365 | - Drop `package-lock.json` from the project. 366 | - Show an indeterminate progress bar during the build. 367 | 368 | ## 2.1.2 369 | 370 | - Fix quoted value handling. 371 | 372 | ## 2.1.1 373 | 374 | - Captions with extended descriptions in Build panel. 375 | - Show an error when a build is already underway. 376 | - Add a settings option to re-use the Terminal. 377 | - Fix last build time display. 378 | 379 | ## 2.1.0 380 | 381 | Major upgrade with a new native interface so you see what you need to know before you do your build. The new foundations started in this version will allow us to build a full configuration interface as time goes on and eliminate the need to scan through long text files. 382 | 383 | - Clean up verbose SVG files. 384 | - Drop dependency on `auto_build.py` script and Tkinter. 385 | - Provide an informative WebView display and build interface. 386 | - Only show relevant environments and build options. 387 | 388 | ## 2.0.3 389 | 390 | - Pass process.env to the terminal. 391 | - Apply titlecase to build type titles. 392 | 393 | ## 2.0.2 394 | 395 | - Fix command line for Windows. 396 | - Use node fs to check the script path. 397 | - Use a common function for registered commands. 398 | 399 | ## 2.0.1 400 | 401 | - Handle `auto_build.py` in different locations. 402 | 403 | ## 2.0.0 404 | 405 | Initial release of ***Auto Build Marlin*** to the Marketplace with a version to match the current Marlin release. 406 | 407 | - Add a button to the Activity Bar. 408 | - Add panels with Build, Upload, Debug, and Clean buttons. 409 | - Start to Build, Upload, Debug, or Clean when a button is pressed. 410 | - Provide a helpful README page. 411 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto Build Marlin 2 | 3 | "Auto Build Marlin" provides a simplified interface to configure, build, and upload Marlin Firmware. 4 | 5 | The **Auto Build** tool automatically detects the correct environments for your `MOTHERBOARD` and provides an interface to build them. No more editing `platformio.ini` or scanning a long list of environments in the PlatformIO IDE. Just press the **Build** button and go! 6 | 7 | The **Configuration Editor** provides an enhanced interface for editing configurations. This includes a search filter to find the options you need and to discover new and useful features. To use, right-click a file in the VSCode file explorer and select **Open With… > Config Editor**. ***This is an alpha preview and will probably have some issues.*** 8 | 9 | **Custom Commands** for formatting, building, and more. 10 | 11 | ## PlatformIO Required 12 | 13 | When installing "Auto Build Marlin" you'll also be prompted to install the [PlatformIO extension](http://marlinfw.org/docs/basics/install_platformio_vscode.html). PlatformIO handles all the details of the build and is required for "Auto Build Marlin" to function. 14 | 15 | ## Usage 16 | 17 | - Start *Visual Studio Code* and open a project folder with *Marlin Firmware* version 2.0 or later. Be careful to open the folder containing `platformio.ini` and not the "`Marlin`" folder within it. (You may also use the **Import Project…** option from the "PlaformIO Home" page.) 18 | 19 | - The "File Explorer" should point to your Marlin Firmware folder like so: 20 | 21 |  22 | 23 | ### Auto Build 24 | 25 | - Click the **Auto Build Marlin** icon  in the Activity Bar (on the far side of the *Visual Studio Code* window) to open the **Auto Build Marlin** sidebar. 26 | 27 |  28 | 29 | - Use the **Show ABM Panel** button (or click on any of the buttons in the toolbar) to open the Auto Build Marlin panel. If more than one target environment exists for your board you'll have to choose the specific environment to use before the build. 30 | 31 | Icon|Action 32 | ----|------ 33 | |Start **Marlin Build** to test your Marlin build 34 | |Start **Marlin Upload** to install Marlin on your board 35 | |Start **Marlin Upload (traceback)** to install Marlin with debugging 36 | |Start **Marlin Clean** to delete old build files 37 | |Open the **Configuration Tool** 38 | 39 | - The **Auto Build Marlin** panel displays information about your selected motherboard and basic machine parameters. Each board comes with one or more build environments that are used to generate the final Marlin binary. Choose the environment that best matches your MCU, bootloader, etc. 40 | 41 |  42 | 43 | ### Configuration Editor 44 | 45 |  46 | 47 | The Config Editor provides a form divided up into sections with search filtering. In the future we may make the Config Editor the default, but in the meantime there are a few ways to open the Editor. 48 | 49 | - Open Auto Build Marlin and reveal the Welcome Panel. Click on the **Edit Configuration.h** or **Edit Configuration_adv.h** button. 50 | - If `Configuration.h` or `Configuration_adv.h` is open as text, right-click on its tab title and choose "Reopen Editor with…" > Config Editor to switch. 51 | - In the VSCode File Explorer right click on `Configuration.h` or `Configuration_adv.h` and choose "Open with…" to select the **Config Editor**. 52 | 53 | #### Editor Usage 54 | 55 | - Use the navigation sidebar to view a single isolated section, or all. 56 | - Use the "Filter" field to locate options by name. 57 | - Click the "Show/Hide Disabled" button to show or hide disabled options. 58 | - Click the "Show/Hide Comments" button to show or hide comments. 59 | - Click the title of a section to hide/show that section. 60 | - Hold down `alt`/`option` and click on any title to hide/show all sections. 61 | 62 | #### Config Annotations 63 | 64 | - Marlin's standard configuration files are annotated to provide hints to configuration tools. Edit the configuration file text to add your own `@section` markers, provide allowed values for options, or improve documentation. Please submit your [improvements](//github.com/MarlinFirmware/AutoBuildMarlin/pulls) and [suggestions](//github.com/MarlinFirmware/AutoBuildMarlin/issues) to enhance the configuration experience for users worldwide! 65 | 66 | ### Formatters 67 | 68 | - Open the Command Palette and choose "Format Marlin Code." The file will be formatted according to Marlin standards. 69 | - NOTE: The context menu item "Format Document With…" -> "Auto Build Marlin" doesn't work so ignore that menu command for now. 70 | 71 | ## Internals 72 | 73 | The Auto Build Marlin extension for VSCode contributes sidebar panels, a web view, a custom editor, custom formatters, and other commands. This extension is written entirely in Javascript (so we don't have to learn TypeScript). 74 | 75 | ### Bootstrapping 76 | 77 | When VSCode starts the extension it just loads `extension.js`. This file imports `abm.js` and `prefs.js` for utility functions, and `format.js`, `info.js`, and `editor.js` for our feature providers. These files import `js/marlin.js` and `js/schema.js` to process Marlin files, and node `fs` for file functions. Any top level code in these files runs as soon as `extension.js` does. This is when modules init their classes and export their symbols. 78 | 79 | With all that done, `extension.js` defines the code that will register ABM's commands and feature providers with VSCode upon activation. 80 | 81 | ### ConfigSchema 82 | 83 | `ConfigSchema` is the most important class, providing a configuration parser and utility methods for use throughout the extension. Since views scripts also need access this class, `js/schema.js` is made to be loaded either as a module with `requires()` or as a typical HEAD script. 84 | 85 | The first time the extension needs to show a view that uses the schema it reads the configurations. 86 | 87 | ### File Changes 88 | 89 | View providers and views don't share common memory, so data has to be sent between them with serialized messaging. Providers handle messages from the UI in `handleMessageFromUI` and their views receive messages in `handleMessageToUI`. 90 | 91 | Any external file changes cause the whole schema to be refreshed. Changes made in the Custom Editor (i.e., `editview.js`) are applied to a local copy of the schema before being sent in a message to the provider. The provider uses the message to update the shared schema and alert other views to update. 92 | -------------------------------------------------------------------------------- /abm/abm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 10 |Firmware: | Marlin |
---|---|
Config By: | |
Machine Name: | |
Extruders: | |
Board: | |
Pins File: | |
Architectures: | |
Environments: |
88 | | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | | 97 |