echo off
rem
rem Copyright (C) 2004,2005  Internet Systems Consortium, Inc. ("ISC")
rem Copyright (C) 2001-2002  Internet Software Consortium.
rem
rem Permission to use, copy, modify, and distribute this software for any
rem purpose with or without fee is hereby granted, provided that the above
rem copyright notice and this permission notice appear in all copies.
rem
rem THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
rem REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
rem AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
rem INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
rem LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
rem OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
rem PERFORMANCE OF THIS SOFTWARE.

rem BuildSetup.bat
rem This script sets up the files necessary ready to build BIND 9.
rem This requires perl to be installed on the system.

rem Set up the configuration file
cd ..
copy config.h.win32 config.h
cd win32utils

rem Get and update for the latest build of the openssl and libxml libraries
perl updateopenssl.pl
perl updatelibxml2.pl

rem Generate the version information
perl makeversion.pl

rem Generate header files for lib/dns

call dnsheadergen.bat

rem Make sure that the Build directories are there.

if NOT Exist ..\Build mkdir ..\Build
if NOT Exist ..\Build\Release mkdir ..\Build\Release
if NOT Exist ..\Build\Debug mkdir ..\Build\Debug

echo Copying the ARM and the Installation Notes.

copy ..\COPYRIGHT ..\Build\Release
copy ..\README ..\Build\Release
copy readme1st.txt ..\Build\Release
copy index.html ..\Build\Release
copy ..\doc\arm\*.html ..\Build\Release
copy ..\doc\arm\Bv9ARM.pdf ..\Build\Release
copy ..\CHANGES ..\Build\Release
copy ..\FAQ ..\Build\Release

echo Copying the standalone manual pages.

copy ..\bin\named\named.html ..\Build\Release
copy ..\bin\rndc\*.html ..\Build\Release
copy ..\bin\confgen\*.html ..\Build\Release
copy ..\bin\dig\*.html ..\Build\Release
copy ..\bin\nsupdate\*.html ..\Build\Release
copy ..\bin\check\*.html ..\Build\Release
copy ..\bin\dnssec\dnssec-keygen.html ..\Build\Release
copy ..\bin\dnssec\dnssec-signzone.html ..\Build\Release
copy ..\bin\dnssec\dnssec-dsfromkey.html ..\Build\Release
copy ..\bin\dnssec\dnssec-keyfromlabel.html ..\Build\Release
copy ..\bin\pkcs11\pkcs11-keygen.html ..\Build\Release
copy ..\bin\pkcs11\pkcs11-list.html ..\Build\Release
copy ..\bin\pkcs11\pkcs11-destroy.html ..\Build\Release

echo Copying the migration notes.

copy ..\doc\misc\migration ..\Build\Release
copy ..\doc\misc\migration-4to9 ..\Build\Release

call SetupLibs.bat

rem
rem set vcredist here so that it is correctly expanded in the if body
rem
set vcredist=BootStrapper\Packages\vcredist_x86\vcredist_x86.exe

if Defined FrameworkSDKDir (

rem
rem vcredist_x86.exe path relative to FrameworkSDKDir
rem
if Exist "%FrameworkSDKDir%\%vcredist%" (

echo Copying Visual C x86 Redistributable Installer

rem
rem Use /Y so we allways have the current version of the installer.
rem

copy /Y "%FrameworkSDKDir%\%vcredist%" ..\Build\Release\
copy /Y "%FrameworkSDKDir%\%vcredist%" ..\Build\Debug\

) else (
	echo "**** %FrameworkSDKDir%\%vcredist% not found ****"
)
) else (
	echo "**** Warning FrameworkSDKDir not defined ****"
	echo "****         Run vsvars32.bat            ****"
)

echo Running Message Compiler

cd ..\lib\win32\bindevt
mc bindevt.mc
cd ..\..\..\win32utils

rem Done

echo off
rem
rem Copyright (C) 2004,2005  Internet Systems Consortium, Inc. ("ISC")
rem Copyright (C) 2001-2002  Internet Software Consortium.
rem
rem Permission to use, copy, modify, and distribute this software for any
rem purpose with or without fee is hereby granted, provided that the above
rem copyright notice and this permission notice appear in all copies.
rem
rem THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
rem REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
rem AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
rem INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
rem LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
rem OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
rem PERFORMANCE OF THIS SOFTWARE.

rem BuildSetup.bat
rem This script sets up the files necessary ready to build BIND 9.
rem This requires perl to be installed on the system.

rem Set up the configuration file
cd ..
copy config.h.win32 config.h
cd win32utils

rem Get and update for the latest build of the openssl and libxml libraries
perl updateopenssl.pl
perl updatelibxml2.pl

rem Generate the version information
perl makeversion.pl

rem Generate header files for lib/dns

call dnsheadergen.bat

rem Make sure that the Build directories are there.

if NOT Exist ..\Build mkdir ..\Build
if NOT Exist ..\Build\Release mkdir ..\Build\Release
if NOT Exist ..\Build\Debug mkdir ..\Build\Debug

echo Copying the ARM and the Installation Notes.

copy ..\COPYRIGHT ..\Build\Release
copy ..\README ..\Build\Release
copy ..\HISTORY ..\Build\Release
copy readme1st.txt ..\Build\Release
copy index.html ..\Build\Release
copy ..\doc\arm\*.html ..\Build\Release
copy ..\doc\arm\Bv9ARM.pdf ..\Build\Release
copy ..\CHANGES ..\Build\Release
copy ..\FAQ ..\Build\Release

echo Copying the standalone manual pages.

copy ..\bin\named\named.html ..\Build\Release
copy ..\bin\rndc\*.html ..\Build\Release
copy ..\bin\confgen\*.html ..\Build\Release
copy ..\bin\dig\*.html ..\Build\Release
copy ..\bin\nsupdate\*.html ..\Build\Release
copy ..\bin\check\*.html ..\Build\Release
copy ..\bin\dnssec\dnssec-keygen.html ..\Build\Release
copy ..\bin\dnssec\dnssec-signzone.html ..\Build\Release
copy ..\bin\dnssec\dnssec-dsfromkey.html ..\Build\Release
copy ..\bin\dnssec\dnssec-keyfromlabel.html ..\Build\Release
copy ..\bin\pkcs11\pkcs11-keygen.html ..\Build\Release
copy ..\bin\pkcs11\pkcs11-list.html ..\Build\Release
copy ..\bin\pkcs11\pkcs11-destroy.html ..\Build\Release

echo Copying the migration notes.

copy ..\doc\misc\migration ..\Build\Release
copy ..\doc\misc\migration-4to9 ..\Build\Release

call SetupLibs.bat

rem
rem set vcredist here so that it is correctly expanded in the if body
rem
set vcredist=BootStrapper\Packages\vcredist_x86\vcredist_x86.exe

if Defined FrameworkSDKDir (

rem
rem vcredist_x86.exe path relative to FrameworkSDKDir
rem
if Exist "%FrameworkSDKDir%\%vcredist%" (

echo Copying Visual C x86 Redistributable Installer

rem
rem Use /Y so we allways have the current version of the installer.
rem

copy /Y "%FrameworkSDKDir%\%vcredist%" ..\Build\Release\
copy /Y "%FrameworkSDKDir%\%vcredist%" ..\Build\Debug\

) else (
	echo "**** %FrameworkSDKDir%\%vcredist% not found ****"
)
) else (
	echo "**** Warning FrameworkSDKDir not defined ****"
	echo "****         Run vsvars32.bat            ****"
)

echo Running Message Compiler

cd ..\lib\win32\bindevt
mc bindevt.mc
cd ..\..\..\win32utils

rem Done

copy HISTORY into the windows zip

copy HISTORY into the windows zip


@echo off
setlocal
set DOTNET_SCRIPT_PATH=
for %%x in (com exe bat cmd) do if exist "%~dp0dotnet-script.%%x" set DOTNET_SCRIPT_PATH=%~dp0dotnet-script.%%x
if not defined DOTNET_SCRIPT_PATH for %%i in (dotnet-script.exe) do set DOTNET_SCRIPT_PATH=%%~$PATH:i
if not defined DOTNET_SCRIPT_PATH call :no-dotnet-script
set LINQPADLESS=__LINQPADLESS__
call "%DOTNET_SCRIPT_PATH%" "%~dpn0.csx" -- %*
goto :EOF

:no-dotnet-script
>&2 echo dotnet does not appear to be installed, which is needed to run this
>&2 echo script. For instructions on how to download and install, visit:
>&2 echo https://github.com/filipw/dotnet-script
exit /b 1

@echo off
setlocal
set DOTNET_SCRIPT_PATH=
for %%x in (com exe bat cmd) do if exist "%~dp0dotnet-script.%%x" set DOTNET_SCRIPT_PATH=%~dp0dotnet-script.%%x
if not defined DOTNET_SCRIPT_PATH for %%i in (dotnet-script.exe) do set DOTNET_SCRIPT_PATH=%%~$PATH:i
if not defined DOTNET_SCRIPT_PATH call :no-dotnet-script
set LINQPADLESS=__LINQPADLESS__
call "%DOTNET_SCRIPT_PATH%" "%~dpn0.csx" -- %*
goto :EOF

:no-dotnet-script
>&2 echo dotnet-script does not appear to be installed, which is needed to
>&2 echo run this script. For instructions on how to download and install,
>&2 echo visit: https://github.com/filipw/dotnet-script
exit /b 1

Fix dotnet-script name in error message

Fix dotnet-script name in error message


@echo OFF
setlocal ENABLEDELAYEDEXPANSION
IF [%1]==[]  GOTO :USAGE

set MKREPO_PATH=%1
SET MKREPO_PATH=%MKREPO_PATH:/=\%
REM Check if its fully qualified.
echo %MKREPO_PATH% | findstr /b ^\\\\ >nul
IF ERRORLEVEL 1 (
 echo ERROR: "%MKREPO_PATH%" is not a fully qualified UNC share name.
 exit /b 1
)

REM FIX up path separators
SET MKREPO_NIX_PATH=%MKREPO_PATH:\=/%
ECHO Going to initialize a git repo in %MKREPO_PATH%

:INITIALIZE_REPO
If EXIST %MKREPO_PATH% ( echo Directory %MKREPO_PATH% already exists.
GOTO :END
)

git init --bare %MKREPO_NIX_PATH%
if NOT ERRORLEVEL 1 (
    echo -------- CREATED REMOTE REPO -----------
	GOTO :END
	)
exit /b 1
:USAGE
echo makeremoterepo.cmd {UNC SHARE}
exit /b 1

:END
endlocal&SET MKREPO_PATH=%MKREPO_NIX_PATH%

@echo OFF
setlocal ENABLEDELAYEDEXPANSION
IF [%1]==[]  GOTO :USAGE

set MKREPO_PATH=%1
SET MKREPO_PATH=%MKREPO_PATH:/=\%
REM Check if its fully qualified.
echo %MKREPO_PATH% | findstr /b ^\\\\ >nul
IF ERRORLEVEL 1 (
 echo ERROR: "%MKREPO_PATH%" is not a fully qualified UNC share name.
 exit /b 1
)

REM FIX up path separators
SET MKREPO_NIX_PATH=%MKREPO_PATH:\=/%
ECHO Going to initialize a git repo in %MKREPO_PATH%

:INITIALIZE_REPO
If EXIST %MKREPO_PATH% ( echo Directory %MKREPO_PATH% already exists.
pushd %MKREPO_PATH%
git rev-parse
IF ERRORLEVEL 1 exit /b 1
popd
GOTO :END
)

git init --bare %MKREPO_NIX_PATH%
if NOT ERRORLEVEL 1 (
    echo -------- CREATED REMOTE REPO -----------
	GOTO :END
	)
exit /b 1
:USAGE
echo makeremoterepo.cmd {UNC SHARE}
exit /b 1

:END
endlocal&SET MKREPO_PATH=%MKREPO_NIX_PATH%

Validate if the folder passed in is a git repo and terminate if not.


set CACHE=C:\cache
set CYGWIN_MIRROR="http://cygwin.mirror.constant.com"
set CYGWIN_ADDITIONAL_REPO="http://www.dronecode.org.uk/cygwin/"
set CYGWIN_ADDITIONAL_REPO_KEY="http://www.dronecode.org.uk/cygwin/dronecode.gpg"

if _%arch%_ == _x64_ set SETUP=setup-x86_64.exe && set CYGWIN_ROOT=C:\cygwin64
if _%arch%_ == _x86_ set SETUP=setup-x86.exe && set CYGWIN_ROOT=C:\cygwin

if not exist %CACHE% mkdir %CACHE%

echo Updating Cygwin and installing ninja and test prerequisites
%CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -s "%CYGWIN_ADDITIONAL_REPO%" -K "%CYGWIN_ADDITIONAL_REPO_KEY%" -l "%CACHE%" -g -P "ninja,gcc-objc,gcc-objc++,libglib2.0-devel,zlib-devel,python3-pip"
echo Install done

set CACHE=C:\cache
set CYGWIN_MIRROR="http://cygwin.mirror.constant.com"

if _%arch%_ == _x64_ set SETUP=setup-x86_64.exe && set CYGWIN_ROOT=C:\cygwin64
if _%arch%_ == _x86_ set SETUP=setup-x86.exe && set CYGWIN_ROOT=C:\cygwin

if not exist %CACHE% mkdir %CACHE%

echo Updating Cygwin and installing ninja and test prerequisites
%CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -l "%CACHE%" -g -P "ninja,gcc-objc,gcc-objc++,libglib2.0-devel,zlib-devel,python3-pip"
echo Install done

Revert "Add an additional Cygwin package repo with patched ninja"

This reverts commit 92c2bb75195c054dcdeae09f7d42393856a91748.

This is no longer needed, as a patched ninja is now available from the
standard Cygwin package repository, and prevents me from accidentally
breaking CI when changing things in my personal package repository.


set version=31.0.0-pre1
NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version%
NuGet pack CefSharp.Wpf.nuspec -NoPackageAnalysis -Version %version%
rem NuGet pack CefSharp.WinForms.nuspec -NoPackageAnalysis -Version %version%

set version=33.0.0-pre0
NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version%
NuGet pack CefSharp.Wpf.nuspec -NoPackageAnalysis -Version %version%
rem NuGet pack CefSharp.WinForms.nuspec -NoPackageAnalysis -Version %version%

bump package version

bump package version


set SOURCE_DIR=%CD%
set BUILD_DIR="../build-sqlitewrapper"
set CMAKE_COMMAND=cmake.exe
set MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe /J 2

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"

python projectfiles_unchanged.py
if %ERRORLEVEL% NEQ 0 (
  RMDIR /S /Q "%BUILD_DIR%"
)

if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
cd "%BUILD_DIR%" || goto error
%CMAKE_COMMAND% -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" "%SOURCE_DIR%" || goto error
%MAKE_COMMAND% || goto error

cd "%SOURCE_DIR%"
exit /b 0

:error
cd "%SOURCE_DIR%"
exit /b 1

set SOURCE_DIR=%CD%
set BUILD_DIR=../build-sqlitewrapper
set CMAKE_COMMAND=cmake.exe
set MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe /J 2

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"

python projectfiles_unchanged.py
if %ERRORLEVEL% NEQ 0 (
  RMDIR /S /Q "%BUILD_DIR%"
)

if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
cd "%BUILD_DIR%" || goto error
%CMAKE_COMMAND% -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" "%SOURCE_DIR%" || goto error
%MAKE_COMMAND% || goto error

cd "%SOURCE_DIR%"
exit /b 0

:error
cd "%SOURCE_DIR%"
exit /b 1

Remove quotes from path variable definition


@ echo off
@ echo Salt Windows Build Script
@ echo.

:: Define Variables
@ echo Defining Variables...
@ echo ---------------------
Set "CurrDir=%cd%"
Set "BinDir=%cd%\buildenv\bin"
Set "InsDir=%cd%\installer"
Set "PyDir=C:\Python27"

:: Find the NSIS Installer
If Exist "C:\Program Files\NSIS\" (
    Set NSIS="C:\Program Files\NSIS\"
) Else (
    Set NSIS="C:\Program Files (x86)\NSIS\"
)
Set "PATH=%NSIS%;%PATH%"
@ echo.

@ echo Copying C:\Python27 to bin...
@ echo -----------------------------
:: Check for existing bin directory and remove
If Exist "%BinDir%\" rd /S /Q "%BinDir%"

:: Copy the Python27 directory to bin
@echo xcopy /S /E "%PyDir%" "%BinDir%\"
xcopy /S /E "%PyDir%" "%BinDir%\"
@ echo.

:: Remove the fixed path in .exe files
@echo Removing fixed path from .exe files
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"

@ echo Cleaning up unused files and directories...
@ echo -------------------------------------------
:: Remove all Compiled Python files (.pyc)
del /S /Q "%BinDir%\*.pyc"
:: Remove all Compiled HTML Help (.chm)
del /S /Q "%BinDir%\*.chm"

:: Delete Unused Docs and Modules
If Exist "%BinDir%\Doc"           rd /S /Q "%BinDir%\Doc"
If Exist "%BinDir%\share"         rd /S /Q "%BinDir%\share"
If Exist "%BinDir%\tcl"           rd /S /Q "%BinDir%\tcl"
If Exist "%BinDir%\Lib\idlelib"   rd /S /Q "%BinDir%\Lib\idlelib"
If Exist "%BinDir%\Lib\lib-tk"    rd /S /Q "%BinDir%\Lib\lib-tk"
If Exist "%BinDir%\Lib\test"      rd /S /Q "%BinDir%\Lib\test"
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"

:: Delete Unused .dll files
If Exist "%BinDir%\DLLs\tcl85.dll"    del /S /Q "%BinDir%\DLLs\tcl85.dll"
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll"
If Exist "%BinDir%\DLLs\tk85.dll"     del /S /Q "%BinDir%\DLLs\tk85.dll"

:: Delete Unused .lib files
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib"

:: Delete .txt files
If Exist "%BinDir%\NEWS.txt"   del /q "%BinDir%\NEWS.txt"
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt"
@ echo.

@ echo Building the installer...
@ echo -------------------------
makensis.exe "%InsDir%\Salt-Minion-Setup.nsi"
@ echo.

@ echo.
@ echo ===================
@ echo Script completed...
@ echo -------------------
@ echo Installation file can be found in the following directory:
@ echo %InsDir%
pause
cls

@ echo off
@ echo Salt Windows Build Script
@ echo.

:: Define Variables
@ echo Defining Variables...
@ echo ---------------------
Set "CurrDir=%cd%"
Set "BinDir=%cd%\buildenv\bin"
Set "InsDir=%cd%\installer"
Set "PyDir=C:\Python27"
Set "Version=%1"

:: Find the NSIS Installer
If Exist "C:\Program Files\NSIS\" (
    Set NSIS="C:\Program Files\NSIS\"
) Else (
    Set NSIS="C:\Program Files (x86)\NSIS\"
)
Set "PATH=%NSIS%;%PATH%"
@ echo.

@ echo Copying C:\Python27 to bin...
@ echo -----------------------------
:: Check for existing bin directory and remove
If Exist "%BinDir%\" rd /S /Q "%BinDir%"

:: Copy the Python27 directory to bin
@echo xcopy /S /E "%PyDir%" "%BinDir%\"
xcopy /S /E "%PyDir%" "%BinDir%\"
@ echo.

:: Remove the fixed path in .exe files
@echo Removing fixed path from .exe files
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"

@ echo Cleaning up unused files and directories...
@ echo -------------------------------------------
:: Remove all Compiled Python files (.pyc)
del /S /Q "%BinDir%\*.pyc"
:: Remove all Compiled HTML Help (.chm)
del /S /Q "%BinDir%\*.chm"

