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.Location = new Point(6, 105);
|
||||||
CCVisualStudioProjDirText.Name = "CCVisualStudioProjDirText";
|
CCVisualStudioProjDirText.Name = "CCVisualStudioProjDirText";
|
||||||
CCVisualStudioProjDirText.PlaceholderText = "Visual studio solution directory";
|
CCVisualStudioProjDirText.PlaceholderText = "Visual studio solution";
|
||||||
CCVisualStudioProjDirText.ReadOnly = true;
|
CCVisualStudioProjDirText.ReadOnly = true;
|
||||||
CCVisualStudioProjDirText.Size = new Size(501, 31);
|
CCVisualStudioProjDirText.Size = new Size(501, 31);
|
||||||
CCVisualStudioProjDirText.TabIndex = 27;
|
CCVisualStudioProjDirText.TabIndex = 27;
|
||||||
|
@ -794,7 +794,8 @@ public partial class ReCodeItForm : Form
|
|||||||
|
|
||||||
private void CCVisualStudioProjDirButton_Click(object sender, EventArgs e)
|
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)
|
if (result != string.Empty)
|
||||||
{
|
{
|
||||||
|
@ -103,38 +103,18 @@ public class ReCodeItCrossCompiler
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void StartBuild()
|
private void StartBuild()
|
||||||
{
|
{
|
||||||
var path = Path.Combine(
|
var arguements = $"build {ActiveProject.VisualStudioClonedSolutionPath} " +
|
||||||
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)} " +
|
|
||||||
$"/p:Configuration=Debug " +
|
$"/p:Configuration=Debug " +
|
||||||
$"/p:Platform=\"Any CPU\"";
|
$"/p:Platform=\"Any CPU\"";
|
||||||
|
|
||||||
// clean the project first
|
// clean the project first
|
||||||
ExecuteDotnetCommand("clean", path);
|
ExecuteDotnetCommand("clean", ActiveProject.VisualStudioClonedSolutionDirectory);
|
||||||
|
|
||||||
// Restore packages
|
// Restore packages
|
||||||
ExecuteDotnetCommand("restore", path);
|
ExecuteDotnetCommand("restore", ActiveProject.VisualStudioClonedSolutionDirectory);
|
||||||
|
|
||||||
Logger.Log(path + ActiveProject.SolutionName + ".sln");
|
|
||||||
|
|
||||||
// Then build the project
|
// Then build the project
|
||||||
ExecuteDotnetCommand(arguements, path);
|
ExecuteDotnetCommand(arguements, ActiveProject.VisualStudioClonedSolutionDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ExecuteDotnetCommand(string arguments, string workingDirectory)
|
private static void ExecuteDotnetCommand(string arguments, string workingDirectory)
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
namespace ReCodeIt.Models;
|
using ReCodeIt.Utils;
|
||||||
|
|
||||||
|
namespace ReCodeIt.Models;
|
||||||
|
|
||||||
public class CrossCompilerProjectModel
|
public class CrossCompilerProjectModel
|
||||||
{
|
{
|
||||||
@ -25,6 +27,23 @@ public class CrossCompilerProjectModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string VisualStudioSolutionPath { get; set; }
|
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>
|
/// <summary>
|
||||||
/// This is where the final dll is built to
|
/// This is where the final dll is built to
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user