@echo off
echo "Build main program"
go build -ldflags "-s -w" ekko.go
go build -ldflags "-s -w" ekpo.go
go build -ldflags "-s -w" lfa1.go
go build -ldflags "-s -w" mara.go
go build -ldflags "-s -w" t024.go
go build -ldflags "-s -w" t024e.go
go build -ldflags "-s -w" tcurr.go
go build -ldflags "-s -w" zstxl.go

echo "Build other utilities"
go build -ldflags "-s -w" dl_consolpack_rtemplate.go
go build -ldflags "-s -w" dl_gl_consol_pack_map.go
go build -ldflags "-s -w" gen_code_ddf.go
go build -ldflags "-s -w" upload_gl_consol_pack_map.go

add echo off

add echo off


@set BIN_DIR=%~dp0
@set BASE_DIR=%BIN_DIR%..\
@set WIN_PROJ_DIR=%BASE_DIR%Client
@set ANDROID_PROJ_DIR=%BASE_DIR%ClientAndroid
@set WEB_PROJ_DIR=%BASE_DIR%ClientWeb

@rem http://docs.unity3d.com/Manual/CommandLineArguments.html

@set UNITY_PATH="c:\Program Files (x86)\Unity\Editor\Unity.exe"

%UNITY_PATH% -quit -batchmode -projectPath %WIN_PROJ_DIR% -executeMethod ScriptBatch.BuildWinGame
%UNITY_PATH% -quit -batchmode -projectPath %ANDROID_PROJ_DIR% -executeMethod ScriptBatch.BuildAndroidGame
%UNITY_PATH% -quit -batchmode -projectPath %WEB_PROJ_DIR% -executeMethod ScriptBatch.BuildWebGame

@set BIN_DIR=%~dp0
@set BASE_DIR=%BIN_DIR%..\
@set WIN_PROJ_DIR=%BASE_DIR%Client
@set ANDROID_PROJ_DIR=%BASE_DIR%ClientAndroid
@set WEB_PROJ_DIR=%BASE_DIR%ClientWeb

@rem http://docs.unity3d.com/Manual/CommandLineArguments.html

@set UNITY_PATH="c:\Program Files (x86)\Unity\Editor\Unity.exe"

"%VS120COMNTOOLS%\..\IDE\devenv.exe" /build Release %BASE_DIR%Yuuki.sln
%UNITY_PATH% -quit -batchmode -projectPath %WIN_PROJ_DIR% -executeMethod ScriptBatch.BuildWinGame
%UNITY_PATH% -quit -batchmode -projectPath %ANDROID_PROJ_DIR% -executeMethod ScriptBatch.BuildAndroidGame
%UNITY_PATH% -quit -batchmode -projectPath %WEB_PROJ_DIR% -executeMethod ScriptBatch.BuildWebGame

append build command of 'Yuuki' solution to build script (build.bat)


cd test
galen check specs/bootstrap.spec --url "http://getbootstrap.com" --size "640x480" --htmlreport ../../../reports/

cd test
galen check specs/bootstrap.gspec --url "http://getbootstrap2.com" --size "640x480" --htmlreport ../../../reports/
galen test galen.test -DwebsiteUrl="http://getbootstrap2.com"