:: Delete Unused Docs and Modules
If Exist "%BinDir%\Doc"           rd /S /Q "%BinDir%\Doc"
If Exist "%BinDir%\share"         rd /S /Q "%BinDir%\share"
If Exist "%BinDir%\tcl"           rd /S /Q "%BinDir%\tcl"
If Exist "%BinDir%\Lib\idlelib"   rd /S /Q "%BinDir%\Lib\idlelib"
If Exist "%BinDir%\Lib\lib-tk"    rd /S /Q "%BinDir%\Lib\lib-tk"
If Exist "%BinDir%\Lib\test"      rd /S /Q "%BinDir%\Lib\test"
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"

:: Delete Unused .dll files
If Exist "%BinDir%\DLLs\tcl85.dll"    del /S /Q "%BinDir%\DLLs\tcl85.dll"
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll"
If Exist "%BinDir%\DLLs\tk85.dll"     del /S /Q "%BinDir%\DLLs\tk85.dll"

:: Delete Unused .lib files
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib"

:: Delete .txt files
If Exist "%BinDir%\NEWS.txt"   del /q "%BinDir%\NEWS.txt"
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt"
@ echo.

@ echo Building the installer...
@ echo -------------------------
makensis.exe "%InsDir%\Salt-Minion-Setup.nsi"
@ echo.

@ echo.
@ echo ===================
@ echo Script completed...
@ echo -------------------
@ echo Installation file can be found in the following directory:
@ echo %InsDir%
pause
cls

Update BuildSalt.bat

Update BuildSalt.bat


echo Creating Release Packages and deploying to %1
xcopy .\include %1\include /e /i /h /y
xcopy .\external_libraries\BWAPI\bwapi\include %1\include /e /i /h /y
xcopy .\external_libraries\BWAPI\bwapi\lib %1\lib /e /i /h /y
xcopy .\external_libraries\BWTAlib_2.2\include %1\include /e /i /h /y
xcopy .\external_libraries\BWTAlib_2.2\lib %1\lib /e /i /h /y
xcopy .\lib\*.lib %1\lib /e /i /h /y

Add release packaging script

Add release packaging script


java -version  >> out.txt

echo 00
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.91.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.91.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.91.jar >> out.txt

echo 01
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.91.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.91.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.91.jar >> out.txt

echo 02
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.91.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.91.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.91.jar >> out.txt

echo 03
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.91.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.91.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.91.jar >> out.txt

echo 04
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.91.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.91.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.91.jar >> out.txt

echo 05
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.91.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.91.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.91.jar >> out.txt

SHUTDOWN -s -t 01

java -version  >> out.txt

echo 00
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.93.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.93.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.93.jar >> out.txt

echo 01
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.93.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.93.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.93.jar >> out.txt

echo 02
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.93.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.93.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.93.jar >> out.txt

echo 03
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.93.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.93.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.93.jar >> out.txt

echo 04
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.93.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.93.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.93.jar >> out.txt

echo 05
java -jar ..\hibernate\target\benchmark.hibernate.pojo-0.93.jar >> out.txt
java -jar ..\hibernate-ujo\target\benchmark.hibernate.ujo-0.93.jar >> out.txt
java -jar ..\ujo-orm\target\benchmark.ujorm-0.93.jar >> out.txt

SHUTDOWN -s -t 01

Change of the benchmark script.

Change of the benchmark script.


@echo off
echo Pulling latest changes for this repository...
echo.
git pull
echo.
echo Pulling the latest changes for all submodules:
echo.
git submodule init
git submodule foreach git pull origin master
echo.
echo  Submodule Status
echo  ================
echo.
git submodule status
echo.
pause

add update.bat [skip ci] 1. git pull 2. update submodules 3. show submodule status / hashes


call dnvm use 1.0.0-rc1-update1 -r clr
IF ERRORLEVEL 1 EXIT /B 1
call dnu restore
IF ERRORLEVEL 1 EXIT /B 1
call dnu build src\Google.Api.Gax
IF ERRORLEVEL 1 EXIT /B 1
call dnu build src\Google.Api.Gax.Rest
IF ERRORLEVEL 1 EXIT /B 1
call dnu build test\Google.Api.Gax.Tests
IF ERRORLEVEL 1 EXIT /B 1
call dnu build test\Google.Api.Gax.Rest.Tests
IF ERRORLEVEL 1 EXIT /B 1
call dnx -p test\Google.Api.Gax.Tests test
IF ERRORLEVEL 1 EXIT /B 1
call dnx -p test\Google.Api.Gax.Rest.Tests test
IF ERRORLEVEL 1 EXIT /B 1
call dnu pack src\Google.Api.Gax
IF ERRORLEVEL 1 EXIT /B 1
call dnu pack src\Google.Api.Gax.Rest
IF ERRORLEVEL 1 EXIT /B 1

call dnvm use 1.0.0-rc1-update1 -r clr
IF ERRORLEVEL 1 EXIT /B 1
call dnu restore
IF ERRORLEVEL 1 EXIT /B 1
call dnu build src\Google.Api.Gax
IF ERRORLEVEL 1 EXIT /B 1
call dnu build src\Google.Api.Gax.Rest
IF ERRORLEVEL 1 EXIT /B 1
call dnu build testing\Google.Api.Gax.Testing
IF ERRORLEVEL 1 EXIT /B 1
call dnu build test\Google.Api.Gax.Tests
IF ERRORLEVEL 1 EXIT /B 1
call dnu build test\Google.Api.Gax.Rest.Tests
IF ERRORLEVEL 1 EXIT /B 1
call dnx -p test\Google.Api.Gax.Tests test
IF ERRORLEVEL 1 EXIT /B 1
call dnx -p test\Google.Api.Gax.Rest.Tests test
IF ERRORLEVEL 1 EXIT /B 1
call dnu pack src\Google.Api.Gax
IF ERRORLEVEL 1 EXIT /B 1
call dnu pack src\Google.Api.Gax.Rest
IF ERRORLEVEL 1 EXIT /B 1
call dnu pack testing\Google.Api.Gax.Testing
IF ERRORLEVEL 1 EXIT /B 1

