@echo off

set script=%~dp0%
set parent=%script: =,%
set parent=%parent:\= %
set parentdir=
call :getparentdir %parent%
set parent=%parentdir:,= %

if not exist ..\env.bat (
	echo Add %parent%\env.bat: (..\env.bat^)
	echo See env.bat.template in %script%
	echo In ..\env.bat, complete your %%PATH%% with Git, VirtualBox and Boot2Docker
	exit /B 1
)
call "%parent%\env.bat"

rem http://stackoverflow.com/a/7218493/6309: test substring
echo.%PATH%| findstr /C:"Boot2Docker" 1>nul
if errorlevel 1 (
	echo "Boot2Docker is not found in PATH: check your ..\env.bat"
	exit /B 1
)
echo.%PATH%| findstr /C:"Git" 1>nul
if errorlevel 1 (
	echo "Git is not found in PATH: check your ..\env.bat"
	exit /B 1
)
echo.%PATH%| findstr /C:"VirtualBox" 1>nul
if errorlevel 1 (
	echo "VirtualBox is not found in PATH: check your ..\env.bat"
	exit /B 1
)

doskey vbm="c:\prgs\VirtualBox\VBoxManage.exe" $*
doskey vbmmt="c:\prgs\VirtualBox\VBoxManage.exe modifyvm \"boot2docker-vm\" natpf1 \"tcp-port$1,tcp,,$1,,$1\";"
doskey vbmmu="c:\prgs\VirtualBox\VBoxManage.exe modifyvm \"boot2docker-vm\" natpf1 \"udp-port$1,udp,,$1,,$1\";"
doskey vbmct="c:\prgs\VirtualBox\VBoxManage.exe controlvm \"boot2docker-vm\" natpf1 \"tcp-port$1,tcp,,$1,,$1\";"
doskey vbmcu="c:\prgs\VirtualBox\VBoxManage.exe controlvm \"boot2docker-vm\" natpf1 \"udp-port$1,udp,,$1,,$1\";"

goto :eof

rem http://www.dostips.com/DtTutoFunctions.php#FunctionTutorial.ReturningValuesClassic
:getparentdir
if "%~1" EQU "b2d" goto :EOF
if not "%parentdir%" == "" (
	set "parentdir=%parentdir%\%~1"
)
if "%parentdir%" == "" (
	set parentdir=%~1
)
shift
goto getparentdir

@echo off

set script=%~dp0%
set parent=%script: =,%
set parent=%parent:\= %
set parentdir=
call :getparentdir %parent%
set parent=%parentdir:,= %

if not exist ..\env.bat (
	echo Add %parent%\env.bat: (..\env.bat^)
	echo See env.bat.template in %script%
	echo In ..\env.bat, complete your %%PATH%% with Git, VirtualBox and Boot2Docker
	exit /B 1
)
call "%parent%\env.bat"
set PATH=%PATH%;%script%

rem http://stackoverflow.com/a/7218493/6309: test substring
echo.%PATH%| findstr /C:"Boot2Docker" 1>nul
if errorlevel 1 (
	echo "Boot2Docker is not found in PATH: check your ..\env.bat"
	exit /B 1
)
echo.%PATH%| findstr /C:"Git" 1>nul
if errorlevel 1 (
	echo "Git is not found in PATH: check your ..\env.bat"
	exit /B 1
)
echo.%PATH%| findstr /C:"VirtualBox" 1>nul
if errorlevel 1 (
	echo "VirtualBox is not found in PATH: check your ..\env.bat"
	exit /B 1
)

doskey vbm="c:\prgs\VirtualBox\VBoxManage.exe" $*
doskey vbmmt="c:\prgs\VirtualBox\VBoxManage.exe modifyvm \"boot2docker-vm\" natpf1 \"tcp-port$1,tcp,,$1,,$1\";"
doskey vbmmu="c:\prgs\VirtualBox\VBoxManage.exe modifyvm \"boot2docker-vm\" natpf1 \"udp-port$1,udp,,$1,,$1\";"
doskey vbmct="c:\prgs\VirtualBox\VBoxManage.exe controlvm \"boot2docker-vm\" natpf1 \"tcp-port$1,tcp,,$1,,$1\";"
doskey vbmcu="c:\prgs\VirtualBox\VBoxManage.exe controlvm \"boot2docker-vm\" natpf1 \"udp-port$1,udp,,$1,,$1\";"

goto :eof

rem http://www.dostips.com/DtTutoFunctions.php#FunctionTutorial.ReturningValuesClassic
:getparentdir
if "%~1" EQU "b2d" goto :EOF
if not "%parentdir%" == "" (
	set "parentdir=%parentdir%\%~1"
)
if "%parentdir%" == "" (
	set parentdir=%~1
)
shift
goto getparentdir

Add b2d path to PATH

Add b2d path to PATH


@echo off
SETLOCAL EnableDelayedExpansion

set failed=0

cd bin
for /r "." %%a in (tst_*.exe) do (
  "%%~fa"
  if not ERRORLEVEL 0 (
    echo Test FAILED: "%%~fa"
    set failed=1
  )
)
cd ..
if %failed% EQU 1 (
  echo ERROR: At least one unit test failed!
  if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" (
    pause
  )
  exit /B 1
)

echo All tests passed
if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" (
  pause
)

@echo off
SETLOCAL EnableDelayedExpansion

set failed=0

cd bin
for /r "." %%a in (tst_*.exe) do (
  "%%~fa"
  if !errorlevel! neq 0 (
    echo Test FAILED: "%%~fa"
    set failed=1
  )
)
cd ..
if !failed! equ 1 (
  echo ERROR: At least one unit test failed!
  if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" (
    pause
  )
  exit /B 1
)

echo All tests passed
if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" (
  pause
)

Fix windows test runner not detecting failure


cls

setlocal EnableDelayedExpansion

if not exist mapnik_c_api.cpp curl -O https://raw.github.com/springmeyer/mapnik-c-api/master/mapnik_c_api.cpp
if not exist mapnik_c_api.h curl -O https://raw.github.com/springmeyer/mapnik-c-api/master/mapnik_c_api.h

If DEFINED ProgramFiles(x86) Set BUILDTOOLS32BIT=%ProgramFiles(x86)%
If NOT DEFINED ProgramFiles(x86) Set BUILDTOOLS32BIT=%ProgramFiles%

call "%BUILDTOOLS32BIT%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

set MAPNIK_C_DEFINES=-DUNICODE -DWIN32

set PATH=%PATH%;c:\mapnik-v2.2.0\bin

for /f "delims=" %%i in ('mapnik-config --prefix') do set MAPNIK_PATH=%%i
for /f "delims=" %%i in ('mapnik-config --cxxflags') do set MAPNIK_CXXFLAGS=%%i
for /f "delims=" %%i in ('mapnik-config --ldflags') do set MAPNIK_LDFLAGS=%%i
for /f "delims=" %%i in ('mapnik-config --dep-libs') do set MAPNIK_DEPLIBS=%%i
for /f "delims=" %%i in ('mapnik-config --libs') do set MAPNIK_LIBS=%%i
for /f "delims=" %%i in ('mapnik-config --defines') do set MAPNIK_DEFINES_LIST=%%i
for /f "delims=" %%i in ('mapnik-config --fonts') do set MAPNIK_FONTS_DIRECTORY=%%i
for /f "delims=" %%i in ('mapnik-config --input-plugins') do set MAPNIK_INPUT_PLUGINS_DIRECTORY=%%i

call :constructDefines %MAPNIK_DEFINES_LIST%

echo.LDFLAGS=%MAPNIK_LDFLAGS%
echo.LIBS=%MAPNIK_LIBS%
echo.DEFINES=%MAPNIK_C_DEFINES%
echo.FONTS=%MAPNIK_FONTS_DIRECTORY%
echo.PLUGINS=%MAPNIK_INPUT_PLUGINS_DIRECTORY%

> gen_import_windows.go (
    echo.package mapnik
	echo.
    echo.// #cgo LDFLAGS: c:/mapnik-v2.2.0/lib/mapnik_c_api.dll
	echo.import"C"
	echo.
	echo.const (
	echo.    fontPath = "%MAPNIK_FONTS_DIRECTORY%"
	echo.    pluginPath = "%MAPNIK_INPUT_PLUGINS_DIRECTORY%"
	echo.^)
)

if not exist mapnik_c_api.obj cl -c -nologo -Zm200 -Zc:wchar_t- -O2 %MAPNIK_CXXFLAGS% -W3 -w34100 -w34189 %MAPNIK_C_DEFINES% -I"c:\mapnik-v2.2.0\include" -I"c:\mapnik-v2.2.0\include\mapnik\agg" -I"." mapnik_c_api.cpp
::link /LIBPATH:%MAPNIK_LDFLAGS% %MAPNIK_LIBS% %MAPNIK_DEPLIBS% mapnik_c_api.obj /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /OUT:mapnik_c_api.dll
link /LIBPATH:%MAPNIK_LDFLAGS% %MAPNIK_LIBS%  mapnik_c_api.obj /DLL /OUT:mapnik_c_api.dll

del mapnik_c_api.obj  mapnik_c_api.cpp  mapnik_c_api.lib  mapnik_c_api.exp
move /y mapnik_c_api.dll c:\mapnik-v2.2.0\lib

go install

goto :eof

:constructDefines
	if "%1"=="" exit /b
	set MAPNIK_C_DEFINES=%MAPNIK_C_DEFINES% -D%1
	shift
	goto :constructDefines

cls

setlocal EnableDelayedExpansion

