@echo off
setlocal EnableDelayedExpansion

REM Uploading all modules at once (with one gradle command) does not work any more, so a separate command for each module must be issued

SET username=%1
SET apikey=%2
SET modules="MediaPlayer" "MediaPlayer-DASH" "MediaPlayer-GLES" "MediaPlayer-GLES-FlowAbs" "MediaPlayer-GLES-QrMarker"

FOR %%m in (%modules%) DO (
	gradlew %%~m:clean %%~m:build %%~m:bintrayUpload -PbintrayUser=%username% -PbintrayKey=%apikey% -PdryRun=false
)

@echo off
setlocal EnableDelayedExpansion

REM Uploading all modules at once (with one gradle command) does not work any more, so a separate command for each module must be issued

SET username=%1
SET apikey=%2
SET modules="MediaPlayer" "MediaPlayer-DASH"

FOR %%m in (%modules%) DO (
	gradlew %%~m:clean %%~m:build %%~m:bintrayUpload -PbintrayUser=%username% -PbintrayKey=%apikey% -PdryRun=false
)

Update bintray upload script

Update bintray upload script


@echo off
setlocal EnableDelayedExpansion

REM Uploading all modules at once (with one gradle command) does not work any more, so a separate command for each module must be issued

SET username=%1
SET apikey=%2
SET modules="Spectaculum-Core" "Spectaculum-Camera" "Spectaculum-Image" "Spectaculum-MediaPlayer" "Spectaculum-MediaPlayerExtended" "Spectaculum-Effect-FloAwbs" "Spectaculum-Effect-Immersive" "Spectaculum-Effect-QrMarker"

FOR %%m in (%modules%) DO (
	gradlew %%~m:clean %%~m:build %%~m:bintrayUpload -PbintrayUser=%username% -PbintrayKey=%apikey% -PdryRun=false --configure-on-demand
)

@echo off
setlocal EnableDelayedExpansion

REM Uploading all modules at once (with one gradle command) does not work any more, so a separate command for each module must be issued

SET username=%1
SET apikey=%2
SET modules="Spectaculum-Core" "Spectaculum-Camera" "Spectaculum-Image" "Spectaculum-MediaPlayer" "Spectaculum-MediaPlayerExtended" "Spectaculum-Effect-FloAwbs" "Spectaculum-Effect-Immersive" "Spectaculum-Effect-QrMarker"

FOR %%m in (%modules%) DO (
	gradlew %%~m:clean %%~m:build %%~m:bintrayUpload -PbintrayUser=%username% -PbintrayKey=%apikey% -PdryRun=false
)

Revert gradle --configure-on-demand

Revert gradle --configure-on-demand

This flag unfortunately leads to incomplete Maven deployments with missing sources/javadoc/pom.


@echo off
echo "Installing ONC/RPC for NT..."
..\bin\inst_pm remove
copy ..\bin\oncrpc.dll %SystemRoot%\system32
copy ..\bin\portmap.exe %SystemRoot%\system32
if exist %SystemRoot%\system32\drivers\etc\rpc goto inst_pm
mkdir %SystemRoot%\system32\drivers\etc
copy ..\etc\rpc %SystemRoot%\system32\drivers\etc
:inst_pm
..\bin\inst_pm %SystemRoot%\system32\portmap.exe
echo "Done."

@echo off
echo "Installing ONC/RPC for NT..."
..\bin\inst_pm remove
copy ..\lib\oncrpc.dll %SystemRoot%\system32
copy ..\bin\portmap.exe %SystemRoot%\system32
if exist %SystemRoot%\system32\drivers\etc\rpc goto inst_pm
mkdir %SystemRoot%\system32\drivers\etc
copy ..\etc\rpc %SystemRoot%\system32\drivers\etc
:inst_pm
..\bin\inst_pm %SystemRoot%\system32\portmap.exe
echo "Done."

Update path: get oncrpc.dll from ../lib

Update path: get oncrpc.dll from ../lib


set D=breathless_parks
mkdir %D%
copy breathless_parks.exe %D%\breathless_parks.exe
copy armchair.png %D%\armchair.png
copy back_music.wav %D%\back_music.wav
copy back_tiles.png %D%\back_tiles.png
copy bird_left_down.png %D%\bird_left_down.png
copy bird_left_up.png %D%\bird_left_up.png
copy bird_right_down.png %D%\bird_right_down.png
copy bird_right_up.png %D%\bird_right_up.png
copy bird1.wav %D%\bird1.wav
copy bird2.wav %D%\bird2.wav
copy bird3.wav %D%\bird3.wav
copy bird4.wav %D%\bird4.wav
copy blink.png %D%\blink.png
copy closed_door.png %D%\closed_door.png
copy couch.png %D%\couch.png
copy couch_back.png %D%\couch_back.png
copy grays_anatomy.wav %D%\grays_anatomy.wav
copy hit_table.wav %D%\hit_table.wav
copy instruction_left.png %D%\instruction_left.png
copy instruction_right.png %D%\instruction_right.png
copy matlock.wav %D%\matlock.wav
copy nurse.wav %D%\nurse.wav
copy nurse1.png %D%\nurse1.png
copy nurse2.png %D%\nurse2.png
copy nurse3.png %D%\nurse3.png
copy old_broad_talk_mouth.png %D%\old_broad_talk_mouth.png
copy old_guy.png %D%\old_guy.png
copy old_guy_sitting.png %D%\old_guy_sitting.png
copy old_guy_sitting_blink.png %D%\old_guy_sitting_blink.png
copy old_guy_win.png %D%\old_guy_win.png
copy old_guy1.png %D%\old_guy1.png
copy old_guy2.png %D%\old_guy2.png
copy old_guy3.png %D%\old_guy3.png
copy other_dude_mouth_talks.png %D%\other_dude_mouth_talks.png
copy other_dude_sitting.png %D%\other_dude_sitting.png
copy other_dude_winning.png %D%\other_dude_winning.png
copy other_dude1.png %D%\other_dude1.png
copy other_dude2.png %D%\other_dude2.png
copy other_dude3.png %D%\other_dude3.png
copy other_guy_wins.wav %D%\other_guy_wins.wav
copy outside.png %D%\outside.png
copy painting1.png %D%\painting1.png
copy painting2.png %D%\painting2.png
copy shut_mouth.png %D%\shut_mouth.png
copy sleeping_woman.png %D%\sleeping_woman.png
copy space_big.png %D%\space_big.png
copy space_small.png %D%\space_small.png
copy squeak.wav %D%\squeak.wav
copy table.png %D%\table.png
copy table_empty.png %D%\table_empty.png
copy tv.png %D%\tv.png
copy win.wav %D%\win.wav
copy woman1.png %D%\woman1.png
copy woman2.png %D%\woman2.png
copy woman3.png %D%\woman3.png

Add build script for non-installer

Add build script for non-installer


@echo off
setlocal

set ELECTRON_RUN_AS_NODE=

pushd %~dp0\..

:: Get Code.exe location
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
set NAMESHORT=%NAMESHORT: "=%
set NAMESHORT=%NAMESHORT:"=%.exe
set CODE=".build\electron\%NAMESHORT%"

:: Download Electron if needed
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
set DESIREDVERSION=%DESIREDVERSION: "=%
set DESIREDVERSION=v%DESIREDVERSION:"=%
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")

if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron

:: Run tests
%CODE% .\test\electron\index.js %*

popd

endlocal
exit /b %errorlevel%

@echo off
setlocal

set ELECTRON_RUN_AS_NODE=

pushd %~dp0\..

:: Get Code.exe location
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
set NAMESHORT=%NAMESHORT: "=%
set NAMESHORT=%NAMESHORT:"=%.exe
set CODE=".build\electron\%NAMESHORT%"

:: Download Electron if needed
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
set DESIREDVERSION=%DESIREDVERSION: "=%
set DESIREDVERSION=v%DESIREDVERSION:"=%
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")

if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron

:: Run tests
%CODE% .\test\electron\index.js %*

popd

endlocal

if %errorlevel% == 255 set errorlevel=0

exit /b %errorlevel%

Set errorlevel to 0 if it's 255

Set errorlevel to 0 if it's 255


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

if exist generated (
  rmdir /s /q generated
)
mkdir generated\include generated\common

cd generated/include
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_safe_struct.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_safe_struct.cpp
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_struct_size_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_struct_size_helper.c
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_enum_string_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_object_types.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_dispatch_table_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml thread_check.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml parameter_validation.cpp
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml unique_objects_wrappers.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_layer_dispatch_table.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_extension_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml object_tracker.cpp
cd ../..

update .bat line termination

build-android: update .bat line termination

Change-Id: I9d4152df8cc7c10e74f6484dbc802c2c854c9fef


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

@echo off
@setlocal

set EXIT_CODE=0

cd %~dp0

if exist setenv.cmd call setenv.cmd

if not "%JAVA_HOME%" == "" goto gotJavaHome

echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
goto error

:gotJavaHome
if exist "%JAVA_HOME%\bin\javaw.exe" goto run

echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = "%JAVA_HOME%"
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
goto error

:run
set JAVA_CMD="%JAVA_HOME%\bin\java"

if exist logback.xml set JAVA_OPTS=%JAVA_OPTS% -Dlogback.configurationFile=logback.xml

set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -jar .\lib\perfload-perfalyzer-${project.version}.jar %*

call %JAVA_CMD% %JAVA_OPTS%

if ERRORLEVEL -1 goto error
goto end

:error
set EXIT_CODE=-1

:end
@endlocal

exit /B %EXIT_CODE%

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

@echo off
@setlocal

set EXIT_CODE=0

cd %~dp0

if exist setenv.cmd call setenv.cmd

if not "%JAVA_HOME%" == "" goto gotJavaHome

echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
goto error

:gotJavaHome
if exist "%JAVA_HOME%\bin\javaw.exe" goto run

echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = "%JAVA_HOME%"
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
goto error

:run
set JAVA_CMD="%JAVA_HOME%\bin\java"

if exist logback.xml set JAVA_OPTS=%JAVA_OPTS% -Dlogback.configurationFile=logback.xml

set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -jar .\lib\perfload-perfalyzer-${project.version}.jar %*

call %JAVA_CMD% %JAVA_OPTS%

if %errorlevel% neq 0 goto error
goto end

:error
exit /B %errorlevel%

:end
@endlocal

Fix script

Fix script


fix bux, in bin/cor.cmd now gets arguments properly


:: Build BWAPI
pushd %CD%
cd bwapi\bwapi
::msbuild /p:Configuration=Debug /p:Platform=Win32 /target:BWAPILIB bwapi.sln
msbuild /p:Configuration=Release /p:Platform=Win32 /target:BWAPILIB bwapi.sln
popd

:: Build KBot
::msbuild /p:Configuration=Debug /p:Platform=x86 KBot.sln
msbuild /p:Configuration=Release /p:Platform=x86 KBot.sln

