Refactor deployment script

This commit is contained in:
LoRd_MuldeR 2010-11-10 17:03:01 +01:00
parent d5909a9937
commit 6a480fd764
6 changed files with 71 additions and 50 deletions

View File

@ -93,7 +93,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Copy plugin DLL&apos;s"
CommandLine="copy &quot;$(QTDIR)\plugins\imageformats\q???d4.dll&quot; &quot;$(TargetDir)\imageformats&quot;"
CommandLine="mkdir &quot;$(TargetDir)\imageformats&quot;&#x0D;&#x0A;copy &quot;$(QTDIR)\plugins\imageformats\q???d4.dll&quot; &quot;$(TargetDir)\imageformats\&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@ -183,7 +183,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Copy plugin DLL&apos;s"
CommandLine="copy &quot;$(QTDIR)\plugins\imageformats\q???4.dll&quot; &quot;$(TargetDir)\imageformats&quot;"
CommandLine="mkdir &quot;$(TargetDir)\imageformats&quot;&#x0D;&#x0A;copy &quot;$(QTDIR)\plugins\imageformats\q???4.dll&quot; &quot;$(TargetDir)\imageformats\&quot;&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
@ -510,7 +510,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -520,7 +520,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>

View File

@ -1,5 +1,5 @@
@echo off
set "LAMEXP_BUILD_SUCCESS=NO"
set "LAMEXP_ERROR=1"
echo ----------------------------------------------------------------
echo Solution File: %1
echo Configuration: %~n2
@ -9,23 +9,11 @@ call "%PATH_MSVC90%\VC\bin\vcvars32.bat"
call "%PATH_QTMSVC%\bin\qtvars.bat"
REM -----------------------------------------------------------------
msbuild.exe /property:Configuration=%~n2 /target:Clean /verbosity:d %1
if exist "%~d1%~p1bin\%~n2\*.exe" (
echo.
echo CLEANUP HAS FAILED!
echo.
GOTO:EOF
)
if exist "%~d1%~p1obj\%~n2\*.obj" (
echo.
echo CLEANUP HAS FAILED!
echo.
GOTO:EOF
)
if exist "%~d1%~p1bin\%~n2\*.exe" GOTO:EOF
if exist "%~d1%~p1obj\%~n2\*.obj" GOTO:EOF
echo ----------------------------------------------------------------
msbuild.exe /property:Configuration=%~n2 /target:Rebuild /verbosity:d %1
echo ----------------------------------------------------------------
if not exist "%~d1%~p1bin\%~n2\%~n1.exe" (
echo BUILD HAS FAILED!
exit
)
set "LAMEXP_BUILD_SUCCESS=YES"
if not exist "%~d1%~p1bin\%~n2\%~n1.exe" GOTO:EOF
REM -----------------------------------------------------------------
set "LAMEXP_ERROR=0"

View File

@ -0,0 +1,5 @@
@echo off
echo.
echo %~n1%~x1 !!!
echo.
pause

View File

@ -0,0 +1,29 @@
@echo off
set "LAMEXP_ERROR=1"
REM ------------------------------------------
set "VER_LAMEXP_MAJOR="
set "VER_LAMEXP_MINOR_HI="
set "VER_LAMEXP_MINOR_LO="
set "VER_LAMEXP_BUILD="
set "VER_LAMEXP_SUFFIX="
REM ------------------------------------------
FOR /F "tokens=2,3" %%s IN (..\..\src\Resource.h) DO (
if "%%s"=="VER_LAMEXP_MAJOR" set "VER_LAMEXP_MAJOR=%%t"
if "%%s"=="VER_LAMEXP_MINOR_HI" set "VER_LAMEXP_MINOR_HI=%%t"
if "%%s"=="VER_LAMEXP_MINOR_LO" set "VER_LAMEXP_MINOR_LO=%%t"
if "%%s"=="VER_LAMEXP_BUILD" set "VER_LAMEXP_BUILD=%%t"
if "%%s"=="VER_LAMEXP_SUFFIX" set "VER_LAMEXP_SUFFIX=%%t"
)
REM ------------------------------------------
set "LAMEXP_ERROR=1"
if "%VER_LAMEXP_MAJOR%"=="" GOTO:EOF
if "%VER_LAMEXP_MINOR_HI%"=="" GOTO:EOF
if "%VER_LAMEXP_MINOR_LO%"=="" GOTO:EOF
if "%VER_LAMEXP_BUILD%"=="" GOTO:EOF
if "%VER_LAMEXP_SUFFIX%"=="" GOTO:EOF
REM ------------------------------------------
echo LameXP Version:
echo %VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%, Build #%VER_LAMEXP_BUILD% (%VER_LAMEXP_SUFFIX%)
echo.
REM ------------------------------------------
set "LAMEXP_ERROR=0"

View File

