From c4d7afcdb7c9c00051b005789807afde48e5bb56 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Mon, 7 Aug 2023 20:38:44 +0200 Subject: [PATCH] added auto version increment --- .gitmodules | 3 +++ .version_no_increment | 0 doc/TODO allgemein.txt | 1 + include/Version.h | 9 +++++++++ platformio.ini | 3 +++ platformio_version_increment | 1 + src/main.cpp | 4 ++++ version | 1 + 8 files changed, 22 insertions(+) create mode 100644 .gitmodules create mode 100644 .version_no_increment create mode 100644 include/Version.h create mode 160000 platformio_version_increment create mode 100644 version diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..60410d0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "platformio_version_increment"] + path = platformio_version_increment + url = https://github.com/sblantipodi/platformio_version_increment.git diff --git a/.version_no_increment b/.version_no_increment new file mode 100644 index 0000000..e69de29 diff --git a/doc/TODO allgemein.txt b/doc/TODO allgemein.txt index 4f6e1bb..c33ae7c 100644 --- a/doc/TODO allgemein.txt +++ b/doc/TODO allgemein.txt @@ -7,4 +7,5 @@ Für irgendwann: Besser zügig: Speedometer buffer ergibt kaum Sinn Abweichung max 25 cm bevor zu ungenau damit nie mehr als 50 cm gesamt. + Doxygen Kommentare aktualisieren diff --git a/include/Version.h b/include/Version.h new file mode 100644 index 0000000..a96e295 --- /dev/null +++ b/include/Version.h @@ -0,0 +1,9 @@ + + // AUTO GENERATED FILE, DO NOT EDIT + #ifndef VERSION + #define VERSION "0.1.3" + #endif + #ifndef BUILD_TIMESTAMP + #define BUILD_TIMESTAMP "2023-08-07 20:34:58.828579" + #endif + \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 7266acd..06a990a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -26,6 +26,9 @@ lib_deps = https://git.kleiax.de/PlatformIO-Libs/Menu.git nrf24/RF24@^1.4.5 upload_port = COM3 +extra_scripts = + pre:platformio_version_increment/version_increment_pre.py + post:platformio_version_increment/version_increment_post.py [env:release] build_type = release diff --git a/platformio_version_increment b/platformio_version_increment new file mode 160000 index 0000000..fd51b62 --- /dev/null +++ b/platformio_version_increment @@ -0,0 +1 @@ +Subproject commit fd51b62f000d23d5649da611c2560af8e2327415 diff --git a/src/main.cpp b/src/main.cpp index 163feed..77a5668 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,8 @@ #include #include +#include "Version.h" + #include "driveModi/driveManager.h" #include "OutputBuf/outputBuf.h" #include "LcdWrapper.h" @@ -109,6 +111,8 @@ void setup() { Network::connectEspNow(receiveCallback, sendCallback); std::cout << "Welcome to Kleiax-Rover" << std::endl; + std::cout << "Project verion: " << VERSION << std::endl; + std::cout << "Build timestamp: " << BUILD_TIMESTAMP << std::endl; std::cout << "All actions from the main program run on Core -> " << xPortGetCoreID() << std::endl; driveManager = new DriveManager(&moveController, spiPort, controlPad->getControlPadDataPtr(), wifiIsActive); diff --git a/version b/version new file mode 100644 index 0000000..7693c96 --- /dev/null +++ b/version @@ -0,0 +1 @@ +0.1.3 \ No newline at end of file