Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log the version on each application start #9

Merged
merged 2 commits into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
needs: clang-format
steps:
- uses: actions/checkout@v3
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./source/version.h
#pragma once
#define MOUDLE_VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary
run: |
docker build . -t builder
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
needs: clang-format
steps:
- uses: actions/checkout@v3
- 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 MODULE_VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary
run: |
docker build . -t builder
Expand Down
4 changes: 4 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "kernel.h"
#include "logger.h"
#include "version.h"
#include <coreinit/cache.h>
#include <coreinit/ios.h>
#include <kernel/kernel.h>
Expand All @@ -10,6 +11,8 @@ WUMS_MODULE_EXPORT_NAME("homebrew_usbseriallogging");
WUMS_MODULE_SKIP_INIT_FINI();
WUMS_DEPENDS_ON(homebrew_kernel);

#define MODULE_VERSION "v0.1.1"

extern "C" void SC_0x51();

WUMS_INITIALIZE() {
Expand Down Expand Up @@ -46,6 +49,7 @@ WUMS_INITIALIZE() {
#define IopShell_CreateThread ((void (*)(void))(0x101C400 + 0x19504))

WUMS_APPLICATION_STARTS() {
OSReport("Running USBSerialLoggingModule " MODULE_VERSION MODULE_VERSION_EXTRA "\n");
initLogging();
DEBUG_FUNCTION_LINE("Register IopShell_UserCallback");
IopShell_RegisterCallback(IopShell_UserCallback, 0x100978f8, 0x10097900, 0x10097c40);
Expand Down
2 changes: 2 additions & 0 deletions source/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#pragma once
#define MODULE_VERSION_EXTRA ""