Bug fixes
This commit is contained in:
parent
e43ed25b84
commit
9a2f83abf9
@ -35,6 +35,9 @@ public class BuildCommand : ICommand
|
|||||||
DataProvider.LoadAppSettings();
|
DataProvider.LoadAppSettings();
|
||||||
|
|
||||||
ProjectManager.LoadProject(RegistryHelper.GetRegistryValue<string>("LastLoadedProject"), true);
|
ProjectManager.LoadProject(RegistryHelper.GetRegistryValue<string>("LastLoadedProject"), true);
|
||||||
|
|
||||||
|
if (!Validate(console)) { return default; }
|
||||||
|
|
||||||
CrossCompiler.StartCrossCompile();
|
CrossCompiler.StartCrossCompile();
|
||||||
|
|
||||||
DataProvider.SaveAppSettings();
|
DataProvider.SaveAppSettings();
|
||||||
@ -43,4 +46,27 @@ public class BuildCommand : ICommand
|
|||||||
|
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool Validate(IConsole console)
|
||||||
|
{
|
||||||
|
if (ProjectManager.ActiveProject == null)
|
||||||
|
{
|
||||||
|
console.Output.WriteLine("No project loaded, go create or load a project in the gui first");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ProjectManager.ActiveProject.RemapModels.Count == 0)
|
||||||
|
{
|
||||||
|
console.Output.WriteLine("No Remaps present, go to the gui and create some first");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ProjectManager.ActiveProject.ChangedTypes.Count == 0)
|
||||||
|
{
|
||||||
|
console.Output.WriteLine("There are no changed types, have you created and used a remapped reference? \nRun the command `buildRef` to generate a project reference");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
54
ReCodeItCLI/Commands/BuildRef.cs
Normal file
54
ReCodeItCLI/Commands/BuildRef.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
using CliFx;
|
||||||
|
using CliFx.Attributes;
|
||||||
|
using CliFx.Infrastructure;
|
||||||
|
using ReCodeIt.CrossCompiler;
|
||||||
|
using ReCodeIt.Utils;
|
||||||
|
using ReCodeItLib.Utils;
|
||||||
|
|
||||||
|
namespace ReCodeIt.Commands;
|
||||||
|
|
||||||
|
[Command("BuildRef", Description = "Builds or rebuilds a new reference DLL for your project")]
|
||||||
|
public class BuildRef : ICommand
|
||||||
|
{
|
||||||
|
private ReCodeItCrossCompiler CrossCompiler { get; set; }
|
||||||
|
|
||||||
|
public ValueTask ExecuteAsync(IConsole console)
|
||||||
|
{
|
||||||
|
console.Output.WriteLine(RegistryHelper.GetRegistryValue<string>("LastLoadedProject"));
|
||||||
|
|
||||||
|
if (RegistryHelper.GetRegistryValue<string>("LastLoadedProject") != null)
|
||||||
|
{
|
||||||
|
CrossCompiler = new();
|
||||||
|
|
||||||
|
DataProvider.LoadAppSettings();
|
||||||
|
|
||||||
|
ProjectManager.LoadProject(RegistryHelper.GetRegistryValue<string>("LastLoadedProject"), true);
|
||||||
|
|
||||||
|
if (!Validate(console)) { return default; }
|
||||||
|
|
||||||
|
CrossCompiler.StartRemap();
|
||||||
|
|
||||||
|
DataProvider.SaveAppSettings();
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool Validate(IConsole console)
|
||||||
|
{
|
||||||
|
if (ProjectManager.ActiveProject == null)
|
||||||
|
{
|
||||||
|
console.Output.WriteLine("No project loaded, please load a project first");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ProjectManager.ActiveProject.RemapModels.Count == 0)
|
||||||
|
{
|
||||||
|
console.Output.WriteLine("No Remaps present, go to the gui and create some first");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -306,7 +306,10 @@ public partial class ReCodeItForm : Form
|
|||||||
DataProvider.SaveMapping();
|
DataProvider.SaveMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(newRemap, this));
|
var node = GUIHelpers.GenerateTreeNode(newRemap, this);
|
||||||
|
|
||||||
|
RemapTreeView.Nodes.Add(node);
|
||||||
|
CCMappingTreeView.Nodes.Add(node);
|
||||||
ResetAllRemapFields();
|
ResetAllRemapFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,6 +435,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!MethodIncludeBox.Items.Contains(IncludeMethodTextBox.Text))
|
if (!MethodIncludeBox.Items.Contains(IncludeMethodTextBox.Text))
|
||||||
{
|
{
|
||||||
MethodIncludeBox.Items.Add(IncludeMethodTextBox.Text);
|
MethodIncludeBox.Items.Add(IncludeMethodTextBox.Text);
|
||||||
|
IncludeMethodTextBox.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,6 +452,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!MethodExcludeBox.Items.Contains(ExcludeMethodTextBox.Text))
|
if (!MethodExcludeBox.Items.Contains(ExcludeMethodTextBox.Text))
|
||||||
{
|
{
|
||||||
MethodExcludeBox.Items.Add(ExcludeMethodTextBox.Text);
|
MethodExcludeBox.Items.Add(ExcludeMethodTextBox.Text);
|
||||||
|
ExcludeMethodTextBox.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,6 +469,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!FieldIncludeBox.Items.Contains(FieldsIncludeTextInput.Text))
|
if (!FieldIncludeBox.Items.Contains(FieldsIncludeTextInput.Text))
|
||||||
{
|
{
|
||||||
FieldIncludeBox.Items.Add(FieldsIncludeTextInput.Text);
|
FieldIncludeBox.Items.Add(FieldsIncludeTextInput.Text);
|
||||||
|
FieldsIncludeTextInput.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,6 +486,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!FieldExcludeBox.Items.Contains(FieldsExcludeTextInput.Text))
|
if (!FieldExcludeBox.Items.Contains(FieldsExcludeTextInput.Text))
|
||||||
{
|
{
|
||||||
FieldExcludeBox.Items.Add(FieldsExcludeTextInput.Text);
|
FieldExcludeBox.Items.Add(FieldsExcludeTextInput.Text);
|
||||||
|
FieldsExcludeTextInput.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,6 +503,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!PropertiesIncludeBox.Items.Contains(PropertiesIncludeTextField.Text))
|
if (!PropertiesIncludeBox.Items.Contains(PropertiesIncludeTextField.Text))
|
||||||
{
|
{
|
||||||
PropertiesIncludeBox.Items.Add(PropertiesIncludeTextField.Text);
|
PropertiesIncludeBox.Items.Add(PropertiesIncludeTextField.Text);
|
||||||
|
PropertiesIncludeTextField.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,6 +520,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!PropertiesExcludeBox.Items.Contains(PropertiesExcludeTextField.Text))
|
if (!PropertiesExcludeBox.Items.Contains(PropertiesExcludeTextField.Text))
|
||||||
{
|
{
|
||||||
PropertiesExcludeBox.Items.Add(PropertiesExcludeTextField.Text);
|
PropertiesExcludeBox.Items.Add(PropertiesExcludeTextField.Text);
|
||||||
|
PropertiesExcludeTextField.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,6 +537,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!NestedTypesIncludeBox.Items.Contains(NestedTypesIncludeTextField.Text))
|
if (!NestedTypesIncludeBox.Items.Contains(NestedTypesIncludeTextField.Text))
|
||||||
{
|
{
|
||||||
NestedTypesIncludeBox.Items.Add(NestedTypesIncludeTextField.Text);
|
NestedTypesIncludeBox.Items.Add(NestedTypesIncludeTextField.Text);
|
||||||
|
NestedTypesIncludeTextField.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,6 +554,7 @@ public partial class ReCodeItForm : Form
|
|||||||
if (!NestedTypesExcludeBox.Items.Contains(NestedTypesExcludeTextField.Text))
|
if (!NestedTypesExcludeBox.Items.Contains(NestedTypesExcludeTextField.Text))
|
||||||
{
|
{
|
||||||
NestedTypesExcludeBox.Items.Add(NestedTypesExcludeTextField.Text);
|
NestedTypesExcludeBox.Items.Add(NestedTypesExcludeTextField.Text);
|
||||||
|
NestedTypesExcludeTextField.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,20 +296,10 @@ public class ReCodeItRemapper
|
|||||||
Logger.Log($"Remap took {Stopwatch.Elapsed.TotalSeconds:F1} seconds", ConsoleColor.Green);
|
Logger.Log($"Remap took {Stopwatch.Elapsed.TotalSeconds:F1} seconds", ConsoleColor.Green);
|
||||||
Logger.Log("-----------------------------------------------", ConsoleColor.Green);
|
Logger.Log("-----------------------------------------------", ConsoleColor.Green);
|
||||||
|
|
||||||
Reset();
|
DataProvider.ScoringModels = [];
|
||||||
|
Stopwatch.Reset();
|
||||||
|
|
||||||
IsRunning = false;
|
IsRunning = false;
|
||||||
OnComplete?.Invoke();
|
OnComplete?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Reset()
|
|
||||||
{
|
|
||||||
Logger.Log("-----------------------------------------------", ConsoleColor.Yellow);
|
|
||||||
Logger.Log("Reloading assembly definitions", ConsoleColor.Yellow);
|
|
||||||
Logger.Log("-----------------------------------------------", ConsoleColor.Yellow);
|
|
||||||
|
|
||||||
DataProvider.LoadAssemblyDefinition(Settings.AssemblyPath);
|
|
||||||
DataProvider.ScoringModels = [];
|
|
||||||
|
|
||||||
Stopwatch.Reset();
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -173,6 +173,8 @@ public static class DataProvider
|
|||||||
|
|
||||||
DefaultAssemblyResolver resolver = new();
|
DefaultAssemblyResolver resolver = new();
|
||||||
|
|
||||||
|
Console.WriteLine(path);
|
||||||
|
|
||||||
resolver.AddSearchDirectory(Path.GetDirectoryName(path)); // Replace with the correct path : (6/14) I have no idea what I met by that
|
resolver.AddSearchDirectory(Path.GetDirectoryName(path)); // Replace with the correct path : (6/14) I have no idea what I met by that
|
||||||
ReaderParameters parameters = new() { AssemblyResolver = resolver };
|
ReaderParameters parameters = new() { AssemblyResolver = resolver };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user