Skip to content

Commit 166bb9f

Browse files
committed
chore(build): 🎯 align ResonitePath naming
1 parent 900546a commit 166bb9f

6 files changed

Lines changed: 27 additions & 27 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,28 +79,28 @@ jobs:
7979
8080
- name: Restore
8181
env:
82-
ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }}
82+
ResonitePath: ${{ env.RESONITE_INSTALL_DIR }}
8383
shell: bash
8484
run: |
8585
dotnet restore ReferenceReplacement.sln
8686
8787
- name: Verify formatting
8888
env:
89-
ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }}
89+
ResonitePath: ${{ env.RESONITE_INSTALL_DIR }}
9090
shell: bash
9191
run: |
9292
dotnet format ReferenceReplacement.sln --verify-no-changes --no-restore
9393
9494
- name: Build
9595
env:
96-
ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }}
96+
ResonitePath: ${{ env.RESONITE_INSTALL_DIR }}
9797
shell: bash
9898
run: |
9999
dotnet build ReferenceReplacement.sln --configuration Release --no-restore
100100
101101
- name: Test
102102
env:
103-
ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }}
103+
ResonitePath: ${{ env.RESONITE_INSTALL_DIR }}
104104
shell: bash
105105
run: |
106106
dotnet test ReferenceReplacement.sln --configuration Release --no-build

Directory.Build.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<EnableNETAnalyzers>true</EnableNETAnalyzers>
77
</PropertyGroup>
88

9-
<PropertyGroup Condition="'$(ResoniteAssembliesDir)'==''">
10-
<ResoniteAssembliesDir>$(MSBuildThisFileDirectory)Resonite/</ResoniteAssembliesDir>
11-
<ResoniteAssembliesDir Condition="Exists('/mnt/c/Program Files (x86)/Steam/steamapps/common/Resonite/')">/mnt/c/Program Files (x86)/Steam/steamapps/common/Resonite/</ResoniteAssembliesDir>
12-
<ResoniteAssembliesDir Condition="Exists('C:\\Program Files (x86)\\Steam\\steamapps\\common\\Resonite\\')">C:\\Program Files (x86)\\Steam\\steamapps\\common\\Resonite\\</ResoniteAssembliesDir>
13-
<ResoniteAssembliesDir Condition="Exists('$(HOME)/.steam/steam/steamapps/common/Resonite/')">$(HOME)/.steam/steam/steamapps/common/Resonite/</ResoniteAssembliesDir>
9+
<PropertyGroup Condition="'$(ResonitePath)'==''">
10+
<ResonitePath>$(MSBuildThisFileDirectory)Resonite/</ResonitePath>
11+
<ResonitePath Condition="Exists('/mnt/c/Program Files (x86)/Steam/steamapps/common/Resonite/')">/mnt/c/Program Files (x86)/Steam/steamapps/common/Resonite/</ResonitePath>
12+
<ResonitePath Condition="Exists('C:\\Program Files (x86)\\Steam\\steamapps\\common\\Resonite\\')">C:\\Program Files (x86)\\Steam\\steamapps\\common\\Resonite\\</ResonitePath>
13+
<ResonitePath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/Resonite/')">$(HOME)/.steam/steam/steamapps/common/Resonite/</ResonitePath>
1414
</PropertyGroup>
1515

16-
<PropertyGroup Condition="'$(ResoniteAssembliesDir)'!=''">
17-
<ResolvedResoniteAssembliesDir>$([System.IO.Path]::GetFullPath('$(ResoniteAssembliesDir)'))</ResolvedResoniteAssembliesDir>
16+
<PropertyGroup Condition="'$(ResonitePath)'!=''">
17+
<ResolvedResonitePath>$([System.IO.Path]::GetFullPath('$(ResonitePath)'))</ResolvedResonitePath>
1818
</PropertyGroup>
1919
</Project>

Directory.Build.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
2-
<Target Name="EnsureResoniteAssembliesDir" BeforeTargets="ResolveReferences">
3-
<Error Condition="'$(ResoniteAssembliesDir)'==''" Text="ResoniteAssembliesDir must be set (or install Resonite under ./Resonite, the default Steam Windows path, or ~/.steam/steam/steamapps/common/Resonite/ for auto-detection)." />
4-
<Error Condition="!Exists('$(ResolvedResoniteAssembliesDir)/FrooxEngine.dll')" Text="Cannot find FrooxEngine.dll under $(ResolvedResoniteAssembliesDir)." />
2+
<Target Name="EnsureResonitePath" BeforeTargets="ResolveReferences">
3+
<Error Condition="'$(ResonitePath)'==''" Text="ResonitePath must be set (or install Resonite under ./Resonite, the default Steam Windows path, or ~/.steam/steam/steamapps/common/Resonite/ for auto-detection)." />
4+
<Error Condition="!Exists('$(ResolvedResonitePath)/FrooxEngine.dll')" Text="Cannot find FrooxEngine.dll under $(ResolvedResonitePath)." />
55
</Target>
66
</Project>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Launch the tool via `Create New > Editor > Reference Replacement (Mod)` in the D
1313
## Build & Hot Reload
1414

