TerraUtil.BuildSystem 1.0.0

dotnet add package TerraUtil.BuildSystem --version 1.0.0                
NuGet\Install-Package TerraUtil.BuildSystem -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TerraUtil.BuildSystem" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TerraUtil.BuildSystem --version 1.0.0                
#r "nuget: TerraUtil.BuildSystem, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TerraUtil.BuildSystem as a Cake Addin
#addin nuget:?package=TerraUtil.BuildSystem&version=1.0.0

// Install TerraUtil.BuildSystem as a Cake Tool
#tool nuget:?package=TerraUtil.BuildSystem&version=1.0.0                

TerraUtil.BuildSystem

The better build system for tModLoader, the mod loader for Terraria.

Based on this pull request by Chik3r, with modifications made by me.

Features

  • build.txt properties moved to the .csproj.
  • tModLoader.targets is automatically imported.
  • The output .tmod file is also located in the bin folder.
  • Moved buildIgnore to a .buildignore file that uses the same syntax as .gitignore.
  • All references - <Reference>, <ProjectReference>, <PackageReference>, and <ModReference> - are done inside the .csproj and are automatically added to the mod file.
    • Note that dll references must be located inside the mod's folder (e.g. under ModSources/ModName/ and it's subfolders) in order to be packaged. This is due to restrictions with MSBuild and may be changed in the future.
  • The mod's code can be located outside of ModSources and still function properly. This works by symlinking the mod into ModSources.
    • The IDE used to build the mod or dotnet build must be run with admin privileges when first creating the symlink, since it requires admin access. Subsequent builds do not require this.
    • This may be changed to opt-in sometime in the future.
  • Allowed changing the internal name of a mod through the .csproj with <InternalName>.
    • This requires the mods code to be outside of ModSources because the name of the folder in ModSources is normally used to determine the internal name.
  • The root namespace and assembly name of the mod are automatically set to the internal name.
    • This may be changed in the future, let me know if you have any issues with this.

Example

See TerraUtil.TestMod for an example of how to use this package.

Licensing

This code is licensed under the MIT license.

Some modified code from tModLoader is used, which is licensed under the MIT license.

The used code is:

  • Everything under the Core folder
  • Tasks/BaseTask.cs
  • Tasks/PackageModFile.cs
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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
1.0.0 0 11/15/2024
0.0.8 119 9/7/2024
0.0.7 99 9/7/2024
0.0.6 114 9/7/2024
0.0.5 92 9/7/2024
0.0.4 104 9/7/2024
0.0.3 104 9/7/2024
0.0.2 92 9/7/2024
0.0.1 98 9/6/2024

Massive work done on finishing the rest of the build system.
     Ready for a few more features, which will be coming sometime soon.