@ -6,44 +6,29 @@ set "OUT_DATE=%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%"
set "OUT_FILE=%OUT_PATH%\..\LameXP.%OUT_DATE%.Release"
set "TMP_PATH=%TEMP%\~LameXP.%OUT_DATE%.tmp"
REM ------------------------------------------
set "VER_LAMEXP_MAJOR=X"
set "VER_LAMEXP_MINOR_HI=X"
set "VER_LAMEXP_MINOR_LO=X"
set "VER_LAMEXP_BUILD=X"
set "VER_LAMEXP_SUFFIX=X"
REM ------------------------------------------
FOR /F "tokens=2,3" %%s IN (..\..\src\Resource.h) DO (
if "%%s"=="VER_LAMEXP_MAJOR" set "VER_LAMEXP_MAJOR=%%t"
if "%%s"=="VER_LAMEXP_MINOR_HI" set "VER_LAMEXP_MINOR_HI=%%t"
if "%%s"=="VER_LAMEXP_MINOR_LO" set "VER_LAMEXP_MINOR_LO=%%t"
if "%%s"=="VER_LAMEXP_BUILD" set "VER_LAMEXP_BUILD=%%t"
if "%%s"=="VER_LAMEXP_SUFFIX" set "VER_LAMEXP_SUFFIX=%%t"
call _version.bat
if not "%LAMEXP_ERROR%"=="0" (
call _error.bat "FAILD TO READ VERSION INFO!"
GOTO:EOF
)
REM ------------------------------------------
echo Version: %VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%, Build #%VER_LAMEXP_BUILD% (%VER_LAMEXP_SUFFIX%)
REM ------------------------------------------
del "%OUT_FILE%.exe"
del "%OUT_FILE%.zip"
if exist "%OUT_FILE%.exe" (
echo BUILD HAS FAILED !!!
pause
exit
call _error.bat "FAILD TO DELET EXISTING FILE"
GOTO:EOF
)
if exist "%OUT_FILE%.zip" (
echo BUILD HAS FAILED !!!
pause
exit
call _error.bat "FAILD TO DELET EXISTING FILE"
GOTO:EOF
)
REM ------------------------------------------
call _build.bat "..\..\LameXP.sln" Release
REM ------------------------------------------
if not "%LAMEXP_BUILD_SUCCESS%"=="YES" (
echo.
echo BUILD HAS FAILED !!!
echo.
pause
exit
if not "%LAMEXP_ERROR%"=="0" (
call _error.bat "BUILD HAS FAILED"
GOTO:EOF
)
REM ------------------------------------------
rd /S /Q "%TMP_PATH%"
mkdir "%TMP_PATH%"
@ -70,4 +55,17 @@ REM ------------------------------------------
"%PATH_MKNSIS%" "/DLAMEXP_SOURCE_PATH=%TMP_PATH%" "/DLAMEXP_OUTPUT_FILE=%OUT_FILE%.exe" "/DLAMEXP_DATE=%OUT_DATE%" "/DLAMEXP_VERSION=%VER_LAMEXP_MAJOR%.%VER_LAMEXP_MINOR_HI%%VER_LAMEXP_MINOR_LO%" "/DLAMEXP_BUILD=%VER_LAMEXP_BUILD%" "/DLAMEXP_SUFFIX=%VER_LAMEXP_SUFFIX%" "..\NSIS\setup.nsi"
rd /S /Q "%TMP_PATH%"
REM ------------------------------------------
if not exist "%OUT_FILE%.zip" (
call _error.bat "PACKAGING HAS FAILED"
GOTO:EOF
)
if not exist "%OUT_FILE%.exe" (
call _error.bat "PACKAGING HAS FAILED"
GOTO:EOF
)
REM ------------------------------------------
echo.
echo BUIDL COMPLETED SUCCESSFULLY :-)
echo.
REM ------------------------------------------
pause

View File

@ -1,8 +1,9 @@
!define ZIP2EXE_NAME `LameXP v${LAMEXP_VERSION} ${LAMEXP_SUFFIX}, Build #${LAMEXP_BUILD} [${LAMEXP_DATE}]`
!define ZIP2EXE_NAME `LameXP v${LAMEXP_VERSION} ${LAMEXP_SUFFIX} [Build #${LAMEXP_BUILD}]`
!define ZIP2EXE_OUTFILE `${LAMEXP_OUTPUT_FILE}`
!define ZIP2EXE_COMPRESSOR_LZMA
!define ZIP2EXE_COMPRESSOR_SOLID
!define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\${ZIP2EXE_NAME}`
BrandingText `Date created: ${LAMEXP_DATE}`
!include `${NSISDIR}\Contrib\zip2exe\Base.nsh`
!include `${NSISDIR}\Contrib\zip2exe\Modern.nsh`
!insertmacro SECTION_BEGIN