From be72a9f4a292018288690abe35fbaa842ee6865d Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sun, 13 Apr 2025 01:01:01 +0300 Subject: [PATCH 1/2] Invalidate build rules assembly when files are added, moved or renamed --- Source/Tools/Flax.Build/Build/Assembler.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Tools/Flax.Build/Build/Assembler.cs b/Source/Tools/Flax.Build/Build/Assembler.cs index 1e71bef57..8f81c9e41 100644 --- a/Source/Tools/Flax.Build/Build/Assembler.cs +++ b/Source/Tools/Flax.Build/Build/Assembler.cs @@ -106,7 +106,10 @@ namespace Flax.Build if (File.Exists(cacheAssemblyPath) && File.Exists(cacheInfoPath)) { var lines = File.ReadAllLines(cacheInfoPath); - if (lines.Length == 2 && long.TryParse(lines[0], out var cacheTimeTicks) && string.Equals(buildInfo, lines[1], StringComparison.Ordinal)) + if (lines.Length == 3 && + long.TryParse(lines[0], out var cacheTimeTicks) && + string.Equals(buildInfo, lines[1], StringComparison.Ordinal) && + !lines[2].Split(';').Except(SourceFiles).Any()) { // Cached time and var cacheTime = DateTime.FromBinary(cacheTimeTicks); @@ -199,7 +202,8 @@ namespace Flax.Build File.WriteAllLines(cacheInfoPath, new[] { recentWriteTime.ToBinary().ToString(), - buildInfo + buildInfo, + string.Join(';', SourceFiles) }); } From 711a75ce3b9d1f2504ef83c562f409f44eab3d91 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sun, 13 Apr 2025 01:03:17 +0300 Subject: [PATCH 2/2] Fix BuildScript file structure with engine files in different drive --- .../Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs index 845753e2f..df1424e95 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs @@ -174,6 +174,7 @@ namespace Flax.Build.Projects.VisualStudio } } + var rootPath = project.WorkspaceRootPath.Replace('/', '\\') + '\\'; foreach (var file in files) { string fileType; @@ -185,7 +186,7 @@ namespace Flax.Build.Projects.VisualStudio var filePath = file.Replace('/', '\\'); // Normalize path var projectPath = Utilities.MakePathRelativeTo(filePath, projectDirectory); string linkPath = null; - if (projectPath.StartsWith(@"..\..\..\")) + if (!filePath.StartsWith(rootPath)) { // Create folder structure for project external files var sourceIndex = filePath.LastIndexOf(@"\Source\");