From e33fe06ec5f30365eca510ce9b78d3187f432c98 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 19 Sep 2022 13:06:52 +0200 Subject: [PATCH] Log the module version on each application start --- .github/workflows/ci.yml | 7 +++++++ .github/workflows/pr.yml | 7 +++++++ source/main.cpp | 5 +++++ source/version.h | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 source/version.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0831cf4..f602873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + cat < ./source/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 97584a3..91d65c2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,6 +26,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}") + cat < ./source/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/source/main.cpp b/source/main.cpp index 29456ad..01e302e 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -5,11 +5,14 @@ #include "patches/patches.h" #include "sdrefcount/refcount.h" #include "symbolnamepatcher/symbolname.h" +#include "version.h" #include WUMS_MODULE_EXPORT_NAME("homebrew_basemodule"); WUMS_MODULE_SKIP_INIT_FINI(); +#define VERSION "v0.1.2" + WUMS_INITIALIZE(args) { initLogging(); gModuleData = args.module_information; @@ -30,5 +33,7 @@ WUMS_INITIALIZE(args) { } WUMS_APPLICATION_STARTS() { + OSReport("Running AromaBaseModule " VERSION VERSION_EXTRA "\n"); + commonPatchesStart(); } diff --git a/source/version.h b/source/version.h new file mode 100644 index 0000000..66a2c7e --- /dev/null +++ b/source/version.h @@ -0,0 +1,2 @@ +#pragma once +#define VERSION_EXTRA "" \ No newline at end of file