if not exist mapnik_c_api.cpp curl -LO https://raw.github.com/springmeyer/mapnik-c-api/master/mapnik_c_api.cpp
if not exist mapnik_c_api.h curl -LO https://raw.github.com/springmeyer/mapnik-c-api/master/mapnik_c_api.h

If DEFINED ProgramFiles(x86) Set BUILDTOOLS32BIT=%ProgramFiles(x86)%
If NOT DEFINED ProgramFiles(x86) Set BUILDTOOLS32BIT=%ProgramFiles%

call "%BUILDTOOLS32BIT%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

set MAPNIK_C_DEFINES=-DUNICODE -DWIN32

set PATH=%PATH%;c:\mapnik-v2.2.0\bin

for /f "delims=" %%i in ('mapnik-config --prefix') do set MAPNIK_PATH=%%i
for /f "delims=" %%i in ('mapnik-config --cxxflags') do set MAPNIK_CXXFLAGS=%%i
for /f "delims=" %%i in ('mapnik-config --ldflags') do set MAPNIK_LDFLAGS=%%i
for /f "delims=" %%i in ('mapnik-config --dep-libs') do set MAPNIK_DEPLIBS=%%i
for /f "delims=" %%i in ('mapnik-config --libs') do set MAPNIK_LIBS=%%i
for /f "delims=" %%i in ('mapnik-config --defines') do set MAPNIK_DEFINES_LIST=%%i
for /f "delims=" %%i in ('mapnik-config --fonts') do set MAPNIK_FONTS_DIRECTORY=%%i
for /f "delims=" %%i in ('mapnik-config --input-plugins') do set MAPNIK_INPUT_PLUGINS_DIRECTORY=%%i

call :constructDefines %MAPNIK_DEFINES_LIST%

echo.LDFLAGS=%MAPNIK_LDFLAGS%
echo.LIBS=%MAPNIK_LIBS%
echo.DEFINES=%MAPNIK_C_DEFINES%
echo.FONTS=%MAPNIK_FONTS_DIRECTORY%
echo.PLUGINS=%MAPNIK_INPUT_PLUGINS_DIRECTORY%

> gen_import_windows.go (
    echo.package mapnik
	echo.
    echo.// #cgo LDFLAGS: c:/mapnik-v2.2.0/lib/mapnik_c_api.dll
	echo.import"C"
	echo.
	echo.const (
	echo.    fontPath = "%MAPNIK_FONTS_DIRECTORY%"
	echo.    pluginPath = "%MAPNIK_INPUT_PLUGINS_DIRECTORY%"
	echo.^)
)

if not exist mapnik_c_api.obj cl -c -nologo -Zm200 -Zc:wchar_t- -O2 %MAPNIK_CXXFLAGS% -W3 -w34100 -w34189 %MAPNIK_C_DEFINES% -I"c:\mapnik-v2.2.0\include" -I"c:\mapnik-v2.2.0\include\mapnik\agg" -I"." mapnik_c_api.cpp
::link /LIBPATH:%MAPNIK_LDFLAGS% %MAPNIK_LIBS% %MAPNIK_DEPLIBS% mapnik_c_api.obj /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /OUT:mapnik_c_api.dll
link /LIBPATH:%MAPNIK_LDFLAGS% %MAPNIK_LIBS%  mapnik_c_api.obj /DLL /OUT:mapnik_c_api.dll

del mapnik_c_api.obj  mapnik_c_api.cpp  mapnik_c_api.lib  mapnik_c_api.exp
move /y mapnik_c_api.dll c:\mapnik-v2.2.0\lib

go install

goto :eof

:constructDefines
	if "%1"=="" exit /b
	set MAPNIK_C_DEFINES=%MAPNIK_C_DEFINES% -D%1
	shift
	goto :constructDefines

Fix follow links when d/l'ing c api for Windows


rem Copy runtime DLLs

FOR /F %%I IN ('stack exec -- where libstdc++-6.dll') DO copy /Y "%%I" .\
FOR /F %%I IN ('stack exec -- where libgcc_s_seh-1.dll') DO copy /Y "%%I" .\
FOR /F %%I IN ('stack exec -- where libwinpthread-1.dll') DO copy /Y "%%I" .\

rem Copy runtime DLLs

echo "" | stack exec -- where libstdc++-6.dll > lib.txt
echo "" | stack exec -- where libgcc_s_seh-1.dll >> lib.txt
echo "" | stack exec -- where libwinpthread-1.dll >> lib.txt

FOR /F %%I IN (lib.txt) DO copy /Y "%%I" .\

del /q lib.txt

Revert "For loop without external file"

Revert "For loop without external file"

This reverts commit edd19a6a29a160495ace70efbef8be33bcecad5c.


java -cp "jars/tigase-server.jar;libs/*" -Djdbc.drivers=com.mysql.jdbc.Driver tigase.server.XMPPServer --property-file etc/init.properties

java -cp "jars/*" -Djdbc.drivers=com.mysql.jdbc.Driver tigase.server.XMPPServer --property-file etc/init.properties

fix classpath for windows Run.bat script


cmd /c certutil -addstore  "Root" C:\Windows\Temp\GeoTrust_Global_CA.pem
cmd /c del C:\Windows\Temp\GeoTrust_Global_CA.pem
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-stdlib
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-registry
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-dism
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-acl
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-reboot
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-inifile
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-powershell
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install chocolatey-chocolatey
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install gildas-firewall

cmd /c certutil -addstore  "Root" C:\Windows\Temp\GeoTrust_Global_CA.pem
cmd /c del C:\Windows\Temp\GeoTrust_Global_CA.pem
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-windows
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-dism
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install puppetlabs-inifile
cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" module install gildas-firewall

Use the new puppetlabs-windows module

Use the new puppetlabs-windows module


:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional go tool compile arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional go tool link arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.
::
:: CC: Command line to run to compile C code for GOHOSTARCH.
:: Default is "gcc".
::
:: CC_FOR_TARGET: Command line to run compile C code for GOARCH.
:: This is used by cgo. Default is CC.
::
:: FC: Command line to run to compile Fortran code.
:: This is used by cgo. Default is "gfortran".

@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
if x%3==x--no-local goto nolocal
if x%4==x--no-local goto nolocal
setlocal
:nolocal

set GOENV=off
set GOBUILDFAIL=0
set GOFLAGS=
set GO111MODULE=

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Set GOROOT for build.
cd ..
set GOROOT=%CD%
cd src
set vflag=
if x%1==x-v set vflag=-v
if x%2==x-v set vflag=-v
if x%3==x-v set vflag=-v
if x%4==x-v set vflag=-v

if not exist ..\bin\tool mkdir ..\bin\tool
if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4
if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%
if x%vflag==x-v echo cmd/dist
setlocal
set GOROOT=%GOROOT_BOOTSTRAP%
set GOOS=
set GOARCH=
set GOBIN=
set GO111MODULE=off
"%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist
endlocal
if errorlevel 1 goto fail
.\cmd\dist\dist.exe env -w -p >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
if x%vflag==x-v echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist
if x%3==x--dist-tool goto copydist
if x%4==x--dist-tool goto copydist

set buildall=-a
if x%1==x--no-clean set buildall=
if x%2==x--no-clean set buildall=
if x%3==x--no-clean set buildall=
if x%4==x--no-clean set buildall=
if x%1==x--no-banner set buildall=%buildall% --no-banner
if x%2==x--no-banner set buildall=%buildall% --no-banner
if x%3==x--no-banner set buildall=%buildall% --no-banner
if x%4==x--no-banner set buildall=%buildall% --no-banner

:: Run dist bootstrap to complete make.bash.
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.
:: Throw ours, built with Go 1.4, away after bootstrap.
.\cmd\dist\dist.exe bootstrap %vflag% %buildall%
if errorlevel 1 goto fail
del .\cmd\dist\dist.exe
goto end

:: DO NOT ADD ANY NEW CODE HERE.
:: The bootstrap+del above are the final step of make.bat.
:: If something must be added, add it to cmd/dist's cmdbootstrap,
:: to avoid needing three copies in three different shell languages
:: (make.bash, make.bat, make.rc).

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:bootstrapfail
echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe
echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go 1.4.

:fail
set GOBUILDFAIL=1
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%

:end

:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional go tool compile arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional go tool link arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.
::
:: CC: Command line to run to compile C code for GOHOSTARCH.
:: Default is "gcc".
::
:: CC_FOR_TARGET: Command line to run compile C code for GOARCH.
:: This is used by cgo. Default is CC.
::
:: FC: Command line to run to compile Fortran code.
:: This is used by cgo. Default is "gfortran".

@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
if x%3==x--no-local goto nolocal
if x%4==x--no-local goto nolocal
setlocal
:nolocal

set GOENV=off
set GOBUILDFAIL=0
set GOFLAGS=
set GO111MODULE=

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Set GOROOT for build.
cd ..
set GOROOT_TEMP=%CD%
set GOROOT=
cd src
set vflag=
if x%1==x-v set vflag=-v
if x%2==x-v set vflag=-v
if x%3==x-v set vflag=-v
if x%4==x-v set vflag=-v

if not exist ..\bin\tool mkdir ..\bin\tool

:: Calculating GOROOT_BOOTSTRAP
if not "x%GOROOT_BOOTSTRAP%"=="x" goto bootstrapset
for /f "tokens=*" %%g in ('where go 2^>nul') do (
	if "x%GOROOT_BOOTSTRAP%"=="x" (
		for /f "tokens=*" %%i in ('%%g env GOROOT 2^>nul') do (
			if /I not %%i==%GOROOT_TEMP% (
				set GOROOT_BOOTSTRAP=%%i
			)
		)
	)
)
if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4

:bootstrapset
if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
set GOROOT=%GOROOT_TEMP%
set GOROOT_TEMP=

echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%
if x%vflag==x-v echo cmd/dist
setlocal
set GOROOT=%GOROOT_BOOTSTRAP%
set GOOS=
set GOARCH=
set GOBIN=
set GO111MODULE=off
"%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist
endlocal
if errorlevel 1 goto fail
.\cmd\dist\dist.exe env -w -p >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
if x%vflag==x-v echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist
if x%3==x--dist-tool goto copydist
if x%4==x--dist-tool goto copydist

set buildall=-a
if x%1==x--no-clean set buildall=
if x%2==x--no-clean set buildall=
if x%3==x--no-clean set buildall=
if x%4==x--no-clean set buildall=
if x%1==x--no-banner set buildall=%buildall% --no-banner
if x%2==x--no-banner set buildall=%buildall% --no-banner
if x%3==x--no-banner set buildall=%buildall% --no-banner
if x%4==x--no-banner set buildall=%buildall% --no-banner

:: Run dist bootstrap to complete make.bash.
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.
:: Throw ours, built with Go 1.4, away after bootstrap.
.\cmd\dist\dist.exe bootstrap %vflag% %buildall%
if errorlevel 1 goto fail
del .\cmd\dist\dist.exe
goto end

:: DO NOT ADD ANY NEW CODE HERE.
:: The bootstrap+del above are the final step of make.bat.
:: If something must be added, add it to cmd/dist's cmdbootstrap,
:: to avoid needing three copies in three different shell languages
:: (make.bash, make.bat, make.rc).

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:bootstrapfail
echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe
echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go 1.4.

:fail
set GOBUILDFAIL=1
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%

:end

add default GOROOT_BOOTSTRAP in Windows

build: add default GOROOT_BOOTSTRAP in Windows

CL 57753 added support to make.bash and make.rc to
default GOROOT_BOOTSTRAP to 'go env GOROOT'. This
patch does the same in make.bat for Windows.

Updates #18545
Fixes #28641

Change-Id: I9152cc5080ed219b4de5bad0bd12d7725422ee1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/96455
Reviewed-by: Alex Brainman <54ba58c8441b5eff861de6b4e5ee46baf086b142@gmail.com>


set SIGN_TARGET=%1%

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool" sign /v /ac "cert\After_10-10-10_MSCV-VSClass3.cer" /s MY /n "RStudio, Inc." /t http://timestamp.VeriSign.com/scripts/timstamp.dll %SIGN_TARGET%
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool" verify /v /kp %SIGN_TARGET%

add signing utility

add signing utility


@echo off

set BIN_NAME=sqlitebiter

echo "----- start clean -----"
pyinstaller cli.py --clean --noconfirm
echo "----- complete clean -----"

echo "----- start build -----"
pyinstaller cli.py --onefile --name %BIN_NAME% --noconfirm
echo "----- complete build -----"

echo "----- start compress -----"
set DIST_DIR_NAME=dist
set BIN_PATH=%DIST_DIR_NAME%/%BIN_NAME%
set ARCHIVE_PATH=%DIST_DIR_NAME%/%BIN_NAME%_win_x64

powershell compress-archive -Force %BIN_PATH%.exe %ARCHIVE_PATH%.zip
echo "----- complete compress -----"

pause

@echo off

set BIN_NAME=sqlitebiter

echo "----- start build -----"
pyinstaller cli.py --onefile --name %BIN_NAME% --clean --noconfirm --specpath build
echo "----- complete build -----"

echo "----- start compress -----"
set DIST_DIR_NAME=dist
set BIN_PATH=%DIST_DIR_NAME%/%BIN_NAME%
set ARCHIVE_PATH=%DIST_DIR_NAME%/%BIN_NAME%_win_x64

powershell compress-archive -Force %BIN_PATH%.exe %ARCHIVE_PATH%.zip
echo "----- complete compress -----"

pause

Remove duplicate processing

Remove duplicate processing


@echo off
:: Change this to ON when debugging this batch file.

SetLocal

cls

:: set window title
TITLE WPN-XM Server Stack for Windows - Build Script!

:: display a Menu

:SHOWMENU
cls
echo.
echo             WPN-XM Build Menu
echo             =================
echo.
echo   [1] Start "One-Click Build"
echo   [2] Download Components for the "not-web" Installation Wizards
echo   [3] Build the "not-web" Installation Wizards
echo   [4] Build the "Server-Control-Panel" (Tray Application)
echo   [x] Quit
echo.

:: ask for input

set input=0
set /p input="Your selection: "

:: accept input and forward to handlers

if %input%==1 goto OPTION1
if %input%==2 goto OPTION2
if %input%==3 goto OPTION3
if %input%==4 goto OPTION4
IF %input%==x goto QUIT
goto SHOWMENU

:: handlers

:OPTION1
    echo.
    echo One-Click Build
    echo.
    call build.bat
goto END

:OPTION2
    echo.
    echo Downloading all Components for the "not-web" Installation Wizards
    echo.
    call bin\nant\bin\nant.exe -buildfile:build.xml download-components
goto END

:OPTION3
    echo.
    echo Building "not-web" Installation Wizards (use existing Downloads)
    echo.
    call bin\nant\bin\nant.exe -buildfile:build.xml compile-wpnxm-allinone-installer-no-download compile-wpnxm-bigpack-installer-no-download compile-wpnxm-lite-installer-no-download
goto END

:OPTION4
    echo.
    echo Building the "Server-Control-Panel" (Tray Application)
    echo.
    call bin\nant\bin\nant.exe -buildfile:build.xml compile-server-control-panel
goto END

:END
pause

:QUIT

@echo off
:: Change this to ON when debugging this batch file.

SetLocal

cls

:: set window title
TITLE WPN-XM Server Stack for Windows - Build Script!

:: display a Menu

:SHOWMENU
cls
echo.
echo             WPN-XM Build Menu
echo             =================
echo.
echo   [1] Start "One-Click Build"
echo   [2] Download Components for the "not-web" Installation Wizards
echo   [3] Build the "not-web" Installation Wizards
echo   [4] Build the "Server-Control-Panel" (Tray Application)
echo   [x] Quit
echo.

:: ask for input

set input=0
set /p input="Your selection: "

:: accept input and forward to handlers

if %input%==1 goto OPTION1
if %input%==2 goto OPTION2
if %input%==3 goto OPTION3
if %input%==4 goto OPTION4
IF %input%==x goto QUIT
goto SHOWMENU

:: handlers

:OPTION1
    echo.
    echo One-Click Build
    echo.
    call build.bat
goto END

:OPTION2
    echo.
    echo Downloading all Components for the "not-web" Installation Wizards
    echo.
    call bin\nant\bin\nant.exe -buildfile:build.xml download-components
goto END

:OPTION3
    echo.
    echo Building "not-web" Installation Wizards (use existing Downloads)
    echo.
    call bin\nant\bin\nant.exe -buildfile:build.xml compile-wpnxm-allinone-installer-no-download compile-wpnxm-bigpack-installer-no-download compile-wpnxm-lite-installer-no-download
goto END

:OPTION4
    echo.
    echo Building the "Server-Control-Panel" (Tray Application)
    echo.
    call bin\nant\bin\nant.exe -buildfile:build.xml build-server-control-panel
goto END

:END
pause

:QUIT

switch from compile to build step execution, just because it works now


MSBuild.exe .\src\kontrols.sln /t:Rebuild /p:Configuration=Release
copy "C:\Dev\kontrols\src\kontrols\bin\Release\kontrols.dll" "C:\Dev\kontrols\nuget\lib\net45\kontrols.dll"
nuget.exe pack "C:\dev\kontrols\nuget\kontrols.nuspec"

Build the assembly before staging for nuget


pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
cd pyuv-*

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /release /x86
echo "Building x86"
py -3.3-32 setup.py build_ext --inplace --libuv-clean-compile
mv pyuv.pyd pyuv-x86.pyd

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /release /x64
echo "Building x64"
py -3.3 setup.py build_ext --inplace --libuv-clean-compile

pip install -d . pyuv
tar -xzf pyuv-*.tar.gz
cd pyuv-*

Setlocal EnableDelayedExpansion
set DISTUTILS_USE_SDK=1

call "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /release /x86
echo "Building 2.7 x86"
py -2.7-32 setup.py build_ext --libuv-clean-compile bdist_wheel
mv pyuv.pyd pyuv-x86.pyd

call "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /release /x64
echo "Building 2.7 x64"
py -2.7 setup.py build_ext --libuv-clean-compile bdist_wheel

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /release /x86
echo "Building 3.3 x86"
py -3.3-32 setup.py build_ext --libuv-clean-compile bdist_wheel
mv pyuv.pyd pyuv-x86.pyd

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /release /x64
echo "Building 3.3 x64"
py -3.3 setup.py build_ext --libuv-clean-compile bdist_wheel

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /release /x86
echo "Building 3.4 x86"
py -3.4-32 setup.py build_ext --libuv-clean-compile bdist_wheel
mv pyuv.pyd pyuv-x86.pyd

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /release /x64
echo "Building 3.4 x64"
py -3.4 setup.py build_ext --libuv-clean-compile bdist_wheel

create wheels for all relevant versions

win: create wheels for all relevant versions


@echo off
rem -----------------------------------
rem TO BE RUN FROM THE ROOT OF THE REPO
rem -----------------------------------

set BUILD_MODE=%1
if "%BUILD_MODE%"=="debug" set TARGET="debug"
if "%BUILD_MODE%"=="appveyor" set TARGET="debug"
if "%BUILD_MODE%"=="release" set TARGET="release"
if "%BUILD_MODE%"=="fulldebug" set TARGET="debug"
if "%BUILD_MODE%"=="fullrelease" set TARGET="release"

