Skip to content

Commit

Permalink
Make use a local build properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
Extremelyd1 committed Dec 19, 2021
1 parent af34766 commit a9d4553
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,5 @@ InitTestScene*.unity
# End of https://www.toptal.com/developers/gitignore/api/csharp,unity

.idea/
*/lib/
*/lib/
LocalBuildProperties.props
34 changes: 21 additions & 13 deletions HKMP/HKMP.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="LocalBuildProperties.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -33,58 +34,58 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\Assembly-CSharp.dll</HintPath>
<HintPath>$(References)\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MMHOOK_Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\MMHOOK_Assembly-CSharp.dll</HintPath>
<HintPath>$(References)\MMHOOK_Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\PlayMaker.dll</HintPath>
<HintPath>$(References)\PlayMaker.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.dll</HintPath>
<HintPath>$(References)\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.AudioModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.AudioModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.CoreModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.ImageConversionModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.ImageConversionModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.InputLegacyModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.ParticleSystemModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.ParticleSystemModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.Physics2DModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.Physics2DModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.TextRenderingModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.UI.dll</HintPath>
<HintPath>$(References)\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>lib\UnityEngine.UIModule.dll</HintPath>
<HintPath>$(References)\UnityEngine.UIModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down Expand Up @@ -230,6 +231,13 @@
<ItemGroup>
<EmbeddedResource Include="Ui\Resources\Images\divider.png" />
</ItemGroup>
<ItemGroup>
<Content Include="LocalBuildProperties.props" />
<Content Include="LocalBuildProperties_example.props" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\HKMPShared\HKMPShared.projitems" Label="Shared" />
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(OutputDirectory)\$(AssemblyName)" />
</Target>
</Project>
8 changes: 8 additions & 0 deletions HKMP/LocalBuildProperties_example.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<!-- Fill in your path to the references, for example: "[steam]\steamapps\common\Hollow Knight\hollow_knight_Data\Managed" -->
<References></References>
<!-- Fill in the output directory of the build, for example: "[steam]\steamapps\common\Hollow Knight\hollow_knight_Data\Managed\Mods -->
<OutputDirectory></OutputDirectory>
</PropertyGroup>
</Project>
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ This way we can keep a clear overview of who is working on what at the moment an
## Build instructions
HKMP can also be built from scratch.
This requires a few dependencies from the Hollow Knight game and the modding API.
Namely, the following dependencies should be added as referenced assemblies from **the modding API**:
Namely, the following assemblies are needed from **the modding API**:
- `Assembly-CSharp.dll (modified by the modding API)`
- `MMHOOK_Assembly-CSharp.dll`

And the following assemblies should be added as references from **the Hollow Knight game/Unity**:
And the following assemblies are needed from **the Hollow Knight game/Unity**:
- `PlayMaker.dll`
- `UnityEngine.AudioModule.dll`
- `UnityEngine.CoreModule.dll`
Expand All @@ -185,6 +185,9 @@ All the files above can be found in the following directory based on your operat
- **Mac**: `~/Library/Application Support/Steam/steamapps/common/Hollow Knight/hollow_knight.app/`, then click "open package contents" and `content -> resources -> data -> managed`
- **Linux**: `~/.local/share/Steam/steamapps/common/Hollow Knight/hollow_knight_Data/Managed`

With these assemblies handy (either in their original Hollow Knight directory or moved somewhere else)
you should copy and rename the `HKMP/LocalBuildProperties_example.props` file to `HKMP/LocalBuildProperties.props`
and fill the paths in it to your locally used paths.
After this the source code can be compiled into a DLL, and you should be good to go!

## Donations
Expand Down

0 comments on commit a9d4553

Please sign in to comment.