@rem Copyright 2015 Google Inc. All Rights Reserved.
@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.

@setlocal

@rem Set the etwtracedir environment variable if it
@rem isn't set already.
@if not "%etwtracedir%" == "" goto TraceDirSet
@set etwtracedir=%homedrive%%homepath%\documents\xperftraces
:TraceDirSet

@rem Make sure %etwtracedir% exists
@if exist %etwtracedir% goto TraceDirExists
@mkdir %etwtracedir%
:TraceDirExists

@rem %temp% should be a good location for temporary traces.
@rem Make sure this is a fast drive, preferably an SSD.
@set xperftemptracedir=%temp%

@rem Generate a file name based on the current date and time and put it in
@rem etwtracedir. This is compatible with UIforETW which looks for traces there.
@rem Note: this probably fails in some locales. Sorry.
@for /F "tokens=2-4 delims=/- " %%A in ('date/T') do @set datevar=%%C-%%A-%%B
@for /F "tokens=1-3 delims=:-. " %%A in ('echo %time%') do @set timevar=%%A-%%B-%%C&set hour=%%A
@rem Make sure that morning hours such as 9:00 are handled as 09 rather than 9
@if %hour% LSS 10 set timevar=0%timevar%
@set tracefile=%etwtracedir%\%datevar%_%timevar%_per_process_cpu_usage.etl
@set textfile=%etwtracedir%\%datevar%_%timevar%_per_process_cpu_usage.txt

@set kernelfile=%temp%\kernel_trace.etl

@echo This repords context switches, DPCs, and interrupts and nothing else, to allow for very long running tracing.
xperf.exe -start "NT Kernel Logger" -on PROC_THREAD+LOADER+DPC+INTERRUPT+CSWITCH -buffersize 1024 -minbuffers 60 -maxbuffers 60 -f "%kernelfile%"
@set starttime=%time%
@if not %errorlevel% equ 0 goto failure
@echo Tracing started at %starttime%

@echo Run the test you want to profile here
@pause
xperf.exe -stop "NT Kernel Logger"
xperf.exe -merge "%kernelfile%" "%tracefile%" -compress
@del "%kernelfile%"
@echo Tracing ran from %starttime% to %time%
@echo Tracing ran from %starttime% to %time% > %textfile%

@echo Trace data is in "%tracefile%"
@dir "%tracefile%" | find /i ".etl"
@exit /b

:failure
@echo Failure!
@exit /b

Add etw_cpuusage_longterm.bat

Add etw_cpuusage_longterm.bat

This batch file is designed for long-running recording of context switch
data and nothing else. This allows monitoring of all processes CPU usage
(including interrupts and DPCs) for periods of around an hour at a time.
The goal is to investigate badly-behaved processes (svchost.exe, I'm
looking at you) which spring to life at annoying times and waste battery
life.


if "%1"=="" goto default_value:
set path=%path%;%1;%1\Scripts
goto custom_python:

:default_value:
set path=%path%;c:\Python34;c:\Python34\Scripts

:custom_python:
%pythonexe% setup.py sdist register upload

if "%1"=="" goto default_value:
set pythonexe=%1\python
goto custom_python:

:default_value:
set pythonexe=c:\Python34\python

:custom_python:
%pythonexe% setup.py sdist register upload

update publish_on_pypi.bat

update publish_on_pypi.bat


@echo off

rem installer bug. http://stackoverflow.com/a/25095327
mkdir "%APPDATA%\npm" > NUL 2>&1

set PATH=node_modules\.bin;node_modules\lisb-hubot\node_modules\.bin;%PATH%
call npm install

for /f "delims=\" %%i in ("%CD%") do set UID=%%i

if "%REDIS_URL%" = "" (
  set REDIS_URL=redis://localhost:6379/%UID%
)

if "%1" == "start" (
  forever start ^
    --uid "%UID%" ^
    --minUptime 10000 --spinSleepTime 600000 ^
    -o hubot.log -a ^
    -w --watchDirectory scripts ^
    -c coffee node_modules\.bin\hubot.cmd -a direct %*
) else if "%1" == "stop" (
  forever stop "%UID%"
) else if "%1" == "restart" (
  forever restart "%UID%"
) else if "%1" == "status" (
  forever list | find "] %UID% "
) else if "%1" == "logs" (
  cat hubot.log | more
) else (
  node_modules\.bin\hubot.cmd -a direct %*
)

@echo off

rem installer bug. http://stackoverflow.com/a/25095327
mkdir "%APPDATA%\npm" > NUL 2>&1

set PATH=node_modules\.bin;node_modules\lisb-hubot\node_modules\.bin;%PATH%
call npm install

for /f "delims=\" %%i in ("%CD%") do set UID=%%i

if "%REDIS_URL%" == "" (
  set REDIS_URL=redis://localhost:6379/%UID%
)

if "%1" == "start" (
  forever start ^
    --uid "%UID%" ^
    --minUptime 10000 --spinSleepTime 600000 ^
    -o hubot.log -a ^
    -w --watchDirectory scripts ^
    -c coffee node_modules\.bin\hubot.cmd -a direct %*
) else if "%1" == "stop" (
  forever stop "%UID%"
) else if "%1" == "restart" (
  forever restart "%UID%"
) else if "%1" == "status" (
  forever list | find "] %UID% "
) else if "%1" == "logs" (
  cat hubot.log | more
) else (
  node_modules\.bin\hubot.cmd -a direct %*
)

Fix the condition to compare strings in the script on Windows.


@echo off
Rmdir .nuget\packages\ /s /q
NuGet.exe install MSBuildTasks        -OutputDirectory .nuget\packages\ -NonInteractive -Version 1.5.0.214
NuGet.exe install NUnit               -OutputDirectory .nuget\packages\ -NonInteractive -Version 3.5.0
NuGet.exe install NUnit.ConsoleRunner -OutputDirectory .nuget\packages\ -NonInteractive -Version 3.5.0
NuGet.exe install WiX                 -OutputDirectory .nuget\packages\ -NonInteractive -Version 4.0.0.4506-pre -Pre

Remove trailing space in bootstrap.cmd

[ci] Remove trailing space in bootstrap.cmd


@echo off
rem *********************************************************************************
rem * dev-shell Bootstrap v0.1                                                      *
rem *                                                                               *
rem * This command script will bootstrap the checked out git source into a complete *
rem * development system for MinGW / MSYS.                                          *
rem *                                                                               *
rem * Usage : double-click or run from the command line, runs fully automatically.  *
rem *********************************************************************************

rem note that there is limited error checking or idiot-proofing in the file at this time.

SETLOCAL
echo dev-shell bootstrap v0.1 (c) seapagan 2015
echo.
echo Downloading the 'TinyPerl' distribution ...
%~dp0mingw32\wget -q --show-progress -c --trust-server-names -c --directory-prefix=%~dp0support\packages http://sourceforge.net/projects/tinyperl/files/tinyperl/2.0/tinyperl-2.0-580-win32.zip/download
if NOT EXIST %~dp0support\packages\tinyperl-2.0-580-win32.zip (
	echo Failure to download tinyperl distribution, please check your internet connection and report as a bug otherwise!
	echo.
	pause
	exit /b 255
)
echo.
echo Unpacking TinyPerl ...
rem erase TinyPerl directory first if exists ...
if EXIST "%~dp0support\tinyperl\" (
RD /S /Q %~dp0support\tinyperl
)
%~dp0support\unzip.exe -q %~dp0support\packages\tinyperl-2.0-580-win32.zip -d %~dp0support
move %~dp0support\tinyperl* %~dp0support\tinyperl > NUL
if NOT EXIST "%~dp0support\tinyperl\" (
	echo "Failure to unpack the TinyPerl distribution, please report any error messages, thanks."
	pause
	exit /b 254
)
ENDLOCAL
pause

@echo off
rem *********************************************************************************
rem * dev-shell Bootstrap v0.1                                                      *
rem *                                                                               *
rem * This command script will bootstrap the checked out git source into a complete *
rem * development system for MinGW / MSYS.                                          *
rem *                                                                               *
rem * Usage : double-click or run from the command line, runs fully automatically.  *
rem *********************************************************************************

rem note that there is limited error checking or idiot-proofing in the file at this time.

echo dev-shell bootstrap v0.1 (c) seapagan 2015
echo.
echo Downloading the 'TinyPerl' distribution ...
%~dp0mingw32\wget -q --show-progress -c --trust-server-names -c --directory-prefix=%~dp0support\packages http://sourceforge.net/projects/tinyperl/files/tinyperl/2.0/tinyperl-2.0-580-win32.zip/download
if NOT EXIST %~dp0support\packages\tinyperl-2.0-580-win32.zip (
	echo Failure to download tinyperl distribution, please check your internet connection and report as a bug otherwise!
	echo.
	pause
	exit /b 255
)
echo.
echo Unpacking TinyPerl ...
rem erase TinyPerl directory first if exists ...
if EXIST "%~dp0support\tinyperl\" (
RD /S /Q %~dp0support\tinyperl
)
%~dp0support\unzip.exe -q %~dp0support\packages\tinyperl-2.0-580-win32.zip -d %~dp0support
move %~dp0support\tinyperl* %~dp0support\tinyperl > NUL
if NOT EXIST "%~dp0support\tinyperl\" (
	echo "Failure to unpack the TinyPerl distribution, please report any error messages, thanks."
	pause
	exit /b 254
)

rem now run the perl script to continue...
cd %~dp0support\bootstrap
%~dp0support\tinyperl\tinyperl bootstrap.pl

pause

tidy bootstrap.cmd

tidy bootstrap.cmd

removed unused SETLOCAL / ENDLOCAL


@rem Build janet on windows
@rem
@rem Open a "Windows SDK Command Shell" and cd to the janet directory
@rem Then run this script with no arguments to build the executable

@echo off

@rem Ensure correct command prompt
@if not defined INCLUDE goto :BADCMD

@rem Sub commands
@if "%1"=="help" goto HELP
@if "%1"=="clean" goto CLEAN
@if "%1"=="test" goto TEST
@if "%1"=="dist" goto DIST

@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /c /O2 /W3 /LD /D_CRT_SECURE_NO_WARNINGS
@set JANET_LINK=link /nologo

mkdir build
mkdir build\core
mkdir build\mainclient
mkdir build\boot