1515
1. Install the .NET 9 SDK.
16-
2. `dotnet build ReferenceReplacement.sln` auto-detects `Resonite` next to the repo, the default Steam Windows path, then the default Steam Linux path. If the game lives elsewhere, pass `-p:ResoniteAssembliesDir="/absolute/path/to/Resonite"` so the build can find `FrooxEngine.dll`, `Elements.Core.dll`, `Libraries/ResoniteModLoader.dll`, and `rml_libs/0Harmony.dll`.
17-
3. Set `CopyToMods=true` when invoking `dotnet build` to copy the compiled DLL into `$(ResoniteAssembliesDir)/rml_mods` after each build.
18-
4. Drop `ResoniteHotReloadLib.dll` (and `ResoniteHotReloadLibCore.dll`) into `$(ResoniteAssembliesDir)/rml_libs` and build with `-p:EnableResoniteHotReloadLib=true` if you want the Dev Tool’s **Hot Reload Mods** panel to reload this mod without restarting Resonite. Leave the property unset on machines without the DLL.
16+
2. `dotnet build ReferenceReplacement.sln` auto-detects the Resonite install next to this repo, the default Steam Windows path, then the default Steam Linux path. If the game lives elsewhere, pass `-p:ResonitePath="/absolute/path/to/Resonite"` so the build can find `FrooxEngine.dll`, `Elements.Core.dll`, `Libraries/ResoniteModLoader.dll`, and `rml_libs/0Harmony.dll`.
17+
3. Set `CopyToMods=true` when invoking `dotnet build` to copy the compiled DLL into `$(ResonitePath)/rml_mods` after each build.
18+
4. Drop `ResoniteHotReloadLib.dll` (and `ResoniteHotReloadLibCore.dll`) into `$(ResonitePath)/rml_libs` and build with `-p:EnableResoniteHotReloadLib=true` if you want the Dev Tool’s **Hot Reload Mods** panel to reload this mod without restarting Resonite. Leave the property unset on machines without the DLL.

src/ReferenceReplacement/ReferenceReplacement.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@
1919

2020
<ItemGroup>
2121
<Reference Include="ResoniteModLoader">
22-
<HintPath>$(ResolvedResoniteAssembliesDir)/Libraries/ResoniteModLoader.dll</HintPath>
22+
<HintPath>$(ResolvedResonitePath)/Libraries/ResoniteModLoader.dll</HintPath>
2323
<Private>false</Private>
2424
</Reference>
2525
<Reference Include="HarmonyLib">
26-
<HintPath>$(ResolvedResoniteAssembliesDir)/rml_libs/0Harmony.dll</HintPath>
26+
<HintPath>$(ResolvedResonitePath)/rml_libs/0Harmony.dll</HintPath>
2727
<Private>false</Private>
2828
</Reference>
2929
<Reference Include="FrooxEngine">
30-
<HintPath>$(ResolvedResoniteAssembliesDir)/FrooxEngine.dll</HintPath>
30+
<HintPath>$(ResolvedResonitePath)/FrooxEngine.dll</HintPath>
3131
<Private>false</Private>
3232
</Reference>
3333
<Reference Include="Elements.Core">
34-
<HintPath>$(ResolvedResoniteAssembliesDir)/Elements.Core.dll</HintPath>
34+
<HintPath>$(ResolvedResonitePath)/Elements.Core.dll</HintPath>
3535
<Private>false</Private>
3636
</Reference>
3737
<Reference Include="Renderite.Shared">
38-
<HintPath>$(ResolvedResoniteAssembliesDir)/Renderite.Shared.dll</HintPath>
38+
<HintPath>$(ResolvedResonitePath)/Renderite.Shared.dll</HintPath>
3939
<Private>false</Private>
4040
</Reference>
4141
<Reference Include="ResoniteHotReloadLib" Condition="'$(EnableResoniteHotReloadLib)'=='true'">
42-
<HintPath>$(ResolvedResoniteAssembliesDir)/rml_libs/ResoniteHotReloadLib.dll</HintPath>
42+
<HintPath>$(ResolvedResonitePath)/rml_libs/ResoniteHotReloadLib.dll</HintPath>
4343
<Private>false</Private>
4444
</Reference>
4545
</ItemGroup>
@@ -56,7 +56,7 @@
5656

5757
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CopyToMods)'=='true'">
5858
<PropertyGroup>
59-
<_ResoniteModsDir>$(ResolvedResoniteAssembliesDir)/rml_mods</_ResoniteModsDir>
59+
<_ResoniteModsDir>$(ResolvedResonitePath)/rml_mods</_ResoniteModsDir>
6060
<_HotReloadModsDir>$(_ResoniteModsDir)/HotReloadMods</_HotReloadModsDir>
6161
<_BuiltAssembly>$(TargetDir)$(TargetFileName)</_BuiltAssembly>
6262
<_HotReloadCopyEnabled>false</_HotReloadCopyEnabled>

tests/ReferenceReplacement.Tests/ReferenceReplacement.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222

2323
<ItemGroup>
2424
<Reference Include="FrooxEngine">
25-
<HintPath>$(ResoniteAssembliesDir)/FrooxEngine.dll</HintPath>
25+
<HintPath>$(ResolvedResonitePath)/FrooxEngine.dll</HintPath>
2626
<Private>true</Private>
2727
</Reference>
2828
<Reference Include="Elements.Core">
29-
<HintPath>$(ResoniteAssembliesDir)/Elements.Core.dll</HintPath>
29+
<HintPath>$(ResolvedResonitePath)/Elements.Core.dll</HintPath>
3030
<Private>true</Private>
3131
</Reference>
3232
<Reference Include="Renderite.Shared">
33-
<HintPath>$(ResoniteAssembliesDir)/Renderite.Shared.dll</HintPath>
33+
<HintPath>$(ResolvedResonitePath)/Renderite.Shared.dll</HintPath>
3434
<Private>true</Private>
3535
</Reference>
3636
</ItemGroup>

0 commit comments

Comments
 (0)