Merge remote-tracking branch 'origin/master' into 1.7
This commit is contained in:
@@ -251,19 +251,13 @@ void Log::Logger::Write(LogType type, const StringView& msg)
|
|||||||
OnError(type, msg);
|
OnError(type, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if need to show message box with that log message
|
// Ensure the error gets written to the disk
|
||||||
if (type == LogType::Fatal)
|
if (type == LogType::Fatal || type == LogType::Error)
|
||||||
{
|
|
||||||
Flush();
|
Flush();
|
||||||
|
|
||||||
// Process message further
|
// Check if need to show message box with that log message
|
||||||
if (type == LogType::Fatal)
|
if (type == LogType::Fatal)
|
||||||
Platform::Fatal(msg);
|
Platform::Fatal(msg);
|
||||||
else if (type == LogType::Error)
|
|
||||||
Platform::Error(msg);
|
|
||||||
else
|
|
||||||
Platform::Info(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Char* ToString(LogType e)
|
const Char* ToString(LogType e)
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define CLR_EXCEPTION 0xE0434352
|
||||||
|
#define VCPP_EXCEPTION 0xE06D7363
|
||||||
|
|
||||||
const Char* WindowsPlatform::ApplicationWindowClass = TEXT("FlaxWindow");
|
const Char* WindowsPlatform::ApplicationWindowClass = TEXT("FlaxWindow");
|
||||||
void* WindowsPlatform::Instance = nullptr;
|
void* WindowsPlatform::Instance = nullptr;
|
||||||
|
|
||||||
@@ -272,6 +275,12 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
LONG CALLBACK SehExceptionHandler(EXCEPTION_POINTERS* ep)
|
LONG CALLBACK SehExceptionHandler(EXCEPTION_POINTERS* ep)
|
||||||
{
|
{
|
||||||
|
if (ep->ExceptionRecord->ExceptionCode == CLR_EXCEPTION)
|
||||||
|
{
|
||||||
|
// Pass CLR exceptions back to runtime
|
||||||
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
}
|
||||||
|
|
||||||
// Skip if engine already crashed
|
// Skip if engine already crashed
|
||||||
if (Globals::FatalErrorOccurred)
|
if (Globals::FatalErrorOccurred)
|
||||||
return EXCEPTION_CONTINUE_SEARCH;
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
|||||||
@@ -135,8 +135,13 @@ namespace FlaxEngine
|
|||||||
{
|
{
|
||||||
if (e.ExceptionObject is Exception exception)
|
if (e.ExceptionObject is Exception exception)
|
||||||
{
|
{
|
||||||
Debug.LogError("Unhandled Exception: " + exception.Message);
|
if (e.IsTerminating && !System.Diagnostics.Debugger.IsAttached)
|
||||||
Debug.LogException(exception);
|
Platform.Fatal($"Unhandled Exception: {exception}");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"Unhandled Exception: {exception.Message}");
|
||||||
|
Debug.LogException(exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,6 +299,8 @@ namespace Flax.Build.Bindings
|
|||||||
// Object reference property
|
// Object reference property
|
||||||
if (typeInfo.IsObjectRef)
|
if (typeInfo.IsObjectRef)
|
||||||
return GenerateCSharpNativeToManaged(buildData, typeInfo.GenericArgs[0], caller);
|
return GenerateCSharpNativeToManaged(buildData, typeInfo.GenericArgs[0], caller);
|
||||||
|
if (typeInfo.Type == "SoftTypeReference" || typeInfo.Type == "SoftObjectReference")
|
||||||
|
return typeInfo.Type;
|
||||||
|
|
||||||
// Array or Span or DataContainer
|
// Array or Span or DataContainer
|
||||||
#if USE_NETCORE
|
#if USE_NETCORE
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ namespace Flax.Build
|
|||||||
using (new ProfileEventScope("GenerateProjects"))
|
using (new ProfileEventScope("GenerateProjects"))
|
||||||
{
|
{
|
||||||
// Pick the project format
|
// Pick the project format
|
||||||
List<ProjectFormat> projectFormats = new List<ProjectFormat>();
|
HashSet<ProjectFormat> projectFormats = new HashSet<ProjectFormat>();
|
||||||
|
|
||||||
if (Configuration.ProjectFormatVS2022)
|
if (Configuration.ProjectFormatVS2022)
|
||||||
projectFormats.Add(ProjectFormat.VisualStudio2022);
|
projectFormats.Add(ProjectFormat.VisualStudio2022);
|
||||||
@@ -191,12 +191,17 @@ namespace Flax.Build
|
|||||||
projectFormats.Add(ProjectFormat.VisualStudio2015);
|
projectFormats.Add(ProjectFormat.VisualStudio2015);
|
||||||
if (Configuration.ProjectFormatVSCode)
|
if (Configuration.ProjectFormatVSCode)
|
||||||
projectFormats.Add(ProjectFormat.VisualStudioCode);
|
projectFormats.Add(ProjectFormat.VisualStudioCode);
|
||||||
|
if (Configuration.ProjectFormatRider)
|
||||||
|
projectFormats.Add(ProjectFormat.VisualStudio2022);
|
||||||
if (!string.IsNullOrEmpty(Configuration.ProjectFormatCustom))
|
if (!string.IsNullOrEmpty(Configuration.ProjectFormatCustom))
|
||||||
projectFormats.Add(ProjectFormat.Custom);
|
projectFormats.Add(ProjectFormat.Custom);
|
||||||
|
|
||||||
if (projectFormats.Count == 0)
|
if (projectFormats.Count == 0)
|
||||||
projectFormats.Add(Platform.BuildPlatform.DefaultProjectFormat);
|
projectFormats.Add(Platform.BuildPlatform.DefaultProjectFormat);
|
||||||
|
|
||||||
|
// Always generate VS solution files for project (needed for C# Intellisense support)
|
||||||
|
projectFormats.Add(ProjectFormat.VisualStudio2022);
|
||||||
|
|
||||||
foreach (ProjectFormat projectFormat in projectFormats)
|
foreach (ProjectFormat projectFormat in projectFormats)
|
||||||
GenerateProject(projectFormat);
|
GenerateProject(projectFormat);
|
||||||
}
|
}
|
||||||
@@ -223,6 +228,8 @@ namespace Flax.Build
|
|||||||
var projectToModulesBuildOptions = new Dictionary<Project, Dictionary<Module, BuildOptions>>();
|
var projectToModulesBuildOptions = new Dictionary<Project, Dictionary<Module, BuildOptions>>();
|
||||||
Project mainSolutionProject = null;
|
Project mainSolutionProject = null;
|
||||||
ProjectGenerator nativeProjectGenerator = ProjectGenerator.Create(projectFormat, TargetType.NativeCpp);
|
ProjectGenerator nativeProjectGenerator = ProjectGenerator.Create(projectFormat, TargetType.NativeCpp);
|
||||||
|
var solutionName = rootProject.Name;
|
||||||
|
var solutionPath = Path.Combine(workspaceRoot, solutionName + '.' + nativeProjectGenerator.SolutionFileExtension);
|
||||||
|
|
||||||
// Group targets by project name and sort groups based on the project (ensures that referenced plugin source projects are generated firstly before main source projects)
|
// Group targets by project name and sort groups based on the project (ensures that referenced plugin source projects are generated firstly before main source projects)
|
||||||
var targetGroups = new List<ProjectTargetsGroup>();
|
var targetGroups = new List<ProjectTargetsGroup>();
|
||||||
@@ -544,7 +551,7 @@ namespace Flax.Build
|
|||||||
foreach (var project in projects)
|
foreach (var project in projects)
|
||||||
{
|
{
|
||||||
Log.Verbose(project.Name + " -> " + project.Path);
|
Log.Verbose(project.Name + " -> " + project.Path);
|
||||||
project.Generate();
|
project.Generate(solutionPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -623,7 +630,7 @@ namespace Flax.Build
|
|||||||
using (new ProfileEventScope("GenerateProject"))
|
using (new ProfileEventScope("GenerateProject"))
|
||||||
{
|
{
|
||||||
Log.Verbose("Project " + rulesProjectName + " -> " + project.Path);
|
Log.Verbose("Project " + rulesProjectName + " -> " + project.Path);
|
||||||
dotNetProjectGenerator.GenerateProject(project);
|
dotNetProjectGenerator.GenerateProject(project, solutionPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
projects.Add(project);
|
projects.Add(project);
|
||||||
@@ -636,9 +643,9 @@ namespace Flax.Build
|
|||||||
using (new ProfileEventScope("CreateSolution"))
|
using (new ProfileEventScope("CreateSolution"))
|
||||||
{
|
{
|
||||||
solution = nativeProjectGenerator.CreateSolution();
|
solution = nativeProjectGenerator.CreateSolution();
|
||||||
solution.Name = rootProject.Name;
|
solution.Name = solutionName;
|
||||||
solution.WorkspaceRootPath = workspaceRoot;
|
solution.WorkspaceRootPath = workspaceRoot;
|
||||||
solution.Path = Path.Combine(workspaceRoot, solution.Name + '.' + nativeProjectGenerator.SolutionFileExtension);
|
solution.Path = solutionPath;
|
||||||
solution.Projects = projects.ToArray();
|
solution.Projects = projects.ToArray();
|
||||||
solution.MainProject = mainSolutionProject;
|
solution.MainProject = mainSolutionProject;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,12 @@ namespace Flax.Build
|
|||||||
[CommandLine("vscode", "Generates Visual Studio Code project format files. Valid only with -genproject option.")]
|
[CommandLine("vscode", "Generates Visual Studio Code project format files. Valid only with -genproject option.")]
|
||||||
public static bool ProjectFormatVSCode = false;
|
public static bool ProjectFormatVSCode = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generates Visual Studio 2022 project format files for Rider. Valid only with -genproject option.
|
||||||
|
/// </summary>
|
||||||
|
[CommandLine("rider", "Generates Visual Studio 2022 project format files for Rider. Valid only with -genproject option.")]
|
||||||
|
public static bool ProjectFormatRider = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates code project files for a custom project format type. Valid only with -genproject option.
|
/// Generates code project files for a custom project format type. Valid only with -genproject option.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Flax.Build.Platforms
|
|||||||
Compiler = Configuration.Compiler;
|
Compiler = Configuration.Compiler;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int ver = 15; ver >= 6; ver--)
|
for (int ver = 17; ver >= 6; ver--)
|
||||||
{
|
{
|
||||||
var compiler = "clang++-" + ver;
|
var compiler = "clang++-" + ver;
|
||||||
if (Which(compiler) != null)
|
if (Which(compiler) != null)
|
||||||
|
|||||||
@@ -68,8 +68,11 @@ namespace Flax.Build.Platforms
|
|||||||
string path = proc.StandardOutput.ReadLine();
|
string path = proc.StandardOutput.ReadLine();
|
||||||
Log.Verbose(string.Format("which {0} exit code: {1}, result: {2}", name, proc.ExitCode, path));
|
Log.Verbose(string.Format("which {0} exit code: {1}, result: {2}", name, proc.ExitCode, path));
|
||||||
|
|
||||||
if (proc.ExitCode == 0 && string.IsNullOrEmpty(proc.StandardError.ReadToEnd()))
|
if (proc.ExitCode == 0)
|
||||||
{
|
{
|
||||||
|
string err = proc.StandardError.ReadToEnd();
|
||||||
|
if (!string.IsNullOrEmpty(err))
|
||||||
|
Log.Verbose(string.Format("which stderr: {0}", err));
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -253,9 +253,9 @@ namespace Flax.Build.Projects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates the project.
|
/// Generates the project.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Generate()
|
public virtual void Generate(string solutionPath)
|
||||||
{
|
{
|
||||||
Generator.GenerateProject(this);
|
Generator.GenerateProject(this, solutionPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Flax.Build.Projects
|
|||||||
/// Generates the project.
|
/// Generates the project.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="project">The project.</param>
|
/// <param name="project">The project.</param>
|
||||||
public abstract void GenerateProject(Project project);
|
public abstract void GenerateProject(Project project, string solutionPath);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates the solution.
|
/// Generates the solution.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
public override TargetType? Type => TargetType.DotNet;
|
public override TargetType? Type => TargetType.DotNet;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void GenerateProject(Project project)
|
public override void GenerateProject(Project project, string solutionPath)
|
||||||
{
|
{
|
||||||
var csProjectFileContent = new StringBuilder();
|
var csProjectFileContent = new StringBuilder();
|
||||||
|
|
||||||
@@ -49,6 +49,11 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
if (vsProject.CSharp.UseFlaxVS && VisualStudioInstance.HasFlaxVS)
|
if (vsProject.CSharp.UseFlaxVS && VisualStudioInstance.HasFlaxVS)
|
||||||
projectTypes = ProjectTypeGuids.ToOption(ProjectTypeGuids.FlaxVS) + ';' + projectTypes;
|
projectTypes = ProjectTypeGuids.ToOption(ProjectTypeGuids.FlaxVS) + ';' + projectTypes;
|
||||||
|
|
||||||
|
// Try to reuse the existing project guid from solution file
|
||||||
|
vsProject.ProjectGuid = GetProjectGuid(solutionPath, vsProject.Name);
|
||||||
|
if (vsProject.ProjectGuid == Guid.Empty)
|
||||||
|
vsProject.ProjectGuid = Guid.NewGuid();
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
|
|
||||||
csProjectFileContent.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
csProjectFileContent.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
public override TargetType? Type => TargetType.DotNetCore;
|
public override TargetType? Type => TargetType.DotNetCore;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void GenerateProject(Project project)
|
public override void GenerateProject(Project project, string solutionPath)
|
||||||
{
|
{
|
||||||
var csProjectFileContent = new StringBuilder();
|
var csProjectFileContent = new StringBuilder();
|
||||||
|
|
||||||
@@ -53,6 +53,11 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try to reuse the existing project guid from solution file
|
||||||
|
vsProject.ProjectGuid = GetProjectGuid(solutionPath, vsProject.Name);
|
||||||
|
if (vsProject.ProjectGuid == Guid.Empty)
|
||||||
|
vsProject.ProjectGuid = Guid.NewGuid();
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
csProjectFileContent.AppendLine("<Project Sdk=\"Microsoft.NET.Sdk\">");
|
csProjectFileContent.AppendLine("<Project Sdk=\"Microsoft.NET.Sdk\">");
|
||||||
csProjectFileContent.AppendLine("");
|
csProjectFileContent.AppendLine("");
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void GenerateProject(Project project)
|
public override void GenerateProject(Project project, string solutionPath)
|
||||||
{
|
{
|
||||||
var vcProjectFileContent = new StringBuilder();
|
var vcProjectFileContent = new StringBuilder();
|
||||||
var vcFiltersFileContent = new StringBuilder();
|
var vcFiltersFileContent = new StringBuilder();
|
||||||
@@ -67,6 +67,13 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
var projectDirectory = Path.GetDirectoryName(project.Path);
|
var projectDirectory = Path.GetDirectoryName(project.Path);
|
||||||
var filtersDirectory = project.SourceFolderPath;
|
var filtersDirectory = project.SourceFolderPath;
|
||||||
|
|
||||||
|
// Try to reuse the existing project guid from existing files
|
||||||
|
vsProject.ProjectGuid = GetProjectGuid(vsProject.Path, vsProject.Name);
|
||||||
|
if (vsProject.ProjectGuid == Guid.Empty)
|
||||||
|
vsProject.ProjectGuid = GetProjectGuid(solutionPath, vsProject.Name);
|
||||||
|
if (vsProject.ProjectGuid == Guid.Empty)
|
||||||
|
vsProject.ProjectGuid = Guid.NewGuid();
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
vcProjectFileContent.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
vcProjectFileContent.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||||
vcProjectFileContent.AppendLine(string.Format("<Project DefaultTargets=\"Build\" ToolsVersion=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">", projectFileToolVersion));
|
vcProjectFileContent.AppendLine(string.Format("<Project DefaultTargets=\"Build\" ToolsVersion=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">", projectFileToolVersion));
|
||||||
|
|||||||
@@ -36,20 +36,5 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override string Path
|
|
||||||
{
|
|
||||||
get => base.Path;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
base.Path = value;
|
|
||||||
|
|
||||||
if (ProjectGuid == Guid.Empty)
|
|
||||||
{
|
|
||||||
ProjectGuid = VisualStudioProjectGenerator.GetProjectGuid(Path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
public override Guid ProjectTypeGuid => ProjectTypeGuids.Android;
|
public override Guid ProjectTypeGuid => ProjectTypeGuids.Android;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Generate()
|
public override void Generate(string solutionPath)
|
||||||
{
|
{
|
||||||
var gen = (VisualStudioProjectGenerator)Generator;
|
var gen = (VisualStudioProjectGenerator)Generator;
|
||||||
var projectFileToolVersion = gen.ProjectFileToolVersion;
|
var projectFileToolVersion = gen.ProjectFileToolVersion;
|
||||||
@@ -141,9 +141,10 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="path">The path.</param>
|
/// <param name="path">The path.</param>
|
||||||
/// <returns>The project ID.</returns>
|
/// <returns>The project ID.</returns>
|
||||||
public static Guid GetProjectGuid(string path)
|
public static Guid GetProjectGuid(string path, string projectName)
|
||||||
{
|
{
|
||||||
if (File.Exists(path))
|
// Look up for the guid in VC++-project file
|
||||||
|
if (File.Exists(path) && Path.GetExtension(path).Equals(".vcxproj", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -161,8 +162,25 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
// Hide errors
|
// Hide errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (File.Exists(path) && Path.GetExtension(path).Equals(".sln", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Regex projectRegex = new Regex(@"Project\(.*\) = \""(\S+)\"", \""(\S+)\"", \""{(\S+)}\""");
|
||||||
|
MatchCollection matches = projectRegex.Matches(File.ReadAllText(path));
|
||||||
|
for (int i = 0; i < matches.Count; i++)
|
||||||
|
{
|
||||||
|
if (matches[i].Groups[1].Value == projectName)
|
||||||
|
return Guid.ParseExact(matches[i].Groups[3].Value, "D");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Hide errors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Guid.NewGuid();
|
return Guid.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -250,7 +268,7 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to extract info from the existing solution file to make random IDs stable
|
// Try to extract solution folder info from the existing solution file to make random IDs stable
|
||||||
var solutionId = Guid.NewGuid();
|
var solutionId = Guid.NewGuid();
|
||||||
var folderIds = new Dictionary<string, Guid>();
|
var folderIds = new Dictionary<string, Guid>();
|
||||||
if (File.Exists(solution.Path))
|
if (File.Exists(solution.Path))
|
||||||
@@ -266,16 +284,12 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
solutionId = Guid.ParseExact(value.Substring(15), "B");
|
solutionId = Guid.ParseExact(value.Substring(15), "B");
|
||||||
}
|
}
|
||||||
|
|
||||||
var folderIdsMatch = Regex.Match(contents, "Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"(.*?)\", \"(.*?)\", \"{(.*?)}\"");
|
var folderIdMatches = new Regex("Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"(.*?)\", \"(.*?)\", \"{(.*?)}\"").Matches(contents);
|
||||||
if (folderIdsMatch.Success)
|
foreach (Match match in folderIdMatches)
|
||||||
{
|
{
|
||||||
foreach (Capture capture in folderIdsMatch.Captures)
|
var folder = match.Groups[1].Value;
|
||||||
{
|
var folderId = Guid.ParseExact(match.Groups[3].Value, "D");
|
||||||
var value = capture.Value.Substring("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"".Length);
|
folderIds[folder] = folderId;
|
||||||
var folder = value.Substring(0, value.IndexOf('\"'));
|
|
||||||
var folderId = Guid.ParseExact(value.Substring(folder.Length * 2 + "\", \"".Length + "\", \"".Length, 38), "B");
|
|
||||||
folderIds["Source\\" + folder] = folderId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Flax.Build.Projects.VisualStudioCode
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void GenerateProject(Project project)
|
public override void GenerateProject(Project project, string solutionPath)
|
||||||
{
|
{
|
||||||
// Not used, solution contains all projects definitions
|
// Not used, solution contains all projects definitions
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Flax.Build.Projects
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void GenerateProject(Project project)
|
public override void GenerateProject(Project project, string solutionPath)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user