Log the module version on each application start

This commit is contained in:
Maschell 2022-09-19 13:06:52 +02:00
parent d101c899c4
commit e33fe06ec5
4 changed files with 21 additions and 0 deletions

View File

@ -18,6 +18,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./source/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -26,6 +26,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
cat <<EOF > ./source/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -5,11 +5,14 @@
#include "patches/patches.h" #include "patches/patches.h"
#include "sdrefcount/refcount.h" #include "sdrefcount/refcount.h"
#include "symbolnamepatcher/symbolname.h" #include "symbolnamepatcher/symbolname.h"
#include "version.h"
#include <wums.h> #include <wums.h>
WUMS_MODULE_EXPORT_NAME("homebrew_basemodule"); WUMS_MODULE_EXPORT_NAME("homebrew_basemodule");
WUMS_MODULE_SKIP_INIT_FINI(); WUMS_MODULE_SKIP_INIT_FINI();
#define VERSION "v0.1.2"
WUMS_INITIALIZE(args) { WUMS_INITIALIZE(args) {
initLogging(); initLogging();
gModuleData = args.module_information; gModuleData = args.module_information;
@ -30,5 +33,7 @@ WUMS_INITIALIZE(args) {
} }
WUMS_APPLICATION_STARTS() { WUMS_APPLICATION_STARTS() {
OSReport("Running AromaBaseModule " VERSION VERSION_EXTRA "\n");
commonPatchesStart(); commonPatchesStart();
} }

2
source/version.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#define VERSION_EXTRA ""