Check test fail (#20)

Check test fail (#20)


set MAKING_PYPARSING_RELEASE=1

copy ..\sourceforge\svn\trunk\src\CHANGES .
copy ..\sourceforge\svn\trunk\src\setup.py .
copy ..\sourceforge\svn\trunk\src\pyparsing.py .
copy ..\sourceforge\svn\trunk\src\MANIFEST.in_bdist .
copy ..\sourceforge\svn\trunk\src\MANIFEST.in_src .

rmdir build
rmdir dist

copy/y MANIFEST.in_src MANIFEST.in
if exist MANIFEST del MANIFEST
python setup.py sdist --formats=gztar,zip

copy/y MANIFEST.in_bdist MANIFEST.in
if exist MANIFEST del MANIFEST

python setup.py bdist_wininst --target-version=2.6 --plat-name=win32
python setup.py bdist_wininst --target-version=2.7 --plat-name=win32
python setup.py bdist_wininst --target-version=3.0 --plat-name=win32
python setup.py bdist_wininst --target-version=3.1 --plat-name=win32
python setup.py bdist_wininst --target-version=3.2 --plat-name=win32
python setup.py bdist_wininst --target-version=3.3 --plat-name=win32

set MAKING_PYPARSING_RELEASE=

copy ..\sourceforge\svn\trunk\src\CHANGES .
copy ..\sourceforge\svn\trunk\src\setup.py .
copy ..\sourceforge\svn\trunk\src\pyparsing.py .
copy ..\sourceforge\svn\trunk\src\MANIFEST.in_bdist .
copy ..\sourceforge\svn\trunk\src\MANIFEST.in_src .
copy ..\sourceforge\svn\trunk\src\examples\* .\examples\
del .\examples\*.pyc

rmdir build
rmdir dist

copy/y MANIFEST.in_src MANIFEST.in
if exist MANIFEST del MANIFEST
python setup.py sdist --formats=gztar,zip

copy/y MANIFEST.in_bdist MANIFEST.in
if exist MANIFEST del MANIFEST

python setup.py bdist_wininst --target-version=2.6 --plat-name=win32
python setup.py bdist_wininst --target-version=2.7 --plat-name=win32
python setup.py bdist_wininst --target-version=3.0 --plat-name=win32
python setup.py bdist_wininst --target-version=3.1 --plat-name=win32
python setup.py bdist_wininst --target-version=3.2 --plat-name=win32
python setup.py bdist_wininst --target-version=3.3 --plat-name=win32

Remove old Py2/3 setup flag Added copying of examples from SVN source, and cleanup any pycs that might by lying around


echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

if "%ANACONDA_USERNAME%" == "" (
  set /p ANACONDA_USERNAME="Username: "
) else (
  echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
  set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
  echo %ANACONDA_USERNAME%'s password: [secure];
)

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit "%ANACONDA_UPLOAD_FLAGS%
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo ON

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
  anaconda logout
  exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
  cd ..
  anaconda logout
  rmdir toolchain /s /q
  exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%x in (%UPLOAD_TARGETS%) do (
  echo.|set /P="for /f %%i in ('conda build " >> _upload.bat
  more _upload.bat
  echo.|set /P=%%x >> _upload.bat
  more _upload.bat
  echo.|set /P=" -c " >> _upload.bat
  more _upload.bat
  echo.|set /P=%ANACONDA_CHANNEL% >> _upload.bat
  more _upload.bat
  echo.|set /P=" " >> _upload.bat
  more _upload.bat
  echo.|set /P=%ANACONDA_FLAGS% >> _upload.bat
  echo.|set /P=" --output') ( set UPLOAD_FILE=%%i )" >> _upload.bat
  more _upload.bat
  echo >> _upload.bat
  more _upload.bat
  echo.|set /P="anaconda upload --user " >> _upload.bat
  more _upload.bat
  echo.|set /P=%ANACONDA_CHANNEL%
  more _upload.bat
  echo.|set /P=" %UPLOAD_FILE%" >> _upload.bat
  more _upload.bat
  echo if \%errorlevel\% neq 0 echo upload failed >> _upload.bat
  more _upload.bat
  del _upload.bat
)

anaconda logout

echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

if "%ANACONDA_USERNAME%" == "" (
  set /p ANACONDA_USERNAME="Username: "
) else (
  echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
  set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
  echo %ANACONDA_USERNAME%'s password: [secure];
)

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit "%ANACONDA_UPLOAD_FLAGS%
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo ON

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
  anaconda logout
  exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
  cd ..
  anaconda logout
  rmdir toolchain /s /q
  exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%x in (%UPLOAD_TARGETS%) do (
  echo.|set /P="for /f %%i in ('conda build " >> _upload.bat
  echo.|set /P=%%x >> _upload.bat
  echo.|set /P=" -c " >> _upload.bat
  echo.|set /P=%ANACONDA_CHANNEL% >> _upload.bat
  echo.|set /P=" " >> _upload.bat
  echo.|set /P=%ANACONDA_FLAGS% >> _upload.bat
  echo.|set /P=" --output') ( set UPLOAD_FILE=%%i " >> _upload.bat
  echo ) >> _upload.bat
  echo.|set /P="anaconda upload --user " >> _upload.bat
  echo.|set /P=%ANACONDA_CHANNEL%
  echo.|set /P=" %UPLOAD_FILE%" >> _upload.bat
  echo.|set /P="if \%errorlevel\% neq 0 " >> _upload.bat
  echo upload failed >> _upload.bat
  more _upload.bat
  del _upload.bat
)

anaconda logout

Update upload.bat

Update upload.bat


echo off
set dir_path = 'path_to_soundcloudrepo'
cd %dir_path%
Powershell.exe -ExecutionPolicy RemoteSigned -NoExit -NonInteractive -windowstyle hidden -file .\runserver.ps1

Create run.bat

Create run.bat


@echo off
SETLOCAL enabledelayedexpansion
goto license
The MIT License (MIT)

Copyright (c) 2014 Jesper S. Dramsch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated DOcumentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
:license

: Run Start Configuration
IF NOT EXIST config.cmd (
	echo Detected first run.
	echo Launchig Configuration
	copy /y NUL config.cmd > NUL
	echo @echo off > config.cmd
	IF EXIST "%PROGRAMFILES(X86)%\Steam\Steam.exe" (
		:Automatically Detect Steam for 64 bit
		echo set "SteamLoc=%PROGRAMFILES(X86)%\Steam\Steam.exe" >> config.cmd
		echo Steam installation found!
	) else (
		IF EXIST "%PROGRAMFILES%\Steam\Steam.exe" (
			:Automatically Detect Steam for 32 bit
			echo set "SteamLoc=%PROGRAMFILES%\Steam\Steam.exe" >> config.cmd
			echo Steam installation found!
		) else (
			:Manually
			echo Your Steam installation could not be detected automatically.
			set /p "SteamLoc=Please input manually: "
			IF NOT EXIST "!SteamLoc!" (
				echo Not valid
				goto Manually
			)
			echo Location is valid
			echo set "SteamLoc=!SteamLoc!" >> config.cmd
		)
	)
	set i_count=0
	:Add Logins
	set /p id="Please input SteamID: "
	echo set "id[!i_count!]=!id!" >> config.cmd
	set /p "another=Would you like to add another SteamID (y/n): "
	set /A i_count=%i_count%+1
	if "!another!"=="y" (goto Add Logins )
)
timeout /T 1 > nul
: Import Config
call config.cmd
echo.
echo The following options are available:
set i_count=0
:Read Array
IF [!id[%i_count%]!] == [] (
	echo X.^> Add another account
) else (
	echo %i_count%.^> !id[%i_count%]!
	set /A i_count=%i_count%+1
	goto Read Array
)
echo.
set /p "choice=Your choice: "
IF %choice% == X (
	goto Add Logins
) ELSE (
	IF %choice% GEQ 0 (
		IF %choice% LEQ %i_count%  (
			set "login=!id[%choice%]!"
			echo WIll now switch account to !login!
		) ELSE (
			GOTO Wrong Choice
		)
	) ELSE (
		:Wrong Choice
		echo Your choice is invalid.
		echo Exiting.
		timeout /T 5  > nul
		exit
	)
)
echo.

:Check if Program is running and shut down (first nice then rigorously)
tasklist /FI "IMAGENAME eq steam.exe" 2>NUL | find /I /N "steam.exe">NUL
IF "%ERRORLEVEL%"=="0" (
echo Program is running
set yup=1
@"%SteamLoc%" -shutdown
timeout /T 2  > nul
)
tasklist /FI "IMAGENAME eq steam.exe" 2>NUL | find /I /N "steam.exe">NUL
IF "%ERRORLEVEL%"=="0" (
echo Attempting force close
taskkill /F /IM steam.exe
echo Program shut down
) ELSE (
IF "%yup%"=="1" (
echo Program shut down
) ELSE (
echo Program not running
)
)

:Password (secure)
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
    $BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
        [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
FOR /f "usebackq delims=" %%p in (`%psCommand%`) DO set password=%%p

:Start Steam with direct Log in
echo Starting up
start "" "%SteamLoc%" -login "%login%" "%password%"

EXIT

@echo off
SETLOCAL enabledelayedexpansion
goto license
The MIT License (MIT)

Copyright (c) 2014 Jesper S. Dramsch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated DOcumentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
:license

: Run Start Configuration
IF NOT EXIST config.cmd (
	echo Detected first run.
	echo Launchig Configuration
	copy /y NUL config.cmd > NUL
	echo @echo off > config.cmd
	IF EXIST "%PROGRAMFILES(X86)%\Steam\Steam.exe" (
		:Automatically Detect Steam for 64 bit
		echo set "SteamLoc=%PROGRAMFILES(X86)%\Steam\Steam.exe" >> config.cmd
		echo Steam installation found!
	) else (
		IF EXIST "%PROGRAMFILES%\Steam\Steam.exe" (
			:Automagically Detect Steam for 32 bit
			echo set "SteamLoc=%PROGRAMFILES%\Steam\Steam.exe" >> config.cmd
			echo Steam installation found!
		) else (
			:Manually
			echo Your Steam installation could not be detected automatically.
			set /p "SteamLoc=Please input manually: "
			IF NOT EXIST "!SteamLoc!" (
				echo Not valid
				goto Manually
			)
			echo Location is valid
			echo set "SteamLoc=!SteamLoc!" >> config.cmd
		)
	)
	set i_count=0
	:Add Logins
	set /p id="Please input SteamID: "
	echo set "id[!i_count!]=!id!" >> config.cmd
	set /p "another=Would you like to add another SteamID (y/n): "
	set /A i_count=%i_count%+1
	if "!another!"=="y" (goto Add Logins )
)
timeout /T 1 > nul
:Import Config
call config.cmd
echo.
echo The following options are available:
set i_count=0
:Read Array
IF [!id[%i_count%]!] == [] (
	echo X.^> Add another account
) else (
	echo %i_count%.^> !id[%i_count%]!
	set /A i_count=%i_count%+1
	goto Read Array
)
echo.
set /p "choice=Your choice: "
IF %choice% == X (
	goto Add Logins
) ELSE (
	IF %choice% GEQ 0 (
		IF %choice% LEQ %i_count%  (
			set "login=!id[%choice%]!"
			echo WIll now switch account to !login!
		) ELSE (
			GOTO Wrong Choice
		)
	) ELSE (
		:Wrong Choice
		echo Your choice is invalid.
		echo Exiting.
		timeout /T 5  > nul
		exit
	)
)
echo.

:Check if Program is running and shut down (first nice then rigorously)
tasklist /FI "IMAGENAME eq steam.exe" 2>NUL | find /I /N "steam.exe">NUL
IF "%ERRORLEVEL%"=="0" (
	echo Program is running
	set yup=1
	@"%SteamLoc%" -shutdown
	timeout /T 2  > nul
)
tasklist /FI "IMAGENAME eq steam.exe" 2>NUL | find /I /N "steam.exe">NUL
IF "%ERRORLEVEL%"=="0" (
	echo Attempting force close
	taskkill /F /IM steam.exe
	echo Program shut down
) ELSE (
	IF "%yup%"=="1" (
		echo Program shut down
	) ELSE (
		echo Program not running
	)
)

:Password (secure)
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
    $BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
        [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
FOR /f "usebackq delims=" %%p in (`%psCommand%`) DO set password=%%p

:Start Steam with direct Log in
echo Starting up
start "" "%SteamLoc%" -login "%login%" "%password%"

EXIT

Update indentation

Update indentation


'  Batch file for running tests on JDK 1.1
'
SET CLASSPATH=\java\junit3.8.1\junit.jar;\java\crimson-1.1.3\crimson.jar;\java\jakarta-oro-2.0.8\jakarta-oro-2.0.8.jar;..\dist\classes;classes;resources
java junit.textui.TestRunner org.apache.log4j.CoreTestSuite
java junit.textui.TestRunner org.apache.log4j.MinimumTestCase
java junit.textui.TestRunner org.apache.log4j.LoggerTestCase
java junit.textui.TestRunner org.apache.log4j.xml.DOMTestCase
java junit.textui.TestRunner org.apache.log4j.xml.CustomLevelTestCase
java junit.textui.TestRunner org.apache.log4j.customLogger.XLoggerTestCase
del classes\log4j.xml
del classes\log4j.properties
java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase1
copy input\xml\defaultInit.xml classes\log4j.xml
java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase2
del classes\log4j.xml
copy input\xml\defaultInit.xml classes\log4j.xml
java -Dlog4j.defaultInitOverride=true junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase1
del classes\log4j.xml
copy input\defaultInit3.properties classes\log4j.properties
java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase3
del classes\log4j.properties
copy input\xml\defaultInit.xml classes\log4j.xml
copy input\defaultInit3.properties classes\log4j.properties
java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase4
del classes\log4j.xml
del classes\log4j.properties
java junit.textui.TestRunner org.apache.log4j.xml.XMLLayoutTestCase
java junit.textui.TestRunner org.apache.log4j.AsyncAppenderTestCase
java junit.textui.TestRunner org.apache.log4j.helpers.OptionConverterTestCase
java junit.textui.TestRunner org.apache.log4j.helpers.BoundedFIFOTestCase
java junit.textui.TestRunner org.apache.log4j.helpers.CyclicBufferTestCase
java junit.textui.TestRunner org.apache.log4j.or.ORTestCase
java junit.textui.TestRunner org.apache.log4j.varia.LevelMatchFilterTestCase
java junit.textui.TestRunner org.apache.log4j.helpers.PatternParserTestCase
java junit.textui.TestRunner org.apache.log4j.PatternLayoutTestCase
java junit.textui.TestRunner org.apache.log4j.DRFATestCase

Add batch file for running subset of tests on JDK 1.1

git-svn-id: f8ec76806b93013cd47e945cc2def9ed48bbf7ea@311492 13f79535-47bb-0310-9956-ffa450edef68


@echo off
cd src
python.exe setup.py build
cd ..

"%PROGRAMFILES%\Inno Setup 5\ISCC.exe" pesel2pbn.iss

@echo off
cd src

cd pesel2pbn
pyuic5 pesel2pbn.ui > pesel2pbn_auto.py
cd ..

python.exe setup.py build
cd ..

"%PROGRAMFILES%\Inno Setup 5\ISCC.exe" pesel2pbn.iss

Recompile UI file on build

Recompile UI file on build


cls
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
cl /c /DEBUG ring_opengl32.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl32.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl32.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl32.obj

cls
call ../../../src/locatevc.bat
cl /c /DEBUG ring_opengl32.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl32.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl32.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl32.obj

Update RingOpenGL 3.2 - buildvc.bat - use locatevc.bat


# test GPIO6 to be 0 (button pressed) to start recovery system
gpio input GPIO6
if test $? -eq 0; then
  echo "==== STARTING RECOVERY SYSTEM ===="
else
  echo "==== NORMAL BOOT ===="
  fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
  fatload mmc ${devnum} ${kernel_addr_r} zImage && bootz ${kernel_addr_r} - ${fdt_addr};
fi

# test GPIO12 to be 1 (button pressed) to start recovery system
gpio input GPIO12
if test $? -eq 1; then
  echo "==== STARTING RECOVERY SYSTEM ===="
else
  echo "==== NORMAL BOOT ===="
  fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
  fatload mmc ${devnum} ${kernel_addr_r} zImage && bootz ${kernel_addr_r} - ${fdt_addr};
fi

switch to gpio12 for recovery system boot.


:: Copyright 2014-2015 The 'mumble-releng' Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that
:: can be found in the LICENSE file in the source tree or at
:: <http://mumble.info/mumble-releng/LICENSE>.

for /F "skip=9 tokens=3" %%M IN ('fsutil reparsepoint query c:\MumbleBuild\latest-1.3.x-win64-static') DO ^
IF NOT DEFINED MUMBLE_BUILDENV_DIR (SET MUMBLE_BUILDENV_DIR=%%M)

for /F %%G IN ('%MUMBLE_BUILDENV_DIR%\mumble-releng\tools\mumble-version.py') DO SET mumblebuildversion=%%G

call %MUMBLE_BUILDENV_DIR%\prep.cmd
if errorlevel 1 exit /b errorlevel

echo Build mumble
if "%MUMBLE_BUILD_TYPE%" == "Release" (
	qmake CONFIG+="release static symbols packaged no-g15 no-asio no-elevation no-server" DEFINES+="MUMBLE_VERSION=%mumblebuildversion%" -recursive
) else (
	qmake CONFIG+="release static symbols packaged no-g15 no-asio no-elevation no-server" DEFINES+="MUMBLE_VERSION=%mumblebuildversion% SNAPSHOT_BUILD=1" -recursive
)
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel

set zipdir=mumble-%mumblebuildversion%.portable.winx64
set zipfile=%zipdir%.zip
mkdir mumble-%mumblebuildversion%.portable.winx64
if errorlevel 1 exit /b errorlevel

copy release\*.exe %zipdir%\
if errorlevel 1 exit /b errorlevel
copy release\*.dll %zipdir%\
if errorlevel 1 exit /b errorlevel
mkdir %zipdir%\plugins
if errorlevel 1 exit /b errorlevel
copy release\plugins\*.dll %zipdir%\plugins\
if errorlevel 1 exit /b errorlevel

copy "C:\Program Files (x86)\Windows Kits\8.1\Redist\D3D\x64\d3dcompiler_47.dll" %zipdir%\
if errorlevel 1 exit /b errorlevel
copy "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" %zipdir%\
if errorlevel 1 exit /b errorlevel
copy "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" %zipdir%\
if errorlevel 1 exit /b errorlevel

"C:\Program Files\7-Zip\7z.exe" a %zipfile% %zipdir%

"%MUMBLE_BUILDENV_DIR%\mumble-releng\tools\collect_symbols.py" collect --version "%mumblebuildversion%" --buildtype "%MUMBLE_BUILD_TYPE%" --product "Mumble %MUMBLE_BUILD_ARCH% Portable" release\ symbols.7z
if errorlevel 1 exit /b errorlevel

buildscripts/1.3.x: add build script for portable x64 build.


set WINSCP="C:\Program Files (x86)\WinSCP\WinSCP.com"
%WINSCP% /script=dosyncftp_maven.cmd
REM Publish artifact to MavenCentral
pushd ..\roborio\c++\navx_frc_cpp
call gradlew publish
popd
REM Publish artifact to MavenCentral
pushd ..\roborio\java\navx_frc
call gradlew publish
popd

ECHO To Release the MavenCentral Artifacts:
ECHO
ECHO - Navigate to https://oss.sonatype.org/service/local/staging/deploy/maven2 and login
ECHO - At bottom of list, select the checkbox next to the staged content
ECHO - Click the Close button, which triggers analysis of the artifacts (takes about 1 minute)
ECHO - Then, click the Release button to migrate the staged build to the Release Repository
ECHO   It takes about 10 minutes to be released, and about 2 hours to show up in Maven Central Search.

set WINSCP="C:\Program Files (x86)\WinSCP\WinSCP.com"
%WINSCP% /script=dosyncftp_maven.cmd
REM Publish artifact to MavenCentral
pushd ..\roborio\java\navx_frc
call gradlew publish
popd
REM Publish artifact to MavenCentral
pushd ..\roborio\c++\navx_frc_cpp
call gradlew publish
popd

ECHO To Release the MavenCentral Artifacts:
ECHO
ECHO - Navigate to https://oss.sonatype.org/service/local/staging/deploy/maven2 and login
ECHO - At bottom of list, select the checkbox next to the staged content
ECHO - Click the Close button, which triggers analysis of the artifacts (takes about 1 minute)
ECHO - Then, click the Release button to migrate the staged build to the Release Repository
ECHO   It takes about 10 minutes to be released, and about 2 hours to show up in Maven Central Search.

Update maven deploy script to hopefully work around some reliability issues encountered during uploads to Sonatype Nexus (Maven Central) Repository.


@echo off
for /f "delims=" %%x in (%1) do (set "%%x")

Create source.cmd

Create source.cmd


taskkill /F /IM node.exe /T
taskkill /F /IM python.exe /T

add kill.bat

add kill.bat


:: Copyright 2014-2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Build

set INC=-I../../openssl/include
if "%_CPU%" == "win32" set XCFLAGS=-m32
if "%_CPU%" == "win64" set XCFLAGS=-m64
if "%_CPU%" == "win32" set XLDFLAGS=-m32 -L../../openssl/lib
if "%_CPU%" == "win64" set XLDFLAGS=-m64 -L../../openssl/lib
set LDFLAGS=%XLDFLAGS%
mingw32-make SYS=mingw SODEF_yes=

:: Make steps for determinism

if exist librtmp\*.a   strip -p --enable-deterministic-archives -g librtmp\*.a
if exist librtmp\*.lib strip -p --enable-deterministic-archives -g librtmp\*.lib

python ..\peclean.py *.exe
python ..\peclean.py librtmp\*.dll

touch -c librtmp/*.exe -r ChangeLog
touch -c librtmp/*.dll -r ChangeLog
touch -c librtmp/*.a   -r ChangeLog
touch -c librtmp/*.lib -r ChangeLog

popd
endlocal

:: Copyright 2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Build

set INC=-I../../openssl/include
if "%_CPU%" == "win32" set XCFLAGS=-m32
if "%_CPU%" == "win64" set XCFLAGS=-m64
if "%_CPU%" == "win32" set XLDFLAGS=-m32 -L../../openssl/lib
if "%_CPU%" == "win64" set XLDFLAGS=-m64 -L../../openssl/lib
set LDFLAGS=%XLDFLAGS%
mingw32-make SYS=mingw SODEF_yes=

:: Make steps for determinism

if exist librtmp\*.a   strip -p --enable-deterministic-archives -g librtmp\*.a
if exist librtmp\*.lib strip -p --enable-deterministic-archives -g librtmp\*.lib

python ..\peclean.py *.exe
python ..\peclean.py librtmp\*.dll

touch -c librtmp/*.exe -r ChangeLog
touch -c librtmp/*.dll -r ChangeLog
touch -c librtmp/*.a   -r ChangeLog
touch -c librtmp/*.lib -r ChangeLog

popd
endlocal

fix copyright year [ci skip]

mk-librtmp.bat: fix copyright year [ci skip]


@echo off
set STS_TEST_VERSION='2.9.2.RELEASE'

set CURRENT_DIR=%~dp0
cd %CURRENT_DIR%

cls

echo.
echo -----------------------------------------------------------------------
echo Spring Framework Eclipse/STS project import guide
echo.
echo This script will guide you through the process of importing the
echo Spring Framework sources into Eclipse/STS. It is recommended that you
echo have a recent version of the SpringSource Tool Suite (this script has
echo been tested against STS %STS_TEST_VERSION%), but at the minimum you will
echo need Eclipse + AJDT.
echo.
echo If you need to download and install STS, please do that now by
echo visiting http://springsource.org/downloads/sts
echo.
echo Otherwise, press enter and we'll begin.

pause

REM this command:
REM - wipes out any existing Eclipse metadata
REM - generates OXM test classes to avoid errors on import into Eclipse
REM - generates metadata for all subprojects
REM - skips metadata gen for the root project (-x :eclipse) to work
REM   around Eclipse's inability to import hierarchical project structures
REM SET COMMAND="./gradlew cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse"
SET COMMAND=gradlew cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse

echo.
echo -----------------------------------------------------------------------
echo STEP 1: Generate subproject Eclipse metadata
echo.
echo The first step will be to generate Eclipse project metadata for each
echo of the spring-* subprojects. This happens via the built-in
echo "Gradle wrapper" script (./gradlew in this directory). If this is your
echo first time using the Gradle wrapper, this step may take a few minutes
echo while a Gradle distribution is downloaded for you.
echo.
echo The command run will be:
echo.
echo     %COMMAND%
echo.
echo Press enter when ready.

pause

call %COMMAND%
if not "%ERRORLEVEL%" == "0" exit /B %ERRORLEVEL%

echo.
echo -----------------------------------------------------------------------
echo STEP 2: Import subprojects into Eclipse/STS
echo.
echo Within Eclipse/STS, do the following:
echo.
echo File ^> Import... ^> Existing Projects into Workspace
echo      ^> When prompted for the 'root directory', provide %CURRENT_DIR%
echo      ^> Press enter. You will see the modules show up under "Projects"
echo      ^> All projects should be selected/checked. Click Finish.
echo      ^> When the project import is complete, you should have no errors.
echo.
echo When the above is complete, return here and press the enter key.

pause

set COMMAND=gradlew :eclipse

echo.
echo -----------------------------------------------------------------------
echo STEP 3: generate root project Eclipse metadata
echo.
echo Unfortunately, Eclipse does not allow for importing project
echo hierarchies, so we had to skip root project metadata generation in the
echo during step 1. In this step we simply generate root project metadata
echo so you can import it in the next step.
echo.
echo The command run will be:
echo.
echo     %COMMAND%
echo.
echo Press the enter key when ready.
pause

call %COMMAND%
if not "%ERRORLEVEL%" == "0" exit /B %ERRORLEVEL%

echo.
echo -----------------------------------------------------------------------
echo STEP 4: Import root project into Eclipse/STS
echo.
echo Follow the project import steps listed in step 2 above to import the
echo root project.
echo.
echo Press enter when complete, and move on to the final step.

pause

echo.
echo -----------------------------------------------------------------------
echo STEP 5: Enable Git support for all projects
echo.
echo - In the Eclipse/STS Package Explorer, select all spring* projects.
echo - Right-click to open the context menu and select Team ^> Share Project...
echo - In the Share Project dialog that appears, select Git and press Next
echo - Check "Use or create repository in parent folder of project"
echo - Click Finish
echo.
echo When complete, you'll have Git support enabled for all projects.
echo.
echo You're ready to code! Goodbye!

Create import-into-eclipse.bat for Windows users

Port import-into-eclipse.sh to a Windows batch file.


@setlocal
@set PROMPT=$$$S

@pushd "%~dp0"

if exist "%~dp0Misc\version.cmd" call "%~dp0Misc\version.cmd"

set MAJOR=-1
set MINOR=-1
set BUILD=-1
set PATCH=-1

if exist goarch.txt for /F %%I in (goarch.txt) do set "GOARCH=%%I"
if "%GOARCH%" == "" for /F "delims=/ tokens=2" %%I in ('go version') do set "GOARCH=%%I"

if "%GOPATH%" == "" set "GOPATH=%USERPROFILE%\go"
for /F "delims=; tokens=1" %%I in ("%GOPATH%") do set "GOPATH1ST=%%I"

call :"%~1" %2 %3 %4 %5 %6
@popd
@endlocal
@exit /b

:""
        for /F %%I in ('git describe --tags') do set "X_VERSION=-X main.version=%%I"
        call :"build"
        @exit /b 0

:"debug"
        set "TAGS=-tags=debug"
        call :"build"
        @exit /b

:"release"
        for /F %%I in (%~dp0Misc\version.txt) do set "VERSION=%%I"
        for /F "delims=. tokens=1,2,3" %%I in ("%VERSION%") do (
            set "MAJOR=%%I"
            set "MINOR=%%J"
            for /F "delims=_ tokens=1,2" %%M in ("%%K") do (
                set "PATCH=%%M"
                set "BUILD=%%N"
            )
        )
        set "X_VERSION=-X main.version=%VERSION%"
        call :"build"
        @exit /b

:"build"
        call :"fmt"
        call :"goversioninfo"
        for /F %%I in ('dir /b /s /aa nyagos.d') do attrib -A "%%I" & if exist mains\bindata.go del mains\bindata.go
        if not exist mains\bindata.go call :"bindata"
        for /F "delims=" %%V in ('git log -1 --date^=short --pretty^=format:"-X main.stamp=%%ad -X main.commit=%%H"') do go build -o nyagos.exe -ldflags "%%V %X_VERSION%" %TAGS%
        @exit /b

:"fmt"
        for /F %%I IN ('dir /s /b /aa *.go') do ( ( if "%%~nxI" == "syscall.go" pushd "%%~dpI" & go generate -x & popd ) & go fmt "%%I" & attrib -A "%%I")
        for /F %%I in ('dir /s /b syscall.go') do if not exist "%%~dpI\zsyscall.go" ( pushd "%%~dpI" & go generate -x & popd )
        @exit /b

:"status"
        nyagos -e "print(nyagos.version or 'Snapshot on '..nyagos.stamp)"
        powershell -ExecutionPolicy RemoteSigned -File showver.ps1 nyagos.exe
        @exit /b

:eachdir
        powershell "ls -R | ?{ $_ -match '\.go$' } | %%{ [System.IO.Path]::GetDirectoryName($_.FullName)} | Sort-Object | Get-Unique | %%{ Write-Host 'go %~1 on',$_ ;  pushd $_ ; go %~1 ; popd }"
        exit /b

:"vet"
        call :eachdir vet
        exit /b

:"clean"
        for %%I in (nyagos.exe nyagos.syso version.now mains\bindata.go goversioninfo.exe go-bindata.exe) do if exist %%I del %%I
        for /R %%I in (zsyscall.go) do if exist "%%I" del "%%I"
        call :eachdir clean

:"sweep"
        for /R %%I in (*~ *.bak) do if exist %%I del %%I
        @exit /b

:"get"
        powershell "Get-ChildItem . -Recurse | ?{ $_.Extension -eq '.go' } | %%{  Get-Content $_.FullName | %%{ ($_ -replace '\s*//.*$','').Split()[-1] } | ?{ $_ -match 'github.com/' -and -not ($_ -match '/nyagos/' ) } } | Sort-Object | Get-Unique | %%{ Write-Host $_ ; go get -u $_ }"
        @exit /b

:getbindata
        go get "github.com/jteeuwen/go-bindata"
        pushd "%GOPATH1ST%\src\github.com\jteeuwen\go-bindata\go-bindata"
        go build
        copy go-bindata.exe "%~dp0\."
        popd
        @exit /b

:"bindata"
        if not exist go-bindata.exe call :getbindata
        go-bindata.exe -pkg "mains" -o "mains\bindata.go" "nyagos.d/..."
        @exit /b

:getgoversioninfo
        go get -u "github.com/josephspurrier/goversioninfo"
        pushd "%GOPATH1ST%\src\github.com\josephspurrier\goversioninfo\cmd\goversioninfo"
        go build
        copy goversioninfo.exe "%~dp0\."
        popd
        @exit /b

:"goversioninfo"
        if not exist goversioninfo.exe call :getgoversioninfo
        goversioninfo.exe ^
            -file-version="%VERSION%" ^
            -product-version="%VERSION%" ^
            -icon=mains\nyagos.ico ^
            -ver-major=%MAJOR% ^
            -ver-minor=%MINOR% ^
            -ver-build=%BUILD% ^
            -ver-patch=%PATCH% ^
            -product-ver-major=%MAJOR% ^
            -product-ver-minor=%MINOR% ^
            -product-ver-build=%BUILD% ^
            -product-ver-patch=%PATCH% ^
            -o nyagos.syso ^
            versioninfo.json
        @exit /b

:"const"
        for /F %%I in ('dir /b /s makeconst.cmd') do pushd %%~dpI & call %%I & popd
        @exit /b

:"package"
        for /F %%I in ('nyagos -e "print(nyagos.version or (string.gsub(nyagos.stamp,[[/]],[[]])))"') do set VERSION=%%I
        zip -9 "nyagos-%VERSION%-%GOARCH%.zip" nyagos.exe lua53.dll nyagos.lua .nyagos _nyagos makeicon.cmd nyagos.d\*.lua nyagos.d\catalog\*.lua license.txt readme_ja.md readme.md Doc\*.md
        @exit /b

:"install"
        if not "%1" == "" set "INSTALLDIR=%1" & echo @set "INSTALLDIR=%~1" > "%~dp0Misc\version.cmd"
        if "%INSTALLDIR%" == "" (
            echo Please %0.cmd install PATH\TO\BIN, once
            @exit /b
        )
        if not exist "%INSTALLDIR%" (
            echo Please %0.cmd install EXIST\PATH\TO\BIN,  once
            @exit /b
        )

        robocopy nyagos.d "%INSTALLDIR%\nyagos.d" /E
        if not exist "%INSTALLDIR%\lua53.dll" copy lua53.dll "%INSTALLDIR%\."
        copy nyagos.lua "%INSTALLDIR%\."
        copy /-Y _nyagos "%INSTALLDIR%\."
        copy nyagos.exe "%INSTALLDIR%\."
        if errorlevel 1 (start "" "%~dpfx0" install_ & @exit /b)
        @exit /b

:"install_"
        taskkill /F /im nyagos.exe
        copy nyagos.exe "%INSTALLDIR%\."
        timeout /T 3
        @exit %ERRORLEVEL%

:"icon"
        makeicon.cmd
        @exit /b

:"help"
        echo Usage for make.cmd
        echo  %0          : Equals to '%0 build'
        echo  %0 build    : Build nyagos.exe as snapshot (ignore version.txt)
        echo  %0 release  : Build nyagos.exe as release  (see version.txt)
        echo  %0 fmt      : Format all source files with 'go fmt'
        echo  %0 clean    : Delete nyagos.exe and nyagos.syso
        echo  %0 package  : Make the package zip-file
        echo  %0 get      : Do 'go get' for each github library
        echo  %0 upgrade  : Do 'git pull' for each github library
        echo  %0 help     : Print help
        echo  %0 install INSTALLDIR
        echo     : Copy binaries to INSTALLDIR
        echo  %0 install
        echo     : Copy binaries to last INSTALLDIR
        @exit /b

@setlocal
@set PROMPT=$$$S

@pushd "%~dp0"

if exist "%~dp0Misc\version.cmd" call "%~dp0Misc\version.cmd"

set MAJOR=-1
set MINOR=-1
set BUILD=-1
set PATCH=-1

if exist goarch.txt for /F %%I in (goarch.txt) do set "GOARCH=%%I"
if "%GOARCH%" == "" for /F "delims=/ tokens=2" %%I in ('go version') do set "GOARCH=%%I"

if "%GOPATH%" == "" set "GOPATH=%USERPROFILE%\go"
for /F "delims=; tokens=1" %%I in ("%GOPATH%") do set "GOPATH1ST=%%I"

call :"%~1" %2 %3 %4 %5 %6
@popd
@endlocal
@exit /b

:""
        for /F %%I in ('git describe --tags') do set "X_VERSION=-X main.version=%%I"
        call :"build"
        @exit /b 0

:"debug"
        set "TAGS=-tags=debug"
        call :"build"
        @exit /b

:"release"
        for /F %%I in (%~dp0Misc\version.txt) do set "VERSION=%%I"
        for /F "delims=. tokens=1,2,3" %%I in ("%VERSION%") do (
            set "MAJOR=%%I"
            set "MINOR=%%J"
            for /F "delims=_ tokens=1,2" %%M in ("%%K") do (
                set "PATCH=%%M"
                set "BUILD=%%N"
            )
        )
        set "X_VERSION=-X main.version=%VERSION%"
        call :"build"
        @exit /b

:"build"
        call :"fmt"
        call :"goversioninfo"
        for /F %%I in ('dir /b /s /aa nyagos.d') do attrib -A "%%I" & if exist mains\bindata.go del mains\bindata.go
        if not exist mains\bindata.go call :"bindata"
        for /F "delims=" %%V in ('git log -1 --date^=short --pretty^=format:"-X main.stamp=%%ad -X main.commit=%%H"') do go build -o nyagos.exe -ldflags "%%V %X_VERSION%" %TAGS%
        @exit /b

:"fmt"
        for /F %%I IN ('dir /s /b /aa *.go') do ( ( if "%%~nxI" == "syscall.go" pushd "%%~dpI" & go generate -x & popd ) & go fmt "%%I" & attrib -A "%%I")
        for /F %%I in ('dir /s /b syscall.go') do if not exist "%%~dpI\zsyscall.go" ( pushd "%%~dpI" & go generate -x & popd )
        @exit /b

:"status"
        nyagos -e "print(nyagos.version or 'Snapshot on '..nyagos.stamp)"
        powershell -ExecutionPolicy RemoteSigned -File showver.ps1 nyagos.exe
        @exit /b

:eachdir
        powershell "ls -R | ?{ $_ -match '\.go$' } | %%{ [System.IO.Path]::GetDirectoryName($_.FullName)} | Sort-Object | Get-Unique | %%{ Write-Host 'go %~1 on',$_ ;  pushd $_ ; go %~1 ; popd }"
        exit /b

:"vet"
        call :eachdir vet
        exit /b

:"clean"
        for %%I in (nyagos.exe nyagos.syso version.now mains\bindata.go goversioninfo.exe go-bindata.exe) do if exist %%I del %%I
        for /R %%I in (zsyscall.go) do if exist "%%I" del "%%I"
        call :eachdir clean

:"sweep"
        for /R %%I in (*~ *.bak) do if exist %%I del %%I
        @exit /b

:"get"
        powershell "Get-ChildItem . -Recurse | ?{ $_.Extension -eq '.go' } | %%{  Get-Content $_.FullName | %%{ ($_ -replace '\s*//.*$','').Split()[-1] } | ?{ $_ -match 'github.com/' -and -not ($_ -match '/nyagos/' ) } } | Sort-Object | Get-Unique | %%{ Write-Host $_ ; go get -u $_ }"
        go get -u golang.org/x/sys/windows
        @exit /b

:getbindata
        go get "github.com/jteeuwen/go-bindata"
        pushd "%GOPATH1ST%\src\github.com\jteeuwen\go-bindata\go-bindata"
        go build
        copy go-bindata.exe "%~dp0\."
        popd
        @exit /b

:"bindata"
        if not exist go-bindata.exe call :getbindata
        go-bindata.exe -pkg "mains" -o "mains\bindata.go" "nyagos.d/..."
        @exit /b

:getgoversioninfo
        go get -u "github.com/josephspurrier/goversioninfo"
        pushd "%GOPATH1ST%\src\github.com\josephspurrier\goversioninfo\cmd\goversioninfo"
        go build
        copy goversioninfo.exe "%~dp0\."
        popd
        @exit /b

:"goversioninfo"
        if not exist goversioninfo.exe call :getgoversioninfo
        goversioninfo.exe ^
            -file-version="%VERSION%" ^
            -product-version="%VERSION%" ^
            -icon=mains\nyagos.ico ^
            -ver-major=%MAJOR% ^
            -ver-minor=%MINOR% ^
            -ver-build=%BUILD% ^
            -ver-patch=%PATCH% ^
            -product-ver-major=%MAJOR% ^
            -product-ver-minor=%MINOR% ^
            -product-ver-build=%BUILD% ^
            -product-ver-patch=%PATCH% ^
            -o nyagos.syso ^
            versioninfo.json
        @exit /b

:"const"
        for /F %%I in ('dir /b /s makeconst.cmd') do pushd %%~dpI & call %%I & popd
        @exit /b

:"package"
        for /F %%I in ('nyagos -e "print(nyagos.version or (string.gsub(nyagos.stamp,[[/]],[[]])))"') do set VERSION=%%I
        zip -9 "nyagos-%VERSION%-%GOARCH%.zip" nyagos.exe lua53.dll nyagos.lua .nyagos _nyagos makeicon.cmd nyagos.d\*.lua nyagos.d\catalog\*.lua license.txt readme_ja.md readme.md Doc\*.md
        @exit /b

:"install"
        if not "%1" == "" set "INSTALLDIR=%1" & echo @set "INSTALLDIR=%~1" > "%~dp0Misc\version.cmd"
        if "%INSTALLDIR%" == "" (
            echo Please %0.cmd install PATH\TO\BIN, once
            @exit /b
        )
        if not exist "%INSTALLDIR%" (
            echo Please %0.cmd install EXIST\PATH\TO\BIN,  once
            @exit /b
        )

        robocopy nyagos.d "%INSTALLDIR%\nyagos.d" /E
        if not exist "%INSTALLDIR%\lua53.dll" copy lua53.dll "%INSTALLDIR%\."
        copy nyagos.lua "%INSTALLDIR%\."
        copy /-Y _nyagos "%INSTALLDIR%\."
        copy nyagos.exe "%INSTALLDIR%\."
        if errorlevel 1 (start "" "%~dpfx0" install_ & @exit /b)
        @exit /b

:"install_"
        taskkill /F /im nyagos.exe
        copy nyagos.exe "%INSTALLDIR%\."
        timeout /T 3
        @exit %ERRORLEVEL%

:"icon"
        makeicon.cmd
        @exit /b

:"help"
        echo Usage for make.cmd
        echo  %0          : Equals to '%0 build'
        echo  %0 build    : Build nyagos.exe as snapshot (ignore version.txt)
        echo  %0 release  : Build nyagos.exe as release  (see version.txt)
        echo  %0 fmt      : Format all source files with 'go fmt'
        echo  %0 clean    : Delete nyagos.exe and nyagos.syso
        echo  %0 package  : Make the package zip-file
        echo  %0 get      : Do 'go get' for each github library
        echo  %0 upgrade  : Do 'git pull' for each github library
        echo  %0 help     : Print help
        echo  %0 install INSTALLDIR
        echo     : Copy binaries to INSTALLDIR
        echo  %0 install
        echo     : Copy binaries to last INSTALLDIR
        @exit /b

make get: go get -u golang.org/x/sys/windows

appveyor failed.


@echo off

echo x64-debug
msbuild /nologo /verbosity:quiet /p:Configuration=debug /p:Platform=x64 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" goto fail

echo x64-release
msbuild /nologo /verbosity:quiet /p:Configuration=release /p:Platform=x64 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" goto fail

echo x86-debug
msbuild /nologo /verbosity:quiet /p:Configuration=debug /p:Platform=x86 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" goto fail

echo x86-release
msbuild /nologo /verbosity:quiet /p:Configuration=release /p:Platform=x86 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" goto fail

exit /b 0

:fail
    echo FAILED!
    exit /b 1

@echo off
setlocal

set /a errorcount=0

echo x64-debug
msbuild /nologo /verbosity:quiet /p:Configuration=debug /p:Platform=x64 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" set /a errorcount=%errorcount% + 1

echo x64-release
msbuild /nologo /verbosity:quiet /p:Configuration=release /p:Platform=x64 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" set /a errorcount=%errorcount% + 1

echo x86-debug
msbuild /nologo /verbosity:quiet /p:Configuration=debug /p:Platform=x86 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" set /a errorcount=%errorcount% + 1

echo x86-release
msbuild /nologo /verbosity:quiet /p:Configuration=release /p:Platform=x86 "%~dp0..\source\PresentMon.sln"
if not "%errorlevel%"=="0" set /a errorcount=%errorcount% + 1

echo.
if %errorcount% GTR 0 (
    echo %errorcount% configs failed!
    exit /b 1
)

echo All configs passed!
exit /b 0

Modify build_all_configs.cmd to not early-out on failure


Add simple .bat wrapper for Windows

Add simple .bat wrapper for Windows


@echo off

echo.
echo == Extract
echo.

set ZIP="..\build-tools\7zip\x64\7za.exe"
set TARGET_DIR="..\extracted"

pushd downloads

if not exist %TARGET_DIR% (mkdir %TARGET_DIR%)

echo.
echo === Extracting Build Tools into the folder %TARGET_DIR%
echo.

echo.
echo CMake
%ZIP% x cmake.zip -o%TARGET_DIR% > nul
move "%TARGET_DIR%\cmake-*" "%TARGET_DIR%\cmake"

echo.
echo Swig
%ZIP% x swig.zip -o%TARGET_DIR% > nul
move "%TARGET_DIR%\swig*" "%TARGET_DIR%\swig"

rem echo.
rem echo TDM-GCC-MINGW
rem %ZIP% x tdm-gcc.7z -o%TARGET_DIR% > nul
rem move "%TARGET_DIR%\tdm-gcc-*" "%TARGET_DIR%\mingw"

echo.
echo === Extracting Fifengine Dependencies into the folder %TARGET_DIR%
echo.

echo.
echo Fifengine Dependencies
%ZIP% x libfife-dependencies.zip -o..\extracted\fifengine-includes > nul

echo.
echo Fifengine Python27 Installer
copy libfife.win32-py2.7.msi "%TARGET_DIR%\libfife.win32-py2.7.msi"

echo.
echo Fifengine Python34 Installer
copy libfife.win32-py3.4.msi "%TARGET_DIR%\libfife.win32-py3.4.msi"

echo.
echo Fifengine Mapeditor
rem extracts folder "fifengine-editor-master"
%ZIP% x fifengine-editor.zip -o..\extracted > nul

echo.
echo Fifengine Python Demos
rem extracts folder "fifengine-demos-master"
%ZIP% x fifengine-demos.zip -o..\extracted > nul

echo.
echo Fifengine Python Tutorials
rem extracts folder "python-tutorials-master"
%ZIP% x python-tutorials.zip -o..\extracted > nul

rem echo.
rem echo Fifengine C++ Tutorials
rem %ZIP% x cpp-tutorials.zip -o..\extracted > nul

rem echo.
rem echo Fifengine Atlas Creator
rem %ZIP% x ?.zip -o..\extracted\fifengine-atlas-creator > nul

rem echo.
rem echo Fifengine Documentations
rem %ZIP% x ?.zip -o..\extracted\.pdf > nul

popd

@echo off

echo.
echo == Extract
echo.

set ZIP="..\build-tools\7zip\x64\7za.exe"
set TARGET_DIR="..\extracted"

pushd downloads

if not exist %TARGET_DIR% (mkdir %TARGET_DIR%)

echo.
echo === Extracting Build Tools into the folder %TARGET_DIR%
echo.

echo.
echo CMake
%ZIP% x cmake.zip -o%TARGET_DIR% > nul
move "%TARGET_DIR%\cmake-*" "%TARGET_DIR%\cmake"

echo.
echo Swig
%ZIP% x swig.zip -o%TARGET_DIR% > nul
move "%TARGET_DIR%\swig*" "%TARGET_DIR%\swig"

rem echo.
rem echo TDM-GCC-MINGW
rem %ZIP% x tdm-gcc.7z -o%TARGET_DIR% > nul
rem move "%TARGET_DIR%\tdm-gcc-*" "%TARGET_DIR%\mingw"

echo.
echo === Extracting Fifengine Dependencies into the folder %TARGET_DIR%
echo.

echo.
echo Fifengine Dependencies
%ZIP% x libfife-dependencies.zip -o..\extracted\fifengine-includes > nul

echo.
echo Fifengine Python27 Installer
copy libfife.win32-py2.7.msi "%TARGET_DIR%\libfife.win32-py2.7.msi"

rem echo.
rem echo Fifengine Python34 Installer
rem copy libfife.win32-py3.4.msi "%TARGET_DIR%\libfife.win32-py3.4.msi"

echo.
echo Fifengine Mapeditor
rem extracts folder "fifengine-editor-master"
%ZIP% x fifengine-editor.zip -o..\extracted > nul

echo.
echo Fifengine Python Demos
rem extracts folder "fifengine-demos-master"
%ZIP% x fifengine-demos.zip -o..\extracted > nul

echo.
echo Fifengine Python Tutorials
rem extracts folder "python-tutorials-master"
%ZIP% x python-tutorials.zip -o..\extracted > nul

rem echo.
rem echo Fifengine C++ Tutorials
rem %ZIP% x cpp-tutorials.zip -o..\extracted > nul

rem echo.
rem echo Fifengine Atlas Creator
rem %ZIP% x ?.zip -o..\extracted\fifengine-atlas-creator > nul

rem echo.
rem echo Fifengine Documentations
rem %ZIP% x ?.zip -o..\extracted\.pdf > nul

popd

Disable Py3

Disable Py3


@echo off
rem Probably not required
rem cd Engine3D\CodeCoverage

nuget restore packages.config -PackagesDirectory packages

rem Probably not required
rem cd ..\Engine3D-Tests
rem dotnet restore
rem cd ..
rem cd ..

rem The -threshold options prevents this taking ages...
.\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" -targetargs:"/noresults /noisolation /testcontainer:"".\Engine3D\Engine3D-Tests\bin\Release\Engine3D-Tests.dll"" -threshold:10 -filter:"+[Engine3D*]*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -returntargetcode -output:.\Engine3D.Coverage.xml

if %errorlevel% neq 0 exit /b %errorlevel%

SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%
pip install codecov
codecov -f "Engine3D.Coverage.xml"

@echo off
rem Probably not required
rem cd Engine3D\CodeCoverage

nuget restore Engine3D\CodeCoverage\packages.config -PackagesDirectory packages

rem Probably not required
rem cd ..\Engine3D-Tests
rem dotnet restore
rem cd ..
rem cd ..

rem The -threshold options prevents this taking ages...
.\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" -targetargs:"/noresults /noisolation /testcontainer:"".\Engine3D\Engine3D-Tests\bin\Release\Engine3D-Tests.dll"" -threshold:10 -filter:"+[Engine3D*]*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -returntargetcode -output:.\Engine3D.Coverage.xml

if %errorlevel% neq 0 exit /b %errorlevel%

SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%
pip install codecov
codecov -f "Engine3D.Coverage.xml"

Update CodeCoverage.cmd

Update CodeCoverage.cmd


add batch file to start local development server


:: 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.

@echo off

if exist ..\bin\go.exe goto ok
echo Must run run.bat from Go src directory after installing cmd/go.
goto fail
:ok

:: 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
setlocal
:nolocal

set GOBUILDFAIL=0

set GOPATH=c:\nonexist-gopath
:: Issue 14340: ignore GOBIN during all.bat.
set GOBIN=
set GOFLAGS=
set GO111MODULE=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo ##### Building packages and commands.
..\bin\go install -a -v std cmd
if errorlevel 1 goto fail
echo.
:norebuild

:: get CGO_ENABLED
..\bin\go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

..\bin\go tool dist test
if errorlevel 1 goto fail
echo.

goto end

:fail
set GOBUILDFAIL=1

: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.

@echo off

if exist ..\bin\go.exe goto ok
echo Must run run.bat from Go src directory after installing cmd/go.
goto fail
:ok

:: 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
setlocal
:nolocal

set GOBUILDFAIL=0

set GOPATH=c:\nonexist-gopath
:: Issue 14340: ignore GOBIN during all.bat.
set GOBIN=
set GOFLAGS=
set GO111MODULE=

:: get CGO_ENABLED
..\bin\go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat

if x%1==x--no-rebuild goto norebuild
..\bin\go tool dist test --rebuild
if errorlevel 1 goto fail
goto end

:norebuild
..\bin\go tool dist test
if errorlevel 1 goto fail
goto end

:fail
set GOBUILDFAIL=1

:end

run.bat: use cmd/dist instead of 'go install' to rebuild std and cmd

cmd/dist may set and/or unset variables before building, and at any
rate it is fragile to run 'go install' before sourcing env.bat.

The build-stamp information embedded by the 'go' command is currently
sensitive to whether CGO_* variables are implicit or explicit, so running
'go install' before env.bat may cause stamped metadata to become stale.
(Explicitly setting to the default arguably ought to produce the same
metadata as leaving the variables unset, but that's a separate issue
and a bigger cleanup.)

Moreover, run.bat is supposed to parallel run.bash, and run.bash
already hasn't invoked 'go install' itself since CL 6531!

For #52009

Change-Id: Ie35217913f02cc7e0c3f9b12874abd7416473478
Reviewed-on: https://go-review.googlesource.com/c/go/+/398060
Trust: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
Run-TryBot: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
Reviewed-by: Dmitri Shuralyov <d181b7fea0ec87c86ba5a890ab716db52498e3ba@golang.org>


@echo on
vfr.py -i audio.flac -vf 24000/1001 test.avs --test > result-int-cfr-%1.txt
vfr.py -i audio.flac -vf 24/1.001 test.avs --test > result-float-cfr-%1.txt
vfr.py -i audio.flac -vf tc1-cfr.txt test.avs --test > result-tc1-cfr-%1.txt
vfr.py -i audio.flac -vf tc2-cfr.txt test.avs --test > result-tc2-cfr-%1.txt
vfr.py -i audio.flac -vf tc1-vfr.txt test.avs --test > result-tc1-vfr-%1.txt
vfr.py -i audio.flac -vf tc2-vfr.txt test.avs --test > result-tc2-vfr-%1.txt
@echo off
REM vfr.py -f 24/1.001 -c chap-fps-%1.txt -n chnames.txt test.avs
REM vfr.py -t tc1-cfr.txt -c chap-cfr-%1.xml -n chnames.txt test.avs
REM vfr.py -t tc1-vfr.txt -c chap-vfr-%1.xml -n chnames.txt test.avs

@echo off
set vfr = "python ..\vfr.py"

@echo on
REM Timecodes testing
%vfr% -i audio.flac -vf 24000/1001 test.avs --test > result-int-cfr-%1.txt
%vfr% -i audio.flac -vf 24/1.001 test.avs --test > result-float-cfr-%1.txt
%vfr% -i audio.flac -v --ofps 24/1.001 test.avs --test > result-ofps-cfr-%1.txt
%vfr% -i audio.flac -vf tc1-cfr.txt test.avs --test > result-tc1-cfr-%1.txt
%vfr% -i audio.flac -vf tc2-cfr.txt test.avs --test > result-tc2-cfr-%1.txt
%vfr% -i audio.flac -vf tc1-vfr.txt test.avs --test > result-tc1-vfr-%1.txt
%vfr% -i audio.flac -vf tc2-vfr.txt test.avs --test > result-tc2-vfr-%1.txt

@echo off
REM Chapter testing
REM %vfr% -f 24/1.001 -c chap-fps-%1.txt -n chnames.txt test.avs
REM %vfr% -t tc1-cfr.txt -c chap-cfr-%1.xml -n chnames.txt test.avs

Improve test.bat

Improve test.bat


@echo off
echo Building setup ...
echo.

powershell -ExecutionPolicy RemoteSigned -File .\Build.ps1 -configuration "Release" -Target Build-Setup

echo.
echo.
pause

@echo off

powershell -ExecutionPolicy RemoteSigned -File .\Build.ps1 -configuration "Release" -Target Build-Setup

echo.
echo.
pause

Clean build script

Clean build script


@echo on
if %TYPE% == "zpm" (
    cd test

    zpm install-package --allow-install --allow-module || exit /b 1
    zpm vs2015 --allow-install || exit /b 1

    msbuild zpm/CoreLib-ZPM.sln || exit /b 1

    test\bin\x86\core-zpm-test.exe || exit /b 1
) else (
    zpm install-package --allow-install --allow-module  || exit /b 1
    zpm %VSTUD% --allow-install || exit /b 1

    msbuild core/CoreLib.sln /property:Configuration=Release /property:Platform=%PLAT% || exit /b 1

    if %TYPE% == "debug" (
        bin\%ARCH%\core-testd
    ) else (
        bin\%ARCH%\core-test
    )
)

Debug statements

Debug statements


if "%TYPE%" == "zpm" (
    cd test

    zpm install-package --allow-install --allow-module || exit /b 1
    zpm vs2015 --allow-install || exit /b 1

    msbuild zpm/MathLib-ZPM.sln || exit /b 1

    bin\x86\math-zpm-test.exe || exit /b 1
) else (
    zpm install-package --allow-install --allow-module || exit /b 1
    zpm %VSTUD% --allow-install || exit /b 1

    msbuild math/MathLib.sln /property:Configuration=Release /property:Platform=%PLAT% || exit /b 1

    if %TYPE% == "debug" (
        bin\%ARCH%\math-testd
    ) else (
        bin\%ARCH%\math-test
    )
)

if "%TYPE%" == "zpm" (
    cd test

    zpm install-package --allow-install --allow-module || exit /b 1
    zpm vs2015 --allow-install || exit /b 1

    msbuild zpm/PlotLib-ZPM.sln || exit /b 1

    bin\x86\plot-zpm-test.exe || exit /b 1
) else (
    zpm install-package --allow-install --allow-module || exit /b 1
    zpm %VSTUD% --allow-install || exit /b 1

    msbuild plot/PlotLib.sln /property:Configuration=Release /property:Platform=%PLAT% || exit /b 1

    if %TYPE% == "debug" (
        bin\%ARCH%\plot-testd
    ) else (
        bin\%ARCH%\plot-test
    )
)

Fix appveyor paths

Fix appveyor paths


@ECHO OFF
@color 2

REM To print a message in console once the gmvault-shell has been launched
ECHO Welcome to gmvault (version 1.7-alpha).
ECHO.
ECHO Run gmvault --help to display the help.
ECHO Run gmvault {command} --help to display help for specific commands.

@ECHO OFF
@color 2
@mode 140,55

REM To print a message in console once the gmvault-shell has been launched
ECHO Welcome to gmvault (version 1.7-alpha).
ECHO.
ECHO Run gmvault --help to display the help.
ECHO Run gmvault {command} --help to display help for specific commands.

increase windows size

increase windows size


@echo off

SET DIR=%~dp0

SET FOUND_PYTHON_EXE=""
SET FOUND_CMAKE_EXE=""

1>NUL 2>NUL CMD /c where python2
IF NOT ERRORLEVEL 1 (
   SET FOUND_PYTHON_EXE=python2
)

IF %FOUND_PYTHON_EXE% EQU "" (
   1>NUL 2>NUL CMD /c where python
   IF NOT ERRORLEVEL 1 (
      SET FOUND_PYTHON_EXE=python
   )
)

IF %FOUND_PYTHON_EXE% EQU "" (
  ECHO ERROR: no Python executable found on PATH.
  ECHO Make sure you can run 'python' or 'python2' in a Command Prompt.
  EXIT /b
)

1>NUL 2>NUL CMD /c where cmake
IF NOT ERRORLEVEL 1 (
   SET FOUND_CMAKE_EXE=cmake
)

IF %FOUND_CMAKE_EXE% EQU "" (
  ECHO ERROR: no cmake executable found on PATH.
  ECHO Make sure you can run 'cmake' in a Command Prompt.
  EXIT /b
)

1>NUL 2>NUL CMD /c where virtualenv
IF ERRORLEVEL 1 (
   ECHO ERROR: virtualenv not installed.
   EXIT /b 1
)

1>NUL 2>NUL CMD /c where npm
IF ERRORLEVEL 1 (
   ECHO ERROR: npm not installed.
   EXIT /b 1
)

SET "DIR=%DIR%\venv"
SET "DEACTIVATE=%DIR%\venv\Scripts\deactivate.bat"

IF "%1" == "setup" (
   IF NOT DEFINED DevEnvDir (
      IF NOT EXIST "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
         ECHO ERROR: could not find vcvarsall.bat
         ECHO Make sure you installed Visual Studio 2015.
         EXIT /b 1
      )
      CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
   )
   GOTO :setup
) ELSE (
       IF NOT EXIST "%DIR%\Scripts\activate.bat" (
          ECHO venv not found. running "ers setup".
          ECHO enter the command again after setup is finished.
          timeout 10
          GOTO :setup
       )
       CALL "%DIR%\Scripts\activate.bat"
       python ers.py %*
       CALL "%DIR%\Scripts\deactivate.bat"
       EXIT /b %ERRORLEVEL%
       GOTO :eof
)

:setup
IF NOT EXIST "%DIR%\venv" (
       virtualenv venv
       PUSHD venv\Scripts
       CALL activate
       pip install click
       pip install wget
       pip install colorama
       CALL deactivate
       POPD
)

git submodule init
git submodule update

CALL venv\Scripts\activate.bat
CALL venv\Scripts\deactivate.bat

IF NOT EXIST "build\bin" (
   ECHO Creating build\bin
   mkdir build\bin
)

IF NOT EXIST "build\bin\Debug" (
   ECHO Creating build\bin\Debug
   mkdir build\bin\Debug
)

IF NOT EXIST "build\bin\Release" (
   ECHO Creating build\bin\Release
   mkdir build\bin\Release
)

pushd libs\g3logger
mkdir build && pushd build
cmake .. -G "Visual Studio 14 Win64"
msbuild /p:Configuration=Debug g3log.sln
msbuild /p:Configuration=Release g3log.sln
popd
popd

tools\build\premake5.exe vs2015

CALL "%DIR%\Scripts\activate.bat"
python ers.py client
CALL "%DIR%\Scripts\deactivate.bat

@echo off

SET DIR=%~dp0

SET FOUND_PYTHON_EXE=""
SET FOUND_CMAKE_EXE=""

1>NUL 2>NUL CMD /c where python2
IF NOT ERRORLEVEL 1 (
   SET FOUND_PYTHON_EXE=python2
)

IF %FOUND_PYTHON_EXE% EQU "" (
   1>NUL 2>NUL CMD /c where python
   IF NOT ERRORLEVEL 1 (
      SET FOUND_PYTHON_EXE=python
   )
)

IF %FOUND_PYTHON_EXE% EQU "" (
  ECHO ERROR: no Python executable found on PATH.
  ECHO Make sure you can run 'python' or 'python2' in a Command Prompt.
  EXIT /b
)

1>NUL 2>NUL CMD /c where cmake
IF NOT ERRORLEVEL 1 (
   SET FOUND_CMAKE_EXE=cmake
)

IF %FOUND_CMAKE_EXE% EQU "" (
  ECHO ERROR: no cmake executable found on PATH.
  ECHO Make sure you can run 'cmake' in a Command Prompt.
  EXIT /b
)

1>NUL 2>NUL CMD /c where virtualenv
IF ERRORLEVEL 1 (
   ECHO ERROR: virtualenv not installed.
   EXIT /b 1
)

1>NUL 2>NUL CMD /c where npm
IF ERRORLEVEL 1 (
   ECHO ERROR: npm not installed.
   EXIT /b 1
)

SET "DIR=%DIR%\venv"
SET "DEACTIVATE=%DIR%\venv\Scripts\deactivate.bat"

IF "%1" == "setup" (
   IF NOT DEFINED DevEnvDir (
      IF NOT EXIST "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
         ECHO ERROR: could not find vcvarsall.bat
         ECHO Make sure you installed Visual Studio 2015.
         EXIT /b 1
      )
      CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
   )
   GOTO :setup
) ELSE (
       IF NOT EXIST "%DIR%\Scripts\activate.bat" (
          ECHO venv not found. running "ers setup".
          ECHO enter the command again after setup is finished.
          ping 127.0.0.1 -n1 -w 10000 >NUL
          GOTO :setup
       )
       CALL "%DIR%\Scripts\activate.bat"
       python ers.py %*
       CALL "%DIR%\Scripts\deactivate.bat"
       EXIT /b %ERRORLEVEL%
       GOTO :eof
)

:setup
IF NOT EXIST "%DIR%\venv" (
       virtualenv venv
       PUSHD venv\Scripts
       CALL activate
       pip install click
       pip install wget
       pip install colorama
       CALL deactivate
       POPD
)

git submodule init
git submodule update

CALL venv\Scripts\activate.bat
CALL venv\Scripts\deactivate.bat

IF NOT EXIST "build\bin" (
   ECHO Creating build\bin
   mkdir build\bin
)

IF NOT EXIST "build\bin\Debug" (
   ECHO Creating build\bin\Debug
   mkdir build\bin\Debug
)

IF NOT EXIST "build\bin\Release" (
   ECHO Creating build\bin\Release
   mkdir build\bin\Release
)

pushd libs\g3logger
mkdir build && pushd build
cmake .. -G "Visual Studio 14 Win64"
msbuild /p:Configuration=Debug g3log.sln
msbuild /p:Configuration=Release g3log.sln
popd
popd

tools\build\premake5.exe vs2015

CALL "%DIR%\Scripts\activate.bat"
python ers.py client
CALL "%DIR%\Scripts\deactivate.bat

Use ping to cause delay

Use ping to cause delay


mkdir build && cd build

cmake -G "Ninja" ^
 -D CMAKE_BUILD_TYPE:STRING=Release ^
 -D CMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
 -D CMAKE_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
 -D CMAKE_SYSTEM_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
 -D BOOST_LIBRARYDIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
 -D BOOST_INCLUDEDIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
 -D OCC_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include\opencascade" ^
 -D OCC_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
 -D COLLADA_SUPPORT:BOOL=OFF ^
 -D BUILD_EXAMPLES:BOOL=OFF ^
 -D BUILD_GEOMSERVER:BOOL=OFF ^
 -D BUILD_CONVERT:BOOL=OFF ^
 ../cmake

if errorlevel 1 exit 1
ninja install
if errorlevel 1 exit 1

mkdir build && cd build

cmake -G "Ninja" ^
 -D CMAKE_BUILD_TYPE:STRING=Release ^
 -D CMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
 -D CMAKE_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
 -D CMAKE_SYSTEM_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
 -D BOOST_LIBRARYDIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
 -D BOOST_INCLUDEDIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
 -D OCC_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include\opencascade" ^
 -D OCC_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
 -D COLLADA_SUPPORT:BOOL=OFF ^
 -D BUILD_EXAMPLES:BOOL=OFF ^
 -D BUILD_GEOMSERVER:BOOL=OFF ^
 -D BUILD_CONVERT:BOOL=OFF ^
 -D PYTHON_EXECUTABLE:FILEPATH=%PREFIX%/python ^
 ../cmake

if errorlevel 1 exit 1
ninja install
if errorlevel 1 exit 1

set python executable

set python executable


@echo off
REM Helper script to build and run IoTivity on Windows
SETLOCAL ENABLEDELAYEDEXPANSION

if [%1]==[] goto USAGE

set IOTIVITY_DIR=%~dp0
set HOME=%USERPROFILE%

IF /I "%1" == "msys" (
  set BUILD_MSYS="YES"
  SHIFT
) ELSE (
  set BUILD_MSYS=
)

REM *** Default BUILD OPTIONS ***
set TARGET_OS=windows

if "%JENKINS_HOME%" == "" (
  set AUTOMATIC_UPDATE=0
) else (
  set AUTOMATIC_UPDATE=1
)

if "%TARGET_ARCH%" == "" (
  set TARGET_ARCH=amd64
)

if "%TEST%" == "" (
  set TEST=1
)

if "%LOGGING%" == "" (
  set LOGGING=0
)

if "%RELEASE%" == "" (
  set RELEASE=0
)

if "%WITH_TCP%" == "" (
  set WITH_TCP=1
)

if "%SECURED%" == "" (
  set SECURED=1
)

if "%MULTIPLE_OWNER%" == "" (
  set MULTIPLE_OWNER=1
)

set THREAD_COUNT=%NUMBER_OF_PROCESSORS%

set ROUTING=EP
set WITH_UPSTREAM_LIBCOAP=1
set BINDIR=debug
set RD_MODE=CLIENT,SERVER

set RUN_ARG=%1
SHIFT

set DEBUG=

:processArgs
IF NOT "%1"=="" (
  IF /I "%1"=="-arch" (
    SET TARGET_ARCH=%2
    SHIFT
  )
  IF /I "%1"=="-threads" (
    SET THREAD_COUNT=%2
    SHIFT
  )
  IF /I "%1"=="-noTest" (
    SET TEST=0
  )
  IF /I "%1"=="-logging" (
    SET LOGGING=1
  )
  IF /I "%1"=="-debugger" (
    set DEBUG="%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\cdb.exe" -2 -c "g"
  )
  IF /I "%1"=="-release" (
    SET RELEASE=1
  )
  IF /I "%1"=="-noTCP" (
    SET WITH_TCP=0
  )
  IF /I "%1"=="-noSecurity" (
    set SECURED=0
  )
  IF /I "%1"=="-noMOT" (
    set MULTIPLE_OWNER=0
  )
  IF /I "%1"=="-automaticUpdate" (
    set AUTOMATIC_UPDATE=1
  )

  SHIFT
  GOTO :processArgs
)

IF %RELEASE% == 1 (
  set BINDIR=release
)

REM We need to append the "PATH" so the octbstack.dll can be found by executables
IF "%BUILD_MSYS%" == "" (
  set BUILD_DIR=out\windows\%TARGET_ARCH%\%BINDIR%
  set PATH=!PATH!;!IOTIVITY_DIR!!BUILD_DIR!;
) ELSE (
  set BUILD_DIR=out\msys_nt\x86_64\%BINDIR%
  set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
)

set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=%WITH_TCP% BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% RD_MODE=%RD_MODE% ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP% MULTIPLE_OWNER=%MULTIPLE_OWNER% -j %THREAD_COUNT% AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE%

REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
IF NOT "%MSVC_VERSION%" == "" (
  set BUILD_OPTIONS=%BUILD_OPTIONS% MSVC_VERSION=%MSVC_VERSION%
)

REM *** BUILD OPTIONS ***

if "!RUN_ARG!"=="server" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserver.exe
) else if "!RUN_ARG!"=="client" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclient.exe
) else if "!RUN_ARG!"=="serverhq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserverHQ.exe
) else if "!RUN_ARG!"=="clienthq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclientHQ.exe
) else if "!RUN_ARG!"=="mediaclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaclient.exe
) else if "!RUN_ARG!"=="mediaserver" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaserver.exe
) else if "!RUN_ARG!"=="winuiclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% winuiclient.exe
) else if "!RUN_ARG!"=="occlient" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
) else if "!RUN_ARG!"=="ocserver" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% ocserverbasicops.exe
) else if "!RUN_ARG!"=="provclient" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% provisioningclient.exe
) else if "!RUN_ARG!"=="justworks" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% sampleserver_justworks.exe
) else if "!RUN_ARG!"=="test" (
  %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\ocrandom\test\randomtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_malloc\test\malloctests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_string\test\stringtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_time\test\timetests.exe
  %DEBUG% %BUILD_DIR%\resource\unittests\unittests.exe
) else if "!RUN_ARG!"=="build" (
  echo Starting IoTivity build with these options:
  echo   TARGET_OS=%TARGET_OS%
  echo   TARGET_ARCH=%TARGET_ARCH%
  echo   SECURED=%SECURED%
  echo   RELEASE=%RELEASE%
  echo   TEST=%TEST%
  echo   LOGGING=%LOGGING%
  echo   ROUTING=%ROUTING%
  echo   WITH_TCP=%WITH_TCP%
  echo   WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
  echo   MULTIPLE_OWNER=%MULTIPLE_OWNER%
  echo   MSVC_VERSION=%MSVC_VERSION%
  echo   THREAD_COUNT=%THREAD_COUNT%
  echo   AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE%
  echo.scons VERBOSE=1 %BUILD_OPTIONS%
  scons VERBOSE=1 %BUILD_OPTIONS%
) else if "!RUN_ARG!"=="clean" (
  del /S *.ilk
  scons VERBOSE=1 %BUILD_OPTIONS% -c
) else if "!RUN_ARG!"=="cleangtest" (
  rd /s /q extlibs\gtest\googletest-release-1.7.0
  del extlibs\gtest\release-1.7.0.zip
) else (
    echo.%0 - Script requires a valid argument!
    goto :EOF
)