:: Build BWAPI
pushd %CD%
cd bwapi\bwapi
msbuild /p:Configuration=Debug   /p:Platform=Win32 /target:BWAPILIB bwapi.sln
msbuild /p:Configuration=Release /p:Platform=Win32 /target:BWAPILIB bwapi.sln
popd

:: Build KBot
msbuild /p:Configuration=Debug   /p:Platform=x86 KBot.sln
msbuild /p:Configuration=Release /p:Platform=x86 KBot.sln

Build debug and release.

Build debug and release.


@echo off

set config=Release
set outputdir=%cwd%\build
set cwd=%CD%
set commonflags=/p:Configuration=%config%;AllowUnsafeBlocks=true /p:CLSCompliant=False

if %PROCESSOR_ARCHITECTURE%==x86 (
         set msbuild="%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
) else ( set msbuild="%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
)

:build
echo ---------------------------------------------------------------------
echo Building AnyCpu release...
%msbuild% MetroFramework.sln %commonflags% /tv:3.5 /p:TargetFrameworkVersion=v2.0 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET20"
if errorlevel 1 goto build-error
%msbuild% MetroFramework.sln %commonflags% /tv:3.5 /p:TargetFrameworkVersion=v3.5 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET35"
if errorlevel 1 goto build-error
%msbuild% MetroFramework.sln %commonflags% /tv:4.0 /p:TargetFrameworkVersion=v4.0 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET40"
if errorlevel 1 goto build-error
%msbuild% MetroFramework.sln %commonflags% /tv:4.0 /p:TargetFrameworkVersion=v4.5 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET45"
if errorlevel 1 goto build-error

:build-error
echo Failed to compile...

:done
echo.
echo ---------------------------------------------------------------------
echo Compile finished....
cd %cwd%
goto exit

:exit

@echo off

set config=Release
set outputdir=%cwd%\build
set cwd=%CD%
set commonflags=/p:Configuration=%config%;AllowUnsafeBlocks=true /p:CLSCompliant=False

if %PROCESSOR_ARCHITECTURE%==x86 (
         set msbuild="%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
) else ( set msbuild="%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
)

:build
echo ---------------------------------------------------------------------
echo Building AnyCpu release...
%msbuild% MetroFramework.sln %commonflags% /tv:4.0 /p:TargetFrameworkVersion=v2.0 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET20"
if errorlevel 1 goto build-error
%msbuild% MetroFramework.sln %commonflags% /tv:4.0 /p:TargetFrameworkVersion=v3.5 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET35"
if errorlevel 1 goto build-error
%msbuild% MetroFramework.sln %commonflags% /tv:4.0 /p:TargetFrameworkVersion=v4.0 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET40"
if errorlevel 1 goto build-error
%msbuild% MetroFramework.sln %commonflags% /tv:4.0 /p:TargetFrameworkVersion=v4.5 /p:Platform="Any Cpu" /p:OutputPath="%outputdir%\AnyCpu\NET45"
if errorlevel 1 goto build-error

:build-error
echo Failed to compile...

:done
echo.
echo ---------------------------------------------------------------------
echo Compile finished....
cd %cwd%
goto exit

:exit

Bump toolsversion to 4.0 to allow building.

Bump toolsversion to 4.0 to allow building, with optional parameters.

Optional parameters from these two files:
\MetroGrid.cs
\MetroMessageBox.cs


%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild %~dp0\build.proj /verbosity:normal /nr:false /p:PackageVersion=%PackageVersion% /p:AutoPush=false

"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" %~dp0\build.proj /verbosity:normal /nr:false /p:PackageVersion=%PackageVersion% /p:AutoPush=false

Change build.bat to use MSBuild 14.0

Change build.bat to use MSBuild 14.0


:: This file generates debug unity builds for rapid iteration

@echo off
pushd %~dp0
if not exist build mkdir build
if not exist build\enet mkdir build\enet
if not exist build\imgui mkdir build\imgui
if not exist build\lib mkdir build\lib
if not exist build\bin mkdir build\bin

:: [Compiler options]
:: /nologo: suppress copyright message
:: /MDd: Runtime library: Multi-threaded Debug DLL
:: /GR-: disable RTTI
:: /EHs-c-: disable exceptions
:: /fp:fast: "fast" floating-point model; results are less predictable
:: /fp:except-: disable floating-point exceptions when generating code
:: /Oi: enable intrinsic functions
:: /Ob1: only __inline function expansion
:: /WX: treat warnings as errors
:: /W4: warning level 4
:: /wd4100:
:: /wd4505:
:: /Bt: display timings (undocumented)

set slBasicCompile=/nologo /MDd /GR- /EHs-c- /fp:fast /fp:except- /Oi
set slDefinitions=-D_DEBUG -DUNICODE -D_UNICODE -D_SCL_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DVC_EXTRALEAN -DSTRICT -DWIN32_LEAN_AND_MEAN -DNOGDI -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS
set slInclude=/Isrc /Iexternal\glm /Iexternal\flatbuffers-1.3.0\include /Iexternal\protobuf-2.6.1\src /Iexternal\enet-1.3.13\include /Iexternal\imgui-1.47
set slCompile=%slBasicCompile% %slDefinitions% %slInclude% /Ob1 /WX /W4 /wd4100 /wd4505 /Bt
::set slFxCompile=/Zi /E"main" /Od /Vn"g_%(Filename)" /WX /Fh"src/%(Filename).h" /nologo

:: [Linker options]
:: /time: display timings (undocumented)

set slLink=/time /LIBPATH:build/lib enet.lib imgui.lib winmm.lib ws2_32.lib

:enet
::if exist build\lib\enet.lib goto imgui
echo [ENet]
pushd external\enet-1.3.13
cl /c %slBasicCompile% /Fo..\..\build\enet\ /Iinclude *.c
popd
pushd build\enet
lib /nologo /out:..\lib\enet.lib *.obj
popd

:imgui
::if exist build\lib\imgui.lib goto starlight
echo [ImGui]
pushd external\imgui-1.47
cl /c %slBasicCompile% /Fo..\..\build\imgui\ /I. imgui.cpp imgui_demo.cpp imgui_draw.cpp examples\directx11_example\imgui_impl_dx11.cpp
popd
pushd build\imgui
lib /nologo /out:..\lib\imgui.lib *.obj
popd

:starlight
echo [starlight_ub]
cl %slCompile% /Fobuild\bin\starlight.dll src/starlight_ub.cpp /LD /link %slLink% /PDB:starlight_%random%.pdb

:starlight_win32
echo [starlight_win32_ub]
fxc /Zi /E"main" /Od /Vn"g_SimplePixelShader" /WX /T ps_4_0 /Fh"src/SimplePixelShader.h" /nologo src/SimplePixelShader.hlsl
fxc /Zi /E"main" /Od /Vn"g_SimpleVertexShader" /WX /T vs_4_0 /Fh"src/SimpleVertexShader.h" /nologo src/SimpleVertexShader.hlsl
cl %slCompile% /Febuild\bin\ /Iexternal\imgui-1.47\examples\directx11_example src/starlight_win32_ub.cpp /link %slLink% d3dcompiler.lib d3d11.lib
popd

:: This file generates debug unity builds for rapid iteration

@echo off
pushd %~dp0
if not exist build mkdir build
if not exist build\enet mkdir build\enet
if not exist build\imgui mkdir build\imgui
if not exist build\lib mkdir build\lib
if not exist build\bin mkdir build\bin

:: [Compiler options]
:: /nologo: suppress copyright message
:: /MDd: Runtime library: Multi-threaded Debug DLL
:: /GR-: disable RTTI
:: /EHs-c-: disable exceptions
:: /fp:fast: "fast" floating-point model; results are less predictable
:: /fp:except-: disable floating-point exceptions when generating code
:: /Oi: enable intrinsic functions
:: /Ob1: only __inline function expansion
:: /WX: treat warnings as errors
:: /W4: warning level 4
:: /wd4100:
:: /wd4505:
:: /Bt: display timings (undocumented)

set slBasicCompile=/nologo /MDd /GR- /EHs-c- /fp:fast /fp:except- /Oi
set slDefinitions=-D_DEBUG -DUNICODE -D_UNICODE -D_SCL_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DVC_EXTRALEAN -DSTRICT -DWIN32_LEAN_AND_MEAN -DNOGDI -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS
set slInclude=/Isrc /Iexternal\glm /Iexternal\flatbuffers-1.3.0\include /Iexternal\protobuf-2.6.1\src /Iexternal\enet-1.3.13\include /Iexternal\imgui-1.47
set slCompile=%slBasicCompile% %slDefinitions% %slInclude% /Ob1 /WX /W4 /wd4100 /wd4505 /Z7 /Bt
::set slFxCompile=/Zi /E"main" /Od /Vn"g_%(Filename)" /WX /Fh"src/%(Filename).h" /nologo

:: [Linker options]
:: /time: display timings (undocumented)

set slLink=/time /LIBPATH:build/lib enet.lib imgui.lib winmm.lib ws2_32.lib

:enet
::if exist build\lib\enet.lib goto imgui
echo [ENet]
pushd external\enet-1.3.13
cl /c %slBasicCompile% /Fo..\..\build\enet\ /Iinclude *.c
popd
pushd build\enet
lib /nologo /out:..\lib\enet.lib *.obj
popd

:imgui
::if exist build\lib\imgui.lib goto starlight
echo [ImGui]
pushd external\imgui-1.47
cl /c %slBasicCompile% /Fo..\..\build\imgui\ /I. imgui.cpp imgui_demo.cpp imgui_draw.cpp examples\directx11_example\imgui_impl_dx11.cpp
popd
pushd build\imgui
lib /nologo /out:..\lib\imgui.lib *.obj
popd

:starlight
echo [starlight_ub]
cl %slCompile% /Fobuild\bin\starlight.dll src/starlight_ub.cpp /LD /link %slLink% /PDB:starlight_%random%.pdb

:starlight_win32
echo [starlight_win32_ub]
fxc /Zi /E"main" /Od /Vn"g_SimplePixelShader" /WX /T ps_4_0 /Fh"src/SimplePixelShader.h" /nologo src/SimplePixelShader.hlsl
fxc /Zi /E"main" /Od /Vn"g_SimpleVertexShader" /WX /T vs_4_0 /Fh"src/SimpleVertexShader.h" /nologo src/SimpleVertexShader.hlsl
cl %slCompile% /Febuild\bin\ /Iexternal\imgui-1.47\examples\directx11_example src/starlight_win32_ub.cpp /link %slLink% d3dcompiler.lib d3d11.lib
popd

Add debug info generation to batch build


@echo Off
cls
set config=%1
if "%config%" == "" (
   set config=release
)

set targetPath=C:\projects\nfluent\
set initialPath=%cd%

git clone %initialPath% %targetPath%

cd %targetPath%