Create Google.Api.Gax.Testing package in myget (#51)


@echo off
color 1e
rem Start of variables setup...
set islogedin="no"
rem not used yet set path=%~dp0/path;%path%
set actualdir=%userprofile%
rem End of variables setup...
echo Presiona cualquier tecla para iniciar la consola "Io"...
title "Io console V 0.4"
pause > nul
echo ##############################
echo #                            #
echo #      Io console V 0.1      #
echo #                            #
echo ##############################
:init
set command=none
set /p command="%actualdir%>"
call :%command%
cls
echo "%command%" is not a command!
pause
goto init
:none
goto init
:cls
cls
echo ##############################
echo #                            #
echo #      Io console V 0.1      #
echo #                            #
echo ##############################
goto init
:help
echo This is the Io's console help.
echo Bla bla bla...
goto init
:other
set /p nativecmd="Type the native windows console you want:"
%nativecmd%
goto init
:cmd
echo ##############################
echo #                            #
echo #      Io console V 0.1      #
echo #                            #
echo ##############################
goto init
:login
set /p user="Enter your username:"
set /p pass="Enter your password:"
set /p usr= < user.txt
set /p pas= < pass.txt
if "%usr%"=="%user%" (
if "%pas%"=="%pass%" (
echo "Login Correct."
set islogedin="yes"
goto init
) else (
echo "Login Incorrect."
set islogedin="no"
goto init
)
) else (
echo "Login Incorrect."
set islogedin="no"
goto init
)
:shell
if %islogedin%=="yes" (
if "%usr%"="" goto init
if "%shellinput%"=="quit" (
goto init
)
%shellinput%
set shellinput="winlogon"
set /p shellinput="%usr%@localhost:%actualdir%>"
goto shell
) else ( echo "You must login first."
pause )
goto init
pause > nul

Create main.bat

Create main.bat


@echo off
::go build option
set TiDBBuildTS=%date:~0,10% %time:~1,7%
for /f "delims=" %%i in ('git rev-parse HEAD') do (set TiDBGitHash=%%i)
set LDFLAGS="-X github.com/pingcap/tidb/util/printer.TiDBBuildTS=%TiDBBuildTS% -X github.com/pingcap/tidb/util/printer.TiDBGitHash=%TiDBGitHash%"

:: godep
go get github.com/tools/godep

@echo [Parser]
go get github.com/qiuyesuifeng/goyacc
go get github.com/qiuyesuifeng/golex
type nul >>temp.XXXXXX & copy temp.XXXXXX +,,
goyacc -o nul -xegen "temp.XXXXXX" parser/parser.y
goyacc -o parser/parser.go -xe "temp.XXXXXX" parser/parser.y
DEL /F /A /Q temp.XXXXXX
DEL /F /A /Q y.output

golex -o parser/scanner.go parser/scanner.l

@echo [Ast-Parser]
go get github.com/qiuyesuifeng/goyacc
go get github.com/qiuyesuifeng/golex
type nul >>temp.XXXXXX & copy temp.XXXXXX +,,
goyacc -o nul -xegen "temp.XXXXXX" parser/parser.y
goyacc -o ast/parser/parser.go -xe "temp.XXXXXX" ast/parser/parser.y
DEL /F /A /Q temp.XXXXXX
DEL /F /A /Q y.output

golex -o ast/parser/scanner.go ast/parser/scanner.l

@echo [Build]
godep go build -ldflags '%LDFLAGS%'

@echo [Install]
godep go install ./...

@echo [Test]
godep go test -cover ./...

::done
@echo [Done]

@echo off
::go build option
set TiDBBuildTS=%date:~0,10% %time:~1,7%
for /f "delims=" %%i in ('git rev-parse HEAD') do (set TiDBGitHash=%%i)
set LDFLAGS="-X github.com/pingcap/tidb/util/printer.TiDBBuildTS=%TiDBBuildTS% -X github.com/pingcap/tidb/util/printer.TiDBGitHash=%TiDBGitHash%"

:: godep
go get github.com/tools/godep

@echo [Parser]
go get github.com/qiuyesuifeng/goyacc
go get github.com/qiuyesuifeng/golex
type nul >>temp.XXXXXX
goyacc -o nul -xegen "temp.XXXXXX" parser/parser.y
goyacc -o parser/parser.go -xe "temp.XXXXXX" parser/parser.y
DEL /F /A /Q temp.XXXXXX
DEL /F /A /Q y.output

golex -o parser/scanner.go parser/scanner.l

@echo [Ast-Parser]
go get github.com/qiuyesuifeng/goyacc
go get github.com/qiuyesuifeng/golex
type nul >>temp.XXXXXX
goyacc -o nul -xegen "temp.XXXXXX" parser/parser.y
goyacc -o ast/parser/parser.go -xe "temp.XXXXXX" ast/parser/parser.y
DEL /F /A /Q temp.XXXXXX
DEL /F /A /Q y.output

golex -o ast/parser/scanner.go ast/parser/scanner.l

@echo [Build]
godep go build -ldflags '%LDFLAGS%'

@echo [Install]
godep go install ./...

@echo [Test]
godep go test -cover ./...

::done
@echo [Done]

clean make.cmd, no need to copy

clean make.cmd, no need to copy


:: This script is used to
:: 1. setup python .venv with requirements installed
:: 2. run all development tasks within that .venv
@echo off
setlocal
chcp 65001 >nul
pushd %~dp0

if /i "%1" == "init" goto INIT
if /i "%1" == "docs" goto DOCS
if /i "%1" == "deploy-docs" goto DEPLOY-DOCS
if /i "%1" == "serve" goto SERVE
if /i "%1" == "lint" goto LINT
if /i "%1" == "release" goto RELEASE
if /i "%1" == "branch" goto BRANCH
goto :usage

:INIT
    if not exist .venv python -m venv .venv
    call :venv
    call python -m pip install --upgrade pip
    call pip install --upgrade -r docs\requirements.txt
    call pip install --upgrade -r tests\requirements.txt
    goto :eof

:DOCS
    call :venv
    mkdocs build
    goto :eof

:DEPLOY-DOCS
    call :venv
    mkdocs gh-deploy
    goto :eof

:SERVE
    call :venv
    call explorer http://localhost:8000
    mkdocs serve
    goto :eof

:LINT
    call :venv
    black .
    flake8
    goto :eof

:BRANCH
    if "%2"== "" goto :usage
    git checkout -b %2
    goto :eof

:RELEASE
    if "%2"== "" goto :usage
    if not exist "messages/release-%2.md" (
        echo Missing release-%2.md
        exit /b 1
    )
    git checkout st3176 && git merge %2 --no-ff
    if not errorlevel 0 (
        echo Unable to merge %2 into st3176!
        exit /b 1
    )
    git checkout master && git merge %2 --no-ff
    if not errorlevel 0 (
        echo Unable to merge %2 into master!
        exit /b 1
    )
    echo Hit any key to push branches!
    pause
    call git push origin st3176
    if not errorlevel 0 (
        echo Failed to push st3176!
        exit /b 1
    )
    call git push origin master
    if not errorlevel 0 (
        echo Failed to push master!
        exit /b 1
    )
    echo Hit any key to publish release!
    pause
    : create release for ST3
    gh release create --target st3176 -t "MarkdownEditing %2 (ST3176+)" -F "messages/release-%2.md" "3176-%2"
    : create release for ST3
    gh release create --target master -t "MarkdownEditing %2 (ST4107+)" -F "messages/release-%2.md" "4107-%2"
    git fetch
    goto :eof

:VENV
    call .venv\scripts\activate.bat
    if "%VIRTUAL_ENV%" neq ".venv" exit /b 1
    goto :eof

:USAGE
    echo USAGE:
    echo.
    echo   make ^[init^|docs^|gh-pages^|serve^|lint^|branch^|release^]
    echo.
    echo   init          -- setup .venv and install requirements.
    echo   docs          -- build documentation
    echo   deploy-docs   -- build documentation and publish on Github Pages
    echo   serve         -- build documentation and serve via development server
    echo   lint          -- run black, flake8 and pytest
    echo   branch 3.0.0  -- prepare version branch
    echo   release 3.0.0 -- make a release
    goto :eof

:: This script is used to
:: 1. setup python .venv with requirements installed
:: 2. run all development tasks within that .venv
@echo off
setlocal
chcp 65001 >nul
pushd %~dp0

if /i "%1" == "init" goto INIT
if /i "%1" == "docs" goto DOCS
if /i "%1" == "deploy-docs" goto DEPLOY-DOCS
if /i "%1" == "serve" goto SERVE
if /i "%1" == "lint" goto LINT
if /i "%1" == "release" goto RELEASE
if /i "%1" == "branch" goto BRANCH
goto :usage

:INIT
    if not exist .venv python -m venv .venv
    call :venv
    call python -m pip install --upgrade pip
    call pip install --upgrade -r docs\requirements.txt
    call pip install --upgrade -r tests\requirements.txt
    goto :eof

:DOCS
    call :venv
    mkdocs build
    goto :eof

:DEPLOY-DOCS
    call :venv
    mkdocs gh-deploy
    goto :eof

:SERVE
    call :venv
    call explorer http://localhost:8000
    mkdocs serve
    goto :eof

:LINT
    call :venv
    black .
    flake8
    goto :eof

:BRANCH
    if "%2"== "" goto :usage
    git checkout -b %2
    goto :eof

:RELEASE
    if "%2"== "" goto :usage
    if not exist "messages/release-%2.md" (
        echo Missing release-%2.md
        exit /b 1
    )
    git checkout st3176 --autostash && git merge st3-develop --no-ff
    if not errorlevel 0 (
        echo Unable to merge st3-develop into st3176!
        exit /b 1
    )
    git checkout master --autostash && git merge st4-develop --no-ff
    if not errorlevel 0 (
        echo Unable to merge st4-develop into master!
        exit /b 1
    )
    echo Hit any key to push branches!
    pause
    call git push origin st3176
    if not errorlevel 0 (
        echo Failed to push st3176!
        exit /b 1
    )
    call git push origin master
    if not errorlevel 0 (
        echo Failed to push master!
        exit /b 1
    )
    echo Hit any key to publish release!
    pause
    : create release for ST3
    gh release create --target st3176 -t "MarkdownEditing %2 (ST3176+)" -F "messages/release-%2.md" "3176-%2"
    : create release for ST3
    gh release create --target master -t "MarkdownEditing %2 (ST4107+)" -F "messages/release-%2.md" "4107-%2"
    git fetch
    goto :eof

:VENV
    call .venv\scripts\activate.bat
    if "%VIRTUAL_ENV%" neq ".venv" exit /b 1
    goto :eof

:USAGE
    echo USAGE:
    echo.
    echo   make ^[init^|docs^|gh-pages^|serve^|lint^|branch^|release^]
    echo.
    echo   init          -- setup .venv and install requirements.
    echo   docs          -- build documentation
    echo   deploy-docs   -- build documentation and publish on Github Pages
    echo   serve         -- build documentation and serve via development server
    echo   lint          -- run black, flake8 and pytest
    echo   branch 3.0.0  -- prepare version branch
    echo   release 3.0.0 -- make a release
    goto :eof

Update make script

Update make script


.nuget\NuGet.exe restore
msbuild src\FsSql.sln

.nuget\NuGet.exe restore
msbuild FsSql.sln

Fix build.bat

Fix build.bat


@echo off
setlocal

:: Check prerequisites
if not "%VisualStudioVersion%" == "14.0" (
    echo Error: build.cmd should be run from a Visual Studio 2015 Command Prompt.
    echo        Please see https://github.com/Microsoft/msbuild/wiki/Building-Testing-and-Debugging for build instructions.
    exit /b 1
)

:: Check for a custom MSBuild path. If not defined, default to the one in your path.
if not defined MSBUILDCUSTOMPATH (
    set MSBUILDCUSTOMPATH=MSBuild.exe
)

set NUGETEXEPATH="%~dp0packages\NuGet.exe"

if not exist "%~dp0packages" mkdir "%~dp0packages"
if not exist "%NUGETEXEPATH%" (
    :: This will need to be fixed for non-windows
    echo ** Downloading NuGet.exe from https://dist.nuget.org/win-x86-commandline/v3.2.0-rc/nuget.exe...
    echo PS^> Invoke-WebRequest -OutFile %NUGETEXEPATH% "https://dist.nuget.org/win-x86-commandline/v3.2.0-rc/nuget.exe"
    powershell -Command "Invoke-WebRequest -OutFile %NUGETEXEPATH% "https://dist.nuget.org/win-x86-commandline/v3.2.0-rc/nuget.exe""
)

echo Restoring NuGet packages
:: Global packages (targets files needed to load projects, things needed everywhere)
"%NUGETEXEPATH%" restore -ConfigFile "%~dp0src\.nuget\NuGet.Config" "%~dp0src\.nuget\packages.config"
:: Packages referenced by individual projects
"%NUGETEXEPATH%" restore "%~dp0src\MSBuild.sln"

echo ** MSBuild Path: %MSBUILDCUSTOMPATH%
echo ** Building all sources

:: Call MSBuild
echo ** "%MSBUILDCUSTOMPATH%" "%~dp0build.proj" /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log" %*
"%MSBUILDCUSTOMPATH%" "%~dp0build.proj" /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log" %*
set BUILDERRORLEVEL=%ERRORLEVEL%
echo.

:: Pull the build summary from the log file
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%~dp0msbuild.log"
echo ** Build completed. Exit code: %BUILDERRORLEVEL%

exit /b %BUILDERRORLEVEL%

@echo off
setlocal

:: Check prerequisites
if not "%VisualStudioVersion%" == "14.0" (
    echo Error: build.cmd should be run from a Visual Studio 2015 Command Prompt.
    echo        Please see https://github.com/Microsoft/msbuild/wiki/Building-Testing-and-Debugging for build instructions.
    exit /b 1
)

:: Check for a custom MSBuild path. If not defined, default to the one in your path.
if not defined MSBUILDCUSTOMPATH (
    set MSBUILDCUSTOMPATH=MSBuild.exe
)

echo ** MSBuild Path: %MSBUILDCUSTOMPATH%
echo ** Building all sources

:: Call MSBuild
echo ** "%MSBUILDCUSTOMPATH%" "%~dp0build.proj" /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log" %*
"%MSBUILDCUSTOMPATH%" "%~dp0build.proj" /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log" %*
set BUILDERRORLEVEL=%ERRORLEVEL%
echo.

:: Pull the build summary from the log file
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%~dp0msbuild.log"
echo ** Build completed. Exit code: %BUILDERRORLEVEL%

exit /b %BUILDERRORLEVEL%

Remove NuGet download from build.cmd

Remove NuGet download from build.cmd


call dotnet restore src/Es.Logging
call dotnet restore src/Es.Logging.Console
call dotnet restore src/Es.Logging.Log4
call dotnet restore src/Es.Logging.NLog

call dotnet pack --configuration release src/Es.Logging  -o artifacts
call dotnet pack --configuration release src/Es.Logging.Console  -o artifacts
call dotnet pack --configuration release src/Es.Logging.Log4  -o artifacts
call dotnet pack --configuration release src/Es.Logging.NLog  -o artifacts

if exist %~dp0artifacts  rd /q /s %~dp0artifacts

call dotnet restore src/Es.Logging
call dotnet restore src/Es.Logging.Console
call dotnet restore src/Es.Logging.Log4
call dotnet restore src/Es.Logging.NLog

call dotnet build -f netstandard1.6 -c Release src/Es.Logging -o artifacts/netstandard1.6
call dotnet build -f netstandard1.6 -c Release src/Es.Logging.Console -o artifacts/netstandard1.6
call dotnet build -f netstandard1.6 -c Release src/Es.Logging.Log4 -o artifacts/netstandard1.6
call dotnet build -f netstandard1.6 -c Release src/Es.Logging.NLog -o artifacts/netstandard1.6

call dotnet build -f net45 -c Release src/Es.Logging -o artifacts/net45
call dotnet build -f net45 -c Release src/Es.Logging.Console -o artifacts/net45
call dotnet build -f net45 -c Release src/Es.Logging.Log4 -o artifacts/net45
call dotnet build -f net45 -c Release src/Es.Logging.NLog -o artifacts/net45

call dotnet pack --configuration release src/Es.Logging  -o artifacts
call dotnet pack --configuration release src/Es.Logging.Console  -o artifacts
call dotnet pack --configuration release src/Es.Logging.Log4  -o artifacts
call dotnet pack --configuration release src/Es.Logging.NLog  -o artifacts

add build script

add build script


:: the windows shell, so amazing

:: options
@echo Off
cd %~dp0
setlocal

:: set tool versions
set NUGET_VERSION=4.6.2
set CSI_VERSION=2.8.0

:: determine nuget cache dir
set NUGET_CACHE_DIR=%LocalAppData%\.nuget\v%NUGET_VERSION%
set NUGET_LOCAL_DIR=.nuget\v%NUGET_VERSION%

:: download nuget to cache dir
set NUGET_URL=https://dist.nuget.org/win-x86-commandline/v%NUGET_VERSION%/NuGet.exe
if not exist %NUGET_CACHE_DIR%\NuGet.exe (
  if not exist %NUGET_CACHE_DIR% mkdir %NUGET_CACHE_DIR%
  echo Downloading '%NUGET_URL%'' to '%NUGET_CACHE_DIR%\NuGet.exe'...
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest '%NUGET_URL%' -OutFile '%NUGET_CACHE_DIR%\NuGet.exe'"
)

:: copy nuget locally
if not exist %NUGET_LOCAL_DIR%\NuGet.exe (
  if not exist %NUGET_LOCAL_DIR% mkdir %NUGET_LOCAL_DIR%
  copy %NUGET_CACHE_DIR%\NuGet.exe %NUGET_LOCAL_DIR%\NuGet.exe > nul || goto :error
)

:: restore packages for build script
echo Restoring NuGet packages for build script...
%NUGET_LOCAL_DIR%\NuGet.exe restore .\packages.config -PackagesDirectory ./packages || goto :error

:: run build script
echo Running build script...
.\packages\Microsoft.Net.Compilers.%CSI_VERSION%\tools\csi.exe .\build.csx %* || goto :error

:: exit
goto :EOF
:error
exit /b %errorlevel%

@echo Off
cd %~dp0
setlocal EnableDelayedExpansion

:: set tool versions
set NUGET_VERSION=4.6.2
set CSI_VERSION=2.8.0

:: determine nuget cache dir
set NUGET_CACHE_DIR=%LocalAppData%\.nuget\v%NUGET_VERSION%
set NUGET_LOCAL_DIR=.nuget\v%NUGET_VERSION%

:: download nuget to cache dir
set NUGET_URL=https://dist.nuget.org/win-x86-commandline/v%NUGET_VERSION%/NuGet.exe
if not exist %NUGET_CACHE_DIR%\NuGet.exe (
  if not exist %NUGET_CACHE_DIR% mkdir %NUGET_CACHE_DIR%
  echo Downloading '%NUGET_URL%'' to '%NUGET_CACHE_DIR%\NuGet.exe'...
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest '%NUGET_URL%' -OutFile '%NUGET_CACHE_DIR%\NuGet.exe'"
)

:: copy nuget locally
if not exist %NUGET_LOCAL_DIR%\NuGet.exe (
  if not exist %NUGET_LOCAL_DIR% mkdir %NUGET_LOCAL_DIR%
  copy %NUGET_CACHE_DIR%\NuGet.exe %NUGET_LOCAL_DIR%\NuGet.exe > nul || goto :error
)

:: restore packages for build script
echo Restoring NuGet packages for build script...
%NUGET_LOCAL_DIR%\NuGet.exe restore .\packages.config -PackagesDirectory ./packages || goto :error

:: run build script
echo Running build script...
.\packages\Microsoft.Net.Compilers.%CSI_VERSION%\tools\csi.exe .\build.csx %* || goto :error

:: exit
goto :EOF
:error
exit /b %errorlevel%

refactor build.cmd

refactor build.cmd


@echo off
if "%VisualStudioVersion%"=="" call %VS2012CommandPromptBat%
msbuild build\build.msbuild %*

Update build.cmd for CI server.

Update build.cmd for CI server.


@echo off

pushd %~dp0
set "DNX_NUGET_API_URL=https://www.nuget.org/api/v2"
setlocal EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
    set PATH=!PATH!;!userprofile!\.k\bin
    set KRE_HOME=!USERPROFILE!\.k
    goto install
)

