msbuild.exe /property:Configuration=%3 /property:Platform=%2 /target:Clean /verbosity:normal "%~1"
if not "%ERRORLEVEL%"=="0" (
- echo. && echo Build process has failed!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nBuild process has failed!\n"
+ pause && exit
)
msbuild.exe /property:Configuration=%3 /property:Platform=%2 /target:Rebuild /verbosity:normal "%~1"
if not "%ERRORLEVEL%"=="0" (
- echo. && echo Build process has failed!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nBuild process has failed!\n"
+ pause && exit
)
msbuild.exe /property:Configuration=%3 /property:Platform=%2 /target:Build /verbosity:normal "%~1"
if not "%ERRORLEVEL%"=="0" (
- echo. && echo Build process has failed!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nBuild process has failed!\n"
+ pause && exit
)
)
if "%ISO_DATE%"=="" (
- echo. && echo "Failed to set up build date!"
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nFailed to set up build date!\n"
+ pause && exit
)
echo.
:: CLEAN UP
:: ---------------------------------------------------------------------------
-echo.
-echo ----------------------------------------------------------------
-echo Cleaning up
-echo ----------------------------------------------------------------
-echo.
+"%~dp0\..\Utilities\CEcho.exe" cyan "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" cyan "Cleaning up..."
+"%~dp0\..\Utilities\CEcho.exe" cyan "===========================================================================\n"
for %%i in (bin,obj,tmp,ipch) do (
del /Q /S /F "%~dp0\..\..\%%i\*.*"
for %%i in (exe,sfx,zip,txt) do (
del "%OUT_FILE%.%%i" 2> NUL
if exist "%OUT_FILE%.%%i" (
- echo. && echo Failed to delete existing output file^^!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nFailed to delete existing output file^^!\n"
+ pause && exit
)
)
:: COPY BINARY FILES AND REDIST
:: ---------------------------------------------------------------------------
+"%~dp0\..\Utilities\CEcho.exe" cyan "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" cyan "Copying binary files..."
+"%~dp0\..\Utilities\CEcho.exe" cyan "===========================================================================\n"
+
rd /S /Q "%TMP_PATH%"
mkdir "%TMP_PATH%"
:: CREATE PACKAGES
:: ---------------------------------------------------------------------------
+"%~dp0\..\Utilities\CEcho.exe" cyan "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" cyan "Creating release packages..."
+"%~dp0\..\Utilities\CEcho.exe" cyan "===========================================================================\n"
+
"%~dp0\..\Utilities\Echo.exe" LameXP - Audio Encoder Front-End > "%OUT_FILE%.txt"
"%~dp0\..\Utilities\Echo.exe" v%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO% %VER_LAMEXP_TYPE%-%VER_LAMEXP_PATCH% (Build #%VER_LAMEXP_BUILD%)\n >> "%OUT_FILE%.txt"
"%~dp0\..\Utilities\Echo.exe" Built on %ISO_DATE% at %TIME%\n\n >> "%OUT_FILE%.txt"
for %%i in (zip,exe) do (
if not exist "%OUT_FILE%.zip" (
- echo. && echo Failed to create release packages^^!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nFailed to create release packages^^!\n"
+ pause && exit
)
)
:: SIGN OUTPUT FILE
:: ---------------------------------------------------------------------------
+"%~dp0\..\Utilities\CEcho.exe" cyan "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" cyan "Signing output file..."
+"%~dp0\..\Utilities\CEcho.exe" cyan "===========================================================================\n"
+
"%PATH_GNUPG1%\gpg.exe" --detach-sign "%OUT_FILE%.exe"
attrib +R "%OUT_FILE%.exe.sig"
:: COMPLETED
:: ---------------------------------------------------------------------------
-echo.
-echo BUIDL COMPLETED SUCCESSFULLY :-)
-echo.
+"%~dp0\..\Utilities\CEcho.exe" green "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" green "Completed successfully :-)"
+"%~dp0\..\Utilities\CEcho.exe" green "===========================================================================\n"
pause
@echo off
setlocal ENABLEDELAYEDEXPANSION
-echo.
-echo ----------------------------------------------------------------
-echo Updating Translation Files
-echo ----------------------------------------------------------------
-echo.
+"%~dp0\..\Utilities\CEcho.exe" cyan "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" cyan "Updating translation files..."
+"%~dp0\..\Utilities\CEcho.exe" cyan "===========================================================================\n"
:: ---------------------------------------------------------------------------
:: SETUP PATHS
copy %%f %%f.bak
lupdate.exe "@%LST_FILE%" -no-obsolete -ts %%f
if not "!ERRORLEVEL!"=="0" (
- echo. && echo Something went wrong^^!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nSomething went wrong^^!\n"
+ pause && exit
)
)
for %%f in ("%~dp0\..\Translation\LameXP_??.ts") do (
lrelease.exe %%f -qm "%~dp0\..\..\res\localization\%%~nf.qm"
if not "!ERRORLEVEL!"=="0" (
- echo. && echo Something went wrong^^!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nSomething went wrong^^!\n"
+ pause && exit
)
)
@echo off
setlocal EnableDelayedExpansion
-echo.
-echo ----------------------------------------------------------------
-echo Building software documentation
-echo ----------------------------------------------------------------
-echo.
+"%~dp0\..\Utilities\CEcho.exe" cyan "\n==========================================================================="
+"%~dp0\..\Utilities\CEcho.exe" cyan "Building software documentation..."
+"%~dp0\..\Utilities\CEcho.exe" cyan "===========================================================================\n"
:: ------------------------------------------
:: Setup Paths
"%PATH_PANDOC%\pandoc.exe" --from markdown_github+pandoc_title_block --to html5 --toc -N --standalone -H "%~dp0\..\Style\style.css" "%%~i" --output "%%~dpni.html"
echo.
if not "!ERRORLEVEL!"=="0" (
- echo. && echo Creating the document has failed^^!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nSomething went wrong^^!\n"
+ pause && exit
)
)
)
if not exist "%BUILDENV_TXT%" (
- echo.
- echo Could not find 'buildenv.txt' in current directory^!
- echo Please create your 'buildenv.txt' file from 'buildenv.template.txt' first.
- echo.
- pause
- exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nCould not find \"buildenv.txt\" in current directory!\n\nPlease create your \"buildenv.txt\" file from 'buildenv.template.txt' first...\n"
+ pause && exit
)
:: ------------------------------------------
:: Print all paths
:: ------------------------------------------
-echo.
-echo ======= BEGIN PATHS =======
-echo PATH_UPXBIN = "%PATH_UPXBIN%"
-echo PATH_MKNSIS = "%PATH_MKNSIS%"
-echo PATH_MSCDIR = "%PATH_MSCDIR%"
-echo PATH_QTMSVC = "%PATH_QTMSVC%"
-echo PATH_GNUPG1 = "%PATH_GNUPG1%"
-echo PATH_PANDOC = "%PATH_PANDOC%"
-echo PATH_VCPROJ = "%PATH_VCPROJ%"
-echo ======== END PATHS ========
-echo.
+"%~dp0\..\Utilities\CEcho.exe" yellow "\n========== BEGIN PATHS =========="
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_UPXBIN = \"%PATH_UPXBIN:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_MKNSIS = \"%PATH_MKNSIS:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_MSCDIR = \"%PATH_MSCDIR:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_QTMSVC = \"%PATH_QTMSVC:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_GNUPG1 = \"%PATH_GNUPG1:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_PANDOC = \"%PATH_PANDOC:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "PATH_VCPROJ = \"%PATH_VCPROJ:\=\\%\""
+"%~dp0\..\Utilities\CEcho.exe" yellow "=========== END PATHS ===========\n"
:: ------------------------------------------
:: Validate Paths
if exist "%PATH_QTMSVC%\bin\qtvars.bat" goto:exit_success
if exist "%PATH_QTMSVC%\bin\qtenv2.bat" goto:exit_success
-echo. && echo Could not find "qtvars.bat" or "qtenv2.bat" in your Qt path.
-echo. && echo Please check your PATH_QTMSVC and try again!
-echo. && pause && exit
+"%~dp0\..\Utilities\CEcho.exe" red "\nCould not find \"qtvars.bat\" or \"qtenv2.bat\" in your Qt path!\n\nPlease check your PATH_QTMSVC path variable and try again...\n"
+pause && exit
:: ------------------------------------------
:: Validate Path
:validate_path
if not exist "%~2" (
- echo. && echo Path could not be found: && echo "%~2"
- echo. && echo Please check your %1 and try again!
- echo. && pause && exit
+ "%~dp0\..\Utilities\CEcho.exe" red "\nPath %1 could not be found!\n\nPlease check your %1 path variable and try again...\n"
+ pause && exit
)
goto:eof
goto:version_success
:version_failure
-echo. && echo "Failed to set up build date!"
-echo. && pause && exit
+"%~dp0\..\Utilities\CEcho.exe" red "\nFailed to set up build date!\n"
+pause && exit
:: ---------------------------------------------------------------------------
:: GET RELEASE TYPE
:: OUTPUT RESULT
:: ---------------------------------------------------------------------------
-echo.
-echo LameXP Version: %VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%, Build #%VER_LAMEXP_BUILD% (%VER_LAMEXP_TYPE%-%VER_LAMEXP_PATCH%)
-echo.
+"%~dp0\..\Utilities\CEcho.exe" yellow "\nLameXP Version: %VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%, Build #%VER_LAMEXP_BUILD% (%VER_LAMEXP_TYPE%-%VER_LAMEXP_PATCH%)\n"