REM msbuild .\.build\Build.proj /p:Configuration="%config%" /t:RunAll /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Diagnostic /nr:false
msbuild .\.build\Build.proj /p:Configuration="%config%" /t:Package /v:d /fl /flp:LogFile=msbuild.log;Verbosity=Diagnostic /nr:false

cd %initialPath%

@echo Off
cls
set config=%1
if "%config%" == "" (
   set config=release
)

set targetPath=C:\projects\nfluent\
set initialPath=%cd%

git clone %initialPath% %targetPath%

cd %targetPath%

REM msbuild .\.build\Build.proj /p:Configuration="%config%" /t:RunAll /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Diagnostic /nr:false
msbuild .\.build\Build.proj /p:Configuration="%config%" /t:Package /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Diagnostic /nr:false

cd %initialPath%

Fix build script verbosity

Fix build script verbosity


@ECHO off
SETLOCAL

SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"

SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=

SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe

IF NOT EXIST %BUILD_FOLDER% (
    md %BUILD_FOLDER%
)

IF NOT EXIST %NUGET_PATH% (
    IF NOT EXIST %CACHED_NUGET% (
        echo Downloading latest version of NuGet.exe...
        IF NOT EXIST %LocalAppData%\NuGet (
            md %LocalAppData%\NuGet
        )
        @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
    )

    copy %CACHED_NUGET% %NUGET_PATH% > nul
)

IF NOT EXIST %KOREBUILD_FOLDER% (
    SET KOREBUILD_DOWNLOAD_ARGS=
    IF NOT "%KOREBUILD_VERSION%"=="" (
        SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
    )

    %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)

"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

@ECHO off
SETLOCAL

SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"

SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=

SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe

IF NOT EXIST %BUILD_FOLDER% (
    md %BUILD_FOLDER%
)

IF NOT EXIST %NUGET_PATH% (
    IF NOT EXIST %CACHED_NUGET% (
        echo Downloading latest version of NuGet.exe...
        IF NOT EXIST %LocalAppData%\NuGet (
            md %LocalAppData%\NuGet
        )
        @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
    )

    copy %CACHED_NUGET% %NUGET_PATH% > nul
)

SET KOREBUILD_DOWNLOAD_ARGS=
IF NOT "%KOREBUILD_VERSION%"=="" (
    SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
)
IF NOT EXIST %KOREBUILD_FOLDER% (
    %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)

"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

Update `build.cmd` to match latest template - aspnet/Universe#347 - `%KOREBUILD_VERSION%` doesn't work without this fix


setlocal
set PATH=%PATH%;../3rdparty/.build/bin/windows

make.exe vs2015

add vs2015.bat

add vs2015.bat


mkdir electron-sample\app
mkdir electron-sample\browser\scripts\splash
cd electron-sample
type NUL > Gulpfile.js
type NUL > app\index.es6.js
type NUL > browser/index.html
type NUL > browser/scripts/splash/app.js
type NUL > browser/scripts/splash/controller.js

echo "project structure created.. installing global node modules..."
npm i gulp electron-prebuilt jspm -g

echo "initializing npm package"
npm init

echo "global dependencies installed... installing local dependencies"
npm i gulp-babel gulp-rename gulp-run --save-dev

echo "dependencies installed..."
echo "run jspm install"

mkdir electron-sample\app
mkdir electron-sample\browser\scripts\splash
cd electron-sample
type NUL > Gulpfile.js
type NUL > app\index.es6.js
type NUL > browser\index.html
type NUL > browser\scripts\splash\app.js
type NUL > browser\scripts\splash\controller.js

echo "project structure created.. installing global node modules..."
npm i gulp electron-prebuilt jspm -g

echo "initializing npm package"
npm init

echo "global dependencies installed... installing local dependencies"
npm i gulp-babel gulp-rename gulp-run --save-dev

echo "dependencies installed..."
echo "run jspm install"

make the path separators consistent

make the path separators consistent

making the path separators consistent.


REM install Chocolatey
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

REM install base tools
choco install firefox
choco install googlechrome

REM install cygwin and all things inside
choco install cygwin cyg-get

add browsers and cygwin to the default windows installation


@ECHO off

set LUVI_PUBLISH_USER=luvit
set LUVI_PUBLISH_REPO=luvi

set GENERATOR=Visual Studio 12
reg query HKEY_CLASSES_ROOT\VisualStudio.DTE.14.0 >nul 2>nul
IF %errorlevel%==0 set GENERATOR=Visual Studio 14
set GENERATOR64=%GENERATOR% Win64

for /f %%i in ('git describe') do set LUVI_TAG=%%i
IF NOT "x%1" == "x" GOTO :%1

GOTO :build

:regular
ECHO "Building regular64"
cmake -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR64%"
GOTO :end

:regular-asm
ECHO "Building regular64 asm"
cmake -DWithOpenSSLASM=ON -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR64%"
GOTO :end

:regular32
ECHO "Building regular32"
cmake -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR%"
GOTO :end

:regular32-asm
ECHO "Building regular32 asm"
cmake -DWithOpenSSLASM=ON -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR%"
GOTO :end

:tiny
ECHO "Building tiny64"
cmake -H. -Bbuild -G"%GENERATOR64%"
GOTO :end

:tiny32
ECHO "Building tiny32"
cmake -H. -Bbuild -G"%GENERATOR%"
GOTO :end

:build
IF NOT EXIST build CALL Make.bat regular
cmake --build build --config Release -- /maxcpucount
COPY build\Release\luvi.exe .
GOTO :end

:test
IF NOT EXIST luvi.exe CALL Make.bat
luvi.exe samples\test.app -- 1 2 3 4
luvi.exe samples\test.app -o test.exe
test.exe 1 2 3 4
DEL /Q test.exe
GOTO :end

:winsvc
IF NOT EXIST luvi.exe CALL Make.bat
DEL /Q winsvc.exe
luvi.exe samples\winsvc.app -o winsvc.exe
GOTO :end

:repl
IF NOT EXIST luvi.exe CALL Make.bat
DEL /Q repl.exe
luvi.exe samples/repl.app -o repl.exe
GOTO :end

:clean
IF EXIST build RMDIR /S /Q build
IF EXIST luvi.exe DEL /F /Q luvi.exe
GOTO :end

:reset
git submodule update --init --recursive
git clean -f -d
git checkout .
GOTO :end

:artifacts-tiny
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-tiny-Windows-amd64.exe
COPY build\Release\luvi.lib artifacts\luvi-tiny-Windows-amd64.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-tiny-Windows-amd64.lib
GOTO :end

:artifacts-tiny32
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-tiny-Windows-ia32.exe
COPY build\Release\luvi.lib artifacts\luvi-tiny-Windows-ia32.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-tiny-Windows-ia32.lib
GOTO :end

:artifacts-regular
:artifacts-regular-asm
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-regular-Windows-amd64.exe
COPY build\Release\luvi.lib artifacts\luvi-regular-Windows-amd64.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-regular-Windows-amd64.lib
GOTO :end

:artifacts-regular32
:artifacts-regular32-asm
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-regular-Windows-ia32.exe
COPY build\Release\luvi.lib artifacts\luvi-regular-Windows-ia32.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-regular-Windows-ia32.lib
GOTO :end

:publish-tiny
CALL make.bat reset
CALL make.bat tiny
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-tiny-Windows-amd64.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-tiny-Windows-amd64.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-tiny-Windows-amd64.lib
GOTO :end

:publish-tiny32
CALL make.bat reset
CALL make.bat tiny32
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-tiny-Windows-ia32.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-tiny-Windows-ia32.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-tiny-Windows-ia32.lib
GOTO :end

:publish-regular
CALL make.bat reset
CALL make.bat regular-asm
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-regular-Windows-amd64.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-regular-Windows-amd64.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-regular-Windows-amd64.lib
GOTO :end

:publish-regular32
CALL make.bat reset
CALL make.bat regular32-asm
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-regular-Windows-ia32.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-regular-Windows-ia32.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-regular-Windows-ia32.lib
GOTO :end

:publish
CALL make.bat clean
CALL make.bat publish-tiny
CALL make.bat clean
CALL make.bat publish-tiny32
CALL make.bat clean
CALL make.bat publish-regular
CALL make.bat clean
CALL make.bat publish-regular32

:end

@ECHO off

set LUVI_PUBLISH_USER=luvit
set LUVI_PUBLISH_REPO=luvi

set GENERATOR=Visual Studio 12
reg query HKEY_CLASSES_ROOT\VisualStudio.DTE.14.0 >nul 2>nul
IF %errorlevel%==0 set GENERATOR=Visual Studio 14
reg query HKEY_CLASSES_ROOT\VisualStudio.DTE.15.0 >nul 2>nul
IF %errorlevel%==0 set GENERATOR=Visual Studio 15
set GENERATOR64=%GENERATOR% Win64

for /f %%i in ('git describe') do set LUVI_TAG=%%i
IF NOT "x%1" == "x" GOTO :%1

GOTO :build

:regular
ECHO "Building regular64"
cmake -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR64%"
GOTO :end

:regular-asm
ECHO "Building regular64 asm"
cmake -DWithOpenSSLASM=ON -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR64%"
GOTO :end

:regular32
ECHO "Building regular32"
cmake -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR%"
GOTO :end

:regular32-asm
ECHO "Building regular32 asm"
cmake -DWithOpenSSLASM=ON -DWithOpenSSL=ON -DWithSharedOpenSSL=OFF -DWithPCRE=ON -DWithLPEG=ON -DWithSharedPCRE=OFF -H. -Bbuild  -G"%GENERATOR%"
GOTO :end

:tiny
ECHO "Building tiny64"
cmake -H. -Bbuild -G"%GENERATOR64%"
GOTO :end

:tiny32
ECHO "Building tiny32"
cmake -H. -Bbuild -G"%GENERATOR%"
GOTO :end

:build
IF NOT EXIST build CALL Make.bat regular
cmake --build build --config Release -- /maxcpucount
COPY build\Release\luvi.exe .
GOTO :end

:test
IF NOT EXIST luvi.exe CALL Make.bat
luvi.exe samples\test.app -- 1 2 3 4
luvi.exe samples\test.app -o test.exe
test.exe 1 2 3 4
DEL /Q test.exe
GOTO :end

:winsvc
IF NOT EXIST luvi.exe CALL Make.bat
DEL /Q winsvc.exe
luvi.exe samples\winsvc.app -o winsvc.exe
GOTO :end

:repl
IF NOT EXIST luvi.exe CALL Make.bat
DEL /Q repl.exe
luvi.exe samples/repl.app -o repl.exe
GOTO :end

:clean
IF EXIST build RMDIR /S /Q build
IF EXIST luvi.exe DEL /F /Q luvi.exe
GOTO :end

:reset
git submodule update --init --recursive
git clean -f -d
git checkout .
GOTO :end