:install
call dnvm install 1.0.0-beta4
call dnvm use 1.0.0-beta4
rem set the runtime path because the above commands set \.dnx<space>\runtimes
set PATH=!USERPROFILE!\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin;!PATH!

call dnu restore
if %errorlevel% neq 0 exit /b %errorlevel%
cd tests\OmniSharp.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
cd ..\OmniSharp.Stdio.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
cd ..\..
call dnu publish src\OmniSharp --no-source --out artifacts\build\omnisharp --runtime dnx-clr-win-x86.1.0.0-beta4

popd

@echo off

pushd %~dp0
set "DNX_NUGET_API_URL=https://www.nuget.org/api/v2"
setlocal EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
    set PATH=!PATH!;!USERPROFILE!\.dnx\bin
    set DNX_HOME=!USERPROFILE!\.dnx
    goto install
)

:install
call dnvm install 1.0.0-beta4
call dnvm use 1.0.0-beta4
rem set the runtime path because the above commands set \.dnx<space>\runtimes
set PATH=!USERPROFILE!\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin;!PATH!

call dnu restore
if %errorlevel% neq 0 exit /b %errorlevel%
cd tests\OmniSharp.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
cd ..\OmniSharp.Stdio.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
cd ..\..
call dnu publish src\OmniSharp --no-source --out artifacts\build\omnisharp --runtime dnx-clr-win-x86.1.0.0-beta4

popd

fix build.cmd for beta4

fix build.cmd for beta4


@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  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,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

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

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init

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

@REM ==== END VALIDATION ====

:init

set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %*

@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir

:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"

:endDetectBaseDir

IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

Normalize line endings.

Normalize line endings.


@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  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,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

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

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init

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

@REM ==== END VALIDATION ====

:init

set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %*

@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir

:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"

:endDetectBaseDir

IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

@REM avoid using MAVEN_CMD_LINE_ARGS below since that would lose parameter escaping in %*
"%MAVEN_JAVA_EXE%" %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath "%WRAPPER_JAR%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  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,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

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

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init

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

@REM ==== END VALIDATION ====

:init

set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %*

@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir

:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"

:endDetectBaseDir

IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

@REM avoid using MAVEN_CMD_LINE_ARGS below since that would lose parameter escaping in %*
"%MAVEN_JAVA_EXE%" %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath "%WRAPPER_JAR%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

Fix more quotes

Fix more quotes

Where did those come from?


@@@ setlocal
@@@ for /f %%i in ('dir /b /ad /on "%windir%\Microsoft.NET\Framework\v*"') do @if exist "%windir%\Microsoft.NET\Framework\%%i\msbuild".exe set msbuild=%windir%\Microsoft.NET\Framework\%%i\msbuild.exe
@@@ if not defined msbuild (echo MSBuild.exe not found>&2 & exit /b 42)
@@@ if defined msbuild "%msbuild%" NUnitFramework.msbuild %*

@echo off
setlocal
for %%a in (%*) do echo "%%a" | findstr /C:"mono">nul && set buildtool=xbuild.bat
if not defined buildtool for /f %%i in ('dir /b /ad /on "%windir%\Microsoft.NET\Framework\v*"') do @if exist "%windir%\Microsoft.NET\Framework\%%i\msbuild".exe set buildtool=%windir%\Microsoft.NET\Framework\%%i\msbuild.exe
if not defined buildtool (echo no MSBuild.exe or xbuild was found>&2 & exit /b 42)
if defined buildtool "%buildtool%" %~dp0NUnitFramework.msbuild %*

