Prettyfy the output of clean.*

First try to make options.exe generate a options file fir PS and CMD. Right now the ps1 file isalways empty... No Idea why

svn path=/trunk/tools/RosBE/; revision=914
This commit is contained in:
Daniel Reimer 2009-01-15 11:40:40 +00:00
parent 7053ec7b76
commit bc2e46d7c2
3 changed files with 77 additions and 21 deletions

View File

@ -57,6 +57,10 @@ function rembin {
$_ROSBE_MAKEFILE = "makefile.auto"
}
if ($ENV:ROS_ARCH -eq $null) {
$ENV:ROS_ARCH = "i386"
}
if (Test-Path "$_ROSBE_OBJCLEANPATH\.") {
"Cleaning ReactOS $ENV:ROS_ARCH source directory..."
if (Test-Path "$_ROSBE_OBJCLEANPATH\.") {
@ -73,6 +77,10 @@ function rembin {
"ERROR: There is no $ENV:ROS_ARCH compiler output to clean."
}
if ($ENV:ROS_ARCH -eq "i386") {
$ENV:ROS_ARCH = $null
}
if (Test-Path "reactos") {
$null = (Remove-Item "reactos" -recurse -force)
}

View File

@ -84,6 +84,10 @@ if not "%ROS_ARCH%" == "" (
set _ROSBE_MAKEFILE=makefile.auto
)
if "%ROS_ARCH%" == "" (
set ROS_ARCH=i386
)
if exist "%_ROSBE_OBJCLEANPATH%\." (
echo Cleaning ReactOS %ROS_ARCH% source directory...
if exist "%_ROSBE_OBJCLEANPATH%\." (
@ -100,6 +104,10 @@ if exist "%_ROSBE_OBJCLEANPATH%\." (
echo ERROR: There is no %ROS_ARCH% compiler output to clean.
)
if "%ROS_ARCH%" == "i386" (
set ROS_ARCH=
)
:ROS
if exist "reactos\." (

View File

@ -40,7 +40,7 @@ BOOL CreateDir(HWND hwnd, WCHAR* dir)
static
const
WCHAR*
getConfigFile()
getConfigFileCMD()
{
static WCHAR filename[MAX_PATH];
if (SHGetSpecialFolderPathW(NULL, filename, CSIDL_APPDATA, FALSE))
@ -55,6 +55,23 @@ getConfigFile()
return filename;
}
static
const
WCHAR*
getConfigFilePS1()
{
static WCHAR filename[MAX_PATH];
if (SHGetSpecialFolderPathW(NULL, filename, CSIDL_APPDATA, FALSE))
{
if ((wcslen(filename) + wcslen(L"\\RosBE\\rosbe-options.ps1")) < MAX_PATH)
wcscat(filename, L"\\RosBE\\rosbe-options.ps1");
}
else
{
wcscpy(filename, L"rosbe-options.ps1");
}
return filename;
}
INT
WriteSettings(POPTIONS_DLG infoPtr)
@ -64,7 +81,7 @@ WriteSettings(POPTIONS_DLG infoPtr)
WCHAR logdir[MAX_PATH], objdir[MAX_PATH], outdir[MAX_PATH], mingwpath[MAX_PATH], checkmgw[MAX_PATH];
WCHAR msgerror[256];
HANDLE hFile;
FILE *pFile;
FILE *pFilecmd, *pFileps1;
showtime = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SHOWBUILDTIME, BM_GETCHECK, 0, 0) == BST_CHECKED);
writelog = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SAVELOGS, BM_GETCHECK, 0, 0) == BST_CHECKED);
@ -104,26 +121,49 @@ WriteSettings(POPTIONS_DLG infoPtr)
}
CloseHandle(hFile);
pFile = _wfopen(getConfigFile(), L"w");
if (pFile)
pFilecmd = _wfopen(getConfigFileCMD(), L"w");
pFileps1 = _wfopen(getConfigFilePS1(), L"w");
if (pFilecmd)
{
fwprintf(pFile, L"::\n");
fwprintf(pFile, L":: This file has been automatically generated by the ReactOS\n");
fwprintf(pFile, L":: Build Environment options utility.\n");
fwprintf(pFile, L"::\n\n");
fwprintf(pFile, L"color %X%X\n", background, foreground);
fwprintf(pFile, L"set _ROSBE_SHOWTIME=%d\n", showtime);
fwprintf(pFile, L"set _ROSBE_USECCACHE=%d\n", useccache);
fwprintf(pFile, L"set _ROSBE_STRIP=%d\n", strip);
fwprintf(pFile, L"set _ROSBE_NOSTRIP=%d\n", nostrip);
fwprintf(pFile, L"set _ROSBE_WRITELOG=%d\n", writelog);
if (logdir[0] != 0) fwprintf(pFile, L"set _ROSBE_LOGDIR=%s\n", logdir);
if (mingwpath[0] != 0) fwprintf(pFile, L"set _ROSBE_MINGWPATH=%s\n", mingwpath);
if ((objdir[0] != 0) && objstate) fwprintf(pFile, L"set _ROSBE_OBJPATH=%s\n", objdir);
if ((outdir[0] != 0) && outstate) fwprintf(pFile, L"set _ROSBE_OUTPATH=%s\n", outdir);
fclose(pFile);
fwprintf(pFilecmd, L"::\n");
fwprintf(pFilecmd, L":: This file has been automatically generated by the ReactOS\n");
fwprintf(pFilecmd, L":: Build Environment options utility.\n");
fwprintf(pFilecmd, L"::\n\n");
fwprintf(pFilecmd, L"color %X%X\n", background, foreground);
fwprintf(pFilecmd, L"set _ROSBE_SHOWTIME=%d\n", showtime);
fwprintf(pFilecmd, L"set _ROSBE_USECCACHE=%d\n", useccache);
fwprintf(pFilecmd, L"set _ROSBE_STRIP=%d\n", strip);
fwprintf(pFilecmd, L"set _ROSBE_NOSTRIP=%d\n", nostrip);
fwprintf(pFilecmd, L"set _ROSBE_WRITELOG=%d\n", writelog);
if (logdir[0] != 0) fwprintf(pFilecmd, L"set _ROSBE_LOGDIR=%s\n", logdir);
if (mingwpath[0] != 0) fwprintf(pFilecmd, L"set _ROSBE_MINGWPATH=%s\n", mingwpath);
if ((objdir[0] != 0) && objstate) fwprintf(pFilecmd, L"set _ROSBE_OBJPATH=%s\n", objdir);
if ((outdir[0] != 0) && outstate) fwprintf(pFilecmd, L"set _ROSBE_OUTPATH=%s\n", outdir);
fclose(pFilecmd);
return TRUE;
}
if (pFileps1)
{
fwprintf(pFileps1, L"#\n");
fwprintf(pFileps1, L"# This file has been automatically generated by the ReactOS\n");
fwprintf(pFileps1, L"# Build Environment options utility.\n");
fwprintf(pFileps1, L"#\n\n");
fwprintf(pFileps1, L"# color %X%X\n", background, foreground);
fwprintf(pFileps1, L"$_ROSBE_SHOWTIME=%d\n", showtime);
fwprintf(pFileps1, L"$_ROSBE_USECCACHE=%d\n", useccache);
fwprintf(pFileps1, L"$_ROSBE_STRIP=%d\n", strip);
fwprintf(pFileps1, L"$_ROSBE_NOSTRIP=%d\n", nostrip);
fwprintf(pFileps1, L"$_ROSBE_WRITELOG=%d\n", writelog);
if (logdir[0] != 0) fwprintf(pFileps1, L"$_ROSBE_LOGDIR=%s\n", logdir);
if (mingwpath[0] != 0) fwprintf(pFileps1, L"$_ROSBE_MINGWPATH=%s\n", mingwpath);
if ((objdir[0] != 0) && objstate) fwprintf(pFileps1, L"$_ROSBE_OBJPATH=%s\n", objdir);
if ((outdir[0] != 0) && outstate) fwprintf(pFileps1, L"$_ROSBE_OUTPATH=%s\n", outdir);
fclose(pFileps1);
return TRUE;
}
LoadString(hInstance, MSG_FILEFAILED, msgerror, 256);
MessageBox(infoPtr->hwndDlg, msgerror, NULL, MB_ICONERROR);
return FALSE;
@ -137,7 +177,7 @@ VOID LoadSettings(POPTIONS_DLG infoPtr)
WCHAR SBTitle[256];
PSETTINGS LoadedSettings = &infoPtr->Settings;
pFile = _wfopen(getConfigFile(), L"r");
pFile = _wfopen(getConfigFileCMD(), L"r");
if (pFile)
{
while (fgetws(WTempLine, 24+MAX_PATH, pFile))
@ -153,7 +193,7 @@ VOID LoadSettings(POPTIONS_DLG infoPtr)
}
else if (wcscmp(ptr, L"set") == 0)
{
ptr = wcstok(NULL, L" ");
ptr = wcstok(NULL, L"\0");
ptr = wcstok(ptr, L"=");
ptr2 = wcstok(NULL, L"=");
if (wcscmp(ptr, L"_ROSBE_SHOWTIME") == 0)