:artifacts-tiny
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-tiny-Windows-amd64.exe
COPY build\Release\luvi.lib artifacts\luvi-tiny-Windows-amd64.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-tiny-Windows-amd64.lib
GOTO :end

:artifacts-tiny32
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-tiny-Windows-ia32.exe
COPY build\Release\luvi.lib artifacts\luvi-tiny-Windows-ia32.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-tiny-Windows-ia32.lib
GOTO :end

:artifacts-regular
:artifacts-regular-asm
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-regular-Windows-amd64.exe
COPY build\Release\luvi.lib artifacts\luvi-regular-Windows-amd64.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-regular-Windows-amd64.lib
GOTO :end

:artifacts-regular32
:artifacts-regular32-asm
IF NOT EXIST artifacts MKDIR artifacts
COPY build\Release\luvi.exe artifacts\luvi-regular-Windows-ia32.exe
COPY build\Release\luvi.lib artifacts\luvi-regular-Windows-ia32.lib
COPY build\Release\luvi_renamed.lib artifacts\luvi_renamed-regular-Windows-ia32.lib
GOTO :end

:publish-tiny
CALL make.bat reset
CALL make.bat tiny
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-tiny-Windows-amd64.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-tiny-Windows-amd64.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-tiny-Windows-amd64.lib
GOTO :end

:publish-tiny32
CALL make.bat reset
CALL make.bat tiny32
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-tiny-Windows-ia32.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-tiny-Windows-ia32.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-tiny-Windows-ia32.lib
GOTO :end

:publish-regular
CALL make.bat reset
CALL make.bat regular-asm
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-regular-Windows-amd64.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-regular-Windows-amd64.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-regular-Windows-amd64.lib
GOTO :end

:publish-regular32
CALL make.bat reset
CALL make.bat regular32-asm
CALL make.bat test
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file luvi.exe --name luvi-regular-Windows-ia32.exe
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi.lib --name luvi-regular-Windows-ia32.lib
github-release upload --user %LUVI_PUBLISH_USER% --repo %LUVI_PUBLISH_REPO% --tag %LUVI_TAG% --file build\Release\luvi_renamed.lib --name luvi_renamed-regular-Windows-ia32.lib
GOTO :end

:publish
CALL make.bat clean
CALL make.bat publish-tiny
CALL make.bat clean
CALL make.bat publish-tiny32
CALL make.bat clean
CALL make.bat publish-regular
CALL make.bat clean
CALL make.bat publish-regular32

:end

make.bat: Check for VS2017 and use that if it exists


@echo off

setlocal enabledelayedexpansion
setlocal enableextensions

call "%~dp0elasticsearch-env.bat" || exit /b 1

set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
if "%SERVICE_ID%" == "" set SERVICE_ID=elasticsearch-service-x64
set ARCH=64-bit

if EXIST "%EXECUTABLE%" goto okExe
echo elasticsearch-service-x64.exe was not found...
exit /B 1

:okExe
set ES_VERSION=${project.version}

if "%SERVICE_LOG_DIR%" == "" set SERVICE_LOG_DIR=%ES_HOME%\logs

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
set SERVICE_ID=%1

:checkServiceCmd

if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%SERVICE_LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto

if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == manager goto doManagment
echo Unknown option "%SERVICE_CMD%"

:displayUsage
echo.
echo Usage: elasticsearch-service.bat install^|remove^|start^|stop^|manager [SERVICE_ID]
goto:eof

:doStart
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
goto:eof
:started
echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
goto:eof
:stopped
echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
goto:eof
:managed
echo Successfully started service manager for '%SERVICE_ID%'.
goto:eof

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
goto:eof
:removed
echo The service '%SERVICE_ID%' has been removed
goto:eof

:doInstall
echo Installing service      :  "%SERVICE_ID%"
echo Using JAVA_HOME (%ARCH%):  "%JAVA_HOME%"

rem Check JVM server dll first
if exist "%JAVA_HOME%\jre\bin\server\jvm.dll" (
	set JVM_DLL=\jre\bin\server\jvm.dll
	goto foundJVM
)

rem Check 'server' JRE (JRE installed on Windows Server)
if exist "%JAVA_HOME%\bin\server\jvm.dll" (
	set JVM_DLL=\bin\server\jvm.dll
	goto foundJVM
) else (
  	echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Exiting...
  	goto:eof
)

:foundJVM
set ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

@setlocal
for /F "usebackq delims=" %%a in (`"%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.launchers.JvmOptionsParser" "%ES_JVM_OPTIONS%" || echo jvm_options_parser_failed"`) do set JVM_OPTIONS=%%a
@endlocal & set "MAYBE_JVM_OPTIONS_PARSER_FAILED=%JVM_OPTIONS%" & set ES_JAVA_OPTS=%JVM_OPTIONS:${ES_TMPDIR}=!ES_TMPDIR!% %ES_JAVA_OPTS%

if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" (
  exit /b 1
)

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

if "%ES_JAVA_OPTS:~-1%"==";" set ES_JAVA_OPTS=%ES_JAVA_OPTS:~0,-1%

echo %ES_JAVA_OPTS%

@setlocal EnableDelayedExpansion
for %%a in ("%ES_JAVA_OPTS:;=","%") do (
  set var=%%a
  if "!var:~1,4!" == "-Xms" (
    if not "!JVM_MS!" == "" (
      echo duplicate min heap size settings found
      goto:eof
    )
    set XMS=!var:~5,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,16!" == "-XX:MinHeapSize=" (
    if not "!JVM_MS!" == "" (
      echo duplicate min heap size settings found
      goto:eof
    )
    set XMS=!var:~17,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,4!" == "-Xmx" (
    if not "!JVM_MX!" == "" (
      echo duplicate max heap size settings found
      goto:eof
    )
    set XMX=!var:~5,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,16!" == "-XX:MaxHeapSize=" (
    if not "!JVM_MX!" == "" (
      echo duplicate max heap size settings found
      goto:eof
    )
    set XMX=!var:~17,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,4!" == "-Xss" (
    if not "!JVM_SS!" == "" (
      echo duplicate thread stack size settings found
      exit 1
    )
    set XSS=!var:~5,-1!
    call:convertxk !XSS! JVM_SS
  )
  if "!var:~1,20!" == "-XX:ThreadStackSize=" (
    if not "!JVM_SS!" == "" (
      echo duplicate thread stack size settings found
      goto:eof
    )
    set XSS=!var:~21,-1!
    call:convertxk !XSS! JVM_SS
  )
)
@endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS%

if "%JVM_MS%" == "" (
  echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_MX%" == "" (
  echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_SS%" == "" (
  echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)

set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%"

if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

if "%SERVICE_DISPLAY_NAME%" == "" set SERVICE_DISPLAY_NAME=Elasticsearch %ES_VERSION% (%SERVICE_ID%)
if "%SERVICE_DESCRIPTION%" == "" set SERVICE_DESCRIPTION=Elasticsearch %ES_VERSION% Windows Service - https://elastic.co

if not "%SERVICE_USERNAME%" == "" (
	if not "%SERVICE_PASSWORD%" == "" (
		set SERVICE_PARAMS=%SERVICE_PARAMS% --ServiceUser "%SERVICE_USERNAME%" --ServicePassword "%SERVICE_PASSWORD%"
	)
)

"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StopClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmMs %JVM_MS% --JvmMx %JVM_MX% --JvmSs %JVM_SS% --JvmOptions %ES_JAVA_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "%SERVICE_DISPLAY_NAME%" --Description "%SERVICE_DESCRIPTION%" --Jvm "%%JAVA_HOME%%%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%" %SERVICE_PARAMS%

if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_ID%' service
goto:eof

:installed
echo The service '%SERVICE_ID%' has been installed.
goto:eof

:err
echo JAVA_HOME environment variable must be set!
pause
goto:eof

rem ---
rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts
rem ---
:convertxm
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
:kilo
rem convert to MB
set /a conv=%conv% / 1024
goto mega
:giga
rem convert to MB
set /a conv=%conv% * 1024
:mega
set "%~2=%conv%"
goto:eof

:convertxk
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
goto kilo
:mega
rem convert to KB
set /a conv=%conv% * 1024
goto kilo
:giga
rem convert to KB
set /a conv=%conv% * 1024 * 1024
:kilo
set "%~2=%conv%"
goto:eof

endlocal
endlocal

@echo off

setlocal enabledelayedexpansion
setlocal enableextensions

call "%~dp0elasticsearch-env.bat" || exit /b 1

set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
if "%SERVICE_ID%" == "" set SERVICE_ID=elasticsearch-service-x64
set ARCH=64-bit

if EXIST "%EXECUTABLE%" goto okExe
echo elasticsearch-service-x64.exe was not found...
exit /B 1

:okExe
set ES_VERSION=${project.version}

if "%SERVICE_LOG_DIR%" == "" set SERVICE_LOG_DIR=%ES_HOME%\logs

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
set SERVICE_ID=%1

:checkServiceCmd

if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%SERVICE_LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto

if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == manager goto doManagment
echo Unknown option "%SERVICE_CMD%"

:displayUsage
echo.
echo Usage: elasticsearch-service.bat install^|remove^|start^|stop^|manager [SERVICE_ID]
goto:eof

:doStart
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
goto:eof
:started
echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
goto:eof
:stopped
echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
goto:eof
:managed
echo Successfully started service manager for '%SERVICE_ID%'.
goto:eof

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
goto:eof
:removed
echo The service '%SERVICE_ID%' has been removed
goto:eof

:doInstall
echo Installing service      :  "%SERVICE_ID%"
echo Using JAVA_HOME (%ARCH%):  "%JAVA_HOME%"

rem Check JVM server dll first
if exist "%JAVA_HOME%\jre\bin\server\jvm.dll" (
	set JVM_DLL=\jre\bin\server\jvm.dll
	goto foundJVM
)

rem Check 'server' JRE (JRE installed on Windows Server)
if exist "%JAVA_HOME%\bin\server\jvm.dll" (
	set JVM_DLL=\bin\server\jvm.dll
	goto foundJVM
) else (
  	echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Exiting...
  	goto:eof
)

:foundJVM
set ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

@setlocal
for /F "usebackq delims=" %%a in (`"%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.launchers.JvmOptionsParser" "%ES_JVM_OPTIONS%" || echo jvm_options_parser_failed"`) do set JVM_OPTIONS=%%a
@endlocal & set "MAYBE_JVM_OPTIONS_PARSER_FAILED=%JVM_OPTIONS%" & set ES_JAVA_OPTS=%JVM_OPTIONS:${ES_TMPDIR}=!ES_TMPDIR!% %ES_JAVA_OPTS%

if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" (
  exit /b 1
)

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

if "%ES_JAVA_OPTS:~-1%"==";" set ES_JAVA_OPTS=%ES_JAVA_OPTS:~0,-1%

echo %ES_JAVA_OPTS%

