Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 912b1b8

Browse files
committed
using ILRepack MSBuild task, adding some base libs
1 parent 6a9c64c commit 912b1b8

File tree

9 files changed

+48
-32
lines changed

9 files changed

+48
-32
lines changed

README.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -155,35 +155,7 @@ If you'd like to build this yourself, you will need to have installed BepInEx an
155155
4. Open the `src\Explorer.sln` project.
156156
5. Select `Solution 'Explorer' (1 of 1 project)` in the Solution Explorer panel, and set the <b>Active config</b> property to the version you want to build, then build it.
157157
5. The DLLs are built to the `Release\` folder in the root of the repository.
158-
159-
[ILRepack](https://github.com/gluck/il-repack) is used to merge `lib\mcs.dll` and the release dll. Download the ILRepack nuget package and take the `ILRepack.exe` file from it.
160-
161-
Put `ILRepack.exe` in the `Release\` folder, then create a `merge.bat` file like so:
162-
163-
```batch
164-
:: Set GameFolder to the full path of the game you have installed MelonLoader and/or BepInEx for.
165-
SET GameFolder="..."
166-
167-
:: Only include the lines for the version(s) you are building.
168-
169-
:: MelonLoader Il2CPP:
170-
ILRepack.exe /lib:"%GameFolder%\MelonLoader" /lib:"%GameFolder%\MelonLoader\Managed" /out:"Explorer.MelonLoader.Il2Cpp\Explorer.dll" "Explorer.MelonLoader.Il2Cpp\Explorer.dll" "..\lib\mcs.dll"
171-
172-
:: MelonLoader Mono
173-
ILRepack.exe /lib:"..\lib" /lib:"%GameFolder%\MelonLoader" /out:"Explorer.MelonLoader.Mono\Explorer.dll" "Explorer.MelonLoader.Mono\Explorer.dll" "..\lib\mcs.dll"
174-
175-
:: MelonLoader Mono .NET35
176-
ILRepack.exe /lib:"..\lib" /lib:"%GameFolder%\MelonLoader" /out:"Explorer.MelonLoader.Mono.NET35\Explorer.dll" "Explorer.MelonLoader.Mono.NET35\Explorer.dll" "..\lib\mcs.NET35.dll"
177-
178-
:: BepInEx Il2Cpp
179-
ILRepack.exe /lib:"%GameFolder%\BepInEx\core" /lib:"%GameFolder%\BepInEx\unhollowed" /out:"Explorer.BepInEx.Il2Cpp\Explorer.dll" "Explorer.BepInEx.Il2Cpp\Explorer.dll" "..\lib\mcs.dll"
180-
181-
:: BepInEx Mono
182-
ILRepack.exe /lib:"..\lib" /lib:"%GameFolder%\BepInEx\core" /out:"Explorer.BepInEx.Mono\Explorer.dll" "Explorer.BepInEx.Mono\Explorer.dll" "..\lib\mcs.dll"
183-
184-
:: BepInEx Mono .NET35
185-
ILRepack.exe /lib:"..\lib" /lib:"%GameFolder%\BepInEx\core" /out:"Explorer.BepInEx.Mono.NET35\Explorer.dll" "Explorer.BepInEx.Mono.NET35\Explorer.dll" "..\lib\mcs.NET35.dll"
186-
```
158+
6. If ILRepack fails or is missing, use the NuGet package manager to re-install `ILRepack.Lib.MSBuild.Task`, then re-build.
187159

188160
## Credits
189161

lib/0Harmony.dll

170 KB
Binary file not shown.

lib/BepInEx.Core.dll

78.5 KB
Binary file not shown.

lib/BepInEx.IL2CPP.dll

42 KB
Binary file not shown.

lib/BepInEx.dll

106 KB
Binary file not shown.

lib/MelonLoader.ModHandler.dll

413 KB
Binary file not shown.

src/Explorer.csproj

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@
2828
<!-- Set this to the MelonLoader Il2Cpp Game folder, without the ending '\' character. -->
2929
<MLCppGameFolder>D:\Steam\steamapps\common\Hellpoint</MLCppGameFolder>
3030
<!-- Set this to the MelonLoader Mono Game folder, without the ending '\' character. -->
31-
<MLMonoGameFolder>D:\Steam\steamapps\common\Outward</MLMonoGameFolder>
31+
<MLMonoGameFolder>D:\Steam\steamapps\common\Outward_Mono</MLMonoGameFolder>
3232
<!-- Set this to the BepInEx Il2Cpp Game folder, without the ending '\' character. -->
33-
<BIECppGameFolder>D:\Steam\steamapps\common\Outward - Il2Cpp</BIECppGameFolder>
33+
<BIECppGameFolder>D:\Steam\steamapps\common\Outward</BIECppGameFolder>
3434
<!-- Set this to the BepInEx Mono Game folder, without the ending '\' character. -->
35-
<BIEMonoGameFolder>D:\Steam\steamapps\common\Outward</BIEMonoGameFolder>
35+
<BIEMonoGameFolder>D:\Steam\steamapps\common\Outward_Mono</BIEMonoGameFolder>
36+
<NuGetPackageImportStamp>
37+
</NuGetPackageImportStamp>
3638
</PropertyGroup>
3739
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_ML_Cpp|AnyCPU' ">
3840
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
@@ -275,5 +277,16 @@
275277
<Compile Include="UnstripFixes\Internal.cs" />
276278
<Compile Include="UnstripFixes\Internal_SliderState.cs" />
277279
</ItemGroup>
280+
<ItemGroup>
281+
<None Include="ILRepack.targets" />
282+
<None Include="packages.config" />
283+
</ItemGroup>
278284
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
285+
<Import Project="packages\ILRepack.Lib.MSBuild.Task.2.0.18.1\build\ILRepack.Lib.MSBuild.Task.targets" Condition="Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.18.1\build\ILRepack.Lib.MSBuild.Task.targets')" />
286+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
287+
<PropertyGroup>
288+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
289+
</PropertyGroup>
290+
<Error Condition="!Exists('packages\ILRepack.Lib.MSBuild.Task.2.0.18.1\build\ILRepack.Lib.MSBuild.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\ILRepack.Lib.MSBuild.Task.2.0.18.1\build\ILRepack.Lib.MSBuild.Task.targets'))" />
291+
</Target>
279292
</Project>

src/ILRepack.targets

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Target Name="ILRepacker" AfterTargets="Build">
4+
5+
<!-- Merging DLLs -->
6+
<ItemGroup>
7+
<InputAssemblies Include="$(OutputPath)$(AssemblyName).dll" />
8+
</ItemGroup>
9+
<ItemGroup Condition="'$(IsNet35)'=='false'">
10+
<InputAssemblies Include="..\lib\mcs.dll" />
11+
</ItemGroup>
12+
<ItemGroup Condition="'$(IsNet35)'=='true'">
13+
<InputAssemblies Include="..\lib\mcs.NET35.dll" />
14+
</ItemGroup>
15+
16+
<ILRepack
17+
Parallel="true"
18+
Internalize="true"
19+
DebugInfo="false"
20+
LibraryPath="..\lib\"
21+
InputAssemblies="@(InputAssemblies)"
22+
TargetKind="Dll"
23+
OutputFile="$(OutputPath)$(AssemblyName).dll"
24+
/>
25+
26+
</Target>
27+
</Project>

src/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="ILRepack.Lib.MSBuild.Task" version="2.0.18.1" targetFramework="net472" />
4+
</packages>

0 commit comments

Comments
 (0)