Skip to content

Commit

Permalink
A bunch of development script improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
negrutiu committed Jun 18, 2020
1 parent d8f6c62 commit 7f88bfc
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 73 deletions.
20 changes: 13 additions & 7 deletions TestDebug/build64.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
@echo off
if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2
SetLocal EnableDelayedExpansion

:build
"%NSIS_PATH%\makensis.exe" /DAMD64 /V4 "%~dp0\NSutils-Debug.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

"%NSIS%\makensis.exe" /V4 /DAMD64 "%~dp0\NSutils-Debug.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%
20 changes: 13 additions & 7 deletions TestDebug/buildA.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
@echo off
if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2
SetLocal EnableDelayedExpansion

:build
"%NSIS_PATH%\makensis.exe" /DANSI /V4 "%~dp0\NSutils-Debug.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

"%NSIS%\makensis.exe" /V4 /DANSI "%~dp0\NSutils-Debug.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%
20 changes: 13 additions & 7 deletions TestDebug/buildW.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
@echo off
if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2
SetLocal EnableDelayedExpansion

:build
"%NSIS_PATH%\makensis.exe" /V4 "%~dp0\NSutils-Debug.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

"%NSIS%\makensis.exe" /V4 "%~dp0\NSutils-Debug.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%
2 changes: 1 addition & 1 deletion _acquire_pluginapi.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set NSIS_REPO=%~dp0..\..
xcopy "%NSIS_REPO%\Contrib\ExDLL\pluginapi.*" "nsis\" /DYI
xcopy "%NSIS_REPO%\Contrib\ExDLL\nsis_tchar.h" "nsis\" /DYI
xcopy "%NSIS_REPO%\Source\exehead\api.h" "nsis\" /DYI
if not exist "nsis\*.*" if not exist "%NSIS_REPO%" echo ERROR: NSIS sources not found. Clone NSIS repository to "%NSIS_REPO%" & pause & exit /B 2
if not exist "nsis\*.*" if not exist "%NSIS_REPO%" echo ERROR: NSIS sources not found. Clone NSIS repository to "%NSIS_REPO%" && pause && exit /B 2

echo.
exit /B 0
25 changes: 13 additions & 12 deletions _build_Release_mingw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ REM :: Marius Negrutiu ([email protected])
@echo off
echo.

if not exist "%MSYS2%" set MSYS2=C:\msys2
if not exist "%MSYS2%" set MSYS2=C:\msys64
set MINGW32=%MSYS2%\mingw32
set MINGW64=%MSYS2%\mingw64
if not exist "%MINGW32%\bin\gcc.exe" set MINGW32=%MINGW32_INSTDIR%
if not exist "%MINGW32%\bin\gcc.exe" set MINGW32=%SYSTEMROOT%\msys64\mingw32
if not exist "%MINGW32%\bin\gcc.exe" set MINGW32=%SYSTEMROOT%\msys2\mingw32

if not exist "%MINGW64%\bin\gcc.exe" set MINGW64=%MINGW64_INSTDIR%
if not exist "%MINGW64%\bin\gcc.exe" set MINGW64=%SYSTEMROOT%\msys64\mingw64
if not exist "%MINGW64%\bin\gcc.exe" set MINGW64=%SYSTEMROOT%\msys2\mingw64

set ORIGINAL_PATH=%PATH%

cd /d "%~dp0"
Expand All @@ -16,7 +20,7 @@ call _acquire_pluginapi.bat
if %errorlevel% neq 0 exit /B %errorlevel%

:x86
if not exist "%MINGW32%" echo ERROR: Missing "%MINGW32%" & pause & exit /B 2
if not exist "%MINGW32%\bin\gcc.exe" echo ERROR: Missing "%MINGW32%" && pause && exit /B 2
set PATH=%MINGW32%\bin;%ORIGINAL_PATH%

echo.
Expand All @@ -25,23 +29,21 @@ set OUTDIR=Release-mingw-x86-ansi
echo %OUTDIR%
title %OUTDIR%
echo -------------------------------------------------------------------
title Release-mingw-x86-ansi
mingw32-make.exe ARCH=X86 CHAR=ANSI OUTDIR=%OUTDIR% -fMakefile.mingw clean all
if %errorlevel% neq 0 echo errorlevel == %errorlevel% & pause & goto :EOF
if %errorlevel% neq 0 pause && exit /B %errorlevel%

echo.
echo -------------------------------------------------------------------
set OUTDIR=Release-mingw-x86-unicode
echo %OUTDIR%
title %OUTDIR%
echo -------------------------------------------------------------------
title Release-mingw-x86-unicode
mingw32-make.exe ARCH=X86 CHAR=Unicode OUTDIR=%OUTDIR% -fMakefile.mingw clean all
if %errorlevel% neq 0 echo errorlevel == %errorlevel% & pause & goto :EOF
if %errorlevel% neq 0 pause && exit /B %errorlevel%