@setlocal EnableDelayedExpansion
for %%a in ("%ES_JAVA_OPTS:;=","%") do (
  set var=%%a
  if "!var:~1,4!" == "-Xms" (
    if not "!JVM_MS!" == "" (
      echo duplicate min heap size settings found
      goto:eof
    )
    set XMS=!var:~5,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,16!" == "-XX:MinHeapSize=" (
    if not "!JVM_MS!" == "" (
      echo duplicate min heap size settings found
      goto:eof
    )
    set XMS=!var:~17,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,4!" == "-Xmx" (
    if not "!JVM_MX!" == "" (
      echo duplicate max heap size settings found
      goto:eof
    )
    set XMX=!var:~5,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,16!" == "-XX:MaxHeapSize=" (
    if not "!JVM_MX!" == "" (
      echo duplicate max heap size settings found
      goto:eof
    )
    set XMX=!var:~17,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,4!" == "-Xss" (
    if not "!JVM_SS!" == "" (
      echo duplicate thread stack size settings found
      exit 1
    )
    set XSS=!var:~5,-1!
    call:convertxk !XSS! JVM_SS
  )
  if "!var:~1,20!" == "-XX:ThreadStackSize=" (
    if not "!JVM_SS!" == "" (
      echo duplicate thread stack size settings found
      goto:eof
    )
    set XSS=!var:~21,-1!
    call:convertxk !XSS! JVM_SS
  )
)
@endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS%

if "%JVM_MS%" == "" (
  echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_MX%" == "" (
  echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_SS%" == "" (
  echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)

set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%"

if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

if "%SERVICE_DISPLAY_NAME%" == "" set SERVICE_DISPLAY_NAME=Elasticsearch %ES_VERSION% (%SERVICE_ID%)
if "%SERVICE_DESCRIPTION%" == "" set SERVICE_DESCRIPTION=Elasticsearch %ES_VERSION% Windows Service - https://elastic.co

if not "%SERVICE_USERNAME%" == "" (
	if not "%SERVICE_PASSWORD%" == "" (
		set SERVICE_PARAMS=%SERVICE_PARAMS% --ServiceUser "%SERVICE_USERNAME%" --ServicePassword "%SERVICE_PASSWORD%"
	)
)

"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main ++StartParams --quiet --StopClass org.elasticsearch.bootstrap.Elasticsearch --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmMs %JVM_MS% --JvmMx %JVM_MX% --JvmSs %JVM_SS% --JvmOptions %ES_JAVA_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "%SERVICE_DISPLAY_NAME%" --Description "%SERVICE_DESCRIPTION%" --Jvm "%%JAVA_HOME%%%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%" %SERVICE_PARAMS%

if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_ID%' service
goto:eof

:installed
echo The service '%SERVICE_ID%' has been installed.
goto:eof

:err
echo JAVA_HOME environment variable must be set!
pause
goto:eof

rem ---
rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts
rem ---
:convertxm
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
:kilo
rem convert to MB
set /a conv=%conv% / 1024
goto mega
:giga
rem convert to MB
set /a conv=%conv% * 1024
:mega
set "%~2=%conv%"
goto:eof

:convertxk
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
goto kilo
:mega
rem convert to KB
set /a conv=%conv% * 1024
goto kilo
:giga
rem convert to KB
set /a conv=%conv% * 1024 * 1024
:kilo
set "%~2=%conv%"
goto:eof

endlocal
endlocal

Disable console logging in the Windows service

When Elasticsearch is run as a service we should not use the console
logger otherwise we end up duplicating logging (to the Elasticsearch
logs and whereever standard output is captured). Previously we disabled
the console logger when started as a service using systemd (otherwise
the console logs are duplicated to the journal). This commit does the
same for the Windows service, starting Elasticsearch with the --quiet
flag to avoid standard output being written to the service stdout logs.

Relates #28618


set PLATFORM=%1
if "%PLATFORM%"=="" set PLATFORM=x64
set PLATFORM_PREFIX=
if "%PLATFORM%"=="x64" set PLATFORM_PREFIX=-x64
set _CL_=/utf-8
set PATH=c:\Program Files\Git\usr\bin;c:\MinGW\bin;%PATH%
set CURRENT_PATH=%~dp0
set LIBRARY_PATH=%CURRENT_PATH%build\root

mkdir build
cd build

cmake .. -A %PLATFORM% -DSPM_BUILD_TEST=ON -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=%LIBRARY_PATH%
cmake --build . --config Release --target install || goto :error
ctest -C Release || goto :error
cpack || goto :error

cd ..\python
rem call :BuildPython C:\Python27%PLATFORM_PREFIX%
call :BuildPython C:\Python35%PLATFORM_PREFIX%
call :BuildPython C:\Python36%PLATFORM_PREFIX%
call :BuildPython C:\Python37%PLATFORM_PREFIX%
call :BuildPython C:\Python38%PLATFORM_PREFIX%
call :BuildPython C:\Python39%PLATFORM_PREFIX%
c:\Python38%PLATFORM_PREFIX%\python setup.py sdist || goto :error
exit

:BuildPython
%1\python -m pip install wheel || goto :error
%1\python setup.py build || goto :error
%1\python setup.py bdist_wheel || goto :error
%1\python setup.py test || goto :error
rmdir /Q /S build
del /S *.pyd
exit /b

:error
exit /b %errorlevel%

set PLATFORM=%1
if "%PLATFORM%"=="" set PLATFORM=x64
set PLATFORM_PREFIX=
if "%PLATFORM%"=="x64" set PLATFORM_PREFIX=-x64
set _CL_=/utf-8
set PATH=c:\Program Files\Git\usr\bin;c:\MinGW\bin;%PATH%
set CURRENT_PATH=%~dp0
set LIBRARY_PATH=%CURRENT_PATH%build\root

mkdir build
cd build

cmake .. -A %PLATFORM% -DSPM_BUILD_TEST=ON -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=%LIBRARY_PATH%
cmake --build . --config Release --target install || goto :error
ctest -C Release || goto :error
cpack || goto :error

cd ..\python
rem call :BuildPython C:\Python27%PLATFORM_PREFIX%
call :BuildPython C:\Python35%PLATFORM_PREFIX%
call :BuildPython C:\Python36%PLATFORM_PREFIX%
call :BuildPython C:\Python37%PLATFORM_PREFIX%
call :BuildPython C:\Python38%PLATFORM_PREFIX%
call :BuildPython C:\Python39%PLATFORM_PREFIX%
call :BuildPython C:\Python310%PLATFORM_PREFIX%
c:\Python38%PLATFORM_PREFIX%\python setup.py sdist || goto :error
exit

:BuildPython
%1\python -m pip install wheel || goto :error
%1\python setup.py build || goto :error
%1\python setup.py bdist_wheel || goto :error
%1\python setup.py test || goto :error
rmdir /Q /S build
del /S *.pyd
exit /b

:error
exit /b %errorlevel%

add python 3.10 support for windows

add python 3.10 support for windows


Add script to start server from windows

Add script to start server from windows


@echo off
setlocal enabledelayedexpansion
SET lastfolder=0
SET dest=0
SET windest=0
SET src=0
SET winsrc=0
SET last=0

SET winsrc=%1
SET src=%winsrc:\=/%
SET src=/cygdrive/%src:~1,1%%src:~3,-1%

SET windest=%2
SET dest=%windest:\=/%
SET dest=/cygdrive/%dest:~1,1%%dest:~3,-2%

echo Src: %src%
echo (win: %winsrc%)
echo Dest: %dest%
echo (win: %windest%)

SET last=%windest:~1,-1%
SET last=%last:~0,-1%
echo ohne letzten Slash: %last%
SET last=%last:\=;%
SET last=%last: =#%
echo bereinigter pfad: %last%

for /F "tokens=* delims=;" %%i IN ("%last%") DO call :LAST_FOLDER %%i
goto :EOF
:LAST_FOLDER
if "%1"=="" (
    SET lastfolder=%LAST:#= %
    goto :CONTINUE
)
SET LAST=%1
SHIFT
goto :LAST_FOLDER
:CONTINUE
echo lastfolder=%lastfolder%

SET searchpath=!windest:%lastfolder%=!
SET searchpath=%searchpath:~1,-3%

echo searchpath=%searchpath%

echo Nach letztem Ordner suchen in %searchpath%
FOR /F " tokens=*" %%i IN ('dir %searchpath% /b /ad-h /o-d') DO (
    SET lastfolder=%%i
    GOTO :FOUND
)
echo No subfolder found
::mkdir %windest%
::E:\Dorian\Desktop\rsync\rsync -avh --delete --ignore-existing --link-dest="%src" "%src%" "%dest%"
goto :eof
:FOUND
echo Letzter Sicherungsordner:
echo %lastfolder%
SET lastfolder=%searchpath%/%lastfolder%
SET lastfolder=/cygdrive/%lastfolder:~0,1%/%lastfolder:~3%
SET lastfolder=%lastfolder:\=/%
echo %lastfolder%
echo Dateien kopieren...
echo mkdir %windest%
mkdir %windest%
echo rsync -avh --delete --ignore-existing --progress --link-dest="%lastfolder%" "%lastfolder%/" "%dest%"
rsync -avh --delete --ignore-existing --progress --link-dest="%lastfolder%" "%lastfolder%/" "%dest%"

echo Warte 20 Sek...
ping localhost -n 20 >NUL

@echo off
setlocal enabledelayedexpansion
SET lastfolder=0
SET dest=0
SET windest=0
SET src=0
SET winsrc=0
SET last=0

SET winsrc=%1
SET src=%winsrc:\=/%
SET src=/cygdrive/%src:~1,1%%src:~3,-1%

SET windest=%2
SET dest=%windest:\=/%
SET dest=/cygdrive/%dest:~1,1%%dest:~3,-2%

echo Src: %src%
echo (win: %winsrc%)
echo Dest: %dest%
echo (win: %windest%)

SET last=%windest:~1,-1%
SET last=%last:~0,-1%
echo ohne letzten Slash: %last%
SET last=%last:\=;%
SET last=%last: =#%
echo bereinigter pfad: %last%

for /F "tokens=* delims=;" %%i IN ("%last%") DO call :LAST_FOLDER %%i
goto :EOF
:LAST_FOLDER
if "%1"=="" (
    SET lastfolder=%LAST:#= %
    goto :CONTINUE
)
SET LAST=%1
SHIFT
goto :LAST_FOLDER
:CONTINUE
echo lastfolder=%lastfolder%

SET searchpath=!windest:%lastfolder%=!
SET searchpath=%searchpath:~1,-3%

echo searchpath=%searchpath%