cd %IOTIVITY_DIR%

echo Done!

goto EOF

:USAGE
echo %0 - Helper to build/test iotivity.  Requires an argument.
echo Installation: Drop this into your iotivity root directory to use it.
echo.
echo. Default build settings are: debug binaries run unittests and no logging
echo.
echo. Default build parameters can be overridden using the following arguments
echo.
REM At a quick look, the "Build either amd64 or x86 architecture binaries" message
REM below seems out of alignment with the other messages underneath it. But, "^|"
REM gets echoed as a single character, so the messages are actually aligned correctly
REM in the output of "run.bat".
echo   -arch [x86 ^| amd64]          - Build either amd64 or x86 architecture binaries
echo.
echo   -noTest                      - Don't run the unittests after building the binaries
echo.
echo   -logging                     - Enable logging while building the binaries
echo.
echo   -debugger                    - Debug the requested application
echo.
echo   -release                     - Build release binaries
echo.
echo   -threads [NUMBER_OF_THREADS] - Build in parallel using [NUMBER_OF_THREADS] threads. Default: %NUMBER_OF_PROCESSORS%.
echo.
echo   -noTCP                       - Build with the TCP adapter disabled
echo.
echo   -noSecurity                  - Remove security support (results in code that cannot be certified by OCF)
echo.
echo   -noMOT                       - Remove Multiple Ownership Transfer support.
echo.
echo   -automaticUpdate             - Automatically update libcoap to required version.
echo.
echo.
echo. Usage examples:
echo.
echo   Launch SimpleClient with debugger:
echo      %0 client -debugger
echo.
echo   Launch SimpleServer:
echo      %0 server
echo.
echo   Launch WinUIClient built in msys:
echo      %0 msys winuiclient
echo.
echo   Build amd64 debug binaries and run unit tests:
echo      %0 build
echo.
echo   Build amd64 release binaries w/o running tests:
echo      %0 build -arch amd64 -noTest -release
echo.
echo   Build x86 debug binaries and run unit tests:
echo      %0 build -arch x86
echo.
echo   Build amd64 release binaries with logging enabled:
echo      %0 build -arch amd64 -release -logging
echo.
echo   Build using only one thread:
echo      %0 build -threads 1
echo.
echo   Build with TCP adapter disabled and run unit tests:
echo      %0 build -noTCP
echo.
echo   Build without security support and run unit tests:
echo      %0 build -noSecurity
echo.
echo   Build without Multiple Ownership Transfer support and run unit tests:
echo      %0 build -noMOT
echo.
echo   Run all tests:
echo      %0 test
echo.
echo   Clean:
echo      %0 clean

