- Warning
dotnet is required to be installed first.
Install via remote script
Navigate to your project with powershell and execute this:
Set-ExecutionPolicy Unrestricted -Scope Process -Force; iex (iwr 'https://raw.githubusercontent.com/microdee/Nuke.Unreal/refs/heads/main/install/install.ps1').ToString()
- Warning
- Very important that the directory this is executed in is your Unreal project root. Otherwise you will install Nuke.Unreal to some random place and it may not find your project.
Install manually
Nuke.Unreal is available as a Nuget package and you can just add it to your build project as usual (package ID is md.Nuke.Unreal)
Install Nuke for an Unreal project
> dotnet tool install Nuke.GlobalTool --global
> nuke :setup
select None for solution
build project inside Nuke.Targets folder
> nuke :add-package md.Nuke.Unreal
- Inherit your Build class from
UnrealBuild instead of NukeBuild and make it public
- Use
Main () => Plugins.Execute<Build>(Execute); instead of Main () => Execute();
- No further boilerplate required, run
nuke --plan to test Nuke.Unreal
- (optional) Inherit
IPackageTargets interface if you want to package the associated Unreal project
Your bare-bones minimal Build.cs which will provide the default features of Nuke.Unreal should look like this:
using Nuke.Common;
using Nuke.Cola.BuildPlugins;
{
public static int Main () => Plugins.Execute<Build>(Execute);
}
The main build class Unreal projects using Nuke.Unreal should inherit from. This class contains all b...
It is also recommended to set up auto-completion for your shell
-
Powershell:
# $PROFILE
Register-ArgumentCompleter -Native -CommandName nuke -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
nuke :complete "$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
-
Bash:
# .bashrc
_nuke_bash_complete()
{
local word=${COMP_WORDS[COMP_CWORD]}
local completions="$(nuke :complete "${COMP_LINE}")"
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
}
complete -f -F _nuke_bash_complete nuke