mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-16 19:44:07 +02:00
Suggestions from bdring, added build-all scripts
This commit is contained in:
34
build-all.ps1
Normal file
34
build-all.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
# This Windows PowerShell script uses PlatformIO to compile Grbl_ESP32
|
||||
# for every machine configuration in the Machines/ directory.
|
||||
# It is useful for automated testing.
|
||||
|
||||
# Setting PYTHONIOENCODING avoids an obscure crash related to code page mismatch
|
||||
$env:PYTHONIOENCODING="utf-8"
|
||||
$envsave = $env:PLATFORMIO_BUILD_FLAGS
|
||||
|
||||
Function BuildMachine($names) {
|
||||
$basename = $names[0]
|
||||
$addname = $names[1]
|
||||
$env:PLATFORMIO_BUILD_FLAGS = "-DMACHINE_FILENAME=$basename"
|
||||
$displayname = $basename
|
||||
if ($addname -ne "") {
|
||||
$env:PLATFORMIO_BUILD_FLAGS += " -DMACHINE_FILENAME2=$addname"
|
||||
$displayname += " + $addname"
|
||||
}
|
||||
Write-Output "Building machine $displayname"
|
||||
platformio run 2>&1 | Select-String error,Took
|
||||
Write-Output " "
|
||||
}
|
||||
|
||||
# First build all the base configurations with names that do not start with add_
|
||||
foreach ($filepath in Get-ChildItem -file .\Grbl_Esp32\Machines\* -Exclude add_*) {
|
||||
BuildMachine($filepath.name, "")
|
||||
}
|
||||
|
||||
# Then build all of the add-ons on top of a single base
|
||||
$base="3axis_v4.h"
|
||||
foreach ($filepath in Get-ChildItem -file .\Grbl_Esp32\Machines\add_*) {
|
||||
BuildMachine($base, $filepath.name)
|
||||
}
|
||||
|
||||
$env:PLATFORMIO_BUILD_FLAGS=$envsave
|
Reference in New Issue
Block a user