echo Nach letztem Ordner suchen in %searchpath%
FOR /F " tokens=*" %%i IN ('dir %searchpath% /b /ad-h /o-d') DO (
    SET lastfolder=%%i
    GOTO :FOUND
)
echo No subfolder found
::mkdir %windest%
::E:\Dorian\Desktop\rsync\rsync -avh --delete --ignore-existing --link-dest="%src" "%src%" "%dest%"
goto :eof
:FOUND
echo Letzter Sicherungsordner:
echo %lastfolder%
SET lastfolder=%searchpath%/%lastfolder%
SET lastfolder=/cygdrive/%lastfolder:~0,1%/%lastfolder:~3%
SET lastfolder=%lastfolder:\=/%
echo %lastfolder%
echo Dateien kopieren...
echo mkdir %windest%
mkdir %windest%
echo rsync -avh --delete --ignore-existing --progress --link-dest="%lastfolder%" "%lastfolder%/" "%dest%"
rsync -avh --delete --ignore-existing --progress --link-dest="%lastfolder%" "%lastfolder%/" "%dest%"

::echo Warte 20 Sek...
::ping localhost -n 20 >NUL
:EOF
pause

add pause on end

add pause on end


@echo off
@pushd %~dp0

ECHO Remember to build the solution first!

pause

"%~dp0\TestHarness\packages\NUnit.Runners.2.6.4\tools\nunit-console.exe" "%~dp0\TestHarness\nunit\bin\Debug\nunitHarness.dll" /result="%~dp0\results-example-nunit.xml"

"%~dp0\TestHarness\packages\NUnit.Console.3.0.0\tools\nunit3-console.exe" "%~dp0\TestHarness\nunit3\bin\Debug\nunit3Harness.dll" /result="%~dp0\results-example-nunit3.xml"

"%~dp0\TestHarness\packages\SpecRun.Runner.1.2.0\tools\specrun.exe" run default.srprofile "/baseFolder:%~dp0\TestHarness\SpecRun\bin\Debug" /log:specrun.log /report:"%~dp0\results-example-specrun.html"

"%~dp0\TestHarness\packagesNonNuget\xunit.runner\xunit.console.clr4.exe" "%~dp0\TestHarness\xunit\bin\Debug\xunitHarness.dll" /xml "%~dp0\results-example-xunit.xml"

"%~dp0\TestHarness\packages\xunit.runner.console.2.1.0\tools\xunit.console.exe" "%~dp0\TestHarness\xunit2\bin\Debug\xunit2Harness.dll" -xml "%~dp0\results-example-xunit2.xml" -parallel none

del "%~dp0\results-example-mstest.trx"
"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:"%~dp0\TestHarness\mstest\bin\Debug\mstestHarness.dll" /resultsfile:"%~dp0\results-example-mstest.trx" /testsettings:"%~dp0\TestHarness\TestSettings.testsettings"

cd "%~dp0\TestHarness\Cucumber"
cucumber --format json_pretty --out "%~dp0\results-example-json.json" --tags ~@ignore
cd "%~dp0"

@popd

@echo off
@pushd %~dp0

ECHO Remember to build the solution first!

"%~dp0\TestHarness\packages\NUnit.Runners.2.6.4\tools\nunit-console.exe" "%~dp0\TestHarness\nunit\bin\Debug\nunitHarness.dll" /result="%~dp0\results-example-nunit.xml"

"%~dp0\TestHarness\packages\NUnit.Console.3.0.0\tools\nunit3-console.exe" "%~dp0\TestHarness\nunit3\bin\Debug\nunit3Harness.dll" /result="%~dp0\results-example-nunit3.xml"

"%~dp0\TestHarness\packages\SpecRun.Runner.1.2.0\tools\specrun.exe" run default.srprofile "/baseFolder:%~dp0\TestHarness\SpecRun\bin\Debug" /log:specrun.log /report:"%~dp0\results-example-specrun.html"

"%~dp0\TestHarness\packagesNonNuget\xunit.runner\xunit.console.clr4.exe" "%~dp0\TestHarness\xunit\bin\Debug\xunitHarness.dll" /xml "%~dp0\results-example-xunit.xml"

"%~dp0\TestHarness\packages\xunit.runner.console.2.1.0\tools\xunit.console.exe" "%~dp0\TestHarness\xunit2\bin\Debug\xunit2Harness.dll" -xml "%~dp0\results-example-xunit2.xml" -parallel none

del "%~dp0\results-example-mstest.trx"
"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:"%~dp0\TestHarness\mstest\bin\Debug\mstestHarness.dll" /resultsfile:"%~dp0\results-example-mstest.trx" /testsettings:"%~dp0\TestHarness\TestSettings.testsettings"

cd "%~dp0\TestHarness\Cucumber"
cucumber --format json_pretty --out "%~dp0\results-example-json.json" --tags ~@ignore
cd "%~dp0"

@popd

Remove annoying pause from script

Remove annoying pause from script


REM Copyright (c) 2017-2020, Patrick Pelissier
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM + Redistributions of source code must retain the above copyright
REM   notice, this list of conditions and the following disclaimer.
REM + Redistributions in binary form must reproduce the above copyright
REM   notice, this list of conditions and the following disclaimer in the
REM   documentation and/or other materials provided with the distribution.
REM
REM THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
REM EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
REM DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
REM DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REM Execute the test suite for Microsoft Visual Studio
REM
REM Load Micosoft Visual Studio environement file.
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

REM Add clang-cl in the PATH. It is the default install of clang for MSVC
REM See https://docs.microsoft.com/de-de/cpp/build/clang-support-msbuild?view=vs-2019
SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\bin;%VCINSTALLDIR%\Tools\Llvm\x64\bin

REM Remove previous results
DEL *.log *.dat

REM List the expected failure (compiler internal error)
set "expectedFailure1=test-msnapshot.c"
set "expectedFailure2=test-none.c"

REM Select compiler to use (either cl or clang-cl)
set "compiler=%1"

echo "Compiler full version (%compiler%):"
%compiler% /Bv
%compiler% -v

REM Perform for each test
for %%f in (test-*.c) do (
    echo =================================================
    echo Testing %%f
    REM Copy the test file as a C++ file as CL.EXE only support C++ file
    copy %%f test.cpp
    if ERRORLEVEL 1 EXIT /B 1
    REM Compile the test suite
    REM /Zc:preprocessor is mandatory to have a compliant preprocessor
    REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation.
    REM Enable warnings and basic optimization
    REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
    echo Compiling %%f with %compiler%
    %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1
    if ERRORLEVEL 1 (
        echo *** BUILD ERROR for %%f *** >> %%f.log
        type %%f.log
        if /i "%%f" NEQ "%expectedFailure1%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1
        )
    REM Execute it
    echo Running %%f
    test.exe >> %%f.log 2>&1
    if ERRORLEVEL 1 (
        echo *** RUNTIME ERROR for %%f ***  >> %%f.log
        type %%f.log
        if /i "%%f" NEQ "%expectedFailure%" EXIT /B 1
    ) ELSE (
        echo Test OK for %%f  >> %%f.log
    )
    type %%f.log
)
echo "All tests passed (except %expectedFailure1%)"
exit /B 0

REM Copyright (c) 2017-2020, Patrick Pelissier
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM + Redistributions of source code must retain the above copyright
REM   notice, this list of conditions and the following disclaimer.
REM + Redistributions in binary form must reproduce the above copyright
REM   notice, this list of conditions and the following disclaimer in the
REM   documentation and/or other materials provided with the distribution.
REM
REM THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
REM EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
REM DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
REM DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REM Execute the test suite for Microsoft Visual Studio
REM
REM Load Micosoft Visual Studio environement file.
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

REM Add clang-cl in the PATH. It is the default install of clang for MSVC:
REM %VCINSTALLDIR%\Tools\Llvm\bin;%VCINSTALLDIR%\Tools\Llvm\x64\bin
REM Adding x64 version
REM See https://docs.microsoft.com/de-de/cpp/build/clang-support-msbuild?view=vs-2019
SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin

REM Remove previous results
DEL *.log *.dat

REM List the expected failure (compiler internal error)
set "expectedFailure1=test-msnapshot.c"
set "expectedFailure2=test-none.c"

REM Select compiler to use (either cl or clang-cl)
set "compiler=%1"

echo "Compiler full version (%compiler%):"
%compiler% /Bv
%compiler% -v

REM Perform for each test
for %%f in (test-*.c) do (
    echo =================================================
    echo Testing %%f
    REM Copy the test file as a C++ file as CL.EXE only support C++ file
    copy %%f test.cpp
    if ERRORLEVEL 1 EXIT /B 1
    REM Compile the test suite
    REM /Zc:preprocessor is mandatory to have a compliant preprocessor
    REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation.
    REM Enable warnings and basic optimization
    REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
    echo Compiling %%f with %compiler%
    %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1
    if ERRORLEVEL 1 (
        echo *** BUILD ERROR for %%f *** >> %%f.log
        type %%f.log
        if /i "%%f" NEQ "%expectedFailure1%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1
        )
    REM Execute it
    echo Running %%f
    test.exe >> %%f.log 2>&1
    if ERRORLEVEL 1 (
        echo *** RUNTIME ERROR for %%f ***  >> %%f.log
        type %%f.log
        if /i "%%f" NEQ "%expectedFailure%" EXIT /B 1
    ) ELSE (
        echo Test OK for %%f  >> %%f.log
    )
    type %%f.log
)
echo "All tests passed (except %expectedFailure1%)"
exit /B 0

Fix clang-cl to target x64 mode

Fix clang-cl to target x64 mode


@echo off

rem get the admin permissions
>nul 2>&1 "%systemroot%\system32\cacls.exe" "%systemroot%\system32\config\system"
if '%errorlevel%' neq '0' (
    echo requesting administrative privileges...
    goto uac_prompt
) else ( goto got_admin )

:uac_prompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit -B

:got_admin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%cd%"
    cd /D "%~dp0"

rem create the xmake install directory
if %PROCESSOR_ARCHITECTURE%==x86_64 (
    set xmake_dir_install_default=C:\Program Files (x86^)\xmake
) else (
    set xmake_dir_install_default=C:\Program Files\xmake
)
echo please input the install directory
set /p xmake_dir_install=(default: %xmake_dir_install_default%):
if "%xmake_dir_install%"=="" set xmake_dir_install=%xmake_dir_install_default%
if exist "%xmake_dir_install%" rmdir /s /q "%xmake_dir_install%"
if not exist "%xmake_dir_install%" mkdir "%xmake_dir_install%"

rem compile xmake-core
echo compiling xmake-core...
cd core
cmd /K build.bat > ..\install.log
cd ..

rem install the xmake core file
set xmake_core=core\bin\demo.pkg\bin\msvc\x86\demo.exe
set xmake_core_install=%xmake_dir_install%\xmake_core.exe
copy /Y "%xmake_core%" "%xmake_core_install%" >> install.log

rem install the xmake directory
xcopy /S /Q /Y "xmake" "%xmake_dir_install%" >> install.log

