19 Specify a folder containing generator specific folders for
20 Scriban scaffolding and templates. If left empty the
21 templates coming with Nuke.Unreal will be used.
25 public virtual AbsolutePath TemplatesPath {
get;
set; } =
BoilerplateGenerator.DefaultTemplateFolder;
27 [Parameter(
"Name parameter for boilerplate generators.")]
28 public string[] Name {
get;
set; } = [];
33 Specification(s) of the imported library(ies). This is used
34 slightly differently based on which library type is being
37 Header / CMake: It's only the name of the library
40 XRepo: specify the xrepo package reference and its config
41 separated by space. For example:
44 --spec "boost regex=
true,thread=
true"
45 --spec "imgui 1.91.1 freetype=
true"
47 Use VCPKG via XRepo, note that specifying an explicit
48 version is not supported in VCPKG (bug in xrepo?)
49 --spec "vcpkg::spdlog
"
51 VCPKG features are supported
52 --spec "vcpkg::spdlog[wchar]
"
54 Use Conan via XRepo (note version is required and
56 --spec "conan::zlib/1.2.11
"
58 And of course multiple libraries can be used in one go
60 "imgui 1.91.1 freetype=
true"
62 "vcpkg::spdlog[wchar]
"
65 More about xrepo: https://xrepo.xmake.io
66 NOTE: since Unreal uses MD runtime linkage
67 `runtimes='MD'` config is always appended by
68 Nuke.Unreal, and the user must not specify it.
72 public virtual string[] Spec {
get;
set; } = [];
77 Some boilerplate generators allows to define an extra
78 suffix for names depending on their use case. For example
79 `NewLibrary` can use the plain `Name` for library folder
80 structure and `Name_MySuffix` for module names
81 (when `Suffix` is set to `MySuffix`)
85 public string? Suffix {
get;
set; }
90 Specify the type of the third-party library being imported:
91 `Header`: header only C++ library which doesn't need
93 `CMake`: generates an extra nuke target which prepares
94 the CMake library to be used and distributed
96 `XRepo`: generates an extra nuke target which then
97 installs the library on preparation via the
98 xrepo package manager. The library for a
99 specific platform will be available when
100 running Prepare<library>, Prepare or
107 [Parameter(
"Explicitly add new module to project target")]
108 public bool AddToTarget {
get;
set; }
110 public Target NewModule => _ => _
114 Create new module in the owning project or plugin
115 (depending on working directory)
120 .Requires(() => Name)
124 .SetAddToTarget(AddToTarget)
127 (AbsolutePath) Environment.CurrentDirectory,
132 public Target AddCode => _ => _
133 .Description(
"Add C++ code to a project which doesn't have one yet.")
143 public Target NewPlugin => _ => _
144 .Description(
"Create a new project plugin.")
146 .Requires(() => Name)
151 (AbsolutePath) Environment.CurrentDirectory,
157 public Target NewActor => _ => _
158 .Description(
"Create new Unreal Actor in current directory")
160 .Requires(() => Name)
165 (AbsolutePath) Environment.CurrentDirectory,
171 public Target NewInterface => _ => _
172 .Description(
"Create new Unreal Interface in current directory")
174 .Requires(() => Name)
179 (AbsolutePath) Environment.CurrentDirectory,
185 public Target NewObject => _ => _
186 .Description(
"Create new Unreal Object in current directory")
188 .Requires(() => Name)
193 (AbsolutePath) Environment.CurrentDirectory,
199 public Target NewStruct => _ => _
200 .Description(
"Create new Unreal Struct in current directory")
202 .Requires(() => Name)
207 (AbsolutePath) Environment.CurrentDirectory,
213 public Target NewSpec => _ => _
214 .Description(
"Create new Unreal Automation Spec in current directory")
216 .Requires(() => Name)
221 (AbsolutePath) Environment.CurrentDirectory,
227 public Target UseLibrary => _ => _
231 Create boilerplate module for third-party C++ libraries. Specify the kind of
232 library with `--library-type Header|CMake|XRepo` The latter two will generate
233 extra nuke targets preparing the library to be consumed by Unreal.
234 Fetching/storing the library is up to the developer
235 (except of course with XRepo).
237 Use type specific targets for more comfortable CLI experience, for example
238 nuke use-xrepo --spec tracy
240 nuke use-library --library-type xrepo --spec tracy
242 This only needs to be done once, you can check the results into source control.
246 .DependsOn(EnsureBuildPluginSupport)
247 .Before(Prepare, Generate)
250 Assert.NotEmpty(Spec);
255 Log.Information(
"Preparing library {0}", n);
259 EnvironmentInfo.WorkingDirectory,
265 Log.Information(
"Run `Prepare` or `Generate` to install new libraries.");
266 Log.Information(
"This only needs to be done once, you can check the results into source control.");
269 public Target UseXRepo => _ => _
273 Use libraries from the xrepo package manager. This target only configures
274 another target which will eventually fetch the input libraries. To make them
275 available to Unreal run `Prepare` or `Generate` targets.
277 Specify the xrepo package reference and its config separated by space.
280 nuke use-xrepo --spec "zlib
"
281 nuke use-xrepo --spec "zlib 1.2.x
"
282 nuke use-xrepo --spec "boost regex=
true,thread=
true"
283 nuke use-xrepo --spec "imgui 1.91.1 freetype=
true"
285 Use VCPKG via XRepo, note that specifying an explicit version is
286 not supported in VCPKG (bug in xrepo?)
287 nuke use-xrepo --spec "vcpkg::spdlog
"
289 VCPKG features are supported
290 nuke use-xrepo --spec "vcpkg::spdlog[wchar]
"
292 Use Conan via XRepo (note version is required and delimited with /)
293 nuke use-xrepo --spec "conan::zlib/1.2.11
"
295 And of course multiple libraries can be used in one go
296 nuke use-xrepo --spec
297 "imgui 1.91.1 freetype=
true"
299 "vcpkg::spdlog[wchar]
"
302 More about xrepo: https://xrepo.xmake.io
303 NOTE: since Unreal uses MD runtime linkage `runtimes='MD'` config is always
304 appended by Nuke.Unreal, and the user must not specify it.
306 This only needs to be done once, you can check the results into source control.
310 .Triggers(UseLibrary)
311 .Requires(() => Spec)
314 public Target UseCMake => _ => _
315 .Triggers(UseLibrary)
316 .Requires(() => Spec)
319 public Target UseHeaderOnly => _ => _
320 .Triggers(UseLibrary)
321 .Requires(() => Spec)