:EOF

@echo off
REM Helper script to build and run IoTivity on Windows
SETLOCAL ENABLEDELAYEDEXPANSION

if [%1]==[] goto USAGE

set IOTIVITY_DIR=%~dp0
set HOME=%USERPROFILE%

IF /I "%1" == "msys" (
  set BUILD_MSYS="YES"
  SHIFT
) ELSE (
  set BUILD_MSYS=
)

REM *** Default BUILD OPTIONS ***
set TARGET_OS=windows

if "%JENKINS_HOME%" == "" (
  set AUTOMATIC_UPDATE=0
) else (
  set AUTOMATIC_UPDATE=1
)

if "%TARGET_ARCH%" == "" (
  set TARGET_ARCH=amd64
)

if "%TEST%" == "" (
  set TEST=1
)

if "%LOGGING%" == "" (
  set LOGGING=0
)

if "%RELEASE%" == "" (
  set RELEASE=0
)

if "%WITH_TCP%" == "" (
  set WITH_TCP=1
)

if "%SECURED%" == "" (
  set SECURED=1
)

if "%MULTIPLE_OWNER%" == "" (
  set MULTIPLE_OWNER=1
)

set THREAD_COUNT=%NUMBER_OF_PROCESSORS%

set ROUTING=EP
set WITH_UPSTREAM_LIBCOAP=1
set BINDIR=debug
set RD_MODE=CLIENT,SERVER