:amd64
if not exist "%MINGW64%" echo ERROR: Missing "%MINGW64%" & pause & exit /B 2
if not exist "%MINGW64%\bin\gcc.exe" echo ERROR: Missing "%MINGW64%" && pause && exit /B 2
set PATH=%MINGW64%\bin;%ORIGINAL_PATH%

echo.
Expand All @@ -50,9 +52,8 @@ set OUTDIR=Release-mingw-amd64-unicode
echo %OUTDIR%
title %OUTDIR%
echo -------------------------------------------------------------------
title Release-mingw-amd64-unicode
mingw32-make.exe ARCH=X64 CHAR=Unicode OUTDIR=%OUTDIR% -fMakefile.mingw clean all
if %errorlevel% neq 0 echo errorlevel == %errorlevel% & pause & goto :EOF
if %errorlevel% neq 0 pause && exit /B %errorlevel%

echo.
REM pause
26 changes: 15 additions & 11 deletions test/NSutils-Test-build.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
REM :: Marius Negrutiu :: 2019/08/25
@echo off
SetLocal EnableDelayedExpansion

if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2
if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

:build
echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

Title Build: amd64-unicode
"%NSIS_PATH%\makensis.exe" /DAMD64 /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
"%NSIS%\makensis.exe" /V4 /DAMD64 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%

Title Build: x86-ansi
"%NSIS_PATH%\makensis.exe" /DANSI /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
"%NSIS%\makensis.exe" /V4 /DANSI "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%

Title Build: x86-unicode
"%NSIS_PATH%\makensis.exe" /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
"%NSIS%\makensis.exe" /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%
13 changes: 9 additions & 4 deletions test/NSutils-Test.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ Target ${_TARGET_}
!include "FileFunc.nsh"
!include "Win\WinNT.nsh"

# NSutils.dll location
;!AddPluginDir /x86-ansi "..\Release-mingw-x86-ansi"
;!AddPluginDir /x86-unicode "..\Release-mingw-x86-unicode"
;!AddPluginDir /amd64-unicode "..\Release-mingw-amd64-unicode"
# NSutils.dll development location
!ifdef DEVEL
!if ! /FileExists "..\Release-mingw-${_TARGET_}\NSutils.dll"
!error "Missing \Release-mingw-${_TARGET_}\NSutils.dll"
!endif
!AddPluginDir /amd64-unicode "..\Release-mingw-amd64-unicode"
!AddPluginDir /x86-unicode "..\Release-mingw-x86-unicode"
!AddPluginDir /x86-ansi "..\Release-mingw-x86-ansi"
!endif

!define /ifndef TRUE 1
!define /ifndef FALSE 0
Expand Down
22 changes: 14 additions & 8 deletions test/build64.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
@echo off
if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2

:build
"%NSIS_PATH%\makensis.exe" /DAMD64 /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
SetLocal EnableDelayedExpansion

if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

"%NSIS%\makensis.exe" /DDEVEL /V4 /DAMD64 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%

REM echo ----------------------------------------------------------
REM set exe=NSutils-Test-amd64-unicode.exe
Expand Down
22 changes: 14 additions & 8 deletions test/buildA.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
@echo off
if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2

:build
"%NSIS_PATH%\makensis.exe" /DANSI /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
SetLocal EnableDelayedExpansion

if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

"%NSIS%\makensis.exe" /DDEVEL /V4 /DANSI "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%

REM echo ----------------------------------------------------------
REM set exe=NSutils-Test-x86-ansi.exe
Expand Down
22 changes: 14 additions & 8 deletions test/buildW.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
@echo off
if exist "W:\GIT\NSIS\NSISbin" set NSIS_PATH=W:\GIT\NSIS\NSISbin& goto :build
if exist "%PROGRAMFILES%\NSIS" set NSIS_PATH=%PROGRAMFILES%\NSIS& goto :build
if exist "%PROGRAMFILES(X86)%\NSIS" set NSIS_PATH=%PROGRAMFILES(X86)%\NSIS& goto :build
echo ERROR: NSIS not found & pause & exit /B 2

:build
"%NSIS_PATH%\makensis.exe" /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause & exit /B %errorlevel%
SetLocal EnableDelayedExpansion

if not exist "%NSIS%\makensis.exe" pushd "%~dp0..\.." && set NSIS=!CD!&& popd
if not exist "%NSIS%\makensis.exe" set NSIS=%NSIS_INSTDIR%
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES%\NSIS
if not exist "%NSIS%\makensis.exe" set NSIS=%PROGRAMFILES(X86)%\NSIS
if not exist "%NSIS%\makensis.exe" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2

echo ********************************************************************************
echo %NSIS%\makensis.exe
echo ********************************************************************************

"%NSIS%\makensis.exe" /DDEVEL /V4 "%~dp0\NSutils-Test.nsi"
if %errorlevel% neq 0 pause && exit /B %errorlevel%

REM echo ----------------------------------------------------------
REM set exe=NSutils-Test-x86-unicode.exe
Expand Down

0 comments on commit 7f88bfc

Please sign in to comment.