HKBuildUtils 0.3.3
See the version list below for details.
dotnet add package HKBuildUtils --version 0.3.3
NuGet\Install-Package HKBuildUtils -Version 0.3.3
<PackageReference Include="HKBuildUtils" Version="0.3.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add HKBuildUtils --version 0.3.3
#r "nuget: HKBuildUtils, 0.3.3"
// Install HKBuildUtils as a Cake Addin #addin nuget:?package=HKBuildUtils&version=0.3.3 // Install HKBuildUtils as a Cake Tool #tool nuget:?package=HKBuildUtils&version=0.3.3
Hollow Knight Mod Build Utils
A nuget package to help make the Hollow Knight Mod
Features
Mods References Helper
Automatically download HKMAPI and other mods that depend on it when building.
How to use
Add the names of the mods you want to depend on to the <ItemGroup>
in the following way
<ModReference Include="<Mod Name in ModLinks>" AssemblyName="[Assembly Name]" />
Among them, AssemblyName
is optional, but due to the limitation of MSBuild, if the Mod assembly file name does not match its name on ModLinks, you need to fill in AssemblyName
by yourself.
For example, Custom Knight, its assembly file name is CustomKnight.dll
instead of Custom Knight.dll
, therefore, it needs to be referenced as follows
<ModReference Include="Custom Knight" AssemblyName="CustomKnight" />
Set game path
Set game paths to use game files directly instead of downloading them again.
HKBuildUtils will look for the game directory in the following order
(1.) The contents of hkpath.txt under the project folder or its ancestor folder
(2.) HollowKnightRefs
defined in the project file
Note:
- (1.) will be used if both (1.) and (2.) are found, you can disable (1.) and use (2.) by using
<DisableOverwriteHollowKnightRefs>true</DisableOverwriteHollowKnightRefs>
- If neither of them exists or the directory they specify does not exist, it will be considered as a build in CI, and the dependent mods and HKMAPI will be downloaded to the
~ModLibrary
folder under the project folder during the build
Merger with HKMirror
Use ILRepack to merge mods with HKMirror and eliminate unused types in HKMirror.
How to enable
Add <MergeHKMirror>true</MergeHKMirror>
to PropertyGroup
and reference HKMirror.
The rest will take care of it for you.
Mod Resources
Using <ModResource></ModResource>
instead of <EmbeddedResource></EmbeddedResource>
automatically generates the type ModResources
for use
Example
Add the following to the project file
<ItemGroup>
<ModResource Include="Test1.txt"></ModResource>
<ModResource Include="a/Test2.txt"></ModResource>
<ModResource Include="b/c/Test3.txt"></ModResource>
</ItemGroup>
Then you can get them like this in your code
Modding.Logger.Log(ModResources.TEST1.Length);
Modding.Logger.Log(ModResources.TEST2.Length);
Modding.Logger.Log(ModResources.TEST3.Length);
You can add Default="true"
to <ModResource>
to use user-defined content.Like this
<ItemGroup>
<ModResource Include="a/b/c" Default="true"></ModResource>
</ItemGroup>
You can get it through ModResources.C
, just like mentioned above.
If ModResources.C
is used, the file $(ModDir)/a/b/c
is checked for existence first. If present, the file contents are returned, and if they are not, read from the assembly and written to the $(ModDir)/a/b/c
file
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.6.1 | 273 | 5/28/2023 |
0.5.56 | 299 | 3/12/2023 |
0.5.55 | 258 | 3/12/2023 |
0.5.54 | 240 | 3/10/2023 |
0.5.53 | 214 | 3/10/2023 |
0.5.52 | 355 | 3/4/2023 |
0.5.35 | 260 | 3/4/2023 |
0.5.33 | 220 | 3/4/2023 |
0.5.4 | 202 | 3/3/2023 |
0.5.1 | 221 | 3/3/2023 |
0.5.0 | 229 | 3/2/2023 |
0.4.51 | 258 | 3/2/2023 |
0.4.46 | 218 | 3/2/2023 |
0.4.45 | 264 | 2/26/2023 |
0.4.0 | 240 | 2/25/2023 |
0.3.16 | 257 | 2/23/2023 |
0.3.4 | 252 | 2/22/2023 |
0.3.3 | 261 | 2/22/2023 |
0.3.2 | 293 | 2/22/2023 |
0.3.1 | 267 | 2/22/2023 |
0.3.0 | 258 | 2/21/2023 |
0.2.0 | 267 | 2/20/2023 |
0.1.4 | 316 | 1/28/2023 |
0.1.3 | 298 | 1/28/2023 |
0.1.2 | 304 | 1/28/2023 |
0.1.0 | 323 | 1/28/2023 |