set RUN_ARG=%1
SHIFT

set DEBUG=

:processArgs
IF NOT "%1"=="" (
  IF /I "%1"=="-arch" (
    SET TARGET_ARCH=%2
    SHIFT
  )
  IF /I "%1"=="-threads" (
    SET THREAD_COUNT=%2
    SHIFT
  )
  IF /I "%1"=="-noTest" (
    SET TEST=0
  )
  IF /I "%1"=="-logging" (
    SET LOGGING=1
  )
  IF /I "%1"=="-debugger" (
    set DEBUG="%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\cdb.exe" -2 -c "g"
  )
  IF /I "%1"=="-release" (
    SET RELEASE=1
  )
  IF /I "%1"=="-noTCP" (
    SET WITH_TCP=0
  )
  IF /I "%1"=="-noSecurity" (
    set SECURED=0
  )
  IF /I "%1"=="-noMOT" (
    set MULTIPLE_OWNER=0
  )
  IF /I "%1"=="-automaticUpdate" (
    set AUTOMATIC_UPDATE=1
  )

  SHIFT
  GOTO :processArgs
)

IF %RELEASE% == 1 (
  set BINDIR=release
)

REM We need to append the "PATH" so the octbstack.dll can be found by executables
IF "%BUILD_MSYS%" == "" (
  set BUILD_DIR=out\windows\%TARGET_ARCH%\%BINDIR%
  set PATH=!PATH!;!IOTIVITY_DIR!!BUILD_DIR!;
) ELSE (
  set BUILD_DIR=out\msys_nt\x86_64\%BINDIR%
  set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
)