@rem Build the xxd tool for generating sources
@cl /nologo /c tools/xxd.c /Fobuild\xxd.obj
@if errorlevel 1 goto :BUILDFAIL
@link /nologo /out:build\xxd.exe build\xxd.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Generate the embedded sources
@build\xxd.exe src\mainclient\init.janet build\init.gen.c janet_gen_init
@if errorlevel 1 goto :BUILDFAIL
@build\xxd.exe src\boot\boot.janet build\boot.gen.c janet_gen_boot
@if errorlevel 1 goto :BUILDFAIL

@rem Build the generated sources
@%JANET_COMPILE% /Fobuild\mainclient\init.gen.obj build\init.gen.c
@if errorlevel 1 goto :BUILDFAIL
@%JANET_COMPILE% /Fobuild\boot\boot.gen.obj build\boot.gen.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the bootstrap interpretter
for %%f in (src\core\*.c) do (
    @%JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
for %%f in (src\boot\*.c) do (
    @%JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
@if errorlevel 1 goto :BUILDFAIL
build\janet_boot build\core_image.c JANET_PATH "C:/Janet/Library"

@rem Build the core image
@%JANET_COMPILE% /Fobuild\core_image.obj build\core_image.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the sources
for %%f in (src\core\*.c) do (
    @%JANET_COMPILE% /Fobuild\core\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Build the main client
for %%f in (src\mainclient\*.c) do (
    @%JANET_COMPILE% /Fobuild\mainclient\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Link everything to main client
%JANET_LINK% /out:janet.exe build\core\*.obj build\mainclient\*.obj build\core_image.obj
@if errorlevel 1 goto :BUILDFAIL

echo === Successfully built janet.exe for Windows ===
echo === Run 'build_win test' to run tests. ==
echo === Run 'build_win clean' to delete build artifacts. ===
exit /b 0

@rem Not using correct command line
:BADCMD
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
exit /b 1

@rem Show help
:HELP
@echo.
@echo Usage: build_windows [subcommand=clean,help,test,dist]
@echo.
@echo Script to build janet on windows. Must be run from the Visual Studio
@echo command prompt.
exit /b 0

@rem Clean build artifacts
:CLEAN
del janet.exe janet.exp janet.lib
rd /s /q build
exit /b 0

@rem Run tests
:TEST
for %%f in (test/suite*.janet) do (
    janet.exe test\%%f
    @if errorlevel 1 goto :TESTFAIL
)
exit /b 0

@rem Build a dist directory
:DIST
mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html
janet.exe tools\amalg.janet > dist\janet.c
copy janet.exe dist\janet.exe
copy LICENSE dist\LICENSE
copy README.md dist\README.md
copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp
copy src\include\janet.h dist\janet.h
copy src\include\janetconf.h dist\janetconf.h
copy tools\cook.janet dist\cook.janet
copy tools\highlight.janet dist\highlight.janet
exit /b 0

:TESTFAIL
@echo.
@echo *******************************************************
@echo *** Tests FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build failed
:BUILDFAIL
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build janet on windows
@rem
@rem Open a "Windows SDK Command Shell" and cd to the janet directory
@rem Then run this script with no arguments to build the executable

@echo off

@rem Ensure correct command prompt
@if not defined INCLUDE goto :BADCMD

@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /c /O2 /W3 /LD /D_CRT_SECURE_NO_WARNINGS
@set JANET_LINK=link /nologo

@rem Sub commands
@if "%1"=="help" goto HELP
@if "%1"=="clean" goto CLEAN
@if "%1"=="test" goto TEST
@if "%1"=="dist" goto DIST

mkdir build
mkdir build\core
mkdir build\mainclient
mkdir build\boot

@rem Build the xxd tool for generating sources
@cl /nologo /c tools/xxd.c /Fobuild\xxd.obj
@if errorlevel 1 goto :BUILDFAIL
@link /nologo /out:build\xxd.exe build\xxd.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Generate the embedded sources
@build\xxd.exe src\mainclient\init.janet build\init.gen.c janet_gen_init
@if errorlevel 1 goto :BUILDFAIL
@build\xxd.exe src\boot\boot.janet build\boot.gen.c janet_gen_boot
@if errorlevel 1 goto :BUILDFAIL

@rem Build the generated sources
@%JANET_COMPILE% /Fobuild\mainclient\init.gen.obj build\init.gen.c
@if errorlevel 1 goto :BUILDFAIL
@%JANET_COMPILE% /Fobuild\boot\boot.gen.obj build\boot.gen.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the bootstrap interpretter
for %%f in (src\core\*.c) do (
    @%JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
for %%f in (src\boot\*.c) do (
    @%JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
@if errorlevel 1 goto :BUILDFAIL
build\janet_boot build\core_image.c JANET_PATH "C:/Janet/Library"

@rem Build the core image
@%JANET_COMPILE% /Fobuild\core_image.obj build\core_image.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the sources
for %%f in (src\core\*.c) do (
    @%JANET_COMPILE% /Fobuild\core\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Build the main client
for %%f in (src\mainclient\*.c) do (
    @%JANET_COMPILE% /Fobuild\mainclient\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Link everything to main client
%JANET_LINK% /out:janet.exe build\core\*.obj build\mainclient\*.obj build\core_image.obj
@if errorlevel 1 goto :BUILDFAIL

echo === Successfully built janet.exe for Windows ===
echo === Run 'build_win test' to run tests. ==
echo === Run 'build_win clean' to delete build artifacts. ===
exit /b 0

@rem Not using correct command line
:BADCMD
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
exit /b 1

@rem Show help
:HELP
@echo.
@echo Usage: build_windows [subcommand=clean,help,test,dist]
@echo.
@echo Script to build janet on windows. Must be run from the Visual Studio
@echo command prompt.
exit /b 0

@rem Clean build artifacts
:CLEAN
del janet.exe janet.exp janet.lib
rd /s /q build
exit /b 0

@rem Run tests
:TEST
for %%f in (test/suite*.janet) do (
    janet.exe test\%%f
    @if errorlevel 1 goto :TESTFAIL
)
exit /b 0

@rem Build a dist directory
:DIST
mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html

@rem Gen amlag
setlocal enabledelayedexpansion
set "amalg_files="
for %%f in (src\core\*.c) do (
    set "amalg_files=!amalg_files! %%f"
)
janet.exe tools\amalg.janet src\core\util.h src\core\state.h src\core\gc.h src\core\vector.h src\core\fiber.h src\core\regalloc.h src\core\compile.h src\core\emit.h src\core\symcache.h %amalg_files% build\core_image.c > dist\janet.c
copy janet.exe dist\janet.exe
copy LICENSE dist\LICENSE
copy README.md dist\README.md
copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp
copy src\include\janet.h dist\janet.h
copy src\include\janetconf.h dist\janetconf.h
copy tools\cook.janet dist\cook.janet
copy tools\highlight.janet dist\highlight.janet
exit /b 0

:TESTFAIL
@echo.
@echo *******************************************************
@echo *** Tests FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build failed
:BUILDFAIL
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

Update build_win.bat to handle new amalg script.


@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

:: This script will try to find if svn and python are accessible and it not,
:: it will try to download it and 'install' it in depot_tools.

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
set GIT_BIN_DIR=git-1.8.0_bin

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:GIT_CHECK
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :MSYS_PATH_CHECK
if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
goto :SVN_CHECK

:MSYS_PATH_CHECK
call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul
if errorlevel 1 goto :SVN_CHECK
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"

:GIT_INSTALL
echo Installing git (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%~dp0git.zip" del "%~dp0git.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%~dp0git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%~dp0git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo Please visit http://code.google.com/p/msysgit to download the latest git
echo client before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :PYTHON_CHECK

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%~dp0svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :PYTHON_CHECK

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo Please visit http://subversion.tigris.org to download the latest subversion client
echo before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:PYTHON_CHECK
if "%DEPOT_TOOLS_PYTHON_275%" == "1" goto :PY275_CHECK
goto :PY26_CHECK

:PY26_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL
set ERRORLEVEL=0
goto :END

:PY275_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python275_bin" goto :PY275_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY275_INSTALL
set ERRORLEVEL=0
goto :END

:PY275_INSTALL
echo Installing python 2.7.5...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python275_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python275_bin"
if exist "%~dp0python275.zip" del "%~dp0python275.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip "%~dp0python275_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python275_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0python275_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python275.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END

:PY26_INSTALL
echo Installing python 2.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
if errorlevel 1 goto :PYTHON_FAIL
:: Create the batch files.
call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.7.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

:: This script will try to find if svn and python are accessible and it not,
:: it will try to download it and 'install' it in depot_tools.

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
set GIT_BIN_DIR=git-1.8.0_bin

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:GIT_CHECK
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :MSYS_PATH_CHECK
if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
goto :SVN_CHECK

:MSYS_PATH_CHECK
call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul
if errorlevel 1 goto :SVN_CHECK
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"

:GIT_INSTALL
echo Installing git (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%~dp0git.zip" del "%~dp0git.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%~dp0git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%~dp0git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo Please visit http://code.google.com/p/msysgit to download the latest git
echo client before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :PYTHON_CHECK

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%~dp0svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :PYTHON_CHECK

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo Please visit http://subversion.tigris.org to download the latest subversion client
echo before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:PYTHON_CHECK
if "%DEPOT_TOOLS_PYTHON_275%" == "0" goto :PY26_CHECK
goto :PY275_CHECK

:PY26_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL
set ERRORLEVEL=0
goto :END

:PY275_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python275_bin" goto :PY275_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY275_INSTALL
set ERRORLEVEL=0
goto :END

:PY275_INSTALL
echo Installing python 2.7.5...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python275_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python275_bin"
if exist "%~dp0python275.zip" del "%~dp0python275.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip "%~dp0python275_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python275_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0python275_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python275.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END

:PY26_INSTALL
echo Installing python 2.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
if errorlevel 1 goto :PYTHON_FAIL
:: Create the batch files.
call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.7.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

Enable implicit auto-upgrade to python 2.7.5.

This will automatically upgrade python to 2.7.5 unless
set DEPOT_TOOLS_PYTHON_275=0
is used.

R=iannucci@chromium.org
BUG=241769

Review URL: https://codereview.chromium.org/53313002

git-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@235140 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


@echo off

echo.
echo == Extract
echo.

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

pushd downloads

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

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

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

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

rem echo.
rem echo Python
rem %ZIP% x ActivePython.zip -o%TARGET_DIR% > nul
rem move "%TARGET_DIR%\ActivePython-*" "%TARGET_DIR%\python-installer"

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

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

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

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

echo.
echo Fifengine Mapeditor
%ZIP% x fife-editor.zip -o..\extracted\fife-editor > nul

echo.
echo Fifengine Python Demos
%ZIP% x fife-python-demos.zip -o..\extracted\fife-python-demos > nul

echo.
echo Fifengine Python Tutorials
%ZIP% x fife-python-tutorials.zip -o..\extracted\fife-python-tutorials > nul

rem echo.
rem echo Fifengine C++ Tutorials
rem %ZIP% x fife-c++-tutorials.zip -o..\extracted\fife-c++-tutorials > nul
rem move "%TARGET_DIR%\fife-c++-tutorials*" "%TARGET_DIR%\fife-c++-tutorials"

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

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

dir "%TARGET_DIR%"

popd

@echo off

echo.
echo == Extract
echo.

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

pushd downloads

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

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

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

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

rem echo.
rem echo Python
rem %ZIP% x ActivePython.zip -o%TARGET_DIR% > nul
rem move "%TARGET_DIR%\ActivePython-*" "%TARGET_DIR%\python-installer"

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

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

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

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

echo.
echo Fifengine Mapeditor
%ZIP% x fife-editor.zip -o..\extracted > nul

echo.
echo Fifengine Python Demos
%ZIP% x fife-python-demos.zip -o..\extracted > nul

echo.
echo Fifengine Python Tutorials
%ZIP% x fife-python-tutorials.zip -o..\extracted > nul

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

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

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

dir "%TARGET_DIR%"

popd

remove target folder, all components ship their own top level dir "x-master"


cmake ^
      -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
      -DWITH_INCHI=ON ^
      -DPYTHON_EXECUTABLE=%PYTHON% ^
      -DPYTHON_BINDINGS=ON ^
      -DRUN_SWIG=ON ^
      -DCMAKE_BUILD_TYPE=Release ^
      .

cmake --build . --target install --config Release

xcopy %PREFIX%\bin\data %PREFIX%\share\openbabel /e /c
rmdir /s /q %PREFIX%\bin\data

cmake ^
      -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
      -DWITH_INCHI=ON ^
      -DPYTHON_EXECUTABLE=%PYTHON% ^
      -DPYTHON_BINDINGS=ON ^
      -DRUN_SWIG=ON ^
      -DCMAKE_BUILD_TYPE=Release ^
      .

cmake --build . --target install --config Release

xcopy %LIBRARY_PREFIX%\data %PREFIX%\share\openbabel /e /c
rmdir /s /q %LIBRARY_PREFIX%\data

Update bld.bat

Update bld.bat


@rem Build janet on windows
@rem
@rem Open a "Windows SDK Command Shell" and cd to the janet directory
@rem Then run this script with no arguments to build the executable

@echo off

@rem Ensure correct command prompt
@if not defined INCLUDE goto :BADCMD

@rem Sub commands
@if "%1"=="help" goto HELP
@if "%1"=="clean" goto CLEAN
@if "%1"=="test" goto TEST
@if "%1"=="dist" goto DIST
@if "%1"=="install" goto INSTALL
@if "%1"=="test-install" goto TESTINSTALL
@if "%1"=="all" goto ALL

@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS
@set JANET_LINK=link /nologo
@set JANET_LINK_STATIC=lib /nologo

@rem Add janet build tag
if not "%JANET_BUILD%" == "" (
    @set JANET_COMPILE=%JANET_COMPILE% /DJANET_BUILD="\"%JANET_BUILD%\""
)

mkdir build
mkdir build\core
mkdir build\mainclient
mkdir build\boot

@rem Build the xxd tool for generating sources
cl /nologo /c tools/xxd.c /Fobuild\xxd.obj
@if errorlevel 1 goto :BUILDFAIL
link /nologo /out:build\xxd.exe build\xxd.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Generate the embedded sources
build\xxd.exe src\boot\boot.janet build\boot.gen.c janet_gen_boot
@if errorlevel 1 goto :BUILDFAIL

@rem Build the generated sources
%JANET_COMPILE% /Fobuild\boot\boot.gen.obj build\boot.gen.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the bootstrap interpreter
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
for %%f in (src\boot\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
@if errorlevel 1 goto :BUILDFAIL
build\janet_boot build\core_image.c

@rem Build the core image
%JANET_COMPILE% /Fobuild\core_image.obj build\core_image.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the sources
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /Fobuild\core\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Build the resources
rc /nologo /fobuild\janet_win.res janet_win.rc

@rem Build the main client
for %%f in (src\mainclient\*.c) do (
    %JANET_COMPILE% /Fobuild\mainclient\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Link everything to main client
%JANET_LINK% /out:janet.exe build\core\*.obj build\mainclient\*.obj build\core_image.obj build\janet_win.res
@if errorlevel 1 goto :BUILDFAIL

@rem Build static library (libjanet.a)
%JANET_LINK_STATIC% /out:build\libjanet.lib build\core\*.obj build\core_image.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Gen amlag
setlocal enabledelayedexpansion
set "amalg_files="
for %%f in (src\core\*.c) do (
    set "amalg_files=!amalg_files! %%f"
)
janet.exe tools\amalg.janet src\core\util.h src\core\state.h src\core\gc.h src\core\vector.h src\core\fiber.h src\core\regalloc.h src\core\compile.h src\core\emit.h src\core\symcache.h %amalg_files% build\core_image.c > build\janet.c
janet.exe tools\removecr.janet build\janet.c

@rem Gen shell.c
janet.exe tools\amalg.janet src\mainclient\line.h src\mainclient\line.c src\mainclient\main.c > build\shell.c
janet.exe tools\removecr.janet build\shell.c

echo === Successfully built janet.exe for Windows ===
echo === Run 'build_win test' to run tests. ==
echo === Run 'build_win clean' to delete build artifacts. ===
exit /b 0

@rem Not using correct command line
:BADCMD
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
exit /b 1

@rem Show help
:HELP
@echo.
@echo Usage: build_windows [subcommand=clean,help,test,dist]
@echo.
@echo Script to build janet on windows. Must be run from the Visual Studio
@echo command prompt.
exit /b 0

@rem Clean build artifacts
:CLEAN
del *.exe *.lib *.exp
rd /s /q build
rd /s /q dist
exit /b 0

@rem Run tests
:TEST
for %%f in (test/suite*.janet) do (
    janet.exe test\%%f
    @if errorlevel 1 goto TESTFAIL
)
exit /b 0

@rem Build a dist directory
:DIST
mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html
janet.exe tools\removecr.janet dist\doc.html

copy build\janet.c dist\janet.c
copy build\shell.c dist\shell.c
copy janet.exe dist\janet.exe
copy LICENSE dist\LICENSE
copy README.md dist\README.md

copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp

copy src\include\janet.h dist\janet.h
copy src\conf\janetconf.h dist\janetconf.h
copy build\libjanet.lib dist\libjanet.lib

copy auxbin\jpm dist\jpm
copy tools\jpm.bat dist\jpm.bat

@rem Create installer
"C:\Program Files (x86)\NSIS\makensis.exe" janet-installer.nsi
exit /b 0

@rem Run the installer. (Installs to the local user with default settings)
:INSTALL
@echo Running Installer...
FOR %%a in (janet-*-windows-installer.exe) DO (
    %%a /S /CurrentUser
)
exit /b 0

@rem Test the installation.
:TESTINSTALL
pushd test\install
call jpm clean
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm test
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --modpath=. install https://github.com/janet-lang/json.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call build\testexec
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose quickbin testexec.janet build\testexec2.exe
@if errorlevel 1 goto :TESTINSTALLFAIL
call build\testexec2.exe
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/jhydro.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/path.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/argparse.git
@if errorlevel 1 goto :TESTINSTALLFAIL
:TESTINSTALLFAIL
popd
goto :TESTFAIL
exit /b 0

@rem build, test, dist, install. Useful for local dev.
:ALL
call %0 build
@if errorlevel 1 exit /b 1
call %0 test
@if errorlevel 1 exit /b 1
call %0 dist
@if errorlevel 1 exit /b 1
call %0 install
@if errorlevel 1 exit /b 1
@echo Done!
exit /b 0

:TESTFAIL
@echo.
@echo *******************************************************
@echo *** Tests FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build failed
:BUILDFAIL
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build janet on windows
@rem
@rem Open a "Windows SDK Command Shell" and cd to the janet directory
@rem Then run this script with no arguments to build the executable

@echo off

@rem Ensure correct command prompt
@if not defined INCLUDE goto :BADCMD

@rem Sub commands
@if "%1"=="help" goto HELP
@if "%1"=="clean" goto CLEAN
@if "%1"=="test" goto TEST
@if "%1"=="dist" goto DIST
@if "%1"=="install" goto INSTALL
@if "%1"=="test-install" goto TESTINSTALL
@if "%1"=="all" goto ALL

@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS
@set JANET_LINK=link /nologo
@set JANET_LINK_STATIC=lib /nologo

@rem Add janet build tag
if not "%JANET_BUILD%" == "" (
    @set JANET_COMPILE=%JANET_COMPILE% /DJANET_BUILD="\"%JANET_BUILD%\""
)

mkdir build
mkdir build\core
mkdir build\mainclient
mkdir build\boot

@rem Build the xxd tool for generating sources
cl /nologo /c tools/xxd.c /Fobuild\xxd.obj
@if errorlevel 1 goto :BUILDFAIL
link /nologo /out:build\xxd.exe build\xxd.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Generate the embedded sources
build\xxd.exe src\boot\boot.janet build\boot.gen.c janet_gen_boot
@if errorlevel 1 goto :BUILDFAIL

@rem Build the generated sources
%JANET_COMPILE% /Fobuild\boot\boot.gen.obj build\boot.gen.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the bootstrap interpreter
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
for %%f in (src\boot\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
@if errorlevel 1 goto :BUILDFAIL
build\janet_boot build\core_image.c

@rem Build the core image
%JANET_COMPILE% /Fobuild\core_image.obj build\core_image.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the sources
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /Fobuild\core\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Build the resources
rc /nologo /fobuild\janet_win.res janet_win.rc

@rem Build the main client
for %%f in (src\mainclient\*.c) do (
    %JANET_COMPILE% /Fobuild\mainclient\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Link everything to main client
%JANET_LINK% /out:janet.exe build\core\*.obj build\mainclient\*.obj build\core_image.obj build\janet_win.res
@if errorlevel 1 goto :BUILDFAIL

@rem Build static library (libjanet.a)
%JANET_LINK_STATIC% /out:build\libjanet.lib build\core\*.obj build\core_image.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Gen amlag
setlocal enabledelayedexpansion
set "amalg_files="
for %%f in (src\core\*.c) do (
    set "amalg_files=!amalg_files! %%f"
)
janet.exe tools\amalg.janet src\core\util.h src\core\state.h src\core\gc.h src\core\vector.h src\core\fiber.h src\core\regalloc.h src\core\compile.h src\core\emit.h src\core\symcache.h %amalg_files% build\core_image.c > build\janet.c
janet.exe tools\removecr.janet build\janet.c

@rem Gen shell.c
janet.exe tools\amalg.janet src\mainclient\line.h src\mainclient\line.c src\mainclient\main.c > build\shell.c
janet.exe tools\removecr.janet build\shell.c

echo === Successfully built janet.exe for Windows ===
echo === Run 'build_win test' to run tests. ==
echo === Run 'build_win clean' to delete build artifacts. ===
exit /b 0

@rem Not using correct command line
:BADCMD
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
exit /b 1

@rem Show help
:HELP
@echo.
@echo Usage: build_windows [subcommand=clean,help,test,dist]
@echo.
@echo Script to build janet on windows. Must be run from the Visual Studio
@echo command prompt.
exit /b 0

@rem Clean build artifacts
:CLEAN
del *.exe *.lib *.exp
rd /s /q build
rd /s /q dist
exit /b 0

@rem Run tests
:TEST
for %%f in (test/suite*.janet) do (
    janet.exe test\%%f
    @if errorlevel 1 goto TESTFAIL
)
exit /b 0

@rem Build a dist directory
:DIST
mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html
janet.exe tools\removecr.janet dist\doc.html

copy build\janet.c dist\janet.c
copy build\shell.c dist\shell.c
copy janet.exe dist\janet.exe
copy LICENSE dist\LICENSE
copy README.md dist\README.md

copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp

copy src\include\janet.h dist\janet.h
copy src\conf\janetconf.h dist\janetconf.h
copy build\libjanet.lib dist\libjanet.lib

copy auxbin\jpm dist\jpm
copy tools\jpm.bat dist\jpm.bat

@rem Create installer
"C:\Program Files (x86)\NSIS\makensis.exe" janet-installer.nsi
exit /b 0

@rem Run the installer. (Installs to the local user with default settings)
:INSTALL
@echo Running Installer...
FOR %%a in (janet-*-windows-installer.exe) DO (
    %%a /S /CurrentUser
)
exit /b 0

@rem Test the installation.
:TESTINSTALL
pushd test\install
call jpm clean
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm test
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --modpath=. install https://github.com/janet-lang/json.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call build\testexec
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose quickbin testexec.janet build\testexec2.exe
@if errorlevel 1 goto :TESTINSTALLFAIL
call build\testexec2.exe
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/jhydro.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/path.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/argparse.git
@if errorlevel 1 goto :TESTINSTALLFAIL
popd
exit /b 0

:TESTINSTALLFAIL
popd
goto :TESTFAIL

@rem build, test, dist, install. Useful for local dev.
:ALL
call %0 build
@if errorlevel 1 exit /b 1
call %0 test
@if errorlevel 1 exit /b 1
call %0 dist
@if errorlevel 1 exit /b 1
call %0 install
@if errorlevel 1 exit /b 1
@echo Done!
exit /b 0

:TESTFAIL
@echo.
@echo *******************************************************
@echo *** Tests FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build failed
:BUILDFAIL
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

Fix build_win.

Fix build_win.


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

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

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

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

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

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

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

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

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

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

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

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

Update to VirtualBox 5.2.6

Update to VirtualBox 5.2.6


@echo off
set OLDDIR=%CD%
cd /d %~dp0
REM ============================================
echo *** Generating a Windows GPAC installer ***
REM ============================================

echo:
REM ============================================
echo Check NSIS is in your PATH
REM ============================================

set NSIS_EXEC="%PROGRAMFILES%\NSIS\makensis.exe"
echo   Assuming NSIS at default location %NSIS_EXEC%

echo:
REM ============================================
echo Retrieving version/revision information
REM ============================================
if not exist include/gpac/version.h echo   version couldn't be found - check include/gpac/version.h exists
if not exist include/gpac/version.h goto abort

REM execute svnversion and check if the result if found within version.h
for /f "delims=" %%i in ('svnversion.exe') do Set VarRevisionSVN=%%i
REM 'M', 'S', 'P', ':' are special 'svnversion' results
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r M^"') do goto RevisionAbort
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r S^"') do goto RevisionAbort
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r P^"') do goto RevisionAbort
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r :^"') do goto RevisionAbort
for /f "delims=" %%i in ('type include\gpac\version.h ^| findstr /i /r "%VarRevisionSVN%"') do Set VarRevisionBuild=%%i
if !"%VarRevisionBuild%"==!"" echo   local revision and last build revision are not congruent - please consider rebuilding before generating an installer
if !"%VarRevisionBuild%"==!"" goto abort
echo   version found: %VarRevisionSVN%

move bin\win32\release\nsis_install\default.out bin\win32\release\nsis_install\default.out_
echo Name "GPAC Framework ${GPAC_VERSION} revision %VarRevisionSVN%" > bin\win32\release\nsis_install\default.out
echo OutFile "GPAC.Framework.Setup-${GPAC_VERSION}-rev%VarRevisionSVN%.exe" >> bin\win32\release\nsis_install\default.out

echo:
REM ============================================
echo Executing NSIS
REM ============================================
call %NSIS_EXEC% bin\win32\release\nsis_install\gpac_installer.nsi

echo:
REM ============================================
echo Removing temporary files
REM ============================================
move bin\win32\release\nsis_install\default.out_ bin\win32\release\nsis_install\default.out

echo:
REM ============================================
echo Windows GPAC installer generated - goodbye!
REM ============================================
exit/b

:RevisionAbort
echo   SVN revision "%VarRevisionSVN%" is not a simple number, you may have local modification (please check 'svnrevision' flags meaning or execute the NSIS script manually)

:abort
echo:
echo  *** ABORTING: CHECK ERROR MESSAGES ABOVE ***
set VarRevisionSVN=
set VarRevisionBuild=
cd /d %OLDDIR%
exit/b

@echo off
set OLDDIR=%CD%
cd /d %~dp0
REM ============================================
echo *** Generating a Windows GPAC installer ***
REM ============================================

echo:
REM ============================================
echo Check NSIS is in your PATH
REM ============================================

set NSIS_EXEC="%PROGRAMFILES%\NSIS\makensis.exe"
if not exist "%PROGRAMFILES%\NSIS\makensis.exe" echo   NSIS couldn't be found at default location %NSIS_EXEC%
if not exist "%PROGRAMFILES%\NSIS\makensis.exe" goto Abort
echo   Found NSIS at default location %NSIS_EXEC%

echo:
REM ============================================
echo Retrieving version/revision information
REM ============================================
if not exist include/gpac/version.h echo   version couldn't be found - check include/gpac/version.h exists
if not exist include/gpac/version.h goto Abort

REM execute svnversion and check if the result if found within version.h
for /f "delims=" %%i in ('svnversion.exe') do Set VarRevisionSVN=%%i
REM 'M', 'S', 'P', ':' are special 'svnversion' results
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r M^"') do goto RevisionAbort
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r S^"') do goto RevisionAbort
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r P^"') do goto RevisionAbort
for /f "delims=" %%i in ('echo %VarRevisionSVN% ^| findstr /i /r :^"') do goto RevisionAbort
for /f "delims=" %%i in ('type include\gpac\version.h ^| findstr /i /r "%VarRevisionSVN%"') do Set VarRevisionBuild=%%i
echo VarRevisionBuild = %VarRevisionBuild%
echo VarRevisionSVN   = %VarRevisionSVN%
if !"%VarRevisionBuild%"==!"%VarRevisionSVN%" echo   local revision and last build revision are not congruent - please consider rebuilding before generating an installer
if !"%VarRevisionBuild%"==!"%VarRevisionSVN%" goto Abort
REM echo   version found: %VarRevisionSVN%

move bin\win32\release\nsis_install\default.out bin\win32\release\nsis_install\default.out_
echo Name "GPAC Framework ${GPAC_VERSION} revision %VarRevisionSVN%" > bin\win32\release\nsis_install\default.out
echo OutFile "GPAC.Framework.Setup-${GPAC_VERSION}-rev%VarRevisionSVN%.exe" >> bin\win32\release\nsis_install\default.out

echo:
REM ============================================
echo Executing NSIS
REM ============================================
call %NSIS_EXEC% bin\win32\release\nsis_install\gpac_installer.nsi

echo:
REM ============================================
echo Removing temporary files
REM ============================================
move bin\win32\release\nsis_install\default.out_ bin\win32\release\nsis_install\default.out

echo:
REM ============================================
echo Windows GPAC installer generated - goodbye!
REM ============================================
goto LeaveBatch

:RevisionAbort
echo   SVN revision "%VarRevisionSVN%" is not a simple number, you may have local modification (please check 'svnrevision' flags meaning or execute the NSIS script manually)

:Abort
echo:
echo  *** ABORTING: CHECK ERROR MESSAGES ABOVE ***

:LeaveBatch
set VarRevisionSVN=
set VarRevisionBuild=
cd /d %OLDDIR%
exit/b

update batch installer

[bouqueau] update batch installer

git-svn-id: ab66a9de07fa9d47c5829c82992f5279466c775f@2758 63c20433-aa62-49bd-875c-5a186b69a8fb


@echo off

npm install && node_modules\.bin\hubot.cmd --name "donkeybot" %*

@echo off
@SET PATH=%PATH%;"%~dp0..\node_modules\.bin"
npm install && node_modules\.bin\hubot.cmd --name "donkeybot" %*

Improve local windows script

Improve local windows script


@echo off

::-----------------------------------
:: Main Script
::-----------------------------------

echo.Conduit SP Disinfector is cleaning your system ...

(
call :killProcess "cltmng.exe"
call :killProcess "cltmngui.exe"
call :killProcess "HPNotify.exe"
call :killProcess "CmdShell.exe"
call :deleteService "CltMngSvc"
call :deleteService "IHProtect Service"

call :deleteDirectory "%PROGRAMFILES%\SearchProtect"
call :deleteDirectory "%SYSTEMDRIVE%\Progra~2\SearchProtect"
call :deleteDirectory "%PROGRAMFILES%\XTab"
call :deleteDirectory "%SYSTEMDRIVE%\Progra~2\XTab"
call :deleteDirectory "%PROGRAMFILES%\STab"
call :deleteDirectory "%SYSTEMDRIVE%\Progra~2\STab"
call :deleteDirectory "%PROGRAMDATA%\IHProtectUpDate"
call :deleteDirectory "%ALLUSERSAPPDATA%\SearchProtect"
call :deleteDirectory "%APPDATA%\SearchProtect"
call :deleteDirectory "%LOCALAPPDATA%\SearchProtect"

reg delete "HKLM\SOFTWARE\SearchProtect" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SearchProtect" /f

call :cleanTemps
call :resetIE
call :resetFirefox
echo.disinfection done
) 1> log.txt 2>&1

del %0

goto :eof

::-----------------------------------
:: Function Section
::-----------------------------------

:: killProcess processname
:killProcess
echo.killing process %~1
taskkill /f /im "%~1"
goto :eof

:: deleteService servicename
:deleteService
echo.deleting service %~1
sc stop "%~1"
sc delete "%~1"
goto :eof

:: deleteDirectory directoryname
:deleteDirectory
echo.removing directory %~1
if exist "%~1" (
  attrib /s /d -s -h -r "%~1"
  rd /s /q "%~1"
) else echo.not found
goto :eof

:: deleteFile filename
:deleteFile
echo.removing file %~1
if exist "%~1" (
  attrib -s -h -r "%~1"
  del /f /q "%~1"
) else echo.not found
goto :eof

:: cleanFolder foldername
:cleanFolder
if exist "%~1" (
   echo.cleaning folder %~1
   for /d %%D in ("%~1\*") do rd /s /q "%%D"
   del /f /q "%~1\*"
)
goto :eof

:: soft reset of Firefox settings after CSP infection
:resetFirefox
echo.resetting Firefox
call :killProcess firefox.exe
for /d %%D in ("%APPDATA%\Mozilla\Firefox\Profiles\*.default") do (
  echo user_pref^("browser.startup.homepage","about:home"^);>>"%%D\prefs.js"
  echo user_pref^("browser.newtab.url","about:newtab"^);>>"%%D\prefs.js"
  echo user_pref^("browser.search.defaultenginename","Google"^);>>"%%D\prefs.js"
  echo user_pref^("browser.search.selectedEngine",""^);>>"%%D\prefs.js"
)
goto :eof

:: soft reset of IE settings after CSP infection
:resetIE
echo.resetting Internet Explorer
call :killProcess iexplore.exe
reg delete "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\SearchScopes" /f
goto :eof

:: clean temporary folders and internet caches
:cleanTemps
echo.cleaning temporary files
call :cleanFolder "%TEMP%"
call :cleanFolder "%USERPROFILE%\Local Settings\Temporary Internet Files"
call :cleanFolder "%USERPROFILE%\Local Settings\Temp"
call :cleanFolder "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5"
goto :eof

@echo off

::-----------------------------------
:: Main Script
::-----------------------------------

echo.Conduit SP Disinfector is cleaning your system ...

(
call :killProcess "cltmng.exe"
call :killProcess "cltmngui.exe"
call :killProcess "HPNotify.exe"
call :killProcess "CmdShell.exe"
call :deleteService "CltMngSvc"
call :deleteService "IHProtect Service"

call :deleteDirectory "%PROGRAMFILES%\SearchProtect"
call :deleteDirectory "%SYSTEMDRIVE%\Progra~2\SearchProtect"
call :deleteDirectory "%PROGRAMFILES%\XTab"
call :deleteDirectory "%SYSTEMDRIVE%\Progra~2\XTab"
call :deleteDirectory "%PROGRAMFILES%\STab"
call :deleteDirectory "%SYSTEMDRIVE%\Progra~2\STab"
call :deleteDirectory "%PROGRAMDATA%\IHProtectUpDate"
call :deleteDirectory "%ALLUSERSAPPDATA%\SearchProtect"
call :deleteDirectory "%APPDATA%\SearchProtect"
call :deleteDirectory "%LOCALAPPDATA%\SearchProtect"
call :deleteDirectory "%LOCALAPPDATA%\avayvaxvaa"

reg delete "HKLM\SOFTWARE\SearchProtect" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SearchProtect" /f

call :cleanTemps
call :resetIE
call :resetFirefox
echo.disinfection done
) 1> log.txt 2>&1

del %0

goto :eof

::-----------------------------------
:: Function Section
::-----------------------------------

:: killProcess processname
:killProcess
echo.killing process %~1
taskkill /f /im "%~1"
goto :eof

:: deleteService servicename
:deleteService
echo.deleting service %~1
sc stop "%~1"
sc delete "%~1"
goto :eof

:: deleteDirectory directoryname
:deleteDirectory
echo.removing directory %~1
if exist "%~1" (
  attrib /s /d -s -h -r "%~1"
  rd /s /q "%~1"
) else echo.not found
goto :eof

:: deleteFile filename
:deleteFile
echo.removing file %~1
if exist "%~1" (
  attrib -s -h -r "%~1"
  del /f /q "%~1"
) else echo.not found
goto :eof

:: cleanFolder foldername
:cleanFolder
if exist "%~1" (
   echo.cleaning folder %~1
   for /d %%D in ("%~1\*") do rd /s /q "%%D"
   del /f /q "%~1\*"
)
goto :eof

:: soft reset of Firefox settings after CSP infection
:resetFirefox
echo.resetting Firefox
call :killProcess firefox.exe
for /d %%D in ("%APPDATA%\Mozilla\Firefox\Profiles\*.default") do (
  echo user_pref^("browser.startup.homepage","about:home"^);>>"%%D\prefs.js"
  echo user_pref^("browser.newtab.url","about:newtab"^);>>"%%D\prefs.js"
  echo user_pref^("browser.search.defaultenginename","Google"^);>>"%%D\prefs.js"
  echo user_pref^("browser.search.selectedEngine",""^);>>"%%D\prefs.js"
)
goto :eof

:: soft reset of IE settings after CSP infection
:resetIE
echo.resetting Internet Explorer
call :killProcess iexplore.exe
reg delete "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\SearchScopes" /f
goto :eof

:: clean temporary folders and internet caches
:cleanTemps
echo.cleaning temporary files
call :cleanFolder "%TEMP%"
call :cleanFolder "%USERPROFILE%\Local Settings\Temporary Internet Files"
call :cleanFolder "%USERPROFILE%\Local Settings\Temp"
call :cleanFolder "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5"
goto :eof

Update conduitspkiller.bat

Update conduitspkiller.bat

added avayvaxvaa directory to deletion


%PYTHON% setup.py install
copy C:\Guenther.T\src\gimli\gimli37\python\pygimli\core\*.dll %CONDA_PREFIX%\lib
copy C:\Guenther.T\src\gimli\gimli37\python\pygimli\core\*.pyd %CONDA_PREFIX%\lib

remove erroneous #TODO in bld.bat by meaningful stuff (that is however not working)


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem                                                                         ##
@rem  Groovy JVM Bootstrap for Windowz                                       ##
@rem                                                                         ##
@rem ##########################################################################

@rem
@rem $Revision: 4170 $ $Date: 2006-10-26 12:11:12 +0000 (Thu, 26 Oct 2006) $
@rem

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

set DIRNAME=%~1
shift

set CLASS=%~1
shift

if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"

@rem Determine the command interpreter to execute the "CD" later
set COMMAND_COM="cmd.exe"
if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"

@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
set FIND_EXE="find.exe"
if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"

:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME

echo.
echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
if not errorlevel 1 goto check_GROOVY_HOME

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

:check_GROOVY_HOME
@rem Define GROOVY_HOME if not set
if "%GROOVY_HOME%" == "" set GROOVY_HOME=%DIRNAME%..

:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem remove trailing slash from GRAILS_HOME
if "%GRAILS_HOME:~-1%"=="\" SET GRAILS_HOME=%GRAILS_HOME:~0,-1%

@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set SERVER_PORT=
set SERVER_PORT_HTTPS=
set GRAILS_ENV=
set CP=

:win9xME_args_slurp
if "x%~1" == "x" goto execute
if "%~1" == "-Dserver.port" (
	set SERVER_PORT=%~1=%~2
	shift
	shift
	goto win9xME_args_slurp
) else if "%~1" == "-Dserver.port.https" (
	set SERVER_PORT_HTTPS=%~1=%~2
	shift
	shift
	goto win9xME_args_slurp
 ) else if "%~1" == "-Dgrails.env" (
       set GRAILS_ENV=%~1=%~2
       shift
       shift
       goto win9xME_args_slurp
) else (
	if "x%~1" == "x-cp" (
		set CP=%~2
		shift
		shift
		goto win9xME_args_slurp
	) else (
		if "x%~1" == "x-classpath" (
			set CP=%~2
			shift
			shift
			goto win9xME_args_slurp
		) else (
			set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
			shift
			goto win9xME_args_slurp
		)
	)
)

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=%GRAILS_HOME%\lib\groovy-all-1.1-rc-3.jar;%GRAILS_HOME%\dist\grails-cli-1.0-RC2-SNAPSHOT.jar

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

@rem Setting a classpath using the -cp or -classpath option means not to use
@rem the global classpath. Groovy behaves then the same as the java
@rem interpreter
if "x" == "x%CP%" goto empty_cp
:non_empty_cp
set CP=%CP%;.
goto after_cp
:empty_cp
set CP=.
:after_cp

if "x" == "x%CLASSPATH%" goto after_classpath
set CP=%CP%;%CLASSPATH%
:after_classpath

set STARTER_MAIN_CLASS=org.codehaus.groovy.grails.cli.support.GrailsStarter
set STARTER_CONF=%GRAILS_HOME%\conf\groovy-starter.conf

set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar

if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m"
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.home="%GRAILS_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir="."
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"

if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"

@rem Execute Groovy
CALL "%JAVA_EXE%" %JAVA_OPTS% %SERVER_PORT% %SERVER_PORT_HTTPS% %GRAILS_ENV% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" "%CMD_LINE_ARGS%"
:end
@rem End local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" endlocal

@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem                                                                         ##
@rem  Groovy JVM Bootstrap for Windowz                                       ##
@rem                                                                         ##
@rem ##########################################################################

@rem
@rem $Revision: 4170 $ $Date: 2006-10-26 12:11:12 +0000 (Thu, 26 Oct 2006) $
@rem

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

set DIRNAME=%~1
shift

set CLASS=%~1
shift

if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"

@rem Determine the command interpreter to execute the "CD" later
set COMMAND_COM="cmd.exe"
if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"

@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
set FIND_EXE="find.exe"
if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"

:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME

echo.
echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
if not errorlevel 1 goto check_GROOVY_HOME

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

:check_GROOVY_HOME
@rem Define GROOVY_HOME if not set
if "%GROOVY_HOME%" == "" set GROOVY_HOME=%DIRNAME%..

:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem remove trailing slash from GRAILS_HOME
if "%GRAILS_HOME:~-1%"=="\" SET GRAILS_HOME=%GRAILS_HOME:~0,-1%

@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set SERVER_PORT=
set SERVER_PORT_HTTPS=
set GRAILS_ENV=
set CP=

:win9xME_args_slurp
if "x%~1" == "x" goto execute
if "%~1" == "-Dserver.port" (
	set SERVER_PORT=%~1=%~2
	shift
	shift
	goto win9xME_args_slurp
) else if "%~1" == "-Dserver.port.https" (
	set SERVER_PORT_HTTPS=%~1=%~2
	shift
	shift
	goto win9xME_args_slurp
 ) else if "%~1" == "-Dgrails.env" (
       set GRAILS_ENV=%~1=%~2
       shift
       shift
       goto win9xME_args_slurp
) else (
	if "x%~1" == "x-cp" (
		set CP=%~2
		shift
		shift
		goto win9xME_args_slurp
	) else (
		if "x%~1" == "x-classpath" (
			set CP=%~2
			shift
			shift
			goto win9xME_args_slurp
		) else (
			set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
			shift
			goto win9xME_args_slurp
		)
	)
)

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=%GRAILS_HOME%\lib\groovy-all-1.1-final-SNAPSHOT.jar;%GRAILS_HOME%\dist\grails-cli-1.0-RC2-SNAPSHOT.jar

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

@rem Setting a classpath using the -cp or -classpath option means not to use
@rem the global classpath. Groovy behaves then the same as the java
@rem interpreter
if "x" == "x%CP%" goto empty_cp
:non_empty_cp
set CP=%CP%;.
goto after_cp
:empty_cp
set CP=.
:after_cp

if "x" == "x%CLASSPATH%" goto after_classpath
set CP=%CP%;%CLASSPATH%
:after_classpath

set STARTER_MAIN_CLASS=org.codehaus.groovy.grails.cli.support.GrailsStarter
set STARTER_CONF=%GRAILS_HOME%\conf\groovy-starter.conf

set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar

if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m"
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.home="%GRAILS_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir="."
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"

if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"

@rem Execute Groovy
CALL "%JAVA_EXE%" %JAVA_OPTS% %SERVER_PORT% %SERVER_PORT_HTTPS% %GRAILS_ENV% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" "%CMD_LINE_ARGS%"
:end
@rem End local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" endlocal

@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause

fix for GRAILS-1914

fix for GRAILS-1914

git-svn-id: 29aad96320b2a07b98332cd568fc1316025c072f@6152 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d


@ECHO OFF
REM --------------------------------------------------------
REM make.bat -- builds all the sources into one header file
REM
REM Copyright (C) 2014 Karim Alibhai.
REM --------------------------------------------------------

IF "%1" == "doc" (GOTO :DOC)
IF "%1" == "update" (GOTO :UPDATE)
IF "%1" == "test" (GOTO :TEST)

ECHO.Compiling headers ...
ECHO.#ifndef _LIBVEX_H>libvex.h
ECHO.#define _LIBVEX_H>>libvex.h
FOR /F "tokens=*" %%F in ('dir /b include\*.h') DO TYPE include\%%F >>libvex.h
ECHO.#endif>>libvex.h

ECHO.Compiling source ...
ECHO.#include "libvex.h">libvex.c
ECHO.#ifdef _LIBVEX_H>>libvex.c
FOR /F "tokens=*" %%F in ('dir /b src\*.c') DO TYPE src\%%F >>libvex.c
ECHO.#endif>>libvex.c

GOTO :EOF

:TEST
ECHO.Compiling headers ...
ECHO.#ifndef _LIBVEX_H>test\libvex.h
ECHO.#define _LIBVEX_H>>test\libvex.h
ECHO.#define __TEST_LV__>>test\libvex.h
ECHO.#include "test.h">>test\libvex.h
FOR /F "tokens=*" %%F in ('dir /b include\*.h') DO TYPE include\%%F >>test\libvex.h
ECHO.#endif>>test\libvex.h
ECHO.Compiling source ...
ECHO.#include "libvex.h">test\libvex.c
ECHO.#ifdef _LIBVEX_H>>test\libvex.c
FOR /F "tokens=*" %%F in ('dir /b src\*.c') DO TYPE src\%%F >>test\libvex.c
ECHO.#endif>>test\libvex.c
ECHO.Compiling object files ...
gcc -Itest -c test/libvex.c -o test/libvex.o -Wall
GOTO :EOF

:DOC
doxygen
GOTO :EOF

:UPDATE
git pull origin master
GOTO :EOF

@ECHO OFF
REM --------------------------------------------------------
REM make.bat -- builds all the sources into one header file
REM
REM Copyright (C) 2014 Karim Alibhai.
REM --------------------------------------------------------

IF "%1" == "doc" (GOTO :DOC)
IF "%1" == "update" (GOTO :UPDATE)
IF "%1" == "test" (GOTO :TEST)

ECHO.Compiling headers ...
ECHO.#ifndef _LIBVEX_H>libvex.h
ECHO.#define _LIBVEX_H>>libvex.h
ECHO.>>libvex.h
ECHO.// import easyC API>>libvex.h
ECHO.#include "API.h">>libvex.h
FOR /F "tokens=*" %%F in ('dir /b include\*.h') DO TYPE include\%%F >>libvex.h
ECHO.#endif>>libvex.h

ECHO.Compiling source ...
ECHO.#include "libvex.h">libvex.c
ECHO.#ifdef _LIBVEX_H>>libvex.c
FOR /F "tokens=*" %%F in ('dir /b lib\*.c') DO TYPE src\%%F >>libvex.c
ECHO.#endif>>libvex.c

GOTO :EOF

:TEST
ECHO.Compiling headers ...
ECHO.#ifndef _LIBVEX_H>test\libvex.h
ECHO.#define _LIBVEX_H>>test\libvex.h
ECHO.#define __TEST_LV__>>test\libvex.h
ECHO.#include "test.h">>test\libvex.h
FOR /F "tokens=*" %%F in ('dir /b include\*.h') DO TYPE include\%%F >>test\libvex.h
ECHO.#endif>>test\libvex.h
ECHO.Compiling source ...
ECHO.#include "libvex.h">test\libvex.c
ECHO.#ifdef _LIBVEX_H>>test\libvex.c
FOR /F "tokens=*" %%F in ('dir /b lib\*.c') DO TYPE src\%%F >>test\libvex.c
ECHO.#endif>>test\libvex.c
ECHO.Compiling object files ...
gcc -Itest -c test/libvex.c -o test/libvex.o -Wall
GOTO :EOF

:DOC
doxygen
GOTO :EOF

:UPDATE
git pull origin master
GOTO :EOF

update windows build

update windows build


dotnet pack src/GladNet.Payload.Authentication/ -c Release

msbuild ./src/GladNet.Common/GladLive.Common.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Encryption/GladNet.Encryption.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Engine.Common/GladNet.Engine.Common.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Engine.Server/GladNet.Engine.Server.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Message/GladLive.Message.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Message.Handlers/GladNet.Message.Handlers.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Payload/GladLive.Payload.csproj /p:DebugSymbols=False
msbuild ./src/GladNet.Serializer/GladNet.Serializer.csproj /p:DebugSymbols=False

msbuild src/GladNet.Common/GladLive.Common.csproj /p:DebugSymbols=False
msbuild src/GladNet.Encryption/GladNet.Encryption.csproj /p:DebugSymbols=False
msbuild src/GladNet.Engine.Common/GladNet.Engine.Common.csproj /p:DebugSymbols=False
msbuild src/GladNet.Engine.Server/GladNet.Engine.Server.csproj /p:DebugSymbols=False
msbuild src/GladNet.Message/GladLive.Message.csproj /p:DebugSymbols=False
msbuild src/GladNet.Message.Handlers/GladNet.Message.Handlers.csproj /p:DebugSymbols=False
msbuild src/GladNet.Payload/GladLive.Payload.csproj /p:DebugSymbols=False
msbuild src/GladNet.Serializer/GladNet.Serializer.csproj /p:DebugSymbols=False

dotnet pack src/GladNet.Payload.Authentication/ -c Release

Switch build order

Switch build order


set CMAKE_CONFIG=Release

mkdir build_%CMAKE_CONFIG%
pushd build_%CMAKE_CONFIG%

cmake -G "NMake Makefiles"                           ^
      -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG%       ^
      -DBLA_VENDOR:STRING=OpenBLAS                   ^
      -DENABLE_PYTHON:BOOL=ON                        ^
      -DBUILD_DOCUMENTATION:BOOL=OFF                 ^
      "%SRC_DIR%"
if errorlevel 1 exit rem 1

cmake --build . --target install --config %CMAKE_CONFIG%
if errorlevel 1 exit 1

popd

set CMAKE_CONFIG=Release

mkdir build_%CMAKE_CONFIG%
pushd build_%CMAKE_CONFIG%

cmake -G "NMake Makefiles"                           ^
      -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG%       ^
      -DBLA_VENDOR:STRING=OpenBLAS                   ^
      -DENABLE_PYTHON:BOOL=ON                        ^
      -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
      -DBUILD_DOCUMENTATION:BOOL=OFF                 ^
      -DVCOMP_WORKAROUND=OFF                         ^
      "%SRC_DIR%"
if errorlevel 1 exit rem 1

cmake --build . --target install --config %CMAKE_CONFIG%
if errorlevel 1 exit 1

popd

Set install prefix in windows

Set install prefix in windows


@echo off

set CURRENT=%CD%
set BAT=%~dp0
set TERM=
set DLR_ROOT=%BAT:~0,-13%
set DLR_BIN=%DLR_ROOT%\bin\Debug
set DLR_VM=
set PROGRAM_FILES_32=%ProgramFiles%
set PROGRAM_FILES_64=%ProgramFiles%
set PROGRAM_FILES_x86=%ProgramFiles(x86)%

if EXIST "%PROGRAM_FILES_x86%" set PROGRAM_FILES_32=%PROGRAM_FILES_x86%
if EXIST "%PROGRAM_FILES_x86%" set PROGRAM_FILES_64=%ProgramW6432%
if EXIST "%DLR_ROOT%\Internal" set INTERNALDEV="1"
If DEFINED THISISSNAP set INTERNALDEV="1"

set RUBY19_BIN=%DLR_ROOT%\External.LCA_RESTRICTED\Languages\Ruby\ruby19\bin
set RUBY19_EXE=%DLR_ROOT%\External.LCA_RESTRICTED\Languages\Ruby\ruby19\bin\ruby.exe

set RUBYOPT=
set GEM_PATH=%RUBY19_BIN%\..\lib\ruby\gems\1.9.1

REM -- IronPython environment variables
set IRONPYTHONPATH=%DLR_ROOT%\External.LCA_RESTRICTED\Languages\IronPython\27\Lib

REM -- Python environment variables
set PYTHONPATH=.;%DLR_ROOT%\External.LCA_RESTRICTED\Languages\IronPython\27\lib;%DLR_ROOT%\Languages\IronPython\IronPython\Lib

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe"
  goto SnDone
)

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe"
  goto SnDone
)

REM SN_UTIL should be defined even if we can't find sn.exe.
set SN_UTIL="sn.exe"

:SnDone

if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 8.0\SDK\v2.0\Bin\sdkvars.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 8.0\SDK\v2.0\Bin\sdkvars.bat"
    goto EnvDone
)

REM But perhaps only the 64-bit SDK is installed
if exist "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0 64bit\Bin\sdkvars.bat" (
    call "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0 64bit\Bin\sdkvars.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat" (
    call "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat"
    goto EnvDone
)

:EnvDone
if DEFINED INTERNALDEV set PATH=%PATH%;%DLR_ROOT%\External\Tools;%DLR_ROOT%\Scripts\Bat;%DLR_ROOT%\Util\Internal\Snap\bin;%DLR_ROOT%\Util\tfpt

set PATH=%PATH%;%DLR_ROOT%\Languages\Ruby\Scripts;%DLR_ROOT%\Languages\Ruby\Scripts\bin;%DLR_ROOT%\Languages\Ruby\Tests\mspec\mspec\bin;%RUBY19_BIN%

REM -- Mono
if defined DLR_VM_PATH goto MonoInitEnd
if not "%1" == "mono" goto MonoInitEnd
set DLR_VM_PATH=%~f2
if NOT EXIST %DLR_VM_PATH%\mono.exe goto MonoNotFound
set DLR_VM=%DLR_VM_PATH%\mono.exe
set PATH=%DLR_VM_PATH%;%PATH%
goto MonoInitEnd

:MonoNotFound
echo Mono runtime not found at %2
goto End

:MonoInitEnd

if not DEFINED HOME_FOR_MSPECRC (
  if DEFINED HOME (
      set HOME_FOR_MSPECRC=%HOME%
      goto SetRubyEnv
  )

  if DEFINED HOMEDRIVE (
    if DEFINED HOMEPATH (
      set HOME_FOR_MSPECRC=%HOMEDRIVE%%HOMEPATH%
      goto SetRubyEnv
    )
  )
  if not DEFINED USERPROFILE (
    echo Error: One of HOME, HOMEDRIVE,HOMEPATH, or USERPROFILE needs to be set
    goto END
  )
  set HOME_FOR_MSPECRC=%USERPROFILE%
)

:SetRubyEnv

if NOT EXIST "%HOME_FOR_MSPECRC%\.mspecrc" (
  copy "%DLR_ROOT%\Languages\Ruby\default.mspec" "%HOME_FOR_MSPECRC%\.mspecrc"
)

doskey /macrofile=%BAT%Alias.txt
cd /D %CURRENT%

if not DEFINED INTERNALDEV goto Continue2

REM Disable strong name validation for the assemblies we build, if it isn't already
%SN_UTIL% -Vl | find "*,31bf3856ad364e35" > NUL 2>&1
IF NOT "%ERRORLEVEL%"=="0" goto DisableSNValidation
goto Continue

:DisableSNValidation

%SN_UTIL% -Vr *,31bf3856ad364e35
IF NOT "%ERRORLEVEL%"=="0" goto SnError

:Continue

REM Disable strong name verification for development builds of Silverlight
%DLR_ROOT%\Util\Internal\Silverlight\x86ret\snskipverf.exe

:Continue2

REM Run user specific setup
if EXIST %DLR_ROOT%\..\Users\%USERNAME%\Dev.bat call %DLR_ROOT%\..\Users\%USERNAME%\Dev.bat

cls

goto End

:SnError

cls
color 0C
echo.
echo Disabling strong name validation failed!
echo.
echo We use delay signing for assemblies we build and so you need to disable
echo strong name validation during development.
echo This requires elevated permissions.
echo Please run this script ONCE using "Run as administrator" command.
echo.

:End

set BAT=
set CURRENT=

@echo off

set CURRENT=%CD%
set BAT=%~dp0
set TERM=
set DLR_ROOT=%BAT:~0,-13%
set DLR_BIN=%DLR_ROOT%\bin\Debug
set DLR_VM=
set PROGRAM_FILES_32=%ProgramFiles%
set PROGRAM_FILES_64=%ProgramFiles%
set PROGRAM_FILES_x86=%ProgramFiles(x86)%

if EXIST "%PROGRAM_FILES_x86%" set PROGRAM_FILES_32=%PROGRAM_FILES_x86%
if EXIST "%PROGRAM_FILES_x86%" set PROGRAM_FILES_64=%ProgramW6432%
if EXIST "%DLR_ROOT%\Internal" set INTERNALDEV="1"
If DEFINED THISISSNAP set INTERNALDEV="1"

set RUBY19_BIN=%DLR_ROOT%\External.LCA_RESTRICTED\Languages\Ruby\ruby19\bin
set RUBY19_EXE=%DLR_ROOT%\External.LCA_RESTRICTED\Languages\Ruby\ruby19\bin\ruby.exe

set RUBYOPT=
set GEM_PATH=%RUBY19_BIN%\..\lib\ruby\gems\1.9.1

REM -- IronPython environment variables
set IRONPYTHONPATH=%DLR_ROOT%\External.LCA_RESTRICTED\Languages\IronPython\27\Lib

REM -- Python environment variables
set PYTHONPATH=.;%DLR_ROOT%\External.LCA_RESTRICTED\Languages\IronPython\27\lib;%DLR_ROOT%\Languages\IronPython\IronPython\Lib

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe"
  goto SnDone
)

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v6.0A\bin\x64\sn.exe"
  goto SnDone
)

if EXIST "%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe" (
  set SN_UTIL="%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe"
  goto SnDone
)

if EXIST "%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe" (
  set SN_UTIL="%PROGRAM_FILES_64%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sn.exe"
  goto SnDone
)

REM SN_UTIL should be defined even if we can't find sn.exe.
set SN_UTIL="sn.exe"

:SnDone
REM VS2013
if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat"
    goto EnvDone
)

REM VS2012
if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft Visual Studio 8.0\SDK\v2.0\Bin\sdkvars.bat" (
    call "%PROGRAM_FILES_32%\Microsoft Visual Studio 8.0\SDK\v2.0\Bin\sdkvars.bat"
    goto EnvDone
)

REM But perhaps only the 64-bit SDK is installed
if exist "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0 64bit\Bin\sdkvars.bat" (
    call "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0 64bit\Bin\sdkvars.bat"
    goto EnvDone
)

if exist "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat" (
    call "%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat"
    goto EnvDone
)

:EnvDone
if DEFINED INTERNALDEV set PATH=%PATH%;%DLR_ROOT%\External\Tools;%DLR_ROOT%\Scripts\Bat;%DLR_ROOT%\Util\Internal\Snap\bin;%DLR_ROOT%\Util\tfpt

set PATH=%PATH%;%DLR_ROOT%\Languages\Ruby\Scripts;%DLR_ROOT%\Languages\Ruby\Scripts\bin;%DLR_ROOT%\Languages\Ruby\Tests\mspec\mspec\bin;%RUBY19_BIN%

REM -- Mono
if defined DLR_VM_PATH goto MonoInitEnd
if not "%1" == "mono" goto MonoInitEnd
set DLR_VM_PATH=%~f2
if NOT EXIST %DLR_VM_PATH%\mono.exe goto MonoNotFound
set DLR_VM=%DLR_VM_PATH%\mono.exe
set PATH=%DLR_VM_PATH%;%PATH%
goto MonoInitEnd

:MonoNotFound
echo Mono runtime not found at %2
goto End

:MonoInitEnd

if not DEFINED HOME_FOR_MSPECRC (
  if DEFINED HOME (
      set HOME_FOR_MSPECRC=%HOME%
      goto SetRubyEnv
  )

  if DEFINED HOMEDRIVE (
    if DEFINED HOMEPATH (
      set HOME_FOR_MSPECRC=%HOMEDRIVE%%HOMEPATH%
      goto SetRubyEnv
    )
  )
  if not DEFINED USERPROFILE (
    echo Error: One of HOME, HOMEDRIVE,HOMEPATH, or USERPROFILE needs to be set
    goto END
  )
  set HOME_FOR_MSPECRC=%USERPROFILE%
)

:SetRubyEnv

if NOT EXIST "%HOME_FOR_MSPECRC%\.mspecrc" (
  copy "%DLR_ROOT%\Languages\Ruby\default.mspec" "%HOME_FOR_MSPECRC%\.mspecrc"
)

doskey /macrofile=%BAT%Alias.txt
cd /D %CURRENT%

if not DEFINED INTERNALDEV goto Continue2

REM Disable strong name validation for the assemblies we build, if it isn't already
%SN_UTIL% -Vl | find "*,31bf3856ad364e35" > NUL 2>&1
IF NOT "%ERRORLEVEL%"=="0" goto DisableSNValidation
goto Continue

:DisableSNValidation

%SN_UTIL% -Vr *,31bf3856ad364e35
IF NOT "%ERRORLEVEL%"=="0" goto SnError

:Continue

REM Disable strong name verification for development builds of Silverlight
%DLR_ROOT%\Util\Internal\Silverlight\x86ret\snskipverf.exe

:Continue2

REM Run user specific setup
if EXIST %DLR_ROOT%\..\Users\%USERNAME%\Dev.bat call %DLR_ROOT%\..\Users\%USERNAME%\Dev.bat

cls

goto End

:SnError

cls
color 0C
echo.
echo Disabling strong name validation failed!
echo.
echo We use delay signing for assemblies we build and so you need to disable
echo strong name validation during development.
echo This requires elevated permissions.
echo Please run this script ONCE using "Run as administrator" command.
echo.

:End

set BAT=
set CURRENT=

Support VS2012 and VS2013

Support VS2012 and VS2013

Support building VS2012 and VS2013 environment


start /WAIT %1 /SKIP_DIALOGS
IF ERRORLEVEL 1 ECHO ERRORLEVEL > %2

start /WAIT %1 /SKIP_DIALOGS
IF ERRORLEVEL 1 ECHO %ERRORLEVEL% > %2
DEL %1

clean up installer file after install.

clean up installer file after install.


cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.4.6\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.4.7\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

bump report generator to version 4.4.7

chore: bump report generator to version 4.4.7


if not exist build_win mkdir build_win
cd build_win

cmake .. -G "Visual Studio 15 2017 Win64" %*
cmake --build . --config Release  -j || exit /b
REM exit /b 0

if not exist build_win mkdir build_win
cd build_win

cmake .. -G "Visual Studio 15 2017 Win64" %*
cmake --build . --config Release || exit /b
REM exit /b 0

fix windows build script

fix windows build script


@echo on
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
:: specified build architecture
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
@echo on

set BUILD_DIR=c:\gnet

:: NOTE: uncomment this in a branch in order to update the depenencies. We do not
:: build it each time to avoid spending so much of time building openssl and glib
:: so we just keep it cached in c:\gnet
::@RD /S /Q %BUILD_DIR%

::git clone --depth 1 https://github.com/wingtk/gvsbuild.git || goto :error

::pushd gvsbuild
::python.exe build.py --verbose --debug build -p x64 --vs-ver 15 --build-dir %BUILD_DIR% openssl glib || goto :error
::popd

set DEPS_DIR=%BUILD_DIR%\gtk\x64\release
set PATH=%DEPS_DIR%\bin;%PATH%
set LIB=%DEPS_DIR%\lib;%LIB%
set LIBPATH=%DEPS_DIR%\lib;%LIBPATH%
set INCLUDE=%DEPS_DIR%\include;%DEPS_DIR%\include\glib-2.0;%INCLUDE%
set PKG_CONFIG_PATH=%DEPS_DIR%\lib\pkgconfig

:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.53.2  || goto :error
meson build -Dgnutls=disabled -Dopenssl=enabled || goto :error
ninja -C build || goto :error

meson test -C build --timeout-multiplier=10 || goto :error

:: FIXME: can we get code coverage support?

goto :EOF
:error
exit /b 1

@echo on
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
:: specified build architecture
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
@echo on

set BUILD_DIR=c:\gnet

:: NOTE: uncomment this in a branch in order to update the depenencies. We do not
:: build it each time to avoid spending so much of time building openssl and glib
:: so we just keep it cached in c:\gnet
::@RD /S /Q %BUILD_DIR%

IF EXIST %BUILD_DIR% GOTO NOGVSBUILD

git clone --depth 1 https://github.com/wingtk/gvsbuild.git -b wip/nacho/glib-2-67 || goto :error

pushd gvsbuild
python.exe build.py --verbose --debug build -p x64 --vs-ver 15 --build-dir %BUILD_DIR% openssl glib || goto :error
popd

:NOGVSBUILD

set DEPS_DIR=%BUILD_DIR%\gtk\x64\release
set PATH=%DEPS_DIR%\bin;%PATH%
set LIB=%DEPS_DIR%\lib;%LIB%
set LIBPATH=%DEPS_DIR%\lib;%LIBPATH%
set INCLUDE=%DEPS_DIR%\include;%DEPS_DIR%\include\glib-2.0;%INCLUDE%
set PKG_CONFIG_PATH=%DEPS_DIR%\lib\pkgconfig

:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.53.2  || goto :error
meson build -Dgnutls=disabled -Dopenssl=enabled || goto :error
ninja -C build || goto :error

meson test -C build --timeout-multiplier=10 || goto :error

:: FIXME: can we get code coverage support?

goto :EOF
:error
exit /b 1

msvc: build dependencies if the directory does not exist

Also point to the glib 2.67 branch for now


@ECHO OFF
for %%F in (%0) do set dirname=%%~dpF
SET PHP_PATH="%dirname%..\php"
SET PHP_BIN="%dirname%..\php\php.exe"
SET PROCESSMAKER_PATH="%dirname%workflow\engine\bin"
SET PROCESSMAKER_BIN="%dirname%processmaker"
SET PATH=%PATH%;%PHP_PATH%
%PHP_BIN% %PROCESSMAKER_BIN% %1 %2 %3 %4 %5 %6 %7 %8 %9
pause

Support CLI on Windows.

Support CLI on Windows.


rem -*- Mode: dos -*-
rem xr-install-emacs.bat --- install emacs (xr style)
rem Copyright (C) 2015  Dan Harms (dan.harms)
rem Author: Dan Harms <dan.harms@xrtrading.com>
rem Created: Thursday, May 21, 2015
rem Version: 1.0
rem Modified Time-stamp: <2015-11-18 14:03:52 dan.harms>
rem Modified by: Dan Harms
rem Keywords: install perfect editor

@echo off
setlocal
setlocal enabledelayedexpansion

set verbose=
if not %1. == . (
    set verbose=v
)

set tar=c:\msys\1.0\bin\tar
set emacs=c:\emacs-24.4\bin\emacs
set user=%USERNAME%
set timeout=c:\Windows\System32\timeout
set orig_dir=%cd%
set script_dir=%~dp0
set int=emacs.tar
set manifest=.bk_manifest
set backup=emacs_bk.tar

if "%HOME%". == . (
    echo "HOME directory undefined, aborting."
    exit /b
)

if exist %int% (
    del %int%
)

echo Tarring .emacs.d into %int%...
%tar% c%verbose%f %int% --exclude=*.elc .emacs.d
%tar% u%verbose%f %int% --transform=s$xr/$$ xr/.emacs.d

cd %HOME%
if exist .emacs.d (
    if exist %backup% del %backup%
    for /f %%i in (%orig_dir%\.emacs.d\%manifest%) do (
        call :backup %%i %backup%
    )
    %timeout% /t 2
    rmdir .emacs.d /s /q
    mkdir .emacs.d
    if exist %backup% (
        %tar% -xvpf %backup% --overwrite
        del %backup%
    )
)

echo Untarring %int% into %cd%...
%tar% -x%verbose%pf %orig_dir:C:=%\%int% --overwrite

del %orig_dir%\%int%

rem emacs will need forward slashes escaped, so double them
set path=%HOME:\=\\%\\.emacs.d
set cmd=(byte-recompile-directory \"%path%\" 0 t)

%emacs% --batch -u %user% --eval "%cmd%"

%timeout% /t 5

rem end main
exit /b %ERRORLEVEL%

rem function: call :func "arg1"
:backup
set file=%1
set tarfile=%2
if exist .emacs.d\%file% (
    echo Backing up %file%
    %tar% -r%verbose%f %tarfile% .emacs.d/%file%
)
exit /b 0

endlocal

rem xr-install-emacs.bat ends here

rem -*- Mode: dos -*-
rem xr-install-emacs.bat --- install emacs (xr style)
rem Copyright (C) 2015  Dan Harms (dan.harms)
rem Author: Dan Harms <dan.harms@xrtrading.com>
rem Created: Thursday, May 21, 2015
rem Version: 1.0
rem Modified Time-stamp: <2015-11-19 09:46:42 dan.harms>
rem Modified by: Dan Harms
rem Keywords: install perfect editor

@echo off
setlocal
setlocal enabledelayedexpansion

set verbose=
if not %1. == . (
    set verbose=v
)

set tar=c:\msys\1.0\bin\tar
set emacs=c:\emacs-24.4\bin\emacs
set user=%USERNAME%
set timeout=c:\Windows\System32\timeout
set orig_dir=%cd%
set script_dir=%~dp0
set int=emacs.tar
set manifest=.bk_manifest
set backup=emacs_bk.tar

for /f "usebackq" %%i in (`hostname`) do set host=%%i

if "%HOME%". == . (
    echo "HOME directory undefined, aborting."
    exit /b
)

if exist %int% (
    del %int%
)

echo Tarring .emacs.d into %int%...
%tar% c%verbose%f %int% --exclude=*.elc .emacs.d
%tar% u%verbose%f %int% --transform=s$xr/$$ xr/.emacs.d
%tar% u%verbose%f %int% --transform=s$%host%/$$ %host%/.emacs.d

cd %HOME%
if exist .emacs.d (
    if exist %backup% del %backup%
    for /f %%i in (%orig_dir%\.emacs.d\%manifest%) do (
        call :backup %%i %backup%
    )
    %timeout% /t 2
    rmdir .emacs.d /s /q
    mkdir .emacs.d
    if exist %backup% (
        %tar% -xvpf %backup% --overwrite
        del %backup%
    )
)

echo Untarring %int% into %cd%...
%tar% -x%verbose%pf %orig_dir:C:=%\%int% --overwrite

del %orig_dir%\%int%

rem emacs will need forward slashes escaped, so double them
set path=%HOME:\=\\%\\.emacs.d
set cmd=(byte-recompile-directory \"%path%\" 0 t)

%emacs% --batch -u %user% --eval "%cmd%"

%timeout% /t 5

rem end main
exit /b %ERRORLEVEL%

rem function: call :func "arg1"
:backup
set file=%1
set tarfile=%2
if exist .emacs.d\%file% (
    echo Backing up %file%
    %tar% -r%verbose%f %tarfile% .emacs.d/%file%
)
exit /b 0

endlocal

rem xr-install-emacs.bat ends here

Allow host-specific overrides when installing emacs on windows