Build using xbuild on Windows for mono

Build using xbuild on Windows for mono


@echo off

REM Ensure we've set things up properly
if [%1] == [] goto Fail

REM Get authentication information
set connection=%1

REM Convert the working directory to something scp can use
REM First grab the invocation directory (/bin)
set cwd=%~dp0
REM Replace \ slashes with / slashes
set cwd=%cwd:\=/%
REM Replace c: with /c so we have a UNIX-style drive reference
set cwd=%cwd:c:=/c%

echo Copying provision scripts to the remote host: %host%

REM Copy both the provision directory and the bin directory to the remote server
scp -r %cwd%../provision/ %connection%:provision
scp -r %cwd% %connection%:scripts

echo Invoking scripts on the remote host.

REM Install dos2unix so we can fix line endings
ssh -t %connection% 'sudo apt-get install dos2unix -y'

REM Convert line endings of the deploy script
ssh -t %connection% 'dos2unix scripts/remote-provision.sh'

REM Fire the provision script so we can build the server
ssh -t %connection% 'sudo scripts/remote-provision.sh'

goto End

:Fail

echo Invalid invocation. Please specify a username (with sudo rights) and hostname.

:End

@echo off

REM Ensure we've set things up properly
if [%1] == [] goto Fail

REM Get authentication information
set connection=%1

REM Convert the working directory to something scp can use
REM First grab the invocation directory (/bin)
set cwd=%~dp0
REM Replace \ slashes with / slashes
set cwd=%cwd:\=/%
REM Replace c: with /c so we have a UNIX-style drive reference
set cwd=%cwd:c:=/c%

echo Copying provision scripts to the remote host: %host%

REM Copy both the provision directory and the bin directory to the remote server
scp -r %cwd%../provision/ %connection%:provision
scp -r %cwd% %connection%:scripts

echo Invoking scripts on the remote host.

REM Install dos2unix so we can fix line endings
ssh -t %connection% 'sudo apt-get install dos2unix -y'

REM Convert line endings of the deploy script
ssh -t %connection% 'dos2unix scripts/remote-provision.sh'

REM Fire the provision script so we can build the server
ssh -t %connection% 'sudo scripts/remote-provision.sh'

REM Remove remote execution scripts
ssh -t %connection% 'rm -rf provision scripts'

goto End

:Fail

echo Invalid invocation. Please specify a username (with sudo rights) and hostname.

:End

Remove what we don't need

Remove what we don't need


@echo off
@rem The Hadoop command script
@rem
@rem Environment Variables
@rem
@rem   JAVA_HOME        The java implementation to use.  Overrides JAVA_HOME.
@rem
@rem   HADOOP_HEAPSIZE  The maximum amount of heap to use, in MB. Default is 1000.
@rem
@rem   HADOOP_OPTS      Extra Java runtime options.
@rem
@rem   HADOOP_CONF_DIR  Alternate conf dir. Default is ${HADOOP_HOME}/conf.

:main
  setlocal enabledelayedexpansion

  set hadoop-command=%1
  shift
  if not defined hadoop-command (
      goto print_usage
  )

	call :make_command_arguments %*

  @rem some directories
  set HADOOP_HOME=H:\job\springspace\hadoop_research\hadoop-0.1r
  set HADOOP_CONF_DIR="%HADOOP_HOME%"\conf

  if defined JAVA_HOME (
  	set JAVA_HOME="%JAVA_HOME%"
  	@echo run java in: %JAVA_HOME%
  ) else (
  	@echo Error: JAVA_HOME is not set.
  	exit /b %ERRORLEVEL%
  )

  set JAVA=%JAVA_HOME%\bin\java
  set JAVA_HEAP_MAX=-Xmx1000m

  @rem check envvars which might override default args
  if defined HADOOP_HEAPSIZE (
  	@echo run with heapsize %HADOOP_HEAPSIZE%
  	set JAVA_HEAP_MAX="-Xmx""%HADOOP_HEAPSIZE%""m"
  	@echo %JAVA_HEAP_MAX%
  )

  @rem CLASSPATH initially contains $HADOOP_CONF_DIR
  SET CLASSPATH="%CLASSPATH%";%HADOOP_CONF_DIR%

  @rem for developers, add Hadoop classes to CLASSPATH
  if exist %HADOOP_HOME%\target\classes (
  	set CLASSPATH=%CLASSPATH%;%HADOOP_HOME%\target\classes
  )
  if exist %HADOOP_HOME%\target\test-classes (
  	set CLASSPATH=%CLASSPATH%;%HADOOP_HOME%\target\test-classes
  )

  @rem for releases, add hadoop jars & webapps to CLASSPATH
  if exist %HADOOP_HOME%\webapps (
    set CLASSPATH=%CLASSPATH%;$HADOOP_HOME
  )
  for %%f in ( %HADOOP_HOME%\hadoop-*.jar ) do (
    set CLASSPATH=!CLASSPATH!;%%f
  )

  @rem add libs to CLASSPATH
  for %%f in ( %HADOOP_HOME%\lib\*.jar ) do (
    set CLASSPATH=!CLASSPATH!;%%f
  )

  call :print_classpath
  @echo %hadoop-command-arguments%

  if %hadoop-command% == classpath (
    if not defined hadoop-command-arguments (
      @rem No need to bother starting up a JVM for this simple case.
      @echo %CLASSPATH%
      exit /b
    )
  )

  set commands=namenode datanode dfs fsck jobtracker tasktracker job jar
  for %%c in ( %commands% ) do (
    if %hadoop-command% == %%c set commands=true
  )
  if defined commands (
    call :%hadoop-command%
  ) else (
    set CLASSPATH=%CLASSPATH%;%CD%
    set CLASS=%hadoop-command%
  )

  call %JAVA% %JAVA_HEAP_MAX% %HADOOP_OPTS% -classpath %CLASSPATH% %CLASS% %hadoop-command-arguments%

  exit /b %ERRORLEVEL%

:namenode
  set CLASS=org.apache.hadoop.dfs.NameNode
  goto :eof

:datanode
  set CLASS=org.apache.hadoop.dfs.DataNode
  goto :eof

:dfs
  set CLASS=org.apache.hadoop.dfs.DFSShell
  goto :eof

:fsck
  set CLASS=org.apache.hadoop.dfs.DFSck
  goto :eof

:jobtracker
  set CLASS=org.apache.hadoop.mapred.JobTracker
  goto :eof

:tasktracker
  set CLASS=org.apache.hadoop.mapred.TaskTracker
  goto :eof

:jar
  set JAR=%1
  shift
  set CLASS=%0 org.apache.hadoop.util.PrintJarMainClass %JAR%

  if not errorlevel 0 do(
  	@echo Error: Could not find main class in jar file %JAR%
  	exit /b %ERRORLEVEL%
  )
  set CLASSPATH=%CLASSPATH%;%JAR%
  goto :eof

:print_classpath
  @echo ------ final classpath is ------
  @echo,
  @echo %CLASSPATH%
  goto :eof

@rem This changes %1, %2 etc. Hence those cannot be used after calling this.
:make_command_arguments
  if "%1" == "--config" (
    shift
    shift
  )
  if [%2] == [] goto :eof
  shift
  set _arguments=
  :MakeCmdArgsLoop
  if [%1]==[] goto :EndLoop

  if not defined _arguments (
    set _arguments=%1
  ) else (
    set _arguments=!_arguments! %1
  )
  shift
  goto :MakeCmdArgsLoop
  :EndLoop
  set hadoop-command-arguments=%_arguments%
  goto :eof

:print_usage
  @echo Usage: hadoop COMMAND
  @echo where COMMAND is one of:
  @echo   namenode -format  format the DFS filesystem
  @echo   namenode          run the DFS namenode
  @echo   datanode          run a DFS datanode
  @echo   dfs               run a DFS admin client
  @echo   fsck              run a DFS filesystem checking utility
  @echo   jobtracker        run the MapReduce job Tracker node
  @echo   tasktracker       run a MapReduce task Tracker node
  @echo   job               manipulate MapReduce jobs
  @echo   jar ^<jar^>         run a jar file
  @echo  or
  @echo   CLASSNAME         run the class named CLASSNAME
  @echo Most commands print help when invoked w/o parameters.

endlocal

add hadoop shell for windows(hadoop.cmd)


::Run.bat
::Automates installation for apk files

apk_mass_install -i archive.zip
apk_mass_install -i folder/path
apk_mass_install -i encrypted.zip

::Run.bat
::mass apk installer v3.0

# restore from zip file
apk_mass_install -i archive.zip

# restore from folder
apk_mass_install -i folder/path

# restore form encrypted zip file
apk_mass_install -i encrypted.zip

Update restore.bat

Update restore.bat


@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

set DART2JS=%SDK_DIR%lib\_internal\compiler\implementation\dart2js.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot

set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=

if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
)

if exist "%SNAPSHOT%" (
  echo Using snapshot "%SNAPSHOT%" >&2
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --library-root=%SDK_DIR%
)

rem See comments regarding options below in dart2js shell script.
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512

if exist "%SNAPSHOT%" (
  "%DART%" %EXTRA_VM_OPTIONS% "SNAPSHOT%" "dart2js" %EXTRA_OPTIONS% %*
) else (
  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
                                     ^| find ">     %~n1 ["') do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

set DART2JS=%SDK_DIR%lib\_internal\compiler\implementation\dart2js.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot

set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=

if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
)

if exist "%SNAPSHOT%" (
  echo Using snapshot "%SNAPSHOT%" >&2
  set EXTRA_OPTIONS=%EXTRA_OPTIONS% --library-root=%SDK_DIR%
)

rem See comments regarding options below in dart2js shell script.
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512

if exist "%SNAPSHOT%" (
  "%DART%" %EXTRA_VM_OPTIONS% "SNAPSHOT%" "dart2js" %EXTRA_OPTIONS% %*
) else (
  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
                                     ^| find ">     %~n1 ["') do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

Fix arguments to dart2js in windows bat file

Wrongly assigned the library path to vm options
Review URL: https://codereview.chromium.org//13812019

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@21248 260f80e4-7a28-3924-810f-c04153c831b5


SETLOCAL

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

rem # run the tests
cd %BUILD_NUMBER%

rem # remove the chef package / clobber the files
rem # then install the new package
rmdir /S /Q C:\opscode
FOR %%i IN (pkg\chef*.msi) DO SET omnibus_package=%%i
call msiexec INSTALLLOCATION=C:\opscode /qb /i %omnibus_package% || GOTO :error

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

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

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

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

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

GOTO :EOF

:error
ECHO Failed with error level %errorlevel%

ENDLOCAL

SETLOCAL

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

rem # run the tests
cd %BUILD_NUMBER%

rem # remove the chef package / clobber the files
rem # then install the new package
rmdir /S /Q C:\opscode
FOR %%i IN (pkg\chef*.msi) DO SET omnibus_package=%%i
call msiexec INSTALLLOCATION=C:\opscode /qb /i %omnibus_package% || GOTO :error

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

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

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

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

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

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

GOTO :EOF

:error
ECHO Failed with error level %errorlevel%

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

ENDLOCAL

Uninstall chef using MSI right after the tests on windows.


rem #------------------------------------------------------------------------------
rem # Copyright 2015 Esri
rem # Licensed under the Apache License, Version 2.0 (the "License");
rem # you may not use this file except in compliance with the License.
rem # You may obtain a copy of the License at
rem #
rem #   http://www.apache.org/licenses/LICENSE-2.0
rem #
rem # Unless required by applicable law or agreed to in writing, software
rem # distributed under the License is distributed on an "AS IS" BASIS,
rem # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem # See the License for the specific language governing permissions and
rem # limitations under the License.
rem #==============================================================================
rem # Name:          InstallEM4OWebContent.bat
rem #
rem # Purpose:       Installs Esri Maps for Office Web Content
rem #
rem #==============================================================================
set ops_ChkErrLevelFile=%~dp0..\..\..\SupportFiles\BatchFiles\CheckErrorLevel.bat

echo.
echo %sectionBreak%
echo Install Esri Maps for Office Web Content

REM ---------------------------------------------------------------------
REM Install Esri Maps for Office Web Content
REM ---------------------------------------------------------------------
echo.
echo --Installing Esri Maps for Office Web Content...
echo.
set execute=%ops_softwareRoot%\EsriMapsForOffice\WebContent\Portal_103_Resources_for_EM4O_3.1_en.exe /passive

echo %execute%
echo.
%execute%
Call %ops_ChkErrLevelFile% %ERRORLEVEL%

PING 127.0.0.1 -n 15 > nul

rem #------------------------------------------------------------------------------
rem # Copyright 2015 Esri
rem # Licensed under the Apache License, Version 2.0 (the "License");
rem # you may not use this file except in compliance with the License.
rem # You may obtain a copy of the License at
rem #
rem #   http://www.apache.org/licenses/LICENSE-2.0
rem #
rem # Unless required by applicable law or agreed to in writing, software
rem # distributed under the License is distributed on an "AS IS" BASIS,
rem # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem # See the License for the specific language governing permissions and
rem # limitations under the License.
rem #==============================================================================
rem # Name:          InstallEM4OWebContent.bat
rem #
rem # Purpose:       Installs Esri Maps for Office Web Content
rem #
rem #==============================================================================
set ops_ChkErrLevelFile=%~dp0..\..\..\SupportFiles\BatchFiles\CheckErrorLevel.bat

echo.
echo %sectionBreak%
echo Install Esri Maps for Office Web Content

REM ---------------------------------------------------------------------
REM Install Esri Maps for Office Web Content
REM ---------------------------------------------------------------------
echo.
echo --Installing Esri Maps for Office Web Content...
echo.
set execute=%ops_softwareRoot%\EsriMapsForOffice\WebContent\Portal_Resources_for_AM4O_4.1_Beta_en.exe /passive

echo %execute%
echo.
%execute%
Call %ops_ChkErrLevelFile% %ERRORLEVEL%

PING 127.0.0.1 -n 15 > nul

Fix #1480

Fix #1480

Update exe path in InstallEM4OWebContent.bat to reference latest
installer for ArcGIS Maps for Office


@echo off
echo @echo off >ant.bat
echo %~dp0ant.bat -Dtopbuild.dir=%CD% %%* >>ant.bat

@echo off
echo @echo off >ant.bat
echo %~dp0ant.bat -Dbuild.dir=%CD%\build %%* >>ant.bat

Change setup.bat to define build.dir.

Change setup.bat to define build.dir.


@echo off
setlocal

set "WD=%__CD__%"
if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\"

rem To activate windows native symlinks uncomment next line
rem set MSYS=winsymlinks:nativestrict

rem Set debugging program for errors
rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^>

rem To export full current PATH from environment into MSYS2 use '-use-full-path' parameter
rem or uncomment next line
rem set MSYS2_PATH_TYPE=inherit

:checkparams
rem Help option
if "x%~1" == "x-help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x--help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x-?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x/?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
rem Shell types
if "x%~1" == "x-msys" shift& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-msys2" shift& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-mingw32" shift& set MSYSTEM=MINGW32& goto :checkparams
if "x%~1" == "x-mingw64" shift& set MSYSTEM=MINGW64& goto :checkparams
if "x%~1" == "x-mingw" shift& (if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32))& goto :checkparams
rem Console types
if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe& goto :checkparams
if "x%~1" == "x-conemu" shift& set MSYSCON=conemu& goto :checkparams
if "x%~1" == "x-defterm" shift& set MSYSCON=defterm& goto :checkparams
rem Other parameters
if "x%~1" == "x-full-path" shift& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-use-full-path" shift& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-here" shift& set CHERE_INVOKING=enabled_from_arguments& goto :checkparams
if "x%~1" == "x-where" (
  if "x%~2" == "x" (
    echo Working directory is not specified for -where parameter. 1>&2
    exit /b 2
  )
  cd /d "%~2" || (
    echo Cannot set specified working diretory "%~2". 1>&2
    exit /b 2
  )
  set CHERE_INVOKING=enabled_from_arguments
)& shift& shift& goto :checkparams
if "x%~1" == "x-no-start" shift& set MSYS2_NOSTART=yes& goto :checkparams

rem Setup proper title
if "%MSYSTEM%" == "MINGW32" (
  set "CONTITLE=MinGW x32"
) else if "%MSYSTEM%" == "MINGW64" (
  set "CONTITLE=MinGW x64"
) else (
  set "CONTITLE=MSYS2 MSYS"
)

if "x%MSYSCON%" == "xmintty.exe" goto startmintty
if "x%MSYSCON%" == "xconemu" goto startconemu
if "x%MSYSCON%" == "xdefterm" goto startsh

if NOT EXIST "%WD%mintty.exe" goto startsh
set MSYSCON=mintty.exe
:startmintty
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%mintty" -i /msys2.ico -t "%CONTITLE%" /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
  "%WD%mintty" -i /msys2.ico -t "%CONTITLE%" /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
)
exit /b %ERRORLEVEL%

:startconemu
call :conemudetect || (
  echo ConEmu not found. Exiting. 1>&2
  exit /b 1
)
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%ComEmuCommand%" /Here /Icon "%WD%..\..\msys2.ico" /cmd "%WD%bash" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
  "%ComEmuCommand%" /Here /Icon "%WD%..\..\msys2.ico" /cmd "%WD%bash" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
)
exit /b %ERRORLEVEL%

:startsh
set MSYSCON=
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%bash" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
  "%WD%bash" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
)
exit /b %ERRORLEVEL%

:EOF
exit /b 0

:conemudetect
set ComEmuCommand=
if defined ConEmuDir (
  if exist "%ConEmuDir%\ConEmu64.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu64.exe"
    set MSYSCON=conemu64.exe
  ) else if exist "%ConEmuDir%\ConEmu.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu.exe"
    set MSYSCON=conemu.exe
  )
)
if not defined ComEmuCommand (
  ConEmu64.exe /Exit 2>nul && (
    set ComEmuCommand=ConEmu64.exe
    set MSYSCON=conemu64.exe
  ) || (
    ConEmu.exe /Exit 2>nul && (
      set ComEmuCommand=ConEmu.exe
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand (
  FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu64.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
    set "ComEmuCommand=%%A"
  )
  if defined ComEmuCommand (
    call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
    set MSYSCON=conemu64.exe
  ) else (
    FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
      set "ComEmuCommand=%%A"
    )
    if defined ComEmuCommand (
      call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand exit /b 2
exit /b 0

:printhelp
echo Usage:
echo     %~1 [options] [bash parameters]
echo.
echo Options:
echo     -mingw32 ^| -mingw64 ^| -msys[2]   Set shell type
echo     -defterm ^| -mintty ^| -conemu     Set terminal type
echo     -here                            Use current directory as working
echo                                      directory
echo     -where DIRECTORY                 Use specified DIRECTORY as working
echo                                      directory
echo     -[use-]full-path                 Use full current PATH variable
echo                                      instead of trimming to minimal
echo     -no-start                        Do not use "start" command and
echo                                      return bash resulting errorcode as
echo                                      this batch file resulting errorcode
echo     -help ^| --help ^| -? ^| /?         Display this help and exit
echo.
echo Any parameter that cannot be treated as valid option and all
echo following parameters are passed as bash command parameters.
echo.
exit /b 0

@echo off
setlocal

set "WD=%__CD__%"
if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\"
set "LOGINSHELL=bash"

rem To activate windows native symlinks uncomment next line
rem set MSYS=winsymlinks:nativestrict

rem Set debugging program for errors
rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^>

rem To export full current PATH from environment into MSYS2 use '-use-full-path' parameter
rem or uncomment next line
rem set MSYS2_PATH_TYPE=inherit

:checkparams
rem Help option
if "x%~1" == "x-help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x--help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x-?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x/?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
rem Shell types
if "x%~1" == "x-msys" shift& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-msys2" shift& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-mingw32" shift& set MSYSTEM=MINGW32& goto :checkparams
if "x%~1" == "x-mingw64" shift& set MSYSTEM=MINGW64& goto :checkparams
if "x%~1" == "x-mingw" shift& (if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32))& goto :checkparams
rem Console types
if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe& goto :checkparams
if "x%~1" == "x-conemu" shift& set MSYSCON=conemu& goto :checkparams
if "x%~1" == "x-defterm" shift& set MSYSCON=defterm& goto :checkparams
rem Other parameters
if "x%~1" == "x-full-path" shift& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-use-full-path" shift& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-here" shift& set CHERE_INVOKING=enabled_from_arguments& goto :checkparams
if "x%~1" == "x-where" (
  if "x%~2" == "x" (
    echo Working directory is not specified for -where parameter. 1>&2
    exit /b 2
  )
  cd /d "%~2" || (
    echo Cannot set specified working diretory "%~2". 1>&2
    exit /b 2
  )
  set CHERE_INVOKING=enabled_from_arguments
)& shift& shift& goto :checkparams
if "x%~1" == "x-no-start" shift& set MSYS2_NOSTART=yes& goto :checkparams
if "x%~1" == "x-shell" (
  if "x%~2" == "x" (
    echo Shell not specified for -shell parameter. 1>&2
    exit /b 2
  )
  set LOGINSHELL="%~2"
)& shift& shift& goto :checkparams

rem Setup proper title
if "%MSYSTEM%" == "MINGW32" (
  set "CONTITLE=MinGW x32"
) else if "%MSYSTEM%" == "MINGW64" (
  set "CONTITLE=MinGW x64"
) else (
  set "CONTITLE=MSYS2 MSYS"
)

if "x%MSYSCON%" == "xmintty.exe" goto startmintty
if "x%MSYSCON%" == "xconemu" goto startconemu
if "x%MSYSCON%" == "xdefterm" goto startsh

if NOT EXIST "%WD%mintty.exe" goto startsh
set MSYSCON=mintty.exe
:startmintty
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%mintty" -i /msys2.ico -t "%CONTITLE%" "/usr/bin/%LOGINSHELL%" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
  "%WD%mintty" -i /msys2.ico -t "%CONTITLE%" "/usr/bin/%LOGINSHELL%" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
)
exit /b %ERRORLEVEL%

:startconemu
call :conemudetect || (
  echo ConEmu not found. Exiting. 1>&2
  exit /b 1
)
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%ComEmuCommand%" /Here /Icon "%WD%..\..\msys2.ico" /cmd "%WD%\%LOGINSHELL%" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
  "%ComEmuCommand%" /Here /Icon "%WD%..\..\msys2.ico" /cmd "%WD%\%LOGINSHELL%" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
)
exit /b %ERRORLEVEL%

:startsh
set MSYSCON=
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%\%LOGINSHELL%" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
) else (
  "%WD%\%LOGINSHELL%" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
)
exit /b %ERRORLEVEL%

:EOF
exit /b 0

:conemudetect
set ComEmuCommand=
if defined ConEmuDir (
  if exist "%ConEmuDir%\ConEmu64.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu64.exe"
    set MSYSCON=conemu64.exe
  ) else if exist "%ConEmuDir%\ConEmu.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu.exe"
    set MSYSCON=conemu.exe
  )
)
if not defined ComEmuCommand (
  ConEmu64.exe /Exit 2>nul && (
    set ComEmuCommand=ConEmu64.exe
    set MSYSCON=conemu64.exe
  ) || (
    ConEmu.exe /Exit 2>nul && (
      set ComEmuCommand=ConEmu.exe
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand (
  FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu64.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
    set "ComEmuCommand=%%A"
  )
  if defined ComEmuCommand (
    call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
    set MSYSCON=conemu64.exe
  ) else (
    FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
      set "ComEmuCommand=%%A"
    )
    if defined ComEmuCommand (
      call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand exit /b 2
exit /b 0

:printhelp
echo Usage:
echo     %~1 [options] [login shell parameters]
echo.
echo Options:
echo     -mingw32 ^| -mingw64 ^| -msys[2]   Set shell type
echo     -defterm ^| -mintty ^| -conemu     Set terminal type
echo     -here                            Use current directory as working
echo                                      directory
echo     -where DIRECTORY                 Use specified DIRECTORY as working
echo                                      directory
echo     -[use-]full-path                 Use full current PATH variable
echo                                      instead of trimming to minimal
echo     -no-start                        Do not use "start" command and
echo                                      return login shell resulting
echo                                      errorcode as this batch file
echo                                      resulting errorcode
echo     -shell SHELL                     Set login shell
echo     -help ^| --help ^| -? ^| /?         Display this help and exit
echo.
echo Any parameter that cannot be treated as valid option and all
echo following parameters are passed as login shell command parameters.
echo.
exit /b 0

Add -shell parameter to msys2_shell.cmd

filesystem: Add -shell parameter to msys2_shell.cmd

Allow setting the login shell via command line parameter.  e.g,

    msys2_shell -shell fish -mintty


@echo off
REM
REM This is intended to be a convenience file when the layout
REM is something like this:
REM
REM python\
REM   make.cmd (this file)
REM   python-make\
REM     make.py
REM     configure.ini
REM   issue12345\
REM     (a python clone)
REM   issue56789\
REM     (a different python clone)
REM
REM You would normally be inside one of the Python clones and then calling
REM ..\make
REM
%~d0%~p0\python-make\make.py %*

Add sample make.cmd

Add sample make.cmd


@rem Copyright 2017 gRPC authors.
@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.

SET ROOT=%~dp0
cd /d %~dp0

powershell -c "Get-Host"
powershell -c "$PSVersionTable"
powershell -c "[System.Environment]::OSVersion"
powershell -c "Get-WmiObject -Class Win32_ComputerSystem"
powershell -c "(Get-WmiObject -Class Win32_ComputerSystem).SystemType"

powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; & { iwr https://raw.githubusercontent.com/grumpycoders/nvm-ps/master/nvm.ps1 | iex }"

SET PATH=%APPDATA%\nvm-ps;%APPDATA%\nvm-ps\nodejs;%PATH%
SET JOBS=8

call nvm version

call nvm install 8
call nvm use 8

SET npm_config_fetch_retries=5

call npm install || goto :error

SET JUNIT_REPORT_STACK=1
SET FAILED=0

for %%v in (8 10 12) do (
  call nvm install %%v
  call nvm use %%v
  if "%%v"=="4" (
    call npm install -g npm@5
  )
  @rem https://github.com/mapbox/node-pre-gyp/issues/362
  call npm install -g node-gyp
  node -e "console.log(process.versions)"

  mkdir reports\node%%v
  SET JUNIT_REPORT_PATH=reports/node%%v

  node -e "process.exit(process.version.startsWith('v%%v') ? 0 : -1)" || goto :error

  call .\node_modules\.bin\gulp cleanAll || SET FAILED=1
  call .\node_modules\.bin\gulp setup || SET FAILED=1
  call .\node_modules\.bin\gulp test || SET FAILED=1
  cmd.exe /c "SET GRPC_DNS_RESOLVER=ares& call .\node_modules\.bin\gulp nativeTestOnly" || SET FAILED=1
)

node merge_kokoro_logs.js
if %FAILED% neq 0 exit /b 1
goto :EOF

:error
exit /b 1

@rem Copyright 2017 gRPC authors.
@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.

SET ROOT=%~dp0
cd /d %~dp0

powershell -c "Get-Host"
powershell -c "$PSVersionTable"
powershell -c "[System.Environment]::OSVersion"
powershell -c "Get-WmiObject -Class Win32_ComputerSystem"
powershell -c "(Get-WmiObject -Class Win32_ComputerSystem).SystemType"

powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; & { iwr https://raw.githubusercontent.com/grumpycoders/nvm-ps/master/nvm.ps1 | iex }"

SET PATH=%APPDATA%\nvm-ps;%APPDATA%\nvm-ps\nodejs;%PATH%
SET JOBS=8

call nvm version

call nvm install 10
call nvm use 10

SET npm_config_fetch_retries=5

call npm install || goto :error

SET JUNIT_REPORT_STACK=1
SET FAILED=0

for %%v in (10 12) do (
  call nvm install %%v
  call nvm use %%v
  if "%%v"=="4" (
    call npm install -g npm@5
  )
  @rem https://github.com/mapbox/node-pre-gyp/issues/362
  call npm install -g node-gyp
  node -e "console.log(process.versions)"

  mkdir reports\node%%v
  SET JUNIT_REPORT_PATH=reports/node%%v

  node -e "process.exit(process.version.startsWith('v%%v') ? 0 : -1)" || goto :error

  call .\node_modules\.bin\gulp cleanAll || SET FAILED=1
  call .\node_modules\.bin\gulp setup || SET FAILED=1
  call .\node_modules\.bin\gulp test || SET FAILED=1
  cmd.exe /c "SET GRPC_DNS_RESOLVER=ares& call .\node_modules\.bin\gulp nativeTestOnly" || SET FAILED=1
)

node merge_kokoro_logs.js
if %FAILED% neq 0 exit /b 1
goto :EOF

:error
exit /b 1

Drop Node 8 tests on Windows

Drop Node 8 tests on Windows


@echo off
setlocal

rem get version
for /f "usebackq tokens=2*" %%i in (`semver -g version ^| findstr /r "^\Input"`) do  set VERSION_STR=%%j

if %VERSION_STR% == "" goto EXIT

git tag GladiatorFirmware_%VERSION_STR%

:EXIT
endlocal
@echo on

@echo off
setlocal

rem get version
for /f "usebackq tokens=2*" %%i in (`semver -g version ^| findstr /r "^\Input"`) do  set VERSION_STR=%%j

if %VERSION_STR% == "" goto EXIT

git tag GladiatorFirmware_%VERSION_STR%
git push origin --tags

:EXIT
endlocal
@echo on

add auto tag

[All] add auto tag


RMDIR "tos-laimas-compass-win32-x64" /S /Q
electron-packager . --platform=win32 --arch=x64 --overwrite

Remove previous content before compiling