SET ROOT_DIR="%cd%"
echo "Root directory is %ROOT_DIR%"
echo "Build mode is %BUILD_MODE%"

rem for Windows 10+ only
rem set PRINT_PREFIX="^<ESC^>[32m [32mGreen[0m"
set PRINT_PREFIX="-"
set NMAKE_OPTIONS="clean all /f Makefile"

set XPIKS_DEPS_ROOT="%ROOT_DIR%\..\xpiks-deps"
set XPIKS_DEPS_LIBS="%XPIKS_DEPS_ROOT%\windows-libs\%TARGET%-x64"

if "%BUILD_MODE%"=="appveyor" (
   set PRINT_PREFIX=""
   set QMAKE_EXE="qmake"
   set ARCH="x64"
   rem call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH%
   git submodule update --init --recursive
) else (
  set QMAKE_EXE="C:\Qt\Qt5.6.2\5.6\msvc2015_64\bin\qmake.exe"
)

rem chillout
echo "%PRINT_PREFIX% Building chillout..."
cd %ROOT_DIR%\vendors\chillout\src\chillout
%QMAKE_EXE% "CONFIG+=%TARGET%" chillout.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\chillout.* ..\..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building chillout... - done"

rem zlib
echo "%PRINT_PREFIX% Building zlib..."
move %XPIKS_DEPS_ROOT%\zlib-1.2.11 %ROOT_DIR%\vendors
cd %ROOT_DIR%\vendors\zlib-project
%QMAKE_EXE% "CONFIG+=%TARGET%" zlib.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\z.* ..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building zlib... - done"

rem mman
echo "%PRINT_PREFIX% Building mman..."
cd %ROOT_DIR%\vendors\cpp-libface\mman-win32
%QMAKE_EXE% "CONFIG+=%TARGET%" mman-win32.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\mman.* ..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building mman... - done"

rem tiny-aes
echo "%PRINT_PREFIX% Renaming tiny-aes..."
cd %ROOT_DIR%\vendors\tiny-aes
ren aes.c aes.cpp
echo "%PRINT_PREFIX% Renaming tiny-aes... - done"

rem cpp-libface
echo "%PRINT_PREFIX% Building cpp-libface..."
cd %ROOT_DIR%\vendors\cpp-libface\libface-project
%QMAKE_EXE% "CONFIG+=%TARGET%" libface.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\face.* ..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building cpp-libface... - done"

rem ssdll
echo "%PRINT_PREFIX% Building ssdll..."
cd %ROOT_DIR%\vendors\ssdll\src\ssdll
%QMAKE_EXE% "CONFIG+=%TARGET% %BUILD_MODE%" ssdll.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\ssdll.* ..\..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building ssdll... - done"

rem quazip
echo "%PRINT_PREFIX% Building quazip..."
cd %ROOT_DIR%\vendors\quazip\quazip
%QMAKE_EXE% "CONFIG+=%TARGET%" quazip.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\quazip* ..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building quazip... - done"

rem hunspell
echo "%PRINT_PREFIX% Building hunspell..."
cd %ROOT_DIR%\vendors\hunspell
%QMAKE_EXE% "CONFIG+=%TARGET%" hunspell.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\hunspell.* ..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building hunspell... - done"

cd %ROOT_DIR%\src\recoverty
%QMAKE_EXE% "CONFIG+=%TARGET%" recoverty.pro
nmake.exe "%NMAKE_OPTIONS%"
echo "%PRINT_PREFIX% Building recoverty... - done"

set XPKS_ROOT="%ROOT_DIR%\..\libxpks"
set THMBNLR_ROOT="%ROOT_DIR%\..\libthmbnlr"

if not "%BUILD_MODE%"=="appveyor" (
  set "TRUE="
  IF "%BUILD_MODE%"=="fulldebug" set TRUE=1
  IF "%BUILD_MODE%"=="fullrelease" set TRUE=1
  IF defined TRUE (
      rem libxpks
      echo "%PRINT_PREFIX% Building real libxpks..."
      copy %ROOT_DIR%\libs\%TARGET%\*curl* %XPKS_ROOT%\libs\%TARGET%
      copy %ROOT_DIR%\libs\%TARGET%\quazip* %XPKS_ROOT%\libs\%TARGET%
      cd %XPKS_ROOT%\src\xpks
      %QMAKE_EXE% "CONFIG+=%TARGET%" xpks.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\xpks.* %ROOT_DIR%\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libxpks... - done"

      rem libthmbnlr
      echo "%PRINT_PREFIX% Building real libthmbnlr..."
      cd "%THMBNLR_ROOT%\src\libthmbnlr"
      %QMAKE_EXE% "CONFIG+=%TARGET%" libthmbnlr.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\thmbnlr.* %ROOT_DIR%\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libthmbnlr... - done"
    ) else (
      rem libxpks
      echo "%PRINT_PREFIX% Building stub libxpks..."
      cd %ROOT_DIR%\src\libxpks_stub
      %QMAKE_EXE% "CONFIG+=%TARGET%" libxpks_stub.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\xpks.* ..\..\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libxpks... - done"

      rem libthmbnlr
      echo "%PRINT_PREFIX% Building stub libthmbnlr..."
      cd "%ROOT_DIR%\vendors\libthmbnlr"
      %QMAKE_EXE% "CONFIG+=%TARGET%" thmbnlr.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\thmbnlr.* %ROOT_DIR%\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libthmbnlr... - done"
    )
) else (
  echo "%PRINT_PREFIX% Copying non-buildable artifacts from xpiks-deps..."
  echo "%PRINT_PREFIX% xpiks-deps root is %XPIKS_DEPS_LIBS%"

  rem ffmpeg
  xcopy /s %XPIKS_DEPS_ROOT%\windows-libs\ffmpeg-x64\%TARGET% %ROOT_DIR%\libs\%TARGET%

  rem xpiks deps
  copy %XPIKS_DEPS_LIBS%\*curl* %ROOT_DIR%\libs\%TARGET%
  copy %XPIKS_DEPS_LIBS%\thmbnlr.* %ROOT_DIR%\libs\%TARGET%
  copy %XPIKS_DEPS_LIBS%\xpks.* %ROOT_DIR%\libs\%TARGET%
  rem integration tests deps
  copy %XPIKS_DEPS_LIBS%\libexpat.* %ROOT_DIR%\libs\%TARGET%
  copy %XPIKS_DEPS_LIBS%\libexiv2.* %ROOT_DIR%\libs\%TARGET%
)

echo "%PRINT_PREFIX% Vendors preparation for %BUILD_MODE%: done"

@echo off
rem -----------------------------------
rem TO BE RUN FROM THE ROOT OF THE REPO
rem -----------------------------------

set BUILD_MODE=%1
if "%BUILD_MODE%"=="debug" set TARGET="debug"
if "%BUILD_MODE%"=="appveyor" set TARGET="debug"
if "%BUILD_MODE%"=="release" set TARGET="release"
if "%BUILD_MODE%"=="fulldebug" set TARGET="debug"
if "%BUILD_MODE%"=="fullrelease" set TARGET="release"

set ARCH=x64

SET ROOT_DIR="%cd%"
echo "Root directory is %ROOT_DIR%"
echo "Build mode is %BUILD_MODE%"

rem for Windows 10+ only
rem set PRINT_PREFIX="^<ESC^>[32m [32mGreen[0m"
set PRINT_PREFIX="-"
set NMAKE_OPTIONS="clean all /f Makefile"

set XPIKS_DEPS_ROOT="%ROOT_DIR%\..\xpiks-deps"
set XPIKS_DEPS_LIBS="%XPIKS_DEPS_ROOT%\windows-libs\%TARGET%-%ARCH%"

if "%BUILD_MODE%"=="appveyor" (
   set PRINT_PREFIX=""
   set QMAKE_EXE="qmake"
   rem call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH%
   git submodule update --init --recursive
) else (
  set QMAKE_EXE="C:\Qt\Qt5.6.2\5.6\msvc2015_64\bin\qmake.exe"
)

rem chillout
echo "%PRINT_PREFIX% Building chillout..."
cd %ROOT_DIR%\vendors\chillout\src\chillout
%QMAKE_EXE% "CONFIG+=%TARGET%" chillout.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\chillout.* ..\..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building chillout... - done"

rem zlib
echo "%PRINT_PREFIX% Building zlib..."
move %XPIKS_DEPS_ROOT%\zlib-1.2.11 %ROOT_DIR%\vendors
cd %ROOT_DIR%\vendors\zlib-project
%QMAKE_EXE% "CONFIG+=%TARGET%" zlib.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\z.* ..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building zlib... - done"

rem mman
echo "%PRINT_PREFIX% Building mman..."
cd %ROOT_DIR%\vendors\cpp-libface\mman-win32
%QMAKE_EXE% "CONFIG+=%TARGET%" mman-win32.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\mman.* ..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building mman... - done"

rem tiny-aes
echo "%PRINT_PREFIX% Renaming tiny-aes..."
cd %ROOT_DIR%\vendors\tiny-aes
ren aes.c aes.cpp
echo "%PRINT_PREFIX% Renaming tiny-aes... - done"

rem cpp-libface
echo "%PRINT_PREFIX% Building cpp-libface..."
cd %ROOT_DIR%\vendors\cpp-libface\libface-project
%QMAKE_EXE% "CONFIG+=%TARGET%" libface.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\face.* ..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building cpp-libface... - done"

rem ssdll
echo "%PRINT_PREFIX% Building ssdll..."
cd %ROOT_DIR%\vendors\ssdll\src\ssdll
%QMAKE_EXE% "CONFIG+=%TARGET% %BUILD_MODE%" ssdll.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\ssdll.* ..\..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building ssdll... - done"

