Generate Rider-specific user solution configuration files
Disables "Use Resharper Build" option by default in generated solutions, Resharper can't detect file changes in project using custom build commands.
This commit is contained in:
@@ -641,6 +641,44 @@ namespace Flax.Build.Projects.VisualStudio
|
||||
File.WriteAllText(e.Key, profile.ToString(), Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate Rider-specific configuration files
|
||||
{
|
||||
StringBuilder dotSettingsFileContent = new StringBuilder();
|
||||
string dotSettingsUserFilePath = solution.Path + ".DotSettings.user";
|
||||
|
||||
// Solution settings (user layer)
|
||||
bool useResharperBuild = false; // This needs to be disabled for custom build steps to run properly
|
||||
|
||||
if (File.Exists(dotSettingsUserFilePath))
|
||||
{
|
||||
foreach (var line in File.ReadAllLines(dotSettingsUserFilePath))
|
||||
{
|
||||
if (line.Contains(@"/UseMsbuildSolutionBuilder/@EntryValue"))
|
||||
{
|
||||
if (!useResharperBuild)
|
||||
{
|
||||
dotSettingsFileContent.Append("\t").Append(@"<s:String x:Key=""/Default/Environment/Hierarchy/Build/SolBuilderDuo/UseMsbuildSolutionBuilder/@EntryValue"">No</s:String>");
|
||||
if (line.Contains("</wpf:ResourceDictionary>"))
|
||||
dotSettingsFileContent.Append("</wpf:ResourceDictionary>\n");
|
||||
else
|
||||
dotSettingsFileContent.Append("\n");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
dotSettingsFileContent.Append(line).Append("\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dotSettingsFileContent.Append(@"<wpf:ResourceDictionary xml:space=""preserve"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" xmlns:s=""clr-namespace:System;assembly=mscorlib"" xmlns:ss=""urn:shemas-jetbrains-com:settings-storage-xaml"" xmlns:wpf=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">").Append("\n");
|
||||
if (!useResharperBuild)
|
||||
dotSettingsFileContent.Append("\t").Append(@"<s:String x:Key=""/Default/Environment/Hierarchy/Build/SolBuilderDuo/UseMsbuildSolutionBuilder/@EntryValue"">No</s:String>");
|
||||
dotSettingsFileContent.Append("</wpf:ResourceDictionary>\n");
|
||||
}
|
||||
|
||||
Utilities.WriteFileIfChanged(dotSettingsUserFilePath, dotSettingsFileContent.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user