Some clean up
This commit is contained in:
parent
04ed493454
commit
df568681f5
2
RecodeItGUI/GUI/Main.Designer.cs
generated
2
RecodeItGUI/GUI/Main.Designer.cs
generated
@ -1536,7 +1536,7 @@ partial class ReCodeItForm
|
||||
//
|
||||
CCVisualStudioProjDirText.Location = new Point(6, 105);
|
||||
CCVisualStudioProjDirText.Name = "CCVisualStudioProjDirText";
|
||||
CCVisualStudioProjDirText.PlaceholderText = "Visual studio solution directory";
|
||||
CCVisualStudioProjDirText.PlaceholderText = "Visual studio solution";
|
||||
CCVisualStudioProjDirText.ReadOnly = true;
|
||||
CCVisualStudioProjDirText.Size = new Size(501, 31);
|
||||
CCVisualStudioProjDirText.TabIndex = 27;
|
||||
|
@ -794,7 +794,8 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
private void CCVisualStudioProjDirButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var result = GUIHelpers.OpenFolderDialog("Select your visual studio project directory");
|
||||
var result = GUIHelpers.OpenFileDialog("Select a Visual Studio solution file",
|
||||
"Solution Files (*.sln)|*.sln|All Files (*.*)|*.*");
|
||||
|
||||
if (result != string.Empty)
|
||||
{
|
||||
|
@ -103,38 +103,18 @@ public class ReCodeItCrossCompiler
|
||||
/// </summary>
|
||||
private void StartBuild()
|
||||
{
|
||||
var path = Path.Combine(
|
||||
DataProvider.ReCodeItProjectsPath,
|
||||
ActiveProject.SolutionName);
|
||||
|
||||
var csProjFile = Directory.GetFiles(path, "*.csproj", SearchOption.AllDirectories)
|
||||
.ToList()
|
||||
.FirstOrDefault();
|
||||
|
||||
if (csProjFile == null || csProjFile == string.Empty)
|
||||
{
|
||||
Logger.Log("No project files found in the solution directory or sub directories", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
var dirName = Path.GetDirectoryName(csProjFile);
|
||||
|
||||
var solutionName = ActiveProject.SolutionName + ".sln";
|
||||
|
||||
var arguements = $"build {Path.Combine(path, solutionName)} " +
|
||||
var arguements = $"build {ActiveProject.VisualStudioClonedSolutionPath} " +
|
||||
$"/p:Configuration=Debug " +
|
||||
$"/p:Platform=\"Any CPU\"";
|
||||
|
||||
// clean the project first
|
||||
ExecuteDotnetCommand("clean", path);
|
||||
ExecuteDotnetCommand("clean", ActiveProject.VisualStudioClonedSolutionDirectory);
|
||||
|
||||
// Restore packages
|
||||
ExecuteDotnetCommand("restore", path);
|
||||
|
||||
Logger.Log(path + ActiveProject.SolutionName + ".sln");
|
||||
ExecuteDotnetCommand("restore", ActiveProject.VisualStudioClonedSolutionDirectory);
|
||||
|
||||
// Then build the project
|
||||
ExecuteDotnetCommand(arguements, path);
|
||||
ExecuteDotnetCommand(arguements, ActiveProject.VisualStudioClonedSolutionDirectory);
|
||||
}
|
||||
|
||||
private static void ExecuteDotnetCommand(string arguments, string workingDirectory)
|
||||
|
@ -1,4 +1,6 @@
|
||||
namespace ReCodeIt.Models;
|
||||
using ReCodeIt.Utils;
|
||||
|
||||
namespace ReCodeIt.Models;
|
||||
|
||||
public class CrossCompilerProjectModel
|
||||
{
|
||||
@ -25,6 +27,23 @@ public class CrossCompilerProjectModel
|
||||
/// </summary>
|
||||
public string VisualStudioSolutionPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The path to the working directory vs project
|
||||
/// </summary>
|
||||
public string VisualStudioSolutionDirectoryPath => Path.GetDirectoryName(VisualStudioSolutionPath)!;
|
||||
|
||||
/// <summary>
|
||||
/// The path the the cloned solution
|
||||
/// </summary>
|
||||
public string VisualStudioClonedSolutionPath => Path.Combine(
|
||||
DataProvider.ReCodeItProjectsPath,
|
||||
SolutionName,
|
||||
SolutionName + ".sln");
|
||||
|
||||
public string VisualStudioClonedSolutionDirectory => Path.Combine(
|
||||
DataProvider.ReCodeItProjectsPath,
|
||||
SolutionName);
|
||||
|
||||
/// <summary>
|
||||
/// This is where the final dll is built to
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user