Log the module version on each application start

This commit is contained in:
Maschell 2023-07-19 19:13:25 +02:00
parent 40c6c81a34
commit f36215347b
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@v3 - uses: actions/checkout@v3
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./src/version.h
#pragma once
#define MODULE_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@v3 - uses: actions/checkout@v3
- name: create version.h
run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
cat <<EOF > ./src/version.h
#pragma once
#define MODULE_VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -1,12 +1,17 @@
#include "export.h" #include "export.h"
#include "utils/logger.h" #include "utils/logger.h"
#include "version.h"
#include <wums.h> #include <wums.h>
WUMS_MODULE_EXPORT_NAME("homebrew_wuhb_utils"); WUMS_MODULE_EXPORT_NAME("homebrew_wuhb_utils");
WUMS_USE_WUT_DEVOPTAB(); WUMS_USE_WUT_DEVOPTAB();
#define MODULE_VERSION "v0.1.1"
#define MODULE_VERSION_FULL MODULE_VERSION MODULE_VERSION_EXTRA
WUMS_APPLICATION_STARTS() { WUMS_APPLICATION_STARTS() {
OSReport("Running WUHBUtilsModule " MODULE_VERSION_FULL "\n");
initLogging(); initLogging();
} }

2
src/version.h Normal file
View File

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