rem quazip
echo "%PRINT_PREFIX% Building quazip..."
cd %ROOT_DIR%\vendors\quazip\quazip
%QMAKE_EXE% "CONFIG+=%TARGET%" quazip.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\quazip* ..\..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building quazip... - done"

rem hunspell
echo "%PRINT_PREFIX% Building hunspell..."
cd %ROOT_DIR%\vendors\hunspell
%QMAKE_EXE% "CONFIG+=%TARGET%" hunspell.pro
nmake.exe "%NMAKE_OPTIONS%"
copy %TARGET%\hunspell.* ..\..\libs\%TARGET%
echo "%PRINT_PREFIX% Building hunspell... - done"

cd %ROOT_DIR%\src\recoverty
%QMAKE_EXE% "CONFIG+=%TARGET%" recoverty.pro
nmake.exe "%NMAKE_OPTIONS%"
echo "%PRINT_PREFIX% Building recoverty... - done"

set XPKS_ROOT="%ROOT_DIR%\..\libxpks"
set THMBNLR_ROOT="%ROOT_DIR%\..\libthmbnlr"

if not "%BUILD_MODE%"=="appveyor" (
  set "TRUE="
  IF "%BUILD_MODE%"=="fulldebug" set TRUE=1
  IF "%BUILD_MODE%"=="fullrelease" set TRUE=1
  IF defined TRUE (
      rem libxpks
      echo "%PRINT_PREFIX% Building real libxpks..."
      copy %ROOT_DIR%\libs\%TARGET%\*curl* %XPKS_ROOT%\libs\%TARGET%
      copy %ROOT_DIR%\libs\%TARGET%\quazip* %XPKS_ROOT%\libs\%TARGET%
      cd %XPKS_ROOT%\src\xpks
      %QMAKE_EXE% "CONFIG+=%TARGET%" xpks.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\xpks.* %ROOT_DIR%\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libxpks... - done"

      rem libthmbnlr
      echo "%PRINT_PREFIX% Building real libthmbnlr..."
      cd "%THMBNLR_ROOT%\src\libthmbnlr"
      %QMAKE_EXE% "CONFIG+=%TARGET%" libthmbnlr.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\thmbnlr.* %ROOT_DIR%\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libthmbnlr... - done"
    ) else (
      rem libxpks
      echo "%PRINT_PREFIX% Building stub libxpks..."
      cd %ROOT_DIR%\src\libxpks_stub
      %QMAKE_EXE% "CONFIG+=%TARGET%" libxpks_stub.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\xpks.* ..\..\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libxpks... - done"

      rem libthmbnlr
      echo "%PRINT_PREFIX% Building stub libthmbnlr..."
      cd "%ROOT_DIR%\vendors\libthmbnlr"
      %QMAKE_EXE% "CONFIG+=%TARGET%" thmbnlr.pro
      nmake.exe "%NMAKE_OPTIONS%"
      copy %TARGET%\thmbnlr.* %ROOT_DIR%\libs\%TARGET%
      echo "%PRINT_PREFIX% Building libthmbnlr... - done"
    )
) else (
  echo "%PRINT_PREFIX% Copying non-buildable artifacts from xpiks-deps..."
  echo "%PRINT_PREFIX% xpiks-deps root is %XPIKS_DEPS_LIBS%"

  rem ffmpeg
  xcopy /s %XPIKS_DEPS_ROOT%\windows-libs\ffmpeg-%ARCH%\%TARGET% %ROOT_DIR%\libs\%TARGET%

  rem xpiks deps
  copy %XPIKS_DEPS_LIBS%\*curl* %ROOT_DIR%\libs\%TARGET%
  copy %XPIKS_DEPS_LIBS%\thmbnlr.* %ROOT_DIR%\libs\%TARGET%
  copy %XPIKS_DEPS_LIBS%\xpks.* %ROOT_DIR%\libs\%TARGET%
  rem integration tests deps
  copy %XPIKS_DEPS_LIBS%\libexpat.* %ROOT_DIR%\libs\%TARGET%
  copy %XPIKS_DEPS_LIBS%\libexiv2.* %ROOT_DIR%\libs\%TARGET%
)

echo "%PRINT_PREFIX% Vendors preparation for %BUILD_MODE%: done"

Move arch to variable

Move arch to variable


SET scene=2017-11-03-01
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-03\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-03-03
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-03\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-03-04
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-03\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-04-01
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-04\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-04-02
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-04\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-04-03
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-04\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-04-04
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-04\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-04-05
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-04\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-01
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-02
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-03
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-05
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-06
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-07
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-08
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-05-09
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-05\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-06-01
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-06\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-06-02
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-06\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-06-03
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-06\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-06-04
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-06\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-06-05
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-06\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-06-06
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-06\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-07-01
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-07\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-07-02
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-07\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-07-03
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-07\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-07-04
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-07\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-07-05
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-07\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-07-06
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-07\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-08-01
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-08\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-08-02
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-08\%scene%\
REN photos.geojson %scene%.geojson

SET scene=2017-11-08-03
python photo_tools/photos2map/photos2geojson.py d:\trolleway\2017-12-25_ortophoto\source\source\2017-11-08\%scene%\
REN photos.geojson %scene%.geojson

Create multifolder.bat

Create multifolder.bat


REM the following works for networked drives with spaces!!!
REM Net use p: "\\myNetwork\HPS Classes$\computer programming 2011\Assignments" /persistent:no
REM set NODE_PATH=p:\nodejs

REM dir/x gives the short file names.
REM you need to get these paths correct for nodejs, ARM, spark-cli, dfu files

set NODE_PATH=C:\progra~1\nodejs

set DFU_FILES_PATH=C:\Users\JEREL_~1\DOCUME~1\Jeremy\cp12\spark\dfu

set SPARK_CLI_PATH=C:\Users\JEREL_~1\AppData\Roaming\npm

set GCC_ARM_PATH=C:\PROGRA~2\GNUTOO~1\4947E~1.920\bin

set PATH=C:\Windows;C:\Windows\System32;%NODE_PATH%;%DFU_FILES_PATH%;%SPARK_CLI_PATH%;%GCC_ARM_PATH%;

REM note the next line overwrites the myoutput using > normally >> adds to the file

echo "*************************************"  > myoutput.txt 2>&1
echo "PATH"                                  >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
rem PATH                                     >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

echo "*************************************" >> myoutput.txt 2>&1
echo "node --version"                        >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
node --version                               >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

echo "*************************************" >> myoutput.txt 2>&1
echo "arm-none-eabi-gcc --version"           >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
arm-none-eabi-gcc --version                  >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

echo "*************************************" >> myoutput.txt 2>&1
echo "dfu-util -l"                           >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
dfu-util -l                                  >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

echo "*************************************" >> myoutput.txt 2>&1
echo "spark flash --usb cc3000"              >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
spark flash --usb cc3000                     >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

rem spark must be last or in its own batch file as it kills the batch program

echo "*************************************" >> myoutput.txt 2>&1
echo "spark --version"                       >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
spark --version                              >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

rem spark must be last or in its own batch file as it kills the batch program

echo "*************************************" >> myoutput.txt 2>&1
echo "npm --version"                         >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1
npm --version                                >> myoutput.txt 2>&1
echo "*************************************" >> myoutput.txt 2>&1

Create cc3000.bat

Create cc3000.bat


::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

set autoRestVersion=0.16.0-Nightly20160329
set specUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-scheduler/2016-03-01/swagger/scheduler.json"
set source=-Source https://www.myget.org/F/autorest/api/v2

set repoRoot=%~dp0..\..\..\..
set autoRestExe=%repoRoot%\packages\autorest.%autoRestVersion%\tools\AutoRest.exe
set generateFolder=%~dp0Generated

%repoRoot%\tools\nuget.exe install autorest %source% -Version %autoRestVersion% -o %repoRoot%\packages

if exist %generateFolder% rd /S /Q  %generateFolder%
%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Scheduler -Input %specUrl% -outputDirectory %generateFolder% -Header NONE

::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

set autoRestVersion=0.16.0-Nightly20160329
set specUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/c582747a6ea5d55ea976a9a3cb7c7959e7f9ce2f/arm-scheduler/2016-03-01/swagger/scheduler.json"
set source=-Source https://www.myget.org/F/autorest/api/v2

set repoRoot=%~dp0..\..\..\..
set autoRestExe=%repoRoot%\packages\autorest.%autoRestVersion%\tools\AutoRest.exe
set generateFolder=%~dp0Generated

%repoRoot%\tools\nuget.exe install autorest %source% -Version %autoRestVersion% -o %repoRoot%\packages

if exist %generateFolder% rd /S /Q  %generateFolder%
%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Scheduler -Input %specUrl% -outputDirectory %generateFolder% -Header NONE

Change specUrl as recommended by the SDK team.


Create runhellomoduleswin64image.bat

Create runhellomoduleswin64image.bat


:: %~dp0 gives the dirname of the script

cmd /c %~dp0common.bat
cmd /c %~dp0vagrant-ssh.bat

:: %~dp0 gives the dirname of the script

cmd /c %~dp0firewall-disable.bat
cmd /c %~dp0vagrant-ssh.bat

Remove a level of indirection

Remove a level of indirection


