Skip to content
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
3 changes: 0 additions & 3 deletions .codex/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ fi

export PATH="$PATH:$HOME/.dotnet/tools"

# Restore local tools (including csharpier)
dotnet tool restore || true

# Restore the project dependencies
dotnet restore || true
10 changes: 0 additions & 10 deletions .config/dotnet-tools.json

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build

on:
push:
branches: [ master, main, feature/** ]
pull_request:
branches: [ master, main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Resonite environment
id: build-env
uses: resonite-modding-group/setup-resonite-env-action@v0.1.0
with:
steam-user: ${{ secrets.STEAMUSER }}
steam-password: ${{ secrets.STEAMPASS }}

- name: Install ResoniteModLoader and Harmony
shell: bash
run: |
set -euo pipefail
LIBS_PATH='${{ steps.build-env.outputs.libraries-path }}'
RESONITE_DIR="$(dirname "${LIBS_PATH}")"
mkdir -p "${LIBS_PATH}" "${RESONITE_DIR}/rml_libs"
echo "Libraries: ${LIBS_PATH}"
echo "Resonite: ${RESONITE_DIR}"
# RML
curl -fsSL -o "${LIBS_PATH}/ResoniteModLoader.dll" \
https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll
# Harmony (prefer rml_libs, fallback to root)
if ! curl -fsSL -o "${RESONITE_DIR}/rml_libs/0Harmony.dll" \
https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll; then
curl -fsSL -o "${RESONITE_DIR}/0Harmony.dll" \
https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll
fi

- name: Build
shell: bash
run: |
set -euo pipefail
dotnet build ./TurboAudioStream.sln -c Release -v minimal

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: TurboAudioStream
path: |
TurboAudioStream/bin/Release/TurboAudioStream.dll
TurboAudioStream/bin/Release/TurboAudioStream.xml
8 changes: 3 additions & 5 deletions .github/workflows/static-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ on:
- ci/*

jobs:
csharpier:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore tools
run: dotnet tool restore
- name: Run csharpier check
run: dotnet csharpier check .
- name: Run dotnet format whitespace (verify)
run: dotnet format whitespace --verify-no-changes
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "format:verify",
"type": "shell",
"command": "dotnet",
"args": [
"format",
"--verify-no-changes"
],
"problemMatcher": [
"$msCompile"
],
"group": "build"
}
]
}
5 changes: 2 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

The CI workflow uses static checks that do not require Resonite assemblies.

- Formatting is enforced with `csharpier`.
- Before committing, run `dotnet csharpier check .` to verify formatting.
- Use `dotnet csharpier format .` to apply formatting fixes.
- CI enforces whitespace-only formatting: `dotnet format whitespace --verify-no-changes`.
- Locally, prefer full checks: `dotnet format --verify-no-changes` and `dotnet format` to fix.
12 changes: 6 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>
<!-- Common Build Properties -->
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
Expand Down Expand Up @@ -56,16 +56,16 @@
</PropertyGroup>
<!-- Derived Resonite Paths -->
<PropertyGroup>
<ResoniteManagedPath>$(ResonitePath)Resonite_Data\Managed\</ResoniteManagedPath>
<ResoniteManagedPath>$(ResonitePath)/</ResoniteManagedPath>
<ResoniteModsPath>$(ResonitePath)rml_mods</ResoniteModsPath>
<ResoniteHotReloadPath>$(ResonitePath)rml_mods\HotReloadMods</ResoniteHotReloadPath>
<ResoniteLibsPath>$(ResonitePath)rml_libs\</ResoniteLibsPath>
<ResoniteHotReloadPath>$(ResonitePath)rml_mods/HotReloadMods</ResoniteHotReloadPath>
<ResoniteLibsPath>$(ResonitePath)rml_libs/</ResoniteLibsPath>
</PropertyGroup>
<!-- Common Resonite References -->
<ItemGroup>
<!-- Core Resonite Mod Dependencies -->
<Reference Include="ResoniteModLoader">
<HintPath>$(ResonitePath)Libraries\ResoniteModLoader.dll</HintPath>
<HintPath>$(ResonitePath)Libraries/ResoniteModLoader.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="HarmonyLib">
Expand Down Expand Up @@ -101,6 +101,6 @@
<!-- Common Items -->
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory).github\**\*" LinkBase=".github" />
<EditorConfigFiles Remove="$(MSBuildProjectDirectory)**\*.editorconfig" />
<EditorConfigFiles Remove="$(MSBuildProjectDirectory)**/*.editorconfig" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Target
Name="Install"
Inputs="$(TargetPath)"
Outputs="$(ResoniteModsPath)\$(TargetFileName);$(ResoniteHotReloadPath)\$(TargetFileName)"
Outputs="$(ResoniteModsPath)/$(TargetFileName);$(ResoniteHotReloadPath)/$(TargetFileName)"
>
<!-- Check if build output exists -->
<Error
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ Configuration changes take effect immediately without requiring a restart.
### Installation for Development

1. Clone this repository
2. Run `dotnet tool restore` to install local tools (e.g., csharpier).
3. Set up your Resonite installation path:
2. Set up your Resonite installation path:
- The project will automatically detect common Steam installation paths
- Alternatively, set the `ResonitePath` property when building: `dotnet build -p:ResonitePath="Path\To\Your\Resonite"`
4. Build the project: `dotnet build`
3. Build the project: `dotnet build`

Optional: enforce formatting locally

- Check formatting: `dotnet format --verify-no-changes`
- Apply formatting: `dotnet format`

### Install to `rml_mods` Directory (and `rml_mods/HotReloadMods`)

Expand Down
35 changes: 35 additions & 0 deletions TurboAudioStream.PrePatcher/TurboAudioStream.PrePatcher.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<NoWarn>NU1603</NoWarn>
</PropertyGroup>
<ItemGroup>
<!-- MonkeyLoader GamePack for Resonite (provides Shim assemblies) -->
<PackageReference Include="MonkeyLoader.GamePacks.Resonite" />

<!-- Direct references to actual Resonite assemblies for type resolution -->
<Reference Include="FrooxEngine">
<HintPath>$(ResoniteManagedPath)FrooxEngine.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Elements.Core">
<HintPath>$(ResoniteManagedPath)Elements.Core.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Elements.Assets">
<HintPath>$(ResoniteManagedPath)Elements.Assets.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="POpusCodec">
<HintPath>$(ResoniteManagedPath)POpusCodec.dll</HintPath>
<Private>false</Private>
</Reference>

<!-- Update pattern for any other Resonite assemblies -->
<Reference Update="Resonite.*">
<HintPath>$(ResoniteManagedPath)%(Filename).dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
</Project>
12 changes: 9 additions & 3 deletions TurboAudioStream/TurboAudioStreamMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ public sealed class TurboAudioStreamMod : ResoniteMod
private static readonly Assembly Assembly = typeof(TurboAudioStreamMod).Assembly;

/// <inheritdoc />
public override string Name => Assembly.GetCustomAttribute<AssemblyTitleAttribute>().Title;
public override string Name =>
Assembly.GetCustomAttribute<AssemblyTitleAttribute>()?.Title
?? Assembly.GetName().Name
?? string.Empty;

/// <inheritdoc />
public override string Author =>
Assembly.GetCustomAttribute<AssemblyCompanyAttribute>().Company;
Assembly.GetCustomAttribute<AssemblyCompanyAttribute>()?.Company
?? string.Empty;

/// <inheritdoc />
public override string Version =>
Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
?? Assembly.GetName().Version?.ToString()
?? "0.0.0";

/// <inheritdoc />
public override string Link =>
Expand Down
Loading