set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=%WITH_TCP% BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% RD_MODE=%RD_MODE% ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP% MULTIPLE_OWNER=%MULTIPLE_OWNER% -j %THREAD_COUNT% AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE%

REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
IF NOT "%MSVC_VERSION%" == "" (
  set BUILD_OPTIONS=%BUILD_OPTIONS% MSVC_VERSION=%MSVC_VERSION%
)

REM *** BUILD OPTIONS ***

if "!RUN_ARG!"=="server" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserver.exe
) else if "!RUN_ARG!"=="client" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclient.exe
) else if "!RUN_ARG!"=="serverhq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserverHQ.exe
) else if "!RUN_ARG!"=="clienthq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclientHQ.exe
) else if "!RUN_ARG!"=="mediaclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaclient.exe
) else if "!RUN_ARG!"=="mediaserver" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaserver.exe
) else if "!RUN_ARG!"=="winuiclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% winuiclient.exe
) else if "!RUN_ARG!"=="occlient" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
) else if "!RUN_ARG!"=="ocserver" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% ocserverbasicops.exe
) else if "!RUN_ARG!"=="provclient" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% provisioningclient.exe
) else if "!RUN_ARG!"=="justworks" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% sampleserver_justworks.exe
) else if "!RUN_ARG!"=="test" (
  %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\ocrandom\test\randomtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_malloc\test\malloctests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_string\test\stringtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_time\test\timetests.exe
  %DEBUG% %BUILD_DIR%\resource\unittests\unittests.exe
) else if "!RUN_ARG!"=="build" (
  echo Starting IoTivity build with these options:
  echo   TARGET_OS=%TARGET_OS%
  echo   TARGET_ARCH=%TARGET_ARCH%
  echo   SECURED=%SECURED%
  echo   RELEASE=%RELEASE%
  echo   TEST=%TEST%
  echo   LOGGING=%LOGGING%
  echo   ROUTING=%ROUTING%
  echo   WITH_TCP=%WITH_TCP%
  echo   WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
  echo   MULTIPLE_OWNER=%MULTIPLE_OWNER%
  echo   MSVC_VERSION=%MSVC_VERSION%
  echo   THREAD_COUNT=%THREAD_COUNT%
  echo   AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE%
  echo.scons VERBOSE=1 %BUILD_OPTIONS%
  call scons.bat VERBOSE=1 %BUILD_OPTIONS%
  if ERRORLEVEL 1 (
    echo SCons failed - exiting run.bat with code 3
    exit /B 3
    )
) else if "!RUN_ARG!"=="clean" (
  del /S *.ilk
  call scons.bat VERBOSE=1 %BUILD_OPTIONS% -c
  if ERRORLEVEL 1 (
    echo SCons failed - exiting run.bat with code 2
    exit /B 2
    )
) else if "!RUN_ARG!"=="cleangtest" (
  rd /s /q extlibs\gtest\googletest-release-1.7.0
  del extlibs\gtest\release-1.7.0.zip
) else (
    echo.%0 - Script requires a valid argument!
    echo Exiting run.bat with code 1
    exit /B 1
)