rem USAGE: unity_RunAutoTests.bat [<UnityExe>] [<SdkRepoName>] [<ProjRootPath>] [<BuildIdentifier>]
@echo on
rem Make folder links from the UnitySdk to this test project
rem Requires mklink which may require administrator
rem Requires the following environment variables:
rem   TestAndroid - (Optional - Default true if unset) set to "false" (without quotes) to skip building Android APK
rem   TestiPhone - (Optional - Default true if unset) set to "false" (without quotes) to skip building iOS XCode project
rem   TestWp8 - (Optional - Default true if unset) set to "false" (without quotes) to skip building Windows Universal 8 vs-sln
rem   UNITY_PUBLISH_VERSION - (Not required if %1 is defined) Versioned Unity executable name (Assumes multiple potential Unity installations, all in your PATH, each uniquely renamed)
rem   EXECUTOR_NUMBER - (Not required if %4 is defined) Automatic Jenkins variable

setlocal
if [%1]==[] (
    set UnityExe=%UNITY_PUBLISH_VERSION%
) ELSE (
    set UnityExe=%1
)
if [%2]==[] (
    set SdkName=UnitySDK
) ELSE (
    set SdkName=%2
)
if [%3]==[] (
    set ProjRootPath=C:\dev\UnityProjects\%UnityExe%
) ELSE (
    set ProjRootPath=%~3
)
if [%4]==[] (
    set BuildIdentifier=JBuild_%SdkName%_%EXECUTOR_NUMBER%
) ELSE (
    set BuildIdentifier=%4
)
if [%TestAndroid%]==[] (set TestAndroid=true)
if [%TestiPhone%]==[] (set TestiPhone=true)
if [%TestWp8%]==[] (set TestWp8=true)

call :SetProjDefines
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :RunClientJenkernaught1
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :RunClientJenkernaught2
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :RunClientJenkernaught3
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
IF [%TestAndroid%]==[true] (call :BuildAndroid)
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
IF [%TestiPhone%]==[true] (call :BuildiPhone)
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
IF [%TestWp8%]==[true] (call :BuildWp8)
endlocal
exit /b %errorLevel%

:SetProjDefines
echo === Test compilation in all example projects ===
call :SetEachProjDefine %SdkName%_BUP
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TA
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TC
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TS
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TZ
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
goto :EOF

:SetEachProjDefine
cd "%ProjRootPath%\%1"
%UnityExe% -projectPath "%ProjRootPath%\%1" -quit -batchmode -executeMethod SetupPlayFabExample.Setup -logFile "%ProjRootPath%\compile%1.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\compile%1.txt"
    exit /b %errorLevel%
)
goto :EOF

:RunClientJenkernaught1
echo === Build Win32 Client Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeWin32TestingBuild -logFile "%ProjRootPath%\buildWin32Client.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\buildWin32Client.txt"
    exit /b %errorLevel%
)
goto :EOF

:RunClientJenkernaught2
echo === Run the %UnityExe% Client UnitTests ===
cd "%ProjRootPath%\%SdkName%_TC\testBuilds"
Win32test -batchmode -nographics -logFile "%ProjRootPath%\clientTestOutput.txt"
if %errorLevel% NEQ 0 (
    exit /b %errorLevel%
)
goto :EOF

:RunClientJenkernaught3
echo === Save test results to Jenkernaught ===
cd %WORKSPACE%/SDKGenerator/JenkinsConsoleUtility/bin/Debug
JenkinsConsoleUtility --listencs -buildIdentifier %BuildIdentifier% -workspacePath %WORKSPACE% -timeout 30 -verbose true
if %errorLevel% NEQ 0 (
    exit /b %errorLevel%
)
goto :EOF

:BuildAndroid
echo === Build Android Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeAndroidBuild -logFile "%ProjRootPath%\buildAndroidOutput.txt"
if %errorLevel% NEQ 0 (
    "%ProjRootPath%\buildAndroidOutput.txt"
    exit /b %errorLevel%
)
goto :EOF

:BuildiPhone
echo === Build iPhone Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeIPhoneBuild -logFile "%ProjRootPath%\buildiPhoneOutput.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\buildiPhoneOutput.txt"
    exit /b %errorLevel%
)
goto :EOF

:BuildWp8
echo === Build WinPhone Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeWp8Build -logFile "%ProjRootPath%\buildWp8Output.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\buildWp8Output.txt"
    exit /b %errorLevel%
)
goto :EOF

rem USAGE: unity_RunAutoTests.bat [<UnityExe>] [<SdkRepoName>] [<ProjRootPath>] [<BuildIdentifier>]
@echo on
rem Make folder links from the UnitySdk to this test project
rem Requires mklink which may require administrator
rem Requires the following environment variables:
rem   TestAndroid - (Optional - Default true if unset) set to "false" (without quotes) to skip building Android APK
rem   TestiPhone - (Optional - Default true if unset) set to "false" (without quotes) to skip building iOS XCode project
rem   TestWp8 - (Optional - Default true if unset) set to "false" (without quotes) to skip building Windows Universal 8 vs-sln
rem   UNITY_PUBLISH_VERSION - (Not required if %1 is defined) Versioned Unity executable name (Assumes multiple potential Unity installations, all in your PATH, each uniquely renamed)
rem   EXECUTOR_NUMBER - (Not required if %4 is defined) Automatic Jenkins variable

setlocal
if [%1]==[] (
    set UnityExe=%UNITY_PUBLISH_VERSION%
) ELSE (
    set UnityExe=%1
)
if [%2]==[] (
    set SdkName=UnitySDK
) ELSE (
    set SdkName=%2
)
if [%3]==[] (
    set ProjRootPath=C:\dev\UnityProjects\%UnityExe%
) ELSE (
    set ProjRootPath=%~3
)
if [%4]==[] (
    set BuildIdentifier=JBuild_%SdkName%_%EXECUTOR_NUMBER%
) ELSE (
    set BuildIdentifier=%4
)
if [%TestAndroid%]==[] (set TestAndroid=true)
if [%TestiPhone%]==[] (set TestiPhone=true)
if [%TestWp8%]==[] (set TestWp8=true)

call :SetProjDefines
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :RunClientJenkernaught1
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :RunClientJenkernaught2
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :RunClientJenkernaught3
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
IF [%TestAndroid%]==[true] (call :BuildAndroid)
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
IF [%TestiPhone%]==[true] (call :BuildiPhone)
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
IF [%TestWp8%]==[true] (call :BuildWp8)
endlocal
exit /b %errorLevel%

:SetProjDefines
echo === Test compilation in all example projects ===
call :SetEachProjDefine %SdkName%_BUP
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TA
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TC
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TS
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
call :SetEachProjDefine %SdkName%_TZ
if %errorLevel% NEQ 0 (exit /b %errorLevel%)
goto :EOF

:SetEachProjDefine
cd "%ProjRootPath%\%1"
%UnityExe% -projectPath "%ProjRootPath%\%1" -quit -batchmode -executeMethod SetupPlayFabExample.Setup -logFile "%ProjRootPath%\compile%1.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\compile%1.txt"
    exit /b %errorLevel%
)
goto :EOF

:RunClientJenkernaught1
echo === Build Win32 Client Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeWin32TestingBuild -logFile "%ProjRootPath%\buildWin32Client.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\buildWin32Client.txt"
    exit /b %errorLevel%
)
goto :EOF

:RunClientJenkernaught2
echo === Run the %UnityExe% Client UnitTests ===
cd "%ProjRootPath%\%SdkName%_TC\testBuilds"
Win32test -batchmode -nographics -logFile "%ProjRootPath%\clientTestOutput.txt"
if %errorLevel% NEQ 0 (
    exit /b %errorLevel%
)
goto :EOF

:RunClientJenkernaught3
echo === Save test results to Jenkernaught ===
cd %WORKSPACE%/SDKGenerator/JenkinsConsoleUtility/bin/Debug
JenkinsConsoleUtility --listencs -buildIdentifier %BuildIdentifier% -workspacePath %WORKSPACE% -timeout 30 -verbose true
if %errorLevel% NEQ 0 (
    echo === error level not zero, exiting === %errorLevel%
rem    exit /b %errorLevel%
)
goto :EOF

:BuildAndroid
echo === Build Android Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeAndroidBuild -logFile "%ProjRootPath%\buildAndroidOutput.txt"
if %errorLevel% NEQ 0 (
    "%ProjRootPath%\buildAndroidOutput.txt"
    exit /b %errorLevel%
)
goto :EOF

:BuildiPhone
echo === Build iPhone Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeIPhoneBuild -logFile "%ProjRootPath%\buildiPhoneOutput.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\buildiPhoneOutput.txt"
    exit /b %errorLevel%
)
goto :EOF

:BuildWp8
echo === Build WinPhone Target ===
cd "%ProjRootPath%\%SdkName%_TC"
%UnityExe% -projectPath "%ProjRootPath%\%SdkName%_TC" -quit -batchmode -executeMethod PlayFab.Internal.PlayFabPackager.MakeWp8Build -logFile "%ProjRootPath%\buildWp8Output.txt"
if %errorLevel% NEQ 0 (
    type "%ProjRootPath%\buildWp8Output.txt"
    exit /b %errorLevel%
)
goto :EOF

