Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 251d6af

Browse files
committed
Add ILMerge to merge dlls into single dll file
1 parent bb7d057 commit 251d6af

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

ModLoader/ModLoader.csproj

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\ILMerge.3.0.41\build\ILMerge.props" Condition="Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" />
34
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
45
<PropertyGroup>
56
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,6 +13,8 @@
1213
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1314
<FileAlignment>512</FileAlignment>
1415
<Deterministic>true</Deterministic>
16+
<NuGetPackageImportStamp>
17+
</NuGetPackageImportStamp>
1518
</PropertyGroup>
1619
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1720
<DebugSymbols>true</DebugSymbols>
@@ -33,11 +36,11 @@
3336
<ItemGroup>
3437
<Reference Include="0Harmony, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
3538
<HintPath>..\packages\Lib.Harmony.2.2.0\lib\net45\0Harmony.dll</HintPath>
36-
<Private>False</Private>
39+
<Private>True</Private>
3740
</Reference>
3841
<Reference Include="Assembly-CSharp">
3942
<HintPath>..\Dependencies\Assembly-CSharp.dll</HintPath>
40-
<Private>False</Private>
43+
<Private>True</Private>
4144
</Reference>
4245
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4346
<SpecificVersion>False</SpecificVersion>
@@ -53,19 +56,19 @@
5356
<Reference Include="System.Xml" />
5457
<Reference Include="UnityEngine">
5558
<HintPath>..\Dependencies\UnityEngine.dll</HintPath>
56-
<Private>False</Private>
59+
<Private>True</Private>
5760
</Reference>
5861
<Reference Include="UnityEngine.AssetBundleModule">
5962
<HintPath>..\Dependencies\UnityEngine.AssetBundleModule.dll</HintPath>
60-
<Private>False</Private>
63+
<Private>True</Private>
6164
</Reference>
6265
<Reference Include="UnityEngine.CoreModule">
6366
<HintPath>..\Dependencies\UnityEngine.CoreModule.dll</HintPath>
64-
<Private>False</Private>
67+
<Private>True</Private>
6568
</Reference>
6669
<Reference Include="UnityEngine.IMGUIModule">
6770
<HintPath>..\Dependencies\UnityEngine.IMGUIModule.dll</HintPath>
68-
<Private>False</Private>
71+
<Private>True</Private>
6972
</Reference>
7073
<Reference Include="UnityEngine.InputLegacyModule">
7174
<HintPath>..\Dependencies\UnityEngine.InputLegacyModule.dll</HintPath>
@@ -75,7 +78,7 @@
7578
</Reference>
7679
<Reference Include="UnityEngine.UI">
7780
<HintPath>..\Dependencies\UnityEngine.UI.dll</HintPath>
78-
<Private>False</Private>
81+
<Private>True</Private>
7982
</Reference>
8083
<Reference Include="UnityEngine.UIModule">
8184
<HintPath>..\Dependencies\UnityEngine.UIModule.dll</HintPath>
@@ -95,4 +98,19 @@
9598
</ItemGroup>
9699
<ItemGroup />
97100
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
101+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
102+
<PropertyGroup>
103+
<ErrorText>Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}.</ErrorText>
104+
</PropertyGroup>
105+
<Error Condition="!Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILMerge.3.0.41\build\ILMerge.props'))" />
106+
</Target>
107+
108+
<ItemGroup>
109+
<PackageReference Include="ILMerge" Version="3.0.29" />
110+
</ItemGroup>
111+
112+
<Target Name="ILMerge">
113+
<!-- the ILMergePath property points to the location of ILMerge.exe console application -->
114+
<Exec Command="$(ILMergeConsolePath) /out:bin/Release/ModLoaderMac.dll bin/Release/0Harmony.dll bin/Release/ModLoader.dll" />
115+
</Target>
98116
</Project>

ModLoader/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="ILMerge" version="3.0.41" targetFramework="net45" />
34
<package id="Lib.Harmony" version="2.2.0" targetFramework="net45" />
45
</packages>

0 commit comments

Comments
 (0)