rem make the xmake loader
set xmake_loader=%temp%\xmake_loader
echo @echo off > %xmake_loader%
echo set XMAKE_PROGRAM_DIR=%xmake_dir_install%>> %xmake_loader%
echo "%xmake_core_install%" %%* >> %xmake_loader%

rem install the xmake loader
set xmake_loader_install=%xmake_dir_install%\xmake.bat
copy /Y "%xmake_loader%" "%xmake_loader_install%" >> install.log

rem set global PATH=%xmake_dir_install%
echo %path% | findstr /i /C:"%xmake_dir_install%" >> nul && (goto set_path_ok)
tools\dtreg.exe -MachineEnvSet path="%path%;%xmake_dir_install%" >> install.log
:set_path_ok

rem ok
echo ok!
pause

@echo off

rem get the admin permissions
>nul 2>&1 "%systemroot%\system32\cacls.exe" "%systemroot%\system32\config\system"
if '%errorlevel%' neq '0' (
    echo requesting administrative privileges...
    goto uac_prompt
) else ( goto got_admin )

:uac_prompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit -B

:got_admin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%cd%"
    cd /D "%~dp0"

rem create the xmake install directory
if %PROCESSOR_ARCHITECTURE%==x86_64 (
    set xmake_dir_install_default=C:\Program Files (x86^)\xmake
) else (
    set xmake_dir_install_default=C:\Program Files\xmake
)
echo please input the install directory
set /p xmake_dir_install=(default: %xmake_dir_install_default%):
if "%xmake_dir_install%"=="" set xmake_dir_install=%xmake_dir_install_default%
if exist "%xmake_dir_install%" rmdir /s /q "%xmake_dir_install%"
if not exist "%xmake_dir_install%" mkdir "%xmake_dir_install%"

rem compile xmake-core
echo compiling xmake-core...
cd core
cmd /K build.bat
cd ..

rem install the xmake core file
set xmake_core=core\bin\demo.pkg\bin\msvc\x86\demo.exe
set xmake_core_install=%xmake_dir_install%\xmake_core.exe
copy /Y "%xmake_core%" "%xmake_core_install%" > install.log

rem install the xmake directory
xcopy /S /Q /Y "xmake" "%xmake_dir_install%" >> install.log

rem make the xmake loader
set xmake_loader=%temp%\xmake_loader
echo @echo off > %xmake_loader%
echo set XMAKE_PROGRAM_DIR=%xmake_dir_install%>> %xmake_loader%
echo "%xmake_core_install%" %%* >> %xmake_loader%

rem install the xmake loader
set xmake_loader_install=%xmake_dir_install%\xmake.bat
copy /Y "%xmake_loader%" "%xmake_loader_install%" >> install.log

rem set global PATH=%xmake_dir_install%
echo %path% | findstr /i /C:"%xmake_dir_install%" >> nul && (goto set_path_ok)
tools\dtreg.exe -MachineEnvSet path="%path%;%xmake_dir_install%" >> install.log
:set_path_ok

rem ok
echo ok!
pause

print verbose install log for windows

print verbose install log for windows


c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe Metrics.Sln /p:Configuration="Debug"
if %errorlevel% neq 0 exit /b %errorlevel%

c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe Metrics.Sln /p:Configuration="Release"
if %errorlevel% neq 0 exit /b %errorlevel%

c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe Metrics.Sln /p:Configuration="MonoDebug"
if %errorlevel% neq 0 exit /b %errorlevel%

c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe Metrics.Sln /p:Configuration="MonoRelease"
if %errorlevel% neq 0 exit /b %errorlevel%

c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe Metrics.Sln /p:Configuration="Net4.0Debug"
if %errorlevel% neq 0 exit /b %errorlevel%

c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe Metrics.Sln /p:Configuration="Net4.0Release"
if %errorlevel% neq 0 exit /b %errorlevel%

.\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe .\bin\Debug\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

.\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe .\bin\Release\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

.\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe .\bin\MonoDebug\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

.\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe .\bin\MonoRelease\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

.\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe .\bin\Net4.0Debug\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

.\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe .\bin\Net4.0Release\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

.nuget\NuGet.exe restore Metrics.sln

set MSBUILD="C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe"
set XUNIT=".\packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe"

%MSBUILD% Metrics.Sln /p:Configuration="Debug"
if %errorlevel% neq 0 exit /b %errorlevel%

%MSBUILD% Metrics.Sln /p:Configuration="Release"
if %errorlevel% neq 0 exit /b %errorlevel%

%MSBUILD% Metrics.Sln /p:Configuration="MonoDebug"
if %errorlevel% neq 0 exit /b %errorlevel%

%MSBUILD% Metrics.Sln /p:Configuration="MonoRelease"
if %errorlevel% neq 0 exit /b %errorlevel%

%MSBUILD% Metrics.Sln /p:Configuration="Net4.0Debug"
if %errorlevel% neq 0 exit /b %errorlevel%

%MSBUILD% Metrics.Sln /p:Configuration="Net4.0Release"
if %errorlevel% neq 0 exit /b %errorlevel%

%XUNIT% .\bin\Debug\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

%XUNIT% .\bin\Release\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

%XUNIT% .\bin\MonoDebug\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

%XUNIT% .\bin\MonoRelease\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

%XUNIT% .\bin\Net4.0Debug\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

%XUNIT% .\bin\Net4.0Release\Tests\Metrics.Tests.dll
if %errorlevel% neq 0 exit /b %errorlevel%

refactor the build script a bit

refactor the build script a bit


set projectPath=%~dp0
if %projectPath:~-1%==\ set projectPath=%projectPath:~0,-1%

set releasePath=%projectPath%\.release
mkdir "%releasePath%"

for /f "tokens=*" %%a in ('type version.txt') do set version=%%a

del "%releasePath%\grocy_%version%.zip"
"build_tools\7za.exe" a -r "%releasePath%\grocy_%version%.zip" "%projectPath%\*" -xr!.* -xr!build_tools -xr!build.bat -xr!composer.json -xr!composer.lock -xr!composer.phar -xr!grocy.phpproj -xr!grocy.phpproj.user -xr!grocy.sln -xr!bower.json
"build_tools\7za.exe" d "%releasePath%\grocy_%version%.zip" data\*.*

set projectPath=%~dp0
if %projectPath:~-1%==\ set projectPath=%projectPath:~0,-1%

set releasePath=%projectPath%\.release
mkdir "%releasePath%"

for /f "tokens=*" %%a in ('type version.txt') do set version=%%a

del "%releasePath%\grocy_%version%.zip"
"build_tools\7za.exe" a -r "%releasePath%\grocy_%version%.zip" "%projectPath%\*" -xr!.* -xr!build_tools -xr!build.bat -xr!composer.json -xr!composer.lock -xr!composer.phar -xr!grocy.phpproj -xr!grocy.phpproj.user -xr!grocy.sln -xr!bower.json -xr!publication_assets
"build_tools\7za.exe" a -r "%releasePath%\grocy_%version%.zip" "%projectPath%\.htaccess"
"build_tools\7za.exe" d "%releasePath%\grocy_%version%.zip" data\*.* data\sessions

Fix build includes

Fix build includes


@ECHO OFF
setlocal
set PATH=%PATH%;%WINDIR%\Microsoft.NET\Framework\v4.0.30319
MSBuild.exe msbuild\WebSharper.proj /verbosity:minimal /p:Arguments="%*"

@ECHO OFF
setlocal
set PATH=%PATH%;%ProgramFiles(x86)%\MSBuild\14.0\Bin;%ProgramFiles(x86)%\MSBuild\12.0\Bin;%WINDIR%\Microsoft.NET\Framework\v4.0.30319
MSBuild.exe msbuild\WebSharper.proj /verbosity:minimal /p:Arguments="%*"

build with MSBuild 12/14 when available

build with MSBuild 12/14 when available


@ECHO OFF
REM NOTE: This file was auto-generated with `IB.exe prepare` from `IntelliFactory.Build`.

setlocal
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;tools\NuGet
nuget install IntelliFactory.Build -nocache -pre -ExcludeVersion -o tools\packages
fsi.exe --exec build.fsx %*

@ECHO OFF
REM NOTE: This file was auto-generated with `IB.exe prepare` from `IntelliFactory.Build`.

setlocal
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\4.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\4.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;tools\NuGet
nuget install IntelliFactory.Build -nocache -pre -ExcludeVersion -o tools\packages
fsi.exe --exec build.fsx %*

Fix build.cmd

Fix build.cmd


@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\Sake goto getdnx
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
    .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
    .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

:getdnx
IF "%SKIP_DNX_INSTALL%"=="" (
    IF "%BUILDCMD_DNX_VERSION%"=="" (
        BUILDCMD_DNX_VERSION=latest
    )
    CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
    CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
    CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
)

packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=
SET BUILDCMD_DNX_VERSION=

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\Sake goto getdnx
IF "%BUILDCMD_KOREBUILD_VERSION%"=="" (
    .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
    .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

:getdnx
IF "%BUILDCMD_DNX_VERSION%"=="" (
    SET BUILDCMD_DNX_VERSION=latest
)
IF "%SKIP_DNX_INSTALL%"=="" (
    CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
    CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
    CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
)

packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Fix local build break

Fix local build break


@echo off
cls
"build\tools\nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion" "-version" "3.14.7"
"packages\FAKE\tools\Fake.exe" build\build.fsx

@echo off
cls
"build\tools\nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion" "-version" "3.14.8"
"packages\FAKE\tools\Fake.exe" build\build.fsx

update FAKE for build

update FAKE for build


@setlocal
@rem call mvn -q org.eclipse.tycho:tycho-versions-plugin:update-pom -Dtycho.mode=maven
@call mvn -e -V verify %*

@setlocal
@rem call mvn -q org.eclipse.tycho:tycho-versions-plugin:update-pom -Dtycho.mode=maven
@call mvn -e -V install %*

use install rather than verify

use install rather than verify


@echo off

:Build
cls

if not exist tools\Cake\Cake.exe (
	echo Installing Cake...
	tools\nuget\nuget.exe install Cake -OutputDirectory tools -ExcludeVersion -NonInteractive -NoCache
	echo.
)

if not exist tools\xunit.runners\tools\xunit.console.exe (
	echo Installing xUnit.net: Runners...
	tools\nuget\nuget.exe install xunit.runners -OutputDirectory tools -ExcludeVersion -Version 1.9.2 -NonInteractive
	echo.
)

SET TARGET="Default"
IF NOT [%1]==[] (set TARGET="%1")
SET BUILDMODE="Release"
IF NOT [%2]==[] (set BUILDMODE="%2")

echo Starting Cake...
tools\Cake\Cake.exe build.cake -target=%TARGET% -configuration=%BUILDMODE% -verbosity=diagnostic

:Quit
exit /b %errorlevel%

@echo off

:Build
cls

if not exist tools\Cake\Cake.exe (
	echo Installing Cake...
	tools\nuget\nuget.exe install Cake -OutputDirectory tools -ExcludeVersion -NonInteractive -NoCache -Source https://www.myget.org/F/cake/ -Prerelease
	echo.
)

if not exist tools\xunit.runners\tools\xunit.console.exe (
	echo Installing xUnit.net: Runners...
	tools\nuget\nuget.exe install xunit.runners -OutputDirectory tools -ExcludeVersion -Version 1.9.2 -NonInteractive
	echo.
)

SET TARGET="Default"
IF NOT [%1]==[] (set TARGET="%1")
SET BUILDMODE="Release"
IF NOT [%2]==[] (set BUILDMODE="%2")

echo Starting Cake...
tools\Cake\Cake.exe build.cake -target=%TARGET% -configuration=%BUILDMODE% -verbosity=diagnostic

:Quit
exit /b %errorlevel%

Use latest CI build from MyGet when building Cake.


@ECHO off
SETLOCAL

SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"

SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=

SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe

IF NOT EXIST %BUILD_FOLDER% (
    md %BUILD_FOLDER%
)

IF NOT EXIST %NUGET_PATH% (
    IF NOT EXIST %CACHED_NUGET% (
        echo Downloading latest version of NuGet.exe...
        IF NOT EXIST %LocalAppData%\NuGet (
            md %LocalAppData%\NuGet
        )
        @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
    )

    copy %CACHED_NUGET% %NUGET_PATH% > nul
)

IF NOT EXIST %KOREBUILD_FOLDER% (
    SET KOREBUILD_DOWNLOAD_ARGS=
    IF NOT "%KOREBUILD_VERSION%"=="" (
        SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
    )

    %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)

"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

@ECHO off
SETLOCAL

SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"

SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=

SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe

IF NOT EXIST %BUILD_FOLDER% (
    md %BUILD_FOLDER%
)

IF NOT EXIST %NUGET_PATH% (
    IF NOT EXIST %CACHED_NUGET% (
        echo Downloading latest version of NuGet.exe...
        IF NOT EXIST %LocalAppData%\NuGet (
            md %LocalAppData%\NuGet
        )
        @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
    )

    copy %CACHED_NUGET% %NUGET_PATH% > nul
)

SET KOREBUILD_DOWNLOAD_ARGS=
IF NOT "%KOREBUILD_VERSION%"=="" (
    SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
)
IF NOT EXIST %KOREBUILD_FOLDER% (
    %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)

"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*


@echo(
@set /p adminemail= "Please enter your Google email address: "

:createproject
@echo(
@set /p yn= "Are you a G Suite admin backup/restoring mail for your users? [y or n] "
@if /I "%yn%"=="n" (
@  echo(
@  echo If you want to backup G Suite users, you can create an API project later by running:
@  echo(
@  echo gyb --action create-project --email %adminemail%
@  goto alldone
   )
@if /I not "%yn%"=="y" (
@  echo(
@  echo Please answer y or n.
@  goto createproject
   )
@gyb --action create-project --email %adminemail%
@if not ERRORLEVEL 1 goto projectdone
@echo(
@echo Projection creation failed. Trying again. Say n to skip projection creation.
@goto createproject
:projectdone

:saauth
@echo(
@set /p yn= "Are you ready to authorize GYB to backup/restore G Suite user mail? [y or n] "
@if /I "%yn%"=="n" (
@  echo(
@  echo You can authorize a service account later by running:
@  echo(
@  echo gyb --email %adminemail% --action check-service-account
@  goto sadone
   )
@if /I not "%yn%"=="y" (
@  echo(
@  echo Please answer y or n.
@  goto saauth
   )
@echo(
@set /p regularuser= "Please enter the email address of a regular G Suite user: "
@echo Great! Checking service account scopes. This will fail the first time. Follow the steps to authorize and retry. It can take a few minutes for scopes to PASS after they've been authorized in the admin console.
@gyb --email %regularuser% --check-service-account
@if not ERRORLEVEL 1 goto sadone
@echo(
@echo Service account authorization failed. Confirm you entered the scopes correctly in the admin console. It can take a few minutes for scopes to PASS after they are entered in the admin console so if you're sure you entered them correctly, go grab a coffee and then hit Y to try again. Say N to skip admin authorization.
@goto saauth
:sadone

@echo GYB installation and setup complete!
:alldone
@pause

@echo(
@set /p adminemail= "Please enter your Google email address: "

:createproject
@echo(
@set /p yn= "Are you a G Suite admin backup/restoring mail for your users? [y or n] "
@if /I "%yn%"=="n" (
@  echo(
@  echo If you want to backup G Suite users, you can create an API project later by running:
@  echo(
@  echo gyb --action create-project --email %adminemail%
@  goto alldone
   )
@if /I not "%yn%"=="y" (
@  echo(
@  echo Please answer y or n.
@  goto createproject
   )
@gyb --action create-project --email %adminemail%
@if not ERRORLEVEL 1 goto projectdone
@echo(
@echo Projection creation failed. Trying again. Say n to skip projection creation.
@goto createproject
:projectdone

:saauth
@echo(
@set /p yn= "Are you ready to authorize GYB to backup/restore G Suite user mail? [y or n] "
@if /I "%yn%"=="n" (
@  echo(
@  echo You can authorize a service account later by running:
@  echo(
@  echo gyb --email %adminemail% --action check-service-account
@  goto sadone
   )
@if /I not "%yn%"=="y" (
@  echo(
@  echo Please answer y or n.
@  goto saauth
   )
@echo(
@set /p regularuser= "Please enter the email address of a regular G Suite user: "
@echo Great! Checking service account scopes. This will fail the first time. Follow the steps to authorize and retry. It can take a few minutes for scopes to PASS after they've been authorized in the admin console.
@gyb --email %regularuser% --action check-service-account
@if not ERRORLEVEL 1 goto sadone
@echo(
@echo Service account authorization failed. Confirm you entered the scopes correctly in the admin console. It can take a few minutes for scopes to PASS after they are entered in the admin console so if you're sure you entered them correctly, go grab a coffee and then hit Y to try again. Say N to skip admin authorization.
@goto saauth
:sadone

@echo GYB installation and setup complete!
:alldone
@pause

Update gyb-setup.bat

Update gyb-setup.bat

Line 44 changed to @gyb --email %regularuser% --action check-service-account

The current line has incorrect syntax and will always give an error.


@echo off
set APP=runeos
set ADDR=":8808"

set GOPATH=E:\projects\goprj\runeos;E:\projects\goprj\gopath

::GO_INSTALL_LIST=utils log4g kernel fuse network network/web network/websocket service/chatroom
::echo Install package %APP%...
::go install %APP%/cmd

if exist bin\%APP%.exe del bin\%APP%.exe

echo Build %APP%...
go build -ldflags="-s -w" -o bin\%APP%.exe .\src\.
::echo GOPATH: %GOPATH%
echo ===================================

bin\%APP% %1 %2 %3 %4 %5 %6
@echo on

@echo off
set APP=runeos
set ADDR=":8808"

set GOPATH=E:\projects\goprj\runeos;E:\projects\goprj\gopath

if exist bin\%APP%.exe del bin\%APP%.exe

echo Build %APP%...
go build -ldflags="-s -w" -o bin\%APP%.exe .\src\.
echo ===================================

bin\%APP% %1 %2 %3 %4 %5 %6
@echo on

Update scripts

master: Update scripts


@echo off

if not exist "genie.exe" (
	echo Downloading genie...
	bitsadmin /transfer "genie" "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" "%~dp0\genie.exe"
)

IF "%1"=="" (
	echo No argument set
	echo Exemple : build.bat vs2015
	exit 1
)

genie.exe %*

if errorlevel 1 pause

@echo off

if not exist "genie.exe" (
	echo Downloading genie...
	rem bitsadmin /transfer "genie" "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" "%~dp0\genie.exe"
	powershell Invoke-WebRequest -Uri "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" -OutFile '%~dp0\genie.exe'
)

IF "%1"=="" (
	echo No argument set
	echo Exemple : build.bat vs2015
	exit 1
)

genie.exe %*

if errorlevel 1 pause

Improve speed downloading of genie for build.bat


java -cp lib/Ab.jar Main bot=inmoovWebKit action=aiml2csv trace=false

Create aiml2csv.bat

Create aiml2csv.bat


start /high C:\"Program Files (x86)"\"Microsoft Visual FoxPro 9"\vfp9.exe %1 %2 %3 %4 %5 %6

Create start.bat

Create start.bat


@ECHO OFF

IF #%1 == # GOTO :fullRebuild
IF #%1 == #compile GOTO :compile
IF #%1 == #clean GOTO :clean
IF #%1 == #rebuild GOTO :fullRebuild
GOTO :options

:options
ECHO Usage: %0 ^(compile^|clean^|rebuild^)
EXIT 255

:fullRebuild
msbuild /property:Configuration=Release /property:Platform=x64 /target:Clean
msbuild /property:Configuration=Release /property:Platform=Win32 /target:Clean
GOTO :compile

:compile
msbuild /property:Configuration=Release /property:Platform=x64 && msbuild /property:Configuration=Release /property:Platform=Win32
GOTO :EOF

:clean
msbuild /property:Configuration=Release /property:Platform=x64 /target:Clean
msbuild /property:Configuration=Release /property:Platform=Win32 /target:Clean
GOTO :EOF

Add a convenient script to build the project

...because I'm too lazy to open VS and I always forget how to manually
launch msbuild.


@echo off
setlocal
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
if not exist "%MSBUILDEXE%" (
    echo The .NET Framework 4.0 does not appear to be installed on this
    echo machine, which is required to build the solution.
    exit /b 1
)
if "%1"=="docs" call :docs %2 %3 %4 %5 %6 %7 %8 %9 & goto :EOF
call :base %*
goto :EOF

:base
for %%i in (debug release) do "%MSBUILDEXE%" "MoreLinq.sln" /v:m /p:Configuration=%%i %*
goto :EOF

:docs
call :base %*
"%MSBUILDEXE%" MoreLinq.shfbproj %*
goto :EOF

@echo off
setlocal
cd "%~dp0"
set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
if not exist "%MSBUILDEXE%" (
    echo The .NET Framework 4.0 does not appear to be installed on this
    echo machine, which is required to build the solution.
    exit /b 1
)
if "%1"=="docs" call :docs %2 %3 %4 %5 %6 %7 %8 %9 & goto :EOF

:base
for %%i in (debug release) do "%MSBUILDEXE%" "MoreLinq.sln" /v:m /p:Configuration=%%i %*
goto :EOF

:docs
call :base
"%MSBUILDEXE%" MoreLinq.shfbproj %*
goto :EOF

Build script simplification

Build script simplification


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.23.0 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.23.0 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.23.0
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.1.8 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.1.8 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.1.8
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.5 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.5 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.5
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Update FAKE.BuildLib 0.3.5 from 0.1.8

Update FAKE.BuildLib 0.3.5 from 0.1.8