diff --git a/RecodeItGUI/GUI/Main.cs b/RecodeItGUI/GUI/Main.cs index 218cc9a..85d0c6e 100644 --- a/RecodeItGUI/GUI/Main.cs +++ b/RecodeItGUI/GUI/Main.cs @@ -371,7 +371,7 @@ public partial class ReCodeItForm : Form Remapper.InitializeRemap( CrossCompiler.ActiveProject.RemapModels, CrossCompiler.ActiveProject.OriginalAssemblyPath, - CrossCompiler.ActiveProject.RemappedAssemblyPath); + CrossCompiler.ActiveProject.VisualStudioDependencyPath); ReloadRemapTreeView(CrossCompiler.ActiveProject.RemapModels); return; @@ -906,7 +906,7 @@ public partial class ReCodeItForm : Form var activeProj = CrossCompiler.ActiveProject; CCOriginalAssemblyText.Text = activeProj.OriginalAssemblyPath; - CCProjectDepdendencyText.Text = activeProj.RemappedAssemblyPath; + CCProjectDepdendencyText.Text = activeProj.VisualStudioDependencyPath; CCVisualStudioProjDirText.Text = activeProj.VisualStudioSolutionPath; CCBuildDirText.Text = activeProj.BuildDirectory; @@ -991,7 +991,6 @@ public partial class ReCodeItForm : Form ProjectManager.CreateProject( CCOriginalAssemblyText.Text, - CCProjectDepdendencyText.Text, CCVisualStudioProjDirText.Text, CCProjectDepdendencyText.Text, CCBuildDirText.Text); diff --git a/RecodeItLib/CrossCompiler/ProjectManager.cs b/RecodeItLib/CrossCompiler/ProjectManager.cs index 0fb8202..e21fab7 100644 --- a/RecodeItLib/CrossCompiler/ProjectManager.cs +++ b/RecodeItLib/CrossCompiler/ProjectManager.cs @@ -16,7 +16,6 @@ public static class ProjectManager public static void CreateProject( string OrigAssemblyPath, - string RemappedAssemblyOutputPath, string VSSolutionDirPath, string DependencyPath, string BuildPath) @@ -24,7 +23,7 @@ public static class ProjectManager Logger.Log("-----------------------------------------------", ConsoleColor.Yellow); Logger.Log($"Generating Cross Compiler project", ConsoleColor.Yellow); Logger.Log($"Original Assembly Path {OrigAssemblyPath}", ConsoleColor.Yellow); - Logger.Log($"Remapped Assembly Path: {RemappedAssemblyOutputPath}", ConsoleColor.Yellow); + Logger.Log($"Remapped Assembly Path: {DependencyPath}", ConsoleColor.Yellow); Logger.Log($"Visual Studio Solution Directory: {VSSolutionDirPath}", ConsoleColor.Yellow); Logger.Log($"Build Path: {BuildPath}", ConsoleColor.Yellow); @@ -32,7 +31,6 @@ public static class ProjectManager ActiveProject = new CrossCompilerProjectModel { OriginalAssemblyPath = OrigAssemblyPath, - RemappedAssemblyPath = RemappedAssemblyOutputPath, VisualStudioSolutionPath = VSSolutionDirPath, VisualStudioDependencyPath = DependencyPath, BuildDirectory = BuildPath, @@ -67,7 +65,7 @@ public static class ProjectManager public static void MoveOriginalReference() { var outPath = Path.Combine( - ActiveProject.VisualStudioClonedSolutionDirectory, + ActiveProject.VisualStudioClonedDependencyPath, ActiveProject.OriginalAssemblyDllName); Logger.Log(ActiveProject.VisualStudioClonedDependencyPath, ConsoleColor.Red); diff --git a/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs b/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs index 00869ed..7d971e0 100644 --- a/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs +++ b/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs @@ -41,16 +41,16 @@ public class ReCodeItCrossCompiler Remapper.InitializeRemap( ActiveProject.RemapModels, ActiveProject.OriginalAssemblyPath, - ActiveProject.RemappedAssemblyPath, + ActiveProject.VisualStudioDependencyPath, true); Logger.Log("-----------------------------------------------", ConsoleColor.Green); Logger.Log($"Generated Cross Mapped DLL for project {ActiveProject.SolutionName}", ConsoleColor.Green); - Logger.Log($"Built to: {Path.Combine(ActiveProject.RemappedAssemblyPath, ActiveProject.OriginalAssemblyDllName)}", ConsoleColor.Green); + Logger.Log($"Built to: {Path.Combine(ActiveProject.VisualStudioDependencyPath, ActiveProject.OriginalAssemblyDllName)}", ConsoleColor.Green); Logger.Log($"Changed {ActiveProject.ChangedTypes.Count} types", ConsoleColor.Green); Logger.Log($"Original assembly path: {ActiveProject.OriginalAssemblyPath}", ConsoleColor.Green); Logger.Log($"Original assembly hash: {ActiveProject.OriginalAssemblyHash}", ConsoleColor.Green); - Logger.Log($"Original patched assembly path: {ActiveProject.RemappedAssemblyPath}", ConsoleColor.Green); + Logger.Log($"Original patched assembly path: {ActiveProject.VisualStudioDependencyPath}", ConsoleColor.Green); //Logger.Log($"Original patched assembly hash: {ActiveProject.RemappedAssemblyHash}", ConsoleColor.Green); Logger.Log("-----------------------------------------------", ConsoleColor.Green); } diff --git a/RecodeItLib/Models/CrossCompilerProjectModel.cs b/RecodeItLib/Models/CrossCompilerProjectModel.cs index 3c7beb0..b48e440 100644 --- a/RecodeItLib/Models/CrossCompilerProjectModel.cs +++ b/RecodeItLib/Models/CrossCompilerProjectModel.cs @@ -13,13 +13,6 @@ public class CrossCompilerProjectModel /// public string OriginalAssemblyPath { get; set; } - /// - /// Remapped output path - /// - /// (Required on creation) - /// - public string RemappedAssemblyPath { get; set; } - /// /// The path to the working directory vs project /// @@ -28,7 +21,8 @@ public class CrossCompilerProjectModel public string VisualStudioSolutionPath { get; set; } /// - /// The path to the working directory vs project + /// The path to the dependency folder for the active solution. Also where the remapped dll is + /// built to and replaced /// /// (Required on creation) /// @@ -63,7 +57,16 @@ public class CrossCompilerProjectModel /// /// The path to the cloned solutions dependency folder /// - public string VisualStudioClonedDependencyPath => Path.GetDirectoryName(VisualStudioDependencyPath)!; + public string VisualStudioClonedDependencyPath + { + get + { + // Take just the folder name + var folderName = VisualStudioDependencyPath.Split('\\').Last(); + + return Path.Combine(VisualStudioClonedSolutionDirectory, folderName); + } + } public string ProjectDllName => SolutionName + ".dll"; diff --git a/RecodeItLib/Utils/Logger.cs b/RecodeItLib/Utils/Logger.cs index 4bc87af..58b64b8 100644 --- a/RecodeItLib/Utils/Logger.cs +++ b/RecodeItLib/Utils/Logger.cs @@ -50,7 +50,7 @@ public static class Logger private static void WriteToDisk(object message) { - if (true) { return; } + if (DataProvider.IsCli) { return; } try {