Skip to content

Commit

Permalink
clean up build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniMacaroni committed Aug 5, 2024
1 parent 55fd45d commit c92f55b
Showing 1 changed file with 17 additions and 43 deletions.
60 changes: 17 additions & 43 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Nuke.Common.Tools.GitHub;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.MSBuild;
using Nuke.Common.Utilities.Collections;
using Octokit;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
Expand Down Expand Up @@ -101,17 +102,19 @@ public static int Main ()
var generatedAssembliesExist = (GamePath / ProjectFolder / "Game").DirectoryExists();

IsWindows64 = true;
//DotNetBuild(x => x.SetNoConsoleLogger(true));
foreach (var project in Solution.AllProjects)
{
if(project.Name == "_build")
continue;

if((project.Name.Contains("Sons") || project == Solution.GLTF) && !generatedAssembliesExist)
continue;

BuildToOutput(project, ShouldCopyToGame);
}
// foreach (var project in Solution.AllProjects)
// {
// if(project.Name == "_build")
// continue;
//
// if((project.Name.Contains("Sons") || project == Solution.GLTF) && !generatedAssembliesExist)
// continue;
//
// BuildToOutput(project, ShouldCopyToGame);
// }

new[]{ Solution.SonsSdk, Solution.GLTF }
.ForEach(x=>BuildToOutput(x, ShouldCopyToGame));

if (!generatedAssembliesExist)
{
Expand All @@ -128,35 +131,6 @@ public static int Main ()
RunGame();
});

Target CompileSdk => _ => _
.DependsOn(Restore)
.Executes(() =>
{
//DotNetBuild(x => x.SetNoConsoleLogger(true));
//BuildToOutput(Solution.SonsSdk, true);
//BuildToOutput(Solution.SonsGameManager, true);
//BuildToOutput(Solution.SonsLoaderPlugin, true);

DotNetBuild(x => x
.SetProjectFile(Solution.FileName)
.EnableNoRestore()
.EnableNoLogo()
.SetConfiguration(Configuration)
.SetPlatform("Windows - x64")
.SetAssemblyVersion(GitVersion.MajorMinorPatch)
.SetFileVersion(GitVersion.MajorMinorPatch)
//.SetOutputDirectory(skipOutput ? x.OutputDirectory : newOutputPath)
.SetNoConsoleLogger(true));

Serilog.Log.Information($"===> Copying to game folder");
CopyToGame(Solution.SonsSdk);
CopyToGame(Solution.SonsLoaderPlugin);
CopyToGame(Solution.SonsGameManager);

if(StartGame)
RunGame();
});

Target Pack => _ => _
.DependsOn(Restore)
.Requires(() => Configuration == Configuration.Release)
Expand Down Expand Up @@ -272,9 +246,9 @@ public static int Main ()
else if (GamePath.DirectoryExists() && ShouldCopyToGame)
{
CopyToGame(Solution.SonsSdk);
//CopyToGame(Solution.RedLoader);
//CopyToGame(Solution.SonsLoaderPlugin);
//CopyToGame(Solution.SonsGameManager);
CopyToGame(Solution.RedLoader);
CopyToGame(Solution.SonsLoaderPlugin);
CopyToGame(Solution.SonsGameManager);
CopyToGame(Solution.GLTF);

var imguiwindowDLL = (Solution.ImGuiWindow.Directory / "bin" / Configuration / "ImGuiWindow.dll");
Expand Down

0 comments on commit c92f55b

Please sign in to comment.