cd %IOTIVITY_DIR%

echo Done!

goto EOF

:USAGE
echo %0 - Helper to build/test iotivity.  Requires an argument.
echo Installation: Drop this into your iotivity root directory to use it.
echo.
echo. Default build settings are: debug binaries run unittests and no logging
echo.
echo. Default build parameters can be overridden using the following arguments
echo.
REM At a quick look, the "Build either amd64 or x86 architecture binaries" message
REM below seems out of alignment with the other messages underneath it. But, "^|"
REM gets echoed as a single character, so the messages are actually aligned correctly
REM in the output of "run.bat".
echo   -arch [x86 ^| amd64]          - Build either amd64 or x86 architecture binaries
echo.
echo   -noTest                      - Don't run the unittests after building the binaries
echo.
echo   -logging                     - Enable logging while building the binaries
echo.
echo   -debugger                    - Debug the requested application
echo.
echo   -release                     - Build release binaries
echo.
echo   -threads [NUMBER_OF_THREADS] - Build in parallel using [NUMBER_OF_THREADS] threads. Default: %NUMBER_OF_PROCESSORS%.
echo.
echo   -noTCP                       - Build with the TCP adapter disabled
echo.
echo   -noSecurity                  - Remove security support (results in code that cannot be certified by OCF)
echo.
echo   -noMOT                       - Remove Multiple Ownership Transfer support.
echo.
echo   -automaticUpdate             - Automatically update libcoap to required version.
echo.
echo.
echo. Usage examples:
echo.
echo   Launch SimpleClient with debugger:
echo      %0 client -debugger
echo.
echo   Launch SimpleServer:
echo      %0 server
echo.
echo   Launch WinUIClient built in msys:
echo      %0 msys winuiclient
echo.
echo   Build amd64 debug binaries and run unit tests:
echo      %0 build
echo.
echo   Build amd64 release binaries w/o running tests:
echo      %0 build -arch amd64 -noTest -release
echo.
echo   Build x86 debug binaries and run unit tests:
echo      %0 build -arch x86
echo.
echo   Build amd64 release binaries with logging enabled:
echo      %0 build -arch amd64 -release -logging
echo.
echo   Build using only one thread:
echo      %0 build -threads 1
echo.
echo   Build with TCP adapter disabled and run unit tests:
echo      %0 build -noTCP
echo.
echo   Build without security support and run unit tests:
echo      %0 build -noSecurity
echo.
echo   Build without Multiple Ownership Transfer support and run unit tests:
echo      %0 build -noMOT
echo.
echo   Run all tests:
echo      %0 test
echo.
echo   Clean:
echo      %0 clean