Update unity_RunAutoTests.bat (#476)

Update unity_RunAutoTests.bat (#476)

skipping errors from this test for now


if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/14.1.1/7528167/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

rd /Q "C:\Windows\Temp\vmware-tools.tar"
rd /Q "C:\Windows\Temp\windows.iso"
rd /S /Q "C:\Windows\Temp\VMware"
goto :done

:virtualbox

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.2.8/VBoxGuestAdditions_5.2.8.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256-r3.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/14.1.1/7528167/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

rd /Q "C:\Windows\Temp\vmware-tools.tar"
rd /Q "C:\Windows\Temp\windows.iso"
rd /S /Q "C:\Windows\Temp\VMware"
goto :done

:virtualbox

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.2.10/VBoxGuestAdditions_5.2.10.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256-r3.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

Update VirtualBox guest additions 5.2.10


@echo off
setlocal
title Fast Http Request Build
echo.
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+       Fast Http Request Build
echo "+
echo "+           v.la@Live.cn
echo "+
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
:menu
echo.
echo [1]   Build Lib
echo [2]   Build Nuget
echo [h]   psake help
echo [0]   Exit
echo.
@echo Please select?
@echo Enter the above option to enter
@echo off

set /p menu=

if %menu% == 0 goto exit
if %menu% == 1 goto 1
if %menu% == 2 goto 2
if %menu% == h goto help
goto :eof

:1
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0tools\psake\psake.ps1' build.ps1 %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
echo.
echo Build ok!
echo.
goto menu

:2
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0tools\psake\psake.ps1' build-nuget.ps1 %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
echo.
echo Build ok!
echo.
goto menu

:help
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0tools\psake\psake.ps1' -help"
goto menu

:exit
goto :eof

@echo off
setlocal
title Fast Http Request Build
echo.
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+       Fast Http Request Build
echo "+
echo "+           v.la@Live.cn
echo "+
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
:menu
echo.
echo [1]   Build Lib
echo [2]   Build Nuget
echo [h]   psake help
echo [0]   Exit
echo.
@echo Please select?
@echo Enter the above option to enter
@echo off

set /p menu=

if %menu% == 0 goto exit
if %menu% == 1 goto 1
if %menu% == 2 goto 2
if %menu% == h goto help
goto :eof

:1
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0tools\psake\psake.ps1' build.ps1 %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
echo.
echo Build ok!
echo.
set menu=
goto menu

:2
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0tools\psake\psake.ps1' build-nuget.ps1 %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
echo.
echo Build ok!
echo.
set menu=
goto menu

:help
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0tools\psake\psake.ps1' -help"
goto menu

:exit
goto :eof

fix build

fix build


if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.0.0/2985596/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "c:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.0.0/2985596/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256-r3.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer
certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "c:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

fix vbox guest tool silent installation on windows due to pending certs


@echo on
setlocal

:: setup compil env
set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
:: find the varsall parameters
if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "static" set VC_VARSALL=amd64

call %VC_DIR% %VC_VARSALL%
echo "step 1"

for %%* in (.) do set CurrDirName=%%~nx*

echo "step 2"

echo C:\Qt\%QT_VER%\%PLATFORM%\bin\qmake
ls C:\Qt\%QT_VER%\%PLATFORM%\bin\
C:\Qt\%QT_VER%\%PLATFORM%\bin\qmake .\app\ || exit /B 1
echo "step 3"

nmake qmake_all || exit /B 1
echo "step 4"

nmake || exit /B 1
echo "step 5"

nmake lrelease || exit /B 1
echo "step 6"

nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1

@echo on
setlocal

:: setup compil env
set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
:: find the varsall parameters
if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "static" set VC_VARSALL=amd64

set qtplatform=%PLATFORM%

call %VC_DIR% %VC_VARSALL%
echo "step 1"

for %%* in (.) do set CurrDirName=%%~nx*

echo "step 2"

echo C:\Qt\%QT_VER%\%qtplatform%\bin\qmake
ls C:\Qt\%QT_VER%\%qtplatform%\bin\
C:\Qt\%QT_VER%\%qtplatform%\bin\qmake .\app\ || exit /B 1
echo "step 3"

nmake qmake_all || exit /B 1
echo "step 4"

nmake || exit /B 1
echo "step 5"

nmake lrelease || exit /B 1
echo "step 6"

nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1

Update build-msvc.bat

Update build-msvc.bat


@REM ----------------------------------------------------------------------------
@REM  Copyright 2001-2006 The Apache Software Foundation.
@REM
@REM  Licensed under the Apache License, Version 2.0 (the "License");
@REM  you may not use this file except in compliance with the License.
@REM  You may obtain a copy of the License at
@REM
@REM       http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM  Unless required by applicable law or agreed to in writing, software
@REM  distributed under the License is distributed on an "AS IS" BASIS,
@REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM  See the License for the specific language governing permissions and
@REM  limitations under the License.
@REM ----------------------------------------------------------------------------
@REM
@REM   Copyright (c) 2001-2006 The Apache Software Foundation.  All rights
@REM   reserved.

@echo off

set ERROR_CODE=0

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set CMD_LINE_ARGS=%*
goto WinNTGetScriptDir

@REM The 4NT Shell from jp software
:4NTArgs
set CMD_LINE_ARGS=%$
goto WinNTGetScriptDir

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of arguments (up to the command line limit, anyway).
set CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto Win9xGetScriptDir
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto Win9xApp

:Win9xGetScriptDir
set SAVEDIR=%CD%
%0\
cd %0\..\..
set BASEDIR=%CD%
cd %SAVEDIR%
set SAVE_DIR=
goto repoSetup

:WinNTGetScriptDir
set BASEDIR=%~dp0\..

:repoSetup

if "%JAVACMD%"=="" set JAVACMD=java

if "%REPO%"=="" set REPO=%BASEDIR%\lib

set CLASSPATH="%BASEDIR%"\etc;"%REPO%"\*
set EXTRA_JVM_ARGUMENTS="-XX:+UseG1GC -XX:CICompilerCount=2 -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:G1ConcRefinementThreads=2"
goto endInit

@REM Reaching here means variables are defined and arguments have been captured
:endInit

%JAVACMD% %JAVA_OPTS% %EXTRA_JVM_ARGUMENTS% -classpath %CLASSPATH_PREFIX%;%CLASSPATH% -Dapp.name="openmole-dbserver" -Dapp.repo="%REPO%" -Dbasedir="%BASEDIR%" org.openmole.dbserver.DBServer %CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=%ERRORLEVEL%

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set CMD_LINE_ARGS=
goto postExec

:endNT
@REM If error code is set to 1 then the endlocal was done already in :error.
if %ERROR_CODE% EQU 0 @endlocal

:postExec

if "%FORCE_EXIT_ON_ERROR%" == "on" (
  if %ERROR_CODE% NEQ 0 exit %ERROR_CODE%
)

exit /B %ERROR_CODE%

@REM ----------------------------------------------------------------------------
@REM  Copyright 2001-2006 The Apache Software Foundation.
@REM
@REM  Licensed under the Apache License, Version 2.0 (the "License");
@REM  you may not use this file except in compliance with the License.
@REM  You may obtain a copy of the License at
@REM
@REM       http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM  Unless required by applicable law or agreed to in writing, software
@REM  distributed under the License is distributed on an "AS IS" BASIS,
@REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM  See the License for the specific language governing permissions and
@REM  limitations under the License.
@REM ----------------------------------------------------------------------------
@REM
@REM   Copyright (c) 2001-2006 The Apache Software Foundation.  All rights
@REM   reserved.

@echo off

set ERROR_CODE=0

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set CMD_LINE_ARGS=%*
goto WinNTGetScriptDir

@REM The 4NT Shell from jp software
:4NTArgs
set CMD_LINE_ARGS=%$
goto WinNTGetScriptDir

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of arguments (up to the command line limit, anyway).
set CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto Win9xGetScriptDir
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto Win9xApp

:Win9xGetScriptDir
set SAVEDIR=%CD%
%0\
cd %0\..\..
set BASEDIR=%CD%
cd %SAVEDIR%
set SAVE_DIR=
goto repoSetup

:WinNTGetScriptDir
set BASEDIR=%~dp0\..

:repoSetup

if "%JAVACMD%"=="" set JAVACMD=java

if "%REPO%"=="" set REPO=%BASEDIR%\lib

set CLASSPATH="%BASEDIR%"\etc;"%REPO%"\*
set EXTRA_JVM_ARGUMENTS=-XX:+UseG1GC -XX:CICompilerCount=2 -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:G1ConcRefinementThreads=2
goto endInit

@REM Reaching here means variables are defined and arguments have been captured
:endInit

%JAVACMD% %JAVA_OPTS% %EXTRA_JVM_ARGUMENTS% -classpath %CLASSPATH_PREFIX%;%CLASSPATH% -Dapp.name="openmole-dbserver" -Dapp.repo="%REPO%" -Dbasedir="%BASEDIR%" org.openmole.dbserver.DBServer %CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=%ERRORLEVEL%

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set CMD_LINE_ARGS=
goto postExec

:endNT
@REM If error code is set to 1 then the endlocal was done already in :error.
if %ERROR_CODE% EQU 0 @endlocal

:postExec

if "%FORCE_EXIT_ON_ERROR%" == "on" (
  if %ERROR_CODE% NEQ 0 exit %ERROR_CODE%
)

exit /B %ERROR_CODE%

fix launch

[DB] fix: fix launch


###application.bat - 210x - Fabien Desert###
echo "Copyright m&m  - 201x"
echo "Build:10:00"
echo "version1.1"

### application.bat - 201x - Fabien Desert ###
version = "2"
build_hour = "11H00"

echo "Build ${build_hour}"
echo "version ${version}"

add var to script

add var to script


#!/bin/bash
csc contest_demo.cs -r:../lib/Contest.Core.dll -t:library -out:../bin/contest_demo.dll

add build script for Windows

add build script for Windows


@ECHO OFF
IF NOT EXIST virtualenv GOTO DIRNOTEXISTS

:DIREXISTS
CALL virtualenv\scripts\activate

SET PYTHONPATH=%CD%\submodule\s3g;%CD%\src\main\python;%PYTHONPATH%

REM EXIT /B 0

easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\mock-1.0.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\lockfile-0.9.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\python_daemon-1.5.5-py2.7.egg
easy_install -q submodule\conveyor_bins\python\argparse-1.2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\unittest2-0.5.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg

GOTO DONE

:DIRNOTEXISTS
python virtualenv.py --extra-search-dir=submodule/conveyor_bins/python --never-download virtualenv
GOTO DIREXISTS

:DONE

@ECHO OFF
IF NOT EXIST virtualenv GOTO DIRNOTEXISTS

:DIREXISTS
CALL virtualenv\scripts\activate

SET PYTHONPATH=%CD%\submodule\s3g;%CD%\src\main\python;%PYTHONPATH%

REM EXIT /B 0

easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\mock-1.0.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\lockfile-0.9.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\python_daemon-1.6-py2.7.egg
easy_install -q submodule\conveyor_bins\python\argparse-1.2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\unittest2-0.5.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg

GOTO DONE

:DIRNOTEXISTS

IF "%1" == "" GOTO DEFAULTPY
set PYTHON=%1
GOTO VIRTUALENV

:DEFAULTPY
set PYTHON=python

:VIRTUALENV
%PYTHON% virtualenv.py --extra-search-dir=submodule/conveyor_bins/python --never-download virtualenv
GOTO DIREXISTS

:DONE

Make setup.bat have an optional python binary parameter, fix python_daemon version


@setlocal ENABLEDELAYEDEXPANSION
@echo Building llvm-config tool...
@ninja -j %throttle% install-llvm-config
@echo.

@rem Build LLVM libraries
@set llvmlibstotal=0
@FOR /F "skip=2 tokens=4 USEBACKQ" %%a IN (`%devroot%\llvm\%abi%\bin\llvm-config.exe --link-static --libnames engine coroutines 2^>^&1`) DO @set /a llvmlibstotal+=1
@set llvmlibscount=0
@FOR /F "skip=2 tokens=4 USEBACKQ" %%a IN (`%devroot%\llvm\%abi%\bin\llvm-config.exe --link-static --libnames engine coroutines 2^>^&1`) DO @set /a llvmlibscount+=1&echo Building library %%~na - !llvmlibscount! of %llvmlibstotal%...&ninja -j %throttle% install-%%~na&echo.

@echo Installing headers...
@ninja -j %throttle% install-llvm-headers
@endlocal

@setlocal ENABLEDELAYEDEXPANSION
@echo Building llvm-config tool...
@ninja -j %throttle% install-llvm-config
@echo.

@rem Build LLVM libraries
@set llvmlibstotal=0
@FOR /F "tokens=4 USEBACKQ" %%a IN (`%devroot%\llvm\%abi%\bin\llvm-config.exe --link-static --libnames engine coroutines 2^>^&1`) DO @set /a llvmlibstotal+=1
@set llvmlibscount=0
@FOR /F "tokens=4 USEBACKQ" %%a IN (`%devroot%\llvm\%abi%\bin\llvm-config.exe --link-static --libnames engine coroutines 2^>^&1`) DO @set /a llvmlibscount+=1&echo Building library %%~na - !llvmlibscount! of %llvmlibstotal%...&ninja -j %throttle% install-%%~na&echo.

@echo Installing headers...
@ninja -j %throttle% install-llvm-headers
@endlocal

Fix LLVM build truncation by 2 libraries. Regression from 527a5d5


set PATH=%PATH%;C:\Program Files\CMake 2.8\bin
set PATH=%PATH%;C:\local\jom

rem bash variables can interfer
set CC=
set CXX=

rem FIXME: https://bugs.winehq.org/show_bug.cgi?id=38859
start mspdbsrv.exe -verbose -start -spawn -shutdowntime 10

set PATH=%PATH%;C:\Program Files\CMake 2.8\bin
set PATH=%PATH%;C:\local\jom

rem bash variables can interfer
set CC=
set CXX=

rem FIXME: https://bugs.winehq.org/show_bug.cgi?id=38859
start mspdbsrv.exe -verbose -start -spawn -shutdowntime 20

set pdbs timeout to 20s

set pdbs timeout to 20s


@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
xcopy ..\data\Sprites "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy ..\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy ..\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy ..\Tutorials "%kam_folder%"\Tutorials\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\Readme "%kam_folder%"\ /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
xcopy ..\KM_TextIDs.inc "%kam_folder%"\KM_TextIDs.inc* /y /r /i
xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
@REM copy utility applications exe files
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\KaM_Remake_Server_linux_x86_64* /y /r /i

@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
xcopy ..\data\Sprites "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy ..\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy ..\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy ..\Tutorials "%kam_folder%"\Tutorials\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\Readme "%kam_folder%"\ /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
xcopy ..\KM_TextIDs.inc "%kam_folder%"\KM_TextIDs.inc* /y /r /i
xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
@REM copy utility applications exe files
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\KaM_Remake_Server_linux_x86_64* /y /r /i

Copy ini readme to release folder

Bat: Copy ini readme to release folder


mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE:STRING=Release ^
      -D CMAKE_PREFIX_PATH:FILEPATH=%LIBRARY_PREFIX% ^
      -D CMAKE_INSTALL_PREFIX:FILEPATH=%LIBRARY_PREFIX% ^
      ..

make install

cd ..

%PYTHON% setup.py build_ext
%PYTHON% setup.py install

add bld.bat

add bld.bat


@ECHO OFF
SETLOCAL

SET build_dir=build
SET src_dir=src
SET samp_src_dir=%src_dir%\sample
SET samp_test_src_dir=test\sample
SET obj_dir=%build_dir%\obj
SET lib_dir=%build_dir%\lib
SET inc_dir=%build_dir%\include

SET cc=clang
SET cflags=-Wall -Wextra -Werror -pedantic -Wno-deprecated-declarations -std=c11 -Os -v

RMDIR /S /Q %build_dir%

ECHO:
ECHO Build CinyTest Library...
MKDIR %obj_dir%
%cc% %cflags% -iquote%src_dir% -c %src_dir%\ciny.c -o %obj_dir%\ciny.obj
IF "%ERRORLEVEL%" NEQ "0" GOTO end

%cc% %cflags% -iquote%src_dir% -c %src_dir%\ciny_win.c -o %obj_dir%\ciny_win.obj
IF "%ERRORLEVEL%" NEQ "0" GOTO end

MKDIR %lib_dir%
LIB %obj_dir%\ciny.obj %obj_dir%\ciny_win.obj /OUT:%lib_dir%\cinytest.lib /VERBOSE /NOLOGO
IF "%ERRORLEVEL%" NEQ "0" GOTO end

MKDIR %inc_dir%
COPY %src_dir%\ciny.h %inc_dir%
IF "%ERRORLEVEL%" NEQ "0" GOTO end

ECHO:
ECHO Build CinyTest Sample...
%cc% %cflags% -iquote%samp_src_dir% %samp_src_dir%\binarytree.c %samp_src_dir%\main.c -o %build_dir%\sample.exe
IF "%ERRORLEVEL%" NEQ "0" GOTO end

ECHO:
ECHO Build CinyTest Sample Tests...
%cc% %cflags% -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-parameter -iquote%build_dir%\include -iquote%samp_src_dir% ^
	-L%lib_dir% -lcinytest %samp_src_dir%\binarytree.c %samp_test_src_dir%\main.c %samp_test_src_dir%\binarytree_tests.c ^
	-o %build_dir%\sampletests.exe
IF "%ERRORLEVEL%" NEQ "0" GOTO end

:end
ENDLOCAL
EXIT /B %ERRORLEVEL%

@ECHO OFF
SETLOCAL

SET build_dir=build
SET src_dir=src
SET samp_src_dir=%src_dir%\sample
SET samp_test_src_dir=test\sample
SET obj_dir=%build_dir%\obj
SET lib_dir=%build_dir%\lib
SET inc_dir=%build_dir%\include

SET cc=clang
SET cflags=-Wall -Wextra -Werror -pedantic -Wno-deprecated-declarations -std=c17 -Os -v

RMDIR /S /Q %build_dir%

ECHO:
ECHO Build CinyTest Library...
MKDIR %obj_dir%
%cc% %cflags% -iquote%src_dir% -c %src_dir%\ciny.c -o %obj_dir%\ciny.obj
IF "%ERRORLEVEL%" NEQ "0" GOTO end

%cc% %cflags% -iquote%src_dir% -c %src_dir%\ciny_win.c -o %obj_dir%\ciny_win.obj
IF "%ERRORLEVEL%" NEQ "0" GOTO end

MKDIR %lib_dir%
LIB %obj_dir%\ciny.obj %obj_dir%\ciny_win.obj /OUT:%lib_dir%\cinytest.lib /VERBOSE /NOLOGO
IF "%ERRORLEVEL%" NEQ "0" GOTO end

MKDIR %inc_dir%
COPY %src_dir%\ciny.h %inc_dir%
IF "%ERRORLEVEL%" NEQ "0" GOTO end

ECHO:
ECHO Build CinyTest Sample...
%cc% %cflags% -iquote%samp_src_dir% %samp_src_dir%\binarytree.c %samp_src_dir%\main.c -o %build_dir%\sample.exe
IF "%ERRORLEVEL%" NEQ "0" GOTO end

ECHO:
ECHO Build CinyTest Sample Tests...
%cc% %cflags% -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-parameter -iquote%build_dir%\include -iquote%samp_src_dir% ^
	-L%lib_dir% -lcinytest %samp_src_dir%\binarytree.c %samp_test_src_dir%\main.c %samp_test_src_dir%\binarytree_tests.c ^
	-o %build_dir%\sampletests.exe
IF "%ERRORLEVEL%" NEQ "0" GOTO end

:end
ENDLOCAL
EXIT /B %ERRORLEVEL%

update windows build to c17

update windows build to c17