mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
emit compiler generated files for docs builds
This commit is contained in:
parent
5824c49819
commit
df4104d868
2 changed files with 28 additions and 5 deletions
|
|
@ -7,6 +7,7 @@ using Nuke.Common.IO;
|
|||
using Nuke.Common.ProjectModel;
|
||||
using Nuke.Common.Tools.DotNet;
|
||||
using Nuke.Common.Tools.MSBuild;
|
||||
using Serilog;
|
||||
|
||||
[UnsetVisualStudioEnvironmentVariables]
|
||||
public class DalamudBuild : NukeBuild
|
||||
|
|
@ -22,6 +23,9 @@ public class DalamudBuild : NukeBuild
|
|||
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
|
||||
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
|
||||
|
||||
[Parameter("Whether we are building for documentation - emits generated files")]
|
||||
readonly bool IsDocsBuild = false;
|
||||
|
||||
[Solution] Solution Solution;
|
||||
[GitRepository] GitRepository GitRepository;
|
||||
|
||||
|
|
@ -55,15 +59,30 @@ public class DalamudBuild : NukeBuild
|
|||
DotNetTasks.DotNetRestore(s => s
|
||||
.SetProjectFile(Solution));
|
||||
});
|
||||
|
||||
|
||||
Target CompileDalamud => _ => _
|
||||
.DependsOn(Restore)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetTasks.DotNetBuild(s => s
|
||||
.SetProjectFile(DalamudProjectFile)
|
||||
.SetConfiguration(Configuration)
|
||||
.EnableNoRestore());
|
||||
DotNetTasks.DotNetBuild(s =>
|
||||
{
|
||||
s = s
|
||||
.SetProjectFile(DalamudProjectFile)
|
||||
.SetConfiguration(Configuration)
|
||||
.EnableNoRestore();
|
||||
|
||||
// We need to emit compiler generated files for the docs build, since docfx can't run generators directly
|
||||
// TODO: This fails every build after this because of redefinitions...
|
||||
if (IsDocsBuild)
|
||||
{
|
||||
Log.Warning("Building for documentation, emitting compiler generated files. This can cause issues on Windows due to path-length limitations");
|
||||
s = s
|
||||
.SetProperty("EmitCompilerGeneratedFiles", "true")
|
||||
.SetProperty("CompilerGeneratedFilesOutputPath", "Generated");
|
||||
}
|
||||
|
||||
return s;
|
||||
});
|
||||
});
|
||||
|
||||
Target CompileDalamudBoot => _ => _
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue