Compare commits

...

5 Commits

Author SHA1 Message Date
Maschell 92b3234518 Fix small typo in README 2023-03-17 16:51:05 +01:00
Maschell 93552746ec Update the README 2023-03-17 16:42:55 +01:00
Maschell 4bcd0471d3 Update Dockerfile 2023-03-17 16:42:55 +01:00
Maschell a295cdef98 Update CI files 2023-03-17 16:42:55 +01:00
Maschell 6713e33c10 Format via clang format 2023-03-17 16:42:55 +01:00
6 changed files with 112 additions and 33 deletions

67
.clang-format Normal file
View File

@ -0,0 +1,67 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never

View File

@ -6,10 +6,18 @@ on:
- main
jobs:
build-binary:
runs-on: ubuntu-18.04
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source
build-binary:
runs-on: ubuntu-22.04
needs: clang-format
steps:
- uses: actions/checkout@v3
- name: build binary
run: |
docker build . -t builder
@ -20,7 +28,7 @@ jobs:
path: "*.wms"
deploy-binary:
needs: build-binary
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Get environment variables
id: get_repository_name
@ -30,29 +38,15 @@ jobs:
- uses: actions/download-artifact@master
with:
name: binary
path: wiiu/modules
- name: zip artifact
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip wiiu
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wms
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: "softprops/action-gh-release@v1"
with:
tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
release_name: Nightly-${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
draft: false
prerelease: true
body: |
Not a stable release:
${{ github.event.head_commit.message }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
asset_name: ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
asset_content_type: application/unknown
generate_release_notes: true
name: Nightly-${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
files: |
./${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip

View File

@ -3,10 +3,18 @@ name: CI-PR
on: [pull_request]
jobs:
build-binary:
runs-on: ubuntu-18.04
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source
build-binary:
runs-on: ubuntu-22.04
needs: clang-format
steps:
- uses: actions/checkout@v3
- name: build binary
run: |
docker build . -t builder

View File

@ -1,5 +1,5 @@
FROM wiiuenv/devkitppc:20221228
FROM ghcr.io/wiiu-env/devkitppc:20221228
COPY --from=wiiuenv/wiiumodulesystem:20230106 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20230106 /artifacts $DEVKITPRO
WORKDIR project

View File

@ -1,3 +1,10 @@
[![CI-Release](https://github.com/wiiu-env/LoggingModule/actions/workflows/ci.yml/badge.svg)](https://github.com/wiiu-env/LoggingModule/actions/workflows/ci.yml)
## Usage
(`[ENVIRONMENT]` is a placeholder for the actual environment name.)
1. Copy the file `LoggingModule.wms` into `sd:/wiiu/environments/[ENVIRONMENT]/modules`.
## Building using the Dockerfile
It's possible to use a docker image for building. This way you don't need anything installed on your host system.
@ -12,3 +19,6 @@ docker run -it --rm -v ${PWD}:/project loggingmodule-builder make
# make clean
docker run -it --rm -v ${PWD}:/project loggingmodule-builder make clean
```
## Format the code via docker
`docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source -i`

View File

@ -1,13 +1,13 @@
#include <wums.h>
#include <coreinit/debug.h>
#include <wums.h>
WUMS_MODULE_EXPORT_NAME("homebrew_logging");
#define OSConsoleWriteEx ((void (*)( uint32_t, uint32_t, const char *, size_t))(0x101C400 + 0x10cf0))
#define OSConsoleWriteEx ((void (*)(uint32_t, uint32_t, const char *, size_t))(0x101C400 + 0x10cf0))
bool WUMSLogWrite(const char *str, size_t size) {
OSConsoleWriteEx(0xFFFFFFFF, 0xFFFFFFFF, str, size);
return true;
OSConsoleWriteEx(0xFFFFFFFF, 0xFFFFFFFF, str, size);
return true;
}
WUMS_EXPORT_FUNCTION(WUMSLogWrite);