:EOF

Exit batch interpreter with error on failure: IOT-2119, RT#40028

Raise error on failure of "build"
Raise error on failure of "test"
Raise error on invalid target specification

Change-Id: Icbcaaa8d3b3541ecdce640632b6fdeff9df4b142
Signed-off-by: C.J. Collier <856843642850a14a2125c4144abbf0b803bc08a4@linuxfoundation.org>
Signed-off-by: Dan Mihai <ba8e1833495515b49ded9e20cae80a8129155aa9@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19401
Reviewed-by: Pawel Winogrodzki <86015b4aa5c210d1e1d093865be7781a2e47e04a@microsoft.com>
Reviewed-by: Omar Maabreh <3a8c539dd1468e5c297e7063158b75a45dd3bf69@microsoft.com>
Reviewed-by: Way Vadhanasin <6677afd41eee20f8edc6a725b43024602ec13be2@microsoft.com>


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

setlocal

md build
cd build

cmake -L ^
-G "%~1" ^
-T "%~2" ^
-D OSPRAY_BUILD_ISA=ALL ^
-D OSPRAY_MODULE_MPI=ON ^
-D OSPRAY_MODULE_BILINEAR_PATCH=ON ^
-D OSPRAY_ENABLE_TESTING=ON ^
-D USE_IMAGE_MAGICK=OFF ^
..

cmake --build . --config Release --target ALL_BUILD -- /m /nologo
ctest .

:abort
endlocal
:end

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

setlocal

md build
cd build

cmake -L ^
-G "%~1" ^
-T "%~2" ^
-D OSPRAY_BUILD_ISA=ALL ^
-D OSPRAY_MODULE_MPI=ON ^
-D OSPRAY_MODULE_BILINEAR_PATCH=ON ^
-D OSPRAY_ENABLE_TESTING=ON ^
-D USE_IMAGE_MAGICK=OFF ^
..

cmake --build . --config Release --target ALL_BUILD -- /m /nologo
ctest . -C Release

:abort
endlocal
:end

update ctest invocation on Windows

update ctest invocation on Windows


:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\masthead.afxm') }" -ExecutionPolicy Bypass

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


Create Restart_PC

Create Restart_PC

Restart PC with a small batch script.


echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\installed\x64-windows\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=perfThread_build ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_59=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\\installed\\x64-windows\\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=thread ^
    CONFIG+=csound6 ^
    CONFIG+=build64 ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_58=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

Support for MSVS 2017 for AppVeyor build.


SETLOCAL

rem # copy off the timestamp for fingerprinting before we blow it away later
move %BUILD_NUMBER%\build_timestamp %WORKSPACE%\

rem # run the tests
cd %BUILD_NUMBER%

rem # remove the chef package / clobber the files
rem # then install the new package
rmdir /S /Q C:\opscode
FOR %%i IN (pkg\chef*.msi) DO SET omnibus_package=%%i
SET omnibus_package=%WORKSPACE%\%BUILD_NUMBER%\%omnibus_package%

call msiexec INSTALLLOCATION=C:\opscode /qb /i %omnibus_package% || GOTO :error

rem # extract the chef source code
mkdir src\chef
FOR %%i IN (src\chef*.tar.gz) DO SET omnibus_source_tarball=%%i
call C:\opscode\chef\bin\tar.exe xvzf %omnibus_source_tarball% -C src\chef || GOTO :error

rem # COMPAT HACK - Chef 11 finally has the core Chef code in the root of the
rem # project repo. Since the Chef Client pipeline needs to build/test Chef 10.x
rem # and 11 releases our test script need to handle both cases gracefully.
IF EXIST .\src\chef\chef (
  cd .\src\chef\chef
) ELSE (
  cd .\src\chef
)

rem # install all of the development gems
mkdir .\bundle
set PATH=C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;%PATH%
call bundle install --without server --path bundle || GOTO :error

rem # run the tests
call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec || GOTO :error

rem # uninstall chef
call msiexec /qb /x %omnibus_package% || GOTO :error

rem # clean up the workspace to save disk space
cd %WORKSPACE%
rmdir /S /Q %BUILD_NUMBER%

GOTO :EOF

:error

SET ERR_LEV=%errorlevel%

ECHO Failed with error level %ERR_LEV%

rem # uninstall chef
call msiexec /qb /x %omnibus_package%

EXIT /B %ERR_LEV%

ENDLOCAL

SETLOCAL

rem # copy off the timestamp for fingerprinting before we blow it away later
move %BUILD_NUMBER%\build_timestamp %WORKSPACE%\

rem # run the tests
cd %BUILD_NUMBER%

rem # remove the chef package / clobber the files
rem # then install the new package
rmdir /S /Q C:\opscode
FOR %%i IN (pkg\chef*.msi) DO SET omnibus_package=%%i
SET omnibus_package=%WORKSPACE%\%BUILD_NUMBER%\%omnibus_package%

call msiexec INSTALLLOCATION=C:\opscode /qb /i %omnibus_package% || GOTO :error

rem # extract the chef source code
mkdir src\chef
FOR %%i IN (src\chef*.tar.gz) DO SET omnibus_source_tarball=%%i
call C:\opscode\chef\bin\tar.exe xvzf %omnibus_source_tarball% -C src\chef || GOTO :error

rem # COMPAT HACK - Chef 11 finally has the core Chef code in the root of the
rem # project repo. Since the Chef Client pipeline needs to build/test Chef 10.x
rem # and 11 releases our test script need to handle both cases gracefully.
IF EXIST .\src\chef\chef (
  cd .\src\chef\chef
) ELSE (
  cd .\src\chef
)

rem # install all of the development gems
mkdir .\bundle
set PATH=C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;%PATH%
call bundle install --without server --path bundle || GOTO :error

rem # run the tests -- exclude spec/stress on windows
call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/functional spec/unit || GOTO :error

rem # uninstall chef
call msiexec /qb /x %omnibus_package% || GOTO :error

rem # clean up the workspace to save disk space
cd %WORKSPACE%
rmdir /S /Q %BUILD_NUMBER%

GOTO :EOF

:error

SET ERR_LEV=%errorlevel%

ECHO Failed with error level %ERR_LEV%

rem # uninstall chef
call msiexec /qb /x %omnibus_package%

EXIT /B %ERR_LEV%

ENDLOCAL

Exclude the stress tests on windows

Exclude the stress tests on windows


@echo off
setlocal EnableDelayedExpansion

mkdir build
cd build

set CMAKE_CONFIG="Release"

if "%PY_VER%" == "3.4" (
    set GENERATOR=Visual Studio 10 2010
) else (
    if "%PY_VER%" == "3.5" (
        set GENERATOR=Visual Studio 14 2015
    ) else (
        set GENERATOR=Visual Studio 9 2008
    )
)

if %ARCH% EQU 64 (
    set GENERATOR=%GENERATOR% Win64
)

rem The Python lib has no period in the
rem version string, so we remove it here.
set PY_VER_NO_DOT=%PY_VER:.=%

cmake ..\tools\python -LAH -G"%GENERATOR%" ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DBUILD_SHARED_LIBS=1 ^
-DBoost_USE_STATIC_LIBS=0 ^
-DBoost_USE_STATIC_RUNTIME=0 ^
-DBOOST_ROOT="%LIBRARY_PREFIX%" ^
-DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
-DBOOST_LIBRARYDIR="%LIBRARY_LIB%" ^
-DPYTHON3=%PY3K% ^
-DPYTHON_LIBRARY="%PREFIX%\libs\python%PY_VER_NO_DOT%.lib" ^
-DPYTHON_INCLUDE_DIR="%PREFIX%\include" ^
-DDLIB_LINK_WITH_SQLITE3=0 ^
-DPNG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DPNG_PNG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DDLIB_NO_GUI_SUPPORT=1 ^
-DDLIB_USE_BLAS=0 ^
-DDLIB_USE_LAPACK=0

cmake --build . --config %CMAKE_CONFIG% --target ALL_BUILD
cmake --build . --config %CMAKE_CONFIG% --target INSTALL

rem Copy the dlib libraries and the dlls it depends upon
rem MAke a dummy folder to expose dlib in
move "..\python_examples\dlib.pyd" "%SP_DIR%\dlib.pyd"

@echo off
setlocal EnableDelayedExpansion

mkdir build
cd build

set CMAKE_CONFIG="Release"

if "%PY_VER%" == "3.4" (
    set GENERATOR=Visual Studio 10 2010
) else (
    if "%PY_VER%" == "3.5" (
        set GENERATOR=Visual Studio 14 2015
    ) else (
        set GENERATOR=Visual Studio 9 2008
    )
)

if %ARCH% EQU 64 (
    set GENERATOR=%GENERATOR% Win64
)

rem The Python lib has no period in the
rem version string, so we remove it here.
set PY_VER_NO_DOT=%PY_VER:.=%

cmake ..\tools\python -LAH -G"%GENERATOR%" ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DBUILD_SHARED_LIBS=1 ^
-DBoost_USE_STATIC_LIBS=0 ^
-DBoost_USE_STATIC_RUNTIME=0 ^
-DBOOST_ROOT="%LIBRARY_PREFIX%" ^
-DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
-DBOOST_LIBRARYDIR="%LIBRARY_BIN%" ^
-DPYTHON3=%PY3K% ^
-DPYTHON_LIBRARY="%PREFIX%\libs\python%PY_VER_NO_DOT%.lib" ^
-DPYTHON_INCLUDE_DIR="%PREFIX%\include" ^
-DDLIB_LINK_WITH_SQLITE3=0 ^
-DPNG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DPNG_PNG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DDLIB_NO_GUI_SUPPORT=1 ^
-DDLIB_USE_BLAS=0 ^
-DDLIB_USE_LAPACK=0 ^
-DUSE_SSE4_INSTRUCTIONS=0

cmake --build . --config %CMAKE_CONFIG% --target ALL_BUILD
cmake --build . --config %CMAKE_CONFIG% --target INSTALL

rem Copy the dlib library to site packages
move "..\python_examples\dlib.pyd" "%SP_DIR%\dlib.pyd"

Update boost location

Update boost location

Update the fact that boost is in BIN and turn off SSE4 instructions
since that seems to break Visual Studio 2008 64-bit


@echo off
pushd %~dp0
set Destination=%1
if [%1]==[] set Destination="Win32\bin\assets"

mkdir %Destination%

:: Copy imgui font file
if not exist external\imgui-1.49\extra_fonts\DroidSans.ttf (
	echo Run install script first!
	goto end
)
xcopy external\imgui-1.49\extra_fonts\*.ttf %Destination% /Y /Q > NUL

:: Copy assets to destination folder
xcopy assets\*.* %Destination% /Y /Q /S > NUL

:end
popd

@echo off
pushd %~dp0
set Destination=%1
if [%1]==[] set Destination="vs\Win32\bin\assets"

mkdir %Destination%

:: Copy imgui font file
if not exist external\imgui-1.49\extra_fonts\DroidSans.ttf (
	echo Run install script first!
	goto end
)
xcopy external\imgui-1.49\extra_fonts\*.ttf %Destination% /Y /Q > NUL

:: Copy assets to destination folder
xcopy assets\*.* %Destination% /Y /Q /S > NUL

:end
popd

Update cook.bat to use new /vs/ folder

Update cook.bat to use new /vs/ folder