mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fix misc bugs w/ IDE build in folders with a space
- Add quotes to bin/msbuild.bat paths - Tweak PostBuildCmds in Debugger64 and IDEHelper - Tweak Debug paths in IDE project to be relative to Workspace - Modify AppendWithOptionalQuotes to not add more quotes if source string already in quotes - Modify quoting behavior in build shell command construction
This commit is contained in:
parent
29beeb4e77
commit
81b909c541
6 changed files with 16 additions and 10 deletions
|
@ -10,7 +10,7 @@ TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||||
TargetName = "IDEHelper64_d.dll"
|
TargetName = "IDEHelper64_d.dll"
|
||||||
BuildCommandsOnCompile = "IfFilesChanged"
|
BuildCommandsOnCompile = "IfFilesChanged"
|
||||||
BuildCommandsOnRun = "IfFilesChanged"
|
BuildCommandsOnRun = "IfFilesChanged"
|
||||||
PostBuildCmds = ["\"$(WorkspaceDir)\\..\\bin\\msbuild.bat\" \"$(WorkspaceDir)\\..\\Debugger64\\Debugger64.vcxproj\" /p:Configuration=Debug /p:Platform=X64 /p:SolutionDir=$(Slash \"$(WorkspaceDir)\\\\..\\\\\") /v:m"]
|
PostBuildCmds = ["\"$(WorkspaceDir)\\..\\bin\\msbuild.bat\" $(Slash \"$(WorkspaceDir)\\\\..\\\\Debugger64\\\\Debugger64.vcxproj\") /p:Configuration=Debug /p:Platform=X64 /p:SolutionDir=$(Slash \"$(WorkspaceDir)\\\\..\\\\\") /v:m"]
|
||||||
OptimizationLevel = "O0"
|
OptimizationLevel = "O0"
|
||||||
|
|
||||||
[Configs.Debug.Win32]
|
[Configs.Debug.Win32]
|
||||||
|
|
|
@ -24,8 +24,8 @@ OtherLinkFlags = ""
|
||||||
TargetDirectory = "$(WorkspaceDir)/dist"
|
TargetDirectory = "$(WorkspaceDir)/dist"
|
||||||
TargetName = "BeefIDE_d"
|
TargetName = "BeefIDE_d"
|
||||||
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
|
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
|
||||||
DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests"
|
DebugCommandArguments = "-proddir=\"$(WorkspaceDir)\\..\\IDEHelper\\Tests\""
|
||||||
DebugWorkingDirectory = "c:\\Beef"
|
DebugWorkingDirectory = "$(WorkspaceDir)\\.."
|
||||||
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
||||||
|
|
||||||
[Configs.Release.Win32]
|
[Configs.Release.Win32]
|
||||||
|
|
|
@ -7801,10 +7801,13 @@ namespace IDE
|
||||||
else if (runFlags.HasFlag(.ShellCommand))
|
else if (runFlags.HasFlag(.ShellCommand))
|
||||||
{
|
{
|
||||||
String shellArgs = scope .();
|
String shellArgs = scope .();
|
||||||
|
shellArgs.Append("/s ");
|
||||||
shellArgs.Append("/c ");
|
shellArgs.Append("/c ");
|
||||||
|
shellArgs.Append("\"");
|
||||||
IDEUtils.AppendWithOptionalQuotes(shellArgs, fileName);
|
IDEUtils.AppendWithOptionalQuotes(shellArgs, fileName);
|
||||||
shellArgs.Append(" ");
|
shellArgs.Append(" ");
|
||||||
shellArgs.Append(args);
|
shellArgs.Append(args);
|
||||||
|
shellArgs.Append("\"");
|
||||||
startInfo.SetFileName("cmd.exe");
|
startInfo.SetFileName("cmd.exe");
|
||||||
startInfo.SetArguments(shellArgs);
|
startInfo.SetArguments(shellArgs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,13 @@ namespace IDE
|
||||||
|
|
||||||
public static void AppendWithOptionalQuotes(String targetStr, String srcFileName)
|
public static void AppendWithOptionalQuotes(String targetStr, String srcFileName)
|
||||||
{
|
{
|
||||||
if (!srcFileName.Contains(' '))
|
bool hasSpace = srcFileName.Contains(' ');
|
||||||
targetStr.Append(srcFileName);
|
bool alreadyQuoted = (srcFileName.Length > 0 && srcFileName[0] == '"' && srcFileName[srcFileName.Length - 1] == '"');
|
||||||
else
|
|
||||||
|
if (hasSpace && !alreadyQuoted)
|
||||||
targetStr.Append("\"", srcFileName, "\"");
|
targetStr.Append("\"", srcFileName, "\"");
|
||||||
|
else
|
||||||
|
targetStr.Append(srcFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool FixFilePath(String filePath, char8 wantSlash, char8 otherSlash)
|
public static bool FixFilePath(String filePath, char8 wantSlash, char8 otherSlash)
|
||||||
|
|
|
@ -17,7 +17,7 @@ TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||||
TargetName = "IDEHelper64_d.dll"
|
TargetName = "IDEHelper64_d.dll"
|
||||||
BuildCommandsOnCompile = "IfFilesChanged"
|
BuildCommandsOnCompile = "IfFilesChanged"
|
||||||
BuildCommandsOnRun = "IfFilesChanged"
|
BuildCommandsOnRun = "IfFilesChanged"
|
||||||
PostBuildCmds = ["\"$(WorkspaceDir)\\..\\bin\\msbuild.bat\" \"$(WorkspaceDir)\\..\\IDEHelper\\IDEHelper.vcxproj\" /p:Configuration=Debug /p:Platform=X64 /p:SolutionDir=$(Slash \"$(WorkspaceDir)\\\\..\\\\\") /v:m"]
|
PostBuildCmds = ["\"$(WorkspaceDir)\\..\\bin\\msbuild.bat\" $(Slash \"$(WorkspaceDir)\\\\..\\\\IDEHelper\\\\IDEHelper.vcxproj\") /p:Configuration=Debug /p:Platform=X64 /p:SolutionDir=$(Slash \"$(WorkspaceDir)\\\\..\\\\\") /v:m"]
|
||||||
|
|
||||||
[Configs.Release.Win32]
|
[Configs.Release.Win32]
|
||||||
TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
TargetDirectory = "$(WorkspaceDir)/../IDE/dist"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
for /f "usebackq tokens=*" %%i in (`%~dp0\vswhere -prerelease -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
|
for /f "usebackq tokens=*" %%i in (`"%~dp0\vswhere" -prerelease -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
|
||||||
set VcInstallDir=%%i
|
set "VcInstallDir=%%i"
|
||||||
)
|
)
|
||||||
|
|
||||||
SET VsBuildDir=%VcInstallDir%\MSBuild\15.0
|
SET "VsBuildDir=%VcInstallDir%\MSBuild\15.0"
|
||||||
@IF EXIST "%VcInstallDir%\MSBuild\Current" SET VsBuildDir=%VcInstallDir%\MSBuild\Current
|
@IF EXIST "%VcInstallDir%\MSBuild\Current" SET VsBuildDir=%VcInstallDir%\MSBuild\Current
|
||||||
|
|
||||||
"%VsBuildDir%\Bin\MSBuild.exe" %*
|
"%VsBuildDir%\Bin\MSBuild.exe" %*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue