diff --git a/EU07.cpp b/EU07.cpp index 1e147913..146c430d 100644 --- a/EU07.cpp +++ b/EU07.cpp @@ -259,8 +259,6 @@ int main(int argc, char *argv[]) } #endif - Global.asVersion = "M7 16.03.2018 (based on tmj c100fcb7)"; - for (int i = 1; i < argc; ++i) { std::string token(argv[i]); diff --git a/Globals.h b/Globals.h index ad6471a6..75301e2d 100644 --- a/Globals.h +++ b/Globals.h @@ -16,6 +16,7 @@ http://mozilla.org/MPL/2.0/. #include "uart.h" #include "utilities.h" #include "motiontelemetry.h" +#include "version.h" struct global_settings { // members @@ -164,7 +165,7 @@ struct global_settings { int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji // other std::string AppName{ "EU07" }; - std::string asVersion{ "UNKNOWN" }; // z opisem + std::string asVersion{ VERSION_INFO }; // z opisem motiontelemetry::conf_t motiontelemetry_conf; std::string screenshot_dir; bool loading_log = true; diff --git a/appveyor.yml b/appveyor.yml index 091076c1..dd40ecf5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,9 @@ version: '{build}' image: Visual Studio 2017 clone_depth: 1 build_script: -- cmd: >- +- ps: >- + Write-Output "#define VERSION_INFO `"$(git log -1 --date="format:%F %R" --format="%cd, %h")`"" > version.h + mkdir builds cd builds diff --git a/version.h b/version.h index c7d482bd..d989ce3a 100644 --- a/version.h +++ b/version.h @@ -1,5 +1 @@ -#pragma once - -#define VERSION_MAJOR 18 -#define VERSION_MINOR 318 -#define VERSION_REVISION 0 +#define VERSION_INFO "git tree build"