echo off
goto :check_parameter

:check_parameter
if [%1]==[] goto :check_file
goto :set_api_key_from_parameter

:check_file
if exist apikey.txt goto :set_api_key_from_file
echo "The first parameter is the api key. If omitted, a file must exist named 'apikey.txt' that contains the api key."
goto :eof

:set_api_key_from_file
set /p ApiKey=<apikey.txt
goto :get_latest_package_and_push_it

:set_api_key_from_parameter
set ApiKey=%1
goto :get_latest_package_and_push_it

:get_latest_package_and_push_it
for /f %%i in ('dir /b/a-d/od/t:c Rock.Messaging.?.?.?*.nupkg') do set LAST=%%i
nuget push %LAST% %ApiKey%

echo off
goto :check_parameter

:check_parameter
if [%1]==[] goto :check_file
goto :set_api_key_from_parameter

:check_file
if exist apikey.txt goto :set_api_key_from_file
echo "The first parameter is the api key. If omitted, a file must exist named 'apikey.txt' that contains the api key."
goto :eof

:set_api_key_from_file
set /p ApiKey=<apikey.txt
goto :get_latest_package_and_push_it

:set_api_key_from_parameter
set ApiKey=%1
goto :get_latest_package_and_push_it

:get_latest_package_and_push_it
for /f %%i in ('dir /b/a-d/od/t:c Rock.Messaging.SQS.?.?.?*.nupkg') do set LAST=%%i
nuget push %LAST% %ApiKey%

Fix publish script

Fix publish script


setlocal EnableDelayedExpansion

if "%ARCH%"=="64" (
    set WIN64="WIN64=YES"
) else (
    set WIN64=
)

:: Work out MSVC_VER - needed for build process.
:: Currently guess from Python version
if  %vc% LEQ 9 set MSVC_VER=1500
if  %vc% GTR 9 set MSVC_VER=1900

:: Get the minor/major version of poppler from the %poppler% environment
:: variable that is set by conda-build
FOR /F "tokens=1,2 delims=." %%a IN ("%poppler%") DO (
  set POPPLER_MAJOR_VERSION=%%a
  set POPPLER_MINOR_VERSION=%%b
)

:: Need consistent flags between build and install.
set BLD_OPTS=%WIN64% ^
    MSVC_VER=%MSVC_VER% ^
    GDAL_HOME=%LIBRARY_PREFIX% ^
    BINDIR=%LIBRARY_BIN% ^
    LIBDIR=%LIBRARY_LIB% ^
    INCDIR=%LIBRARY_INC% ^
    DATADIR=%LIBRARY_PREFIX%\share\gdal ^
    CURL_INC="-I%LIBRARY_INC%" ^
    CURL_LIB="%LIBRARY_LIB%\libcurl.lib wsock32.lib wldap32.lib winmm.lib" ^
    EXPAT_DIR=%LIBRARY_PREFIX% ^
    EXPAT_INCLUDE="-I%LIBRARY_INC%" ^
    EXPAT_LIB=%LIBRARY_LIB%\expat.lib ^
    FITS_PLUGIN=NO ^
    FITS_INC_DIR=%LIBRARY_INC% ^
    FITS_LIB="%LIBRARY_LIB%\cfitsio.lib" ^
    FREEXL_CFLAGS="-I%LIBRARY_INC%" ^
    FREEXL_LIBS=%LIBRARY_LIB%\freexl_i.lib ^
    GEOS_CFLAGS="-I%LIBRARY_INC% -DHAVE_GEOS" ^
    GEOS_DIR=%LIBRARY_PREFIX% ^
    GEOS_LIB=%LIBRARY_LIB%\geos_c.lib ^
    HDF4_DIR=%LIBRARY_PREFIX% ^
    HDF4_HAS_MAXOPENFILES=YES ^
    HDF4_LIB="%LIBRARY_LIB%\hdf.lib %LIBRARY_LIB%\mfhdf.lib %LIBRARY_LIB%\xdr.lib" ^
    HDF5_DIR=%LIBRARY_PREFIX% ^
    HDF5_LIB=%LIBRARY_LIB%\hdf5.lib ^
    HDF5_H5_IS_DLL=YES ^
    TILEDB_ENABLED=YES ^
    TILEDB_DIR=%LIBRARY_PREFIX% ^
    TILEDB_LIBS=%LIBRARY_LIB%\tiledb.lib ^
    JPEGDIR=%LIBRARY_INC% ^
    JPEG_EXTERNAL_LIB=1 ^
    JPEG_LIB=%LIBRARY_LIB%\libjpeg.lib ^
    KEA_CFLAGS="-I%LIBRARY_INC%" ^
    KEA_LIB="%LIBRARY_LIB%\hdf5_cpp.lib %LIBRARY_LIB%\libkea.lib" ^
    NETCDF_INC_DIR=%LIBRARY_INC% ^
    NETCDF_LIB=%LIBRARY_LIB%\netcdf.lib ^
    NETCDF_SETTING=yes ^
    NETCDF_HAS_NC4=yes ^
    OPENJPEG_CFLAGS="-I%LIBRARY_INC%\openjpeg-2.4" ^
    OPENJPEG_ENABLED=YES ^
    OPENJPEG_LIB=%LIBRARY_LIB%\openjp2.lib ^
    PG_INC_DIR=%LIBRARY_INC% ^
    PG_LIB=%LIBRARY_LIB%\libpq.lib ^
    PNGDIR=%LIBRARY_INC% ^
    PNG_EXTERNAL_LIB=1 ^
    PNG_LIB=%LIBRARY_LIB%\libpng.lib ^
    PROJ_FLAGS="-DPROJ_STATIC -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" ^
    PROJ_INCLUDE="-I%LIBRARY_INC%" ^
    PROJ_LIBRARY=%LIBRARY_LIB%\proj.lib ^
    SPATIALITE_412_OR_LATER=yes ^
    SQLITE_INC="-I%LIBRARY_INC% -DHAVE_SPATIALITE" ^
    SQLITE_LIB="%LIBRARY_LIB%\sqlite3.lib %LIBRARY_LIB%\spatialite_i.lib" ^
    TIFF_INC="-I%LIBRARY_INC%" ^
    TIFF_LIB=%LIBRARY_LIB%\tiff.lib ^
    TIFF_OPTS=-DBIGTIFF_SUPPORT ^
    XERCES_DIR=%LIBRARY_PREFIX% ^
    XERCES_INCLUDE="-I%LIBRARY_INC% -I%LIBRARY_INC%\xercesc" ^
    XERCES_LIB=%LIBRARY_LIB%\xerces-c_3.lib ^
    GEOTIFF_INC="-I%LIBRARY_INC%" ^
    GEOTIFF_LIB=%LIBRARY_LIB%\geotiff_i.lib ^
    LIBICONV_INCLUDE="-I%LIBRARY_INC% -DICONV_CONST= " ^
    LIBICONV_LIBRARY="%LIBRARY_LIB%\iconv.lib" ^
    POPPLER_ENABLED=YES ^
    POPPLER_CFLAGS="-I%LIBRARY_INC%\poppler -DPOPPLER_HAS_OPTCONTENT= -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS= " ^
    POPPLER_MAJOR_VERSION=%POPPLER_MAJOR_VERSION% ^
    POPPLER_MINOR_VERSION=%POPPLER_MINOR_VERSION% ^
    POPPLER_LIBS="%LIBRARY_LIB%\poppler.lib" ^
    WEBP_ENABLED=YES ^
    WEBP_CFLAGS="-I%LIBRARY_INC%" ^
    WEBP_LIBS="%LIBARY_LIB%\libwebp.lib" ^
    ZSTD_CFLAGS="-I%LIBRARY_INC%" ^
    ZSTD_LIBS=""%LIBRARY_LIB%\libzstd.lib"

endlocal && set BLD_OPTS=%BLD_OPTS%

setlocal EnableDelayedExpansion

if "%ARCH%"=="64" (
    set WIN64="WIN64=YES"
) else (
    set WIN64=
)

:: Work out MSVC_VER - needed for build process.
:: Currently guess from Python version
if  %vc% LEQ 9 set MSVC_VER=1500
if  %vc% GTR 9 set MSVC_VER=1900

:: Get the minor/major version of poppler from the %poppler% environment
:: variable that is set by conda-build
FOR /F "tokens=1,2 delims=." %%a IN ("%poppler%") DO (
  set POPPLER_MAJOR_VERSION=%%a
  set POPPLER_MINOR_VERSION=%%b
)

:: Need consistent flags between build and install.
set BLD_OPTS=%WIN64% ^
    MSVC_VER=%MSVC_VER% ^
    GDAL_HOME=%LIBRARY_PREFIX% ^
    BINDIR=%LIBRARY_BIN% ^
    LIBDIR=%LIBRARY_LIB% ^
    INCDIR=%LIBRARY_INC% ^
    DATADIR=%LIBRARY_PREFIX%\share\gdal ^
    CURL_INC="-I%LIBRARY_INC%" ^
    CURL_LIB="%LIBRARY_LIB%\libcurl.lib wsock32.lib wldap32.lib winmm.lib" ^
    EXPAT_DIR=%LIBRARY_PREFIX% ^
    EXPAT_INCLUDE="-I%LIBRARY_INC%" ^
    EXPAT_LIB=%LIBRARY_LIB%\expat.lib ^
    FITS_PLUGIN=NO ^
    FITS_INC_DIR=%LIBRARY_INC% ^
    FITS_LIB="%LIBRARY_LIB%\cfitsio.lib" ^
    FREEXL_CFLAGS="-I%LIBRARY_INC%" ^
    FREEXL_LIBS=%LIBRARY_LIB%\freexl_i.lib ^
    GEOS_CFLAGS="-I%LIBRARY_INC% -DHAVE_GEOS" ^
    GEOS_DIR=%LIBRARY_PREFIX% ^
    GEOS_LIB=%LIBRARY_LIB%\geos_c.lib ^
    HDF4_DIR=%LIBRARY_PREFIX% ^
    HDF4_HAS_MAXOPENFILES=YES ^
    HDF4_LIB="%LIBRARY_LIB%\hdf.lib %LIBRARY_LIB%\mfhdf.lib %LIBRARY_LIB%\xdr.lib" ^
    HDF5_DIR=%LIBRARY_PREFIX% ^
    HDF5_LIB=%LIBRARY_LIB%\hdf5.lib ^
    HDF5_H5_IS_DLL=YES ^
    TILEDB_ENABLED=YES ^
    TILEDB_DIR=%LIBRARY_PREFIX% ^
    TILEDB_LIBS=%LIBRARY_LIB%\tiledb.lib ^
    JPEGDIR=%LIBRARY_INC% ^
    JPEG_EXTERNAL_LIB=1 ^
    JPEG_LIB=%LIBRARY_LIB%\libjpeg.lib ^
    KEA_CFLAGS="-I%LIBRARY_INC%" ^
    KEA_LIB="%LIBRARY_LIB%\hdf5_cpp.lib %LIBRARY_LIB%\libkea.lib" ^
    NETCDF_INC_DIR=%LIBRARY_INC% ^
    NETCDF_LIB=%LIBRARY_LIB%\netcdf.lib ^
    NETCDF_SETTING=yes ^
    NETCDF_HAS_NC4=yes ^
    OPENJPEG_CFLAGS="-I%LIBRARY_INC%\openjpeg-2.4" ^
    OPENJPEG_ENABLED=YES ^
    OPENJPEG_LIB=%LIBRARY_LIB%\openjp2.lib ^
    PG_INC_DIR=%LIBRARY_INC% ^
    PG_LIB=%LIBRARY_LIB%\libpq.lib ^
    PNGDIR=%LIBRARY_INC% ^
    PNG_EXTERNAL_LIB=1 ^
    PNG_LIB=%LIBRARY_LIB%\libpng.lib ^
    PROJ_FLAGS="-DPROJ_STATIC" ^
    PROJ_INCLUDE="-I%LIBRARY_INC%" ^
    PROJ_LIBRARY=%LIBRARY_LIB%\proj.lib ^
    SPATIALITE_412_OR_LATER=yes ^
    SQLITE_INC="-I%LIBRARY_INC% -DHAVE_SPATIALITE" ^
    SQLITE_LIB="%LIBRARY_LIB%\sqlite3.lib %LIBRARY_LIB%\spatialite_i.lib" ^
    TIFF_INC="-I%LIBRARY_INC%" ^
    TIFF_LIB=%LIBRARY_LIB%\tiff.lib ^
    TIFF_OPTS=-DBIGTIFF_SUPPORT ^
    XERCES_DIR=%LIBRARY_PREFIX% ^
    XERCES_INCLUDE="-I%LIBRARY_INC% -I%LIBRARY_INC%\xercesc" ^
    XERCES_LIB=%LIBRARY_LIB%\xerces-c_3.lib ^
    GEOTIFF_INC="-I%LIBRARY_INC%" ^
    GEOTIFF_LIB=%LIBRARY_LIB%\geotiff_i.lib ^
    LIBICONV_INCLUDE="-I%LIBRARY_INC% -DICONV_CONST= " ^
    LIBICONV_LIBRARY="%LIBRARY_LIB%\iconv.lib" ^
    POPPLER_ENABLED=YES ^
    POPPLER_CFLAGS="-I%LIBRARY_INC%\poppler -DPOPPLER_HAS_OPTCONTENT= -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS= " ^
    POPPLER_MAJOR_VERSION=%POPPLER_MAJOR_VERSION% ^
    POPPLER_MINOR_VERSION=%POPPLER_MINOR_VERSION% ^
    POPPLER_LIBS="%LIBRARY_LIB%\poppler.lib" ^
    WEBP_ENABLED=YES ^
    WEBP_CFLAGS="-I%LIBRARY_INC%" ^
    WEBP_LIBS="%LIBARY_LIB%\libwebp.lib" ^
    ZSTD_CFLAGS="-I%LIBRARY_INC%" ^
    ZSTD_LIBS=""%LIBRARY_LIB%\libzstd.lib"

endlocal && set BLD_OPTS=%BLD_OPTS%

remove -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H


@echo off
setlocal

set curl_cmd="curl"

:test_for_curl
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :missing_curl_in_path
goto :curl_the_things

:missing_curl_in_path
set curl_cmd=%LOCALAPPDATA%\Apps\cURL\bin\curl.exe
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :install_curl
goto :curl_the_things

:install_curl
echo [*] Installing cURL locally...
if not exist curl-7.35.0-win32-local-fix1.msi goto :missing_curl_installer
curl-7.35.0-win32-local-fix1.msi /quiet /passive
goto :curl_the_things

:curl_the_things
echo [*] Using %curl_cmd% to fetch binaries...
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip"
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/conf/p2p.conf"

REM Even though we test for 64-bit, it just matters for file installation.
REM We're not actually using 64-bit for anything in this version. TODO.

if exist "%ProgramFiles(x86)%" goto :64bit
echo [*] 32-bit system detected...
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer
echo [*] Installing 7-Bit....

%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer
echo [*] Unzipping 32-bit cpuminer...
"%ProgramFiles%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip
goto :startminer

:64bit

echo [*] 64-bit detected...

:test_for_7z_64
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer_64
if exist "%ProgramFiles(x86)%\7-zip\7z.exe" goto :unzip_cpuminer_64

echo [*] Installing 7-Bit....
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer_64
echo [*] Unzipping 64-bit cpuminer...
"%ProgramFiles(x86)%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip

:startminer
echo [*] All right, let's get mining!
minerd -c p2p.conf
goto :end

:missing_curl_installer
echo [*] Missing curl installer. Did you download it?
echo [*] https://raw.githubusercontent.com/thegoddambatman/diy-dogecoin-digger/master/bin/curl-7.35.0-win32-local-fix1.msi
:end

@echo off
setlocal

set curl_cmd="curl"

:test_for_curl
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :missing_curl_in_path
goto :curl_the_things

:missing_curl_in_path
set curl_cmd=%LOCALAPPDATA%\Apps\cURL\bin\curl.exe
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :install_curl
goto :curl_the_things

:install_curl
echo [*] Installing cURL locally...
if not exist curl-7.35.0-win32-local-fix1.msi goto :missing_curl_installer
curl-7.35.0-win32-local-fix1.msi /quiet /passive
goto :curl_the_things

:curl_the_things
echo [*] Using %curl_cmd% to fetch binaries...
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip"
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/conf/p2p.conf"

REM Even though we test for 64-bit, it just matters for file installation.
REM We're not actually using 64-bit for anything in this version. TODO.

if exist "%ProgramFiles(x86)%" goto :64bit
echo [*] 32-bit system detected...
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer
echo [*] Installing 7-Bit....

%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer
echo [*] Unzipping cpuminer...
"%ProgramFiles%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip
goto :startminer

:64bit

echo [*] 64-bit detected...

:test_for_7z_64
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer_64
if exist "%ProgramFiles(x86)%\7-zip\7z.exe" goto :unzip_cpuminer_64

echo [*] Installing 7-Bit....
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer_64
echo [*] Unzipping cpuminer...
"%ProgramFiles(x86)%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip

:startminer
echo [*] All right, let's get mining!
minerd -c p2p.conf
goto :end

:missing_curl_installer
echo [*] Missing curl installer. Did you download it?
echo [*] https://raw.githubusercontent.com/thegoddambatman/diy-dogecoin-digger/master/bin/curl-7.35.0-win32-local-fix1.msi
:end

Update diydoge.bat

Update diydoge.bat


echo on
setlocal EnableDelayedExpansion

SET POWERSHELL_PATH=
FOR /F "delims=" %%F IN ('where powershell.exe') DO (SET POWERSHELL_PATH=!POWERSHELL_PATH!%%~dpF.;)

set NEW_PATH=C:\Windows\system32;C:\Windows;%PYTHON3_PATH%;%PYTHON3_PATH%\Scripts;C:\Program Files\CMake\bin;C:\ProgramData\Chocolatey\bin;
set PATH=%NEW_PATH%

SET CL_PATH=
SET MSBUILD_PATH=

if not "%VCVARSALL_DIR%" == "" (
  CALL "%VCVARSALL_DIR%\vcvarsall.bat" amd64
  echo on
  FOR /F "delims=" %%F IN ('where cl.exe') DO (SET CL_PATH=!CL_PATH!%%~dpF.;)
  FOR /F "delims=" %%F IN ('where msbuild.exe') DO (SET MSBUILD_PATH=!MSBUILD_PATH!%%~dpF.;)
)

set NEW_PATH=%NEW_PATH%%CL_PATH%%MSBUILD_PATH%%POWERSHELL_PATH%

if not "%MINGW_PATH%" == "" SET NEW_PATH=%NEW_PATH%%MINGW_PATH%;

set PATH=%NEW_PATH%
setx PATH "%PATH%"

mkdir build-%CONFIGURATION%
cd build-%CONFIGURATION%

cmake.exe -G "%CMAKE_GENERATOR%" .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% %ADDITIONAL_CMAKE_ARGS%

echo "Content of CMakeFiles\CMakeError.log:"
if exist "CMakeFiles\CMakeError.log" (
  type "CMakeFiles\CMakeError.log"
)

IF "%CMAKE_GENERATOR%"=="MinGW Makefiles" (
  mingw32-make -j12 || exit /b 1
) ELSE (
  type ALL_BUILD.vcxproj
  msbuild ALL_BUILD.vcxproj || exit /b 1
)

pip3 install absl-py
pip3 install pytest
pip3 install pytest-xdist

cd tests
py.test -r a -n 1 || exit /b 1

echo on
setlocal EnableDelayedExpansion

SET POWERSHELL_PATH=
FOR /F "delims=" %%F IN ('where powershell.exe') DO (SET POWERSHELL_PATH=!POWERSHELL_PATH!%%~dpF.;)

set OLD_PATH=%PATH%

SET CL_PATH=
SET MSBUILD_PATH=

if not "%VCVARSALL_DIR%" == "" (
  CALL "%VCVARSALL_DIR%\vcvarsall.bat" amd64
  echo on
  FOR /F "delims=" %%F IN ('where cl.exe') DO (SET CL_PATH=!CL_PATH!%%~dpF.;)
  FOR /F "delims=" %%F IN ('where msbuild.exe') DO (SET MSBUILD_PATH=!MSBUILD_PATH!%%~dpF.;)
)

set PATH=%OLD_PATH%%CL_PATH%%MSBUILD_PATH%%POWERSHELL_PATH%

if not "%MINGW_PATH%" == "" SET PATH=%PATH%%MINGW_PATH%;

setx PATH "%PATH%"

mkdir build-%CONFIGURATION%
cd build-%CONFIGURATION%

cmake.exe -G "%CMAKE_GENERATOR%" .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% %ADDITIONAL_CMAKE_ARGS%

echo "Content of CMakeFiles\CMakeError.log:"
if exist "CMakeFiles\CMakeError.log" (
  type "CMakeFiles\CMakeError.log"
)

IF "%CMAKE_GENERATOR%"=="MinGW Makefiles" (
  mingw32-make -j12 || exit /b 1
) ELSE (
  type ALL_BUILD.vcxproj
  msbuild ALL_BUILD.vcxproj || exit /b 1
)

pip3 install absl-py
pip3 install pytest
pip3 install pytest-xdist

cd tests
py.test -r a -n 1 || exit /b 1

Maintain the original PATH (and only add) in Windows CI tests.


@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0
set SBT_ARGS=

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET "PATH=%JAVA_HOME%\bin;%PATH%"

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET JAVA_OPTS=%%A !JAVA_OPTS!
)

rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

:args_loop
if "%~1" == "" goto args_end

if "%~1" == "-jvm-debug" (
  set JVM_DEBUG=true
  set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
  set /a JVM_DEBUG_PORT=%1 2>nul >nul
  if not "%~1" == "!JVM_DEBUG_PORT!" (
    set SBT_ARGS=!SBT_ARGS! %1
  )
) else (
  set SBT_ARGS=!SBT_ARGS! %1
)

shift
goto args_loop
:args_end

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :process

call :checkjava

call :copyrt

call :sync_preloaded

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:process
rem parses 1.7, 1.8, 9, etc out of java version "1.8.0_91"
"%_JAVACMD%" -Xmx512M -version 2> "%TEMP%\out.txt"
set JAVA_VERSION=0
>nul findstr /c:"version \"9" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=9)
>nul findstr /c:"version \"1.8" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.8)
>nul findstr /c:"version \"1.7" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.7)
>nul findstr /c:"version \"1.6" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.6)
>nul findstr /c:"version \"1.5" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.5)
exit /B 0

:checkjava
set required_version=1.6
if /I "%JAVA_VERSION%" GEQ "%required_version%" (
  exit /B 0
)
echo.
echo The java installation you have is not up to date
echo sbt requires at least version %required_version%+, you have
echo version %JAVA_VERSION%
echo.
echo Please go to http://www.java.com/getjava/ and download
echo a valid Java Runtime and install before running sbt.
echo.
exit /B 1

:copyrt
if /I "%JAVA_VERSION%" GEQ "9" (
  set rtexport="%SBT_HOME%java9-rt-export.jar"

  "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "%rtexport%" --rt-ext-dir > "%TEMP%.\rtext.txt"
  set /p java9_ext= < "%TEMP%.\rtext.txt"
  set java9_rt=%java9_ext%\rt.jar

  if not exist "%java9_rt%" (
    echo Copying runtime jar.
    mkdir "%java9_ext%"
    "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "%rtexport%" "%java9_rt%"
  )
  set _JAVA_OPTS=!_JAVA_OPTS! -Dscala.ext.dirs="%java9_ext%"
)
exit /B 0

:sync_preloaded
if "%INIT_SBT_VERSION%"=="" (
  rem FIXME: better %INIT_SBT_VERSION% detection
  FOR /F "tokens=* USEBACKQ" %%F IN (`dir /b "%SBT_HOME%\..\lib\local-preloaded\org.scala-sbt\sbt" /B`) DO (
    SET INIT_SBT_VERSION=%%F
  )
)
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "1.8" (
  where robocopy >nul 2>nul
  if %ERRORLEVEL% equ 0 (
    echo %PRELOAD_SBT_JAR%
    if not exist %PRELOAD_SBT_JAR% (
      if exist "%SBT_HOME%\..\lib\local-preloaded\" (
        echo 'about to robocopy'
        robocopy "%SBT_HOME%\..\lib\local-preloaded" "%UserProfile%\.sbt\preloaded" /E
      )
    )
  )
)
exit /B 0

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0
set SBT_ARGS=

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET "PATH=%JAVA_HOME%\bin;%PATH%"

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET JAVA_OPTS=%%A !JAVA_OPTS!
)

rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

set INIT_SBT_VERSION=

:args_loop
if "%~1" == "" goto args_end

if "%~1" == "-jvm-debug" (
  set JVM_DEBUG=true
  set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
  set /a JVM_DEBUG_PORT=%1 2>nul >nul
  if not "%~1" == "!JVM_DEBUG_PORT!" (
    set SBT_ARGS=!SBT_ARGS! %1
  )
) else (
  set SBT_ARGS=!SBT_ARGS! %1
)

shift
goto args_loop
:args_end

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :process

call :checkjava

call :copyrt

call :sync_preloaded

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:process
rem parses 1.7, 1.8, 9, etc out of java version "1.8.0_91"
"%_JAVACMD%" -Xmx512M -version 2> "%TEMP%\out.txt"
set JAVA_VERSION=0
>nul findstr /c:"version \"9" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=9)
>nul findstr /c:"version \"1.8" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.8)
>nul findstr /c:"version \"1.7" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.7)
>nul findstr /c:"version \"1.6" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.6)
>nul findstr /c:"version \"1.5" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.5)
exit /B 0

:checkjava
set required_version=1.6
if /I "%JAVA_VERSION%" GEQ "%required_version%" (
  exit /B 0
)
echo.
echo The java installation you have is not up to date
echo sbt requires at least version %required_version%+, you have
echo version %JAVA_VERSION%
echo.
echo Please go to http://www.java.com/getjava/ and download
echo a valid Java Runtime and install before running sbt.
echo.
exit /B 1

:copyrt
if /I "%JAVA_VERSION%" GEQ "9" (
  set rtexport="%SBT_HOME%java9-rt-export.jar"

  "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "%rtexport%" --rt-ext-dir > "%TEMP%.\rtext.txt"
  set /p java9_ext= < "%TEMP%.\rtext.txt"
  set java9_rt=%java9_ext%\rt.jar

  if not exist "%java9_rt%" (
    echo Copying runtime jar.
    mkdir "%java9_ext%"
    "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "%rtexport%" "%java9_rt%"
  )
  set _JAVA_OPTS=!_JAVA_OPTS! -Dscala.ext.dirs="%java9_ext%"
)
exit /B 0

:sync_preloaded
if "%INIT_SBT_VERSION%"=="" (
  rem FIXME: better %INIT_SBT_VERSION% detection
  FOR /F "tokens=* USEBACKQ" %%F IN (`dir /b "%SBT_HOME%\..\lib\local-preloaded\org.scala-sbt\sbt" /B`) DO (
    SET INIT_SBT_VERSION=%%F
  )
)
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "1.8" (
  where robocopy >nul 2>nul
  if %ERRORLEVEL% equ 0 (
    echo %PRELOAD_SBT_JAR%
    if not exist %PRELOAD_SBT_JAR% (
      if exist "%SBT_HOME%\..\lib\local-preloaded\" (
        echo 'about to robocopy'
        robocopy "%SBT_HOME%\..\lib\local-preloaded" "%UserProfile%\.sbt\preloaded" /E
      )
    )
  )
)
exit /B 0

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

Fix missing placeholder `INIT_SBT_VERSION'


:: Start with bootstrap
cd tools\build
CALL bootstrap.bat
CALL .\b2 install --prefix=%LIBRARY_BIN%
cd ..\..

:: Build step
CALL .\b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=gcc ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=shared ^
    -j%CPU_COUNT% ^
    -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
    -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
    --with-python
IF errorlevel 1 exit 1

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1
Status API Training Shop Blog About

:: Start with bootstrap
cd tools\build
CALL bootstrap.bat mingw
:: CALL .\b2 install --prefix=%LIBRARY_BIN%
cd ..\..

:: Build step
CALL .\tools\build\b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=gcc ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=shared ^
    -j%CPU_COUNT% ^
    -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
    -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
    --with-python
IF errorlevel 1 exit 1

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1
Status API Training Shop Blog About

Update bld.bat

Update bld.bat


:: Start with bootstrap
:: cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
IF errorlevel 1 exit 1
ECHO cd %SRCDIR%
cd %SRCDIR%
IF errorlevel 1 exit 1
set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
IF errorlevel 1 exit 1
ECHO b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
CALL b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
IF errorlevel 1 exit 1
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

:: Start with bootstrap
cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
IF errorlevel 1 exit 1
ECHO cd %SRCDIR%
cd %SRCDIR%
IF errorlevel 1 exit 1
set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
IF errorlevel 1 exit 1
ECHO b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
CALL b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
IF errorlevel 1 exit 1
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


rem Build Arelle GUI using cx_Freeze
rem both win 32 (x86) and win 64 (x64)

rem arguments may be eiopa, x86, and er3
rem build x86 only for eiopa or x86

@set PYTHON32DIR=c:\python34x86
@set PYTHON64DIR=c:\python35
@set NSISDIR=C:\Program Files (x86)\NSIS
@set BUILT32DIR=build\exe.win32-3.4
@set BUILT64DIR=build\exe.win-amd64-3.5
@set ZIP=c:\progra~1\7-zip\7z.exe

@set do32bitBuild=true
@if not "%1"=="eiopa" if not "%1"=="x86" set do32bitBuild=false

rem Rebuild messages.pot internationalization file
"%PYTHON64DIR%\python" pygettext.py -v -o arelle\locale\messages.pot arelle\*.pyw arelle\*.py
pause "Please check the python gettext string conversions"

rem Regenerate messages catalog (doc/messagesCatalog.xml)
"%PYTHON64DIR%\python" generateMessagesCatalog.py

rmdir build /s/q
rmdir dist /s/q
mkdir build
mkdir dist

@set FILESUFFIX=""

@if "%1" == "er3.814" (
echo Copying EdgarRenderer
@set ER3DIR=Z:\Documents\mvsl\projects\SEC\RenderingEngine\github_plugin_3_3_0_814
xcopy "%ER3DIR%" arelle\plugin\EdgarRenderer/s/i
@set FILESUFFIX="ER3"
)

"%PYTHON64DIR%\python" buildVersion.py %FILESUFFIX%

rem win 64 build
"%PYTHON64DIR%\python" setup.py build_exe
@if "%1" == "er3.814" (
rmdir arelle\plugin\EdgarRenderer/s/q
)

@if not "%1" == "eiopa" (
"%NSISDIR%\makensis" installWin64.nsi
rem rename for build date
call buildRenameX64.bat
)

@if "%do32bitBuild%" == "true" (
rem win 32 (x86) build
"%PYTHON32DIR%\python" setup.py build_exe
@if not "%1" == "eiopa" (
"%NSISDIR%\makensis" installWin86.nsi
rem rename for build date
call buildRenameX86.bat
)
)

@if "%1" == "eiopa" (
rem win 64 zip
cd "%BUILT64DIR%"
"%ZIP%" a -tzip ..\..\dist\arelle-cmd64.zip *
cd ..\..
"%ZIP%" d dist\arelle-cmd64.zip arelleGUI.exe tck85.dll tk85.dll tck tcl tk images scripts doc examples locale QuickBooks.qwc msvcrt.dll msvcp100.dll
rem don't remove (for bare machine) MSVCR100.dll
call buildRenameZip64.bat

rem win 32 zip
cd "%BUILT32DIR%"
"%ZIP%" a -tzip ..\..\dist\arelle-cmd32.zip *
cd ..\..
"%ZIP%" d dist\arelle-cmd32.zip arelleGUI.exe tck85.dll tk85.dll tck tcl tk images scripts doc examples locale QuickBooks.qwc msvcrt.dll msvcp100.dll
rem don't remove (for bare machine) MSVCR100.dll
call buildRenameZip32.bat
)

rem rmdir build /s/q

rem Build Arelle GUI using cx_Freeze
rem both win 32 (x86) and win 64 (x64)

rem arguments may be eiopa, x86, and er3
rem build x86 only for eiopa or x86

@set PYTHON32DIR=c:\python34x86
@set PYTHON64DIR=c:\python34
rem @set TCL_LIBRARY=c:\python35\tcl\tcl8.6
rem @set TK_LIBRARY=c:\python35\tcl\tk8.6
@set NSISDIR=C:\Program Files (x86)\NSIS
@set BUILT32DIR=build\exe.win32-3.4
@set BUILT64DIR=build\exe.win-amd64-3.4
@set ZIP=c:\progra~1\7-zip\7z.exe

@set do32bitBuild=true
@if not "%1"=="eiopa" if not "%1"=="x86" set do32bitBuild=false

rem Rebuild messages.pot internationalization file
"%PYTHON64DIR%\python" pygettext.py -v -o arelle\locale\messages.pot arelle\*.pyw arelle\*.py
pause "Please check the python gettext string conversions"

rem Regenerate messages catalog (doc/messagesCatalog.xml)
"%PYTHON64DIR%\python" generateMessagesCatalog.py

rmdir build /s/q
rmdir dist /s/q
mkdir build
mkdir dist

@set FILESUFFIX=""

@if "%1" == "er3.814" (
echo Copying EdgarRenderer
@set ER3DIR=Z:\Documents\mvsl\projects\SEC\RenderingEngine\github_plugin_3_3_0_814
xcopy "%ER3DIR%" arelle\plugin\EdgarRenderer/s/i
@set FILESUFFIX="ER3"
)

"%PYTHON64DIR%\python" buildVersion.py %FILESUFFIX%

rem win 64 build
"%PYTHON64DIR%\python" setup.py build_exe
@if "%1" == "er3.814" (
rmdir arelle\plugin\EdgarRenderer/s/q
)

@if not "%1" == "eiopa" (
"%NSISDIR%\makensis" installWin64.nsi
rem rename for build date
call buildRenameX64.bat
)

@if "%do32bitBuild%" == "true" (
rem win 32 (x86) build
"%PYTHON32DIR%\python" setup.py build_exe
@if not "%1" == "eiopa" (
"%NSISDIR%\makensis" installWin86.nsi
rem rename for build date
call buildRenameX86.bat
)
)

@if "%1" == "eiopa" (
rem win 64 zip
cd "%BUILT64DIR%"
"%ZIP%" a -tzip ..\..\dist\arelle-cmd64.zip *
cd ..\..
"%ZIP%" d dist\arelle-cmd64.zip arelleGUI.exe tck85.dll tk85.dll tck tcl tk images scripts doc examples locale QuickBooks.qwc msvcrt.dll msvcp100.dll
rem don't remove (for bare machine) MSVCR100.dll
call buildRenameZip64.bat

rem win 32 zip
cd "%BUILT32DIR%"
"%ZIP%" a -tzip ..\..\dist\arelle-cmd32.zip *
cd ..\..
"%ZIP%" d dist\arelle-cmd32.zip arelleGUI.exe tck85.dll tk85.dll tck tcl tk images scripts doc examples locale QuickBooks.qwc msvcrt.dll msvcp100.dll
rem don't remove (for bare machine) MSVCR100.dll
call buildRenameZip32.bat
)

rem rmdir build /s/q

revert python to 3.4 (3.5.1 cx_Freeze not ready yet)


rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set
set BORLAND_BASE=C:\Borland\bcc55
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
mingw32-make
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem Set path for VC 6
path %MSDEV_BASE%;%path%
rem
rem ************************************************************
rem Target 4: Visual C++ .NET using scite\boundscheck\SciTE.sln
call "%MSDEV71_BASE%\vsvars32.bat"
call scite\scripts\clearboth
cd scite\boundscheck
devenv scite.sln /rebuild release
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
call scite\scripts\clearboth
cd scintilla\win32
nmake -f scintilla_vc6.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Removed: Target 7
rem
rem ************************************************************
rem Removed: Target 8
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
call scite\scripts\clearboth
cd scite\boundscheck
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set BORLAND_BASE=
set MSDEV_BASE=
set

rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
mingw32-make
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem Set path for VC 6
path %MSDEV_BASE%;%path%
rem
rem ************************************************************
rem Target 4: Visual C++ .NET using scite\boundscheck\SciTE.sln
call "%MSDEV71_BASE%\vsvars32.bat"
call scite\scripts\clearboth
cd scite\boundscheck
devenv scite.sln /rebuild release
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
call scite\scripts\clearboth
cd scintilla\win32
nmake -f scintilla_vc6.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Removed: Target 7
rem
rem ************************************************************
rem Removed: Target 8
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
call scite\scripts\clearboth
cd scite\boundscheck
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set MSDEV_BASE=
set

Remove dead Borland support.

Remove dead Borland support.


SET CURRENTDIR="%cd%"

if exist maven-android-sdk-deployer (
    cd maven-android-sdk-deployer
        git pull
) else (
    git clone https://github.com/mosabua/maven-android-sdk-deployer.git
        cd maven-android-sdk-deployer
)

call mvn clean install -P 4.4a

cd extras\compatibility-v13

call mvn clean install -Dextras.compatibility.v13.groupid=com.android.support -

Dextras.compatibility.v13.artifactid=support-v13

cd ..\compatibility-v4

call mvn clean install -Dextras.compatibility.v4.groupid=com.android.support -Dextras.compatibility.v4.artifactid=support-

v4

cd ..\gcm\gcm-server

call mvn clean install

cd /d %CURRENTDIR%

Create setup.bat

Create setup.bat


REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-Server-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\Windows\Temp

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass

REM SQLServer-SSEI-Dev.exe /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /QS /ADDCURRENTUSERASSQLADMIN /SQLSVCINSTANTFILEINIT="True"

REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-Server-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\Windows\Temp

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass

REM SQLServer-SSEI-Dev.exe /Q /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat


@echo off
echo Updating Avalon Setup..
echo+

git submodule foreach git reset --hard
git reset --hard
git pull origin master
git submodule update --recursive

echo+
echo Update finished successfully!
pause

@echo off
echo Updating Avalon Setup..
echo+

:: Discard any rouge changes to the codebase
git submodule foreach git reset --hard
git reset --hard

:: Update, include any added submodules
git pull origin master
git submodule init
git submodule update --recursive

echo+
echo Update finished successfully!
pause

Improve update.bat

Improve update.bat


mkdir pubdocs
cd pubdocs

git clone https://%1:%2@github.com/SkillsFundingAgency/das-paymentsacceptancetesting.git --branch gh-pages

xcopy ..\das-payments-AcceptanceTests\AcceptanceTests\docs das-paymentsacceptancetesting /E /R /Y

git config  --global user.email "kalim.akbar@fasst.org.uk"
git config  --global user.name "build agent"

cd das-paymentsacceptancetesting
git add --all
git commit -m "Update docs for release %RELEASE_RELEASENAME%"
git push origin gh-pages

mkdir pubdocs
cd pubdocs

git clone https://%1:%2@github.com/SkillsFundingAgency/das-paymentsacceptancetesting.git --branch gh-pages

xcopy ..\das-payments-AcceptanceTests\AcceptanceTests\docs das-paymentsacceptancetesting /E /R /Y

git config  user.email "kalim.akbar@fasst.org.uk"
git config  user.name "build agent"

cd das-paymentsacceptancetesting
git add --all
git commit -m "Update docs for release %RELEASE_RELEASENAME%"
git push origin gh-pages

Update publishdocs.bat

Update publishdocs.bat


@echo off

set PYTHON=%~1
set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%

python -m pytest
python -m flake8

set PYTHON=%~1
set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%

pytest
flake8

Use pytest and flake8 commands.

Use pytest and flake8 commands.


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

REM Build
call "%msbuild%" src\cr-viewmodels.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

REM Unit tests
call %nuget% install NUnit.Runners -Version 2.6.2 -OutputDirectory packages
packages\NUnit.Runners.2.6.2\tools\nunit-console.exe /config:%config% /framework:net-4.5 src\tests\bin\%config%\CR.ViewModels.Tests.dll
if not "%errorlevel%"=="0" goto failure

REM Package
mkdir Build
cmd /c %nuget% pack "src\core\core.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\persistance.memory\persistance.memory.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\persistance.ravendb\persistance.ravendb.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\persistance.applicationstate\persistance.applicationstate.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

Revert "Removed myget.bat"

Revert "Removed myget.bat"

This reverts commit 7340223ac3394ae71dfdc3ed9785282f73443ac2.


@echo off
echo "Building the executable"
python setup.py py2exe -b 1
copy ../configurations/default.ini default.ini
copy ../configurations/default-logger.ini default-logger.ini
copy ../configurations/ovirt-guest-agent.ini ovirt-guest-agent.ini

@echo off
echo "Building the executable"
python setup.py py2exe -b 1
copy ..\configurations\default.ini default.ini
copy ..\configurations\default-logger.ini default-logger.ini
copy ..\configurations\ovirt-guest-agent.ini ovirt-guest-agent.ini

Fix win-guest-agent-build-exe.bat

Fix win-guest-agent-build-exe.bat

File paths must use backslashes.

Change-Id: I24609f3afccd364ba2717e57cf241711f2461c91
Signed-off-by: Lev Veyde <32edd3ccb8e9d69e90ee9ce8dbc368c1f61bdf7b@redhat.com>


@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" (
  echo Options:
  echo     -mingw32,mingw64,msys            Set shell type
  echo     -defterm,mintty,conemu,consolez  Set terminal type
  echo     -here [DIRECTORY]                Starting directory
  echo     -full-path                       Inherit Windows path
  exit /b 1
)
rem Shell types
if "x%~1" == "x-msys" shift& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-msys2" shift& set MSYSTEM=MSYS& set _deprecated_msys2=true& 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& set _deprecated_mingw=true& (if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32))& goto :checkparams
rem Console types
if "x%~1" == "x-consolez" shift& set MSYSCON=console.exe& goto :checkparams
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& set _deprecated_use_full_path=true& goto :checkparams
if "x%~1" == "x-here" shift& set CHERE_INVOKING=enabled_from_arguments& goto :checkparams
if "x%~1" == "x-where" shift& set CHERE_INVOKING=enabled_from_arguments& set _deprecated_where=true& goto :checkparams
if "x%CHERE_INVOKING%" == "xenabled_from_arguments" if not "%~1" == "" if exist "%~1\" shift& cd /d "%~1\"& goto :checkparams

rem Deprecated parameters
rem TODO: remove this check when most users have stopped using them
if "x%_deprecated_use_full_path%" == "xtrue" (
  echo The MSYS2 shell has been started with the deprecated -use-full-path> "%WD%..\..\etc\profile.d\msys2_shell.use_full_path.warning.once"
  echo option. Please update your shortcuts to use -full-path instead.>>    "%WD%..\..\etc\profile.d\msys2_shell.use_full_path.warning.once"
)
if "x%_deprecated_where%" == "xtrue" (
  echo The MSYS2 shell has been started with the deprecated -where> "%WD%..\..\etc\profile.d\msys2_shell.where.warning.once"
  echo option. Please update your shortcuts to use -here instead.>> "%WD%..\..\etc\profile.d\msys2_shell.where.warning.once"
)
if "x%_deprecated_msys2%" == "xtrue" (
  echo The MSYS2 shell has been started with the deprecated -msys2> "%WD%..\..\etc\profile.d\msys2_shell.msys2.warning.once"
  echo option. Please update your shortcuts to use -msys instead.>> "%WD%..\..\etc\profile.d\msys2_shell.msys2.warning.once"
)
if "x%_deprecated_mingw%" == "xtrue" (
  echo The MSYS2 shell has been started with the deprecated -mingw option.> "%WD%..\..\etc\profile.d\msys2_shell.mingw.warning.once"
  echo Please update your shortcuts to use -mingw32 or -mingw64 instead.>>  "%WD%..\..\etc\profile.d\msys2_shell.mingw.warning.once"
)

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%" == "xconsole.exe" goto startconsolez
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
start "%CONTITLE%" "%WD%mintty" -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
exit /b %ERRORLEVEL%

:startconsolez
cd %WD%..\lib\ConsoleZ
start console -t "%CONTITLE%" -r %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
)
start "%CONTITLE%" "%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=
start "%CONTITLE%" "%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

@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" (
  echo Options:
  echo     -mingw32,mingw64,msys            Set shell type
  echo     -defterm,mintty,conemu,consolez  Set terminal type
  echo     -here [DIRECTORY]                Starting directory
  echo     -full-path                       Inherit Windows path
  exit /b 1
)
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-consolez" shift& set MSYSCON=console.exe& goto :checkparams
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" shift& set CHERE_INVOKING=enabled_from_arguments& goto :checkparams
if "x%CHERE_INVOKING%" == "xenabled_from_arguments" if not "%~1" == "" if exist "%~1\" shift& cd /d "%~1\"& 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%" == "xconsole.exe" goto startconsolez
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
start "%CONTITLE%" "%WD%mintty" -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
exit /b %ERRORLEVEL%

:startconsolez
cd %WD%..\lib\ConsoleZ
start console -t "%CONTITLE%" -r %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
)
start "%CONTITLE%" "%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=
start "%CONTITLE%" "%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

msys2_shell.cmd: Stop deprecating parameters, give users freedom to use whatever they found convenient


REM BL-MCP version 1.1
REM @author acomputerdog 1-25-14
REM TODO:
REM * get blazeloader sources that are not the newest dev version.
REM * get libraries without hardcoding them
@echo off
if not exist "%cd%/BlazeLoader/instlflg" (
    echo --- MCP and BL setup script ---
    echo Please select an install type:
    echo 1 - Cancel install
    echo 2 - Setup MCP for developing BlazeLoader itself
    echo 3 - Setup MCP for developing BlazeLoader mods
    choice /C 123
    echo.
    if errorlevel 3 (
        echo Setting up MCP to develop BlazeLoader mods.
        echo Unmodified BlazeLoader sources will be excluded from getChangedSrc and reobfuscate scripts.
        set setupmode=mod
    ) else if errorlevel 2 (
        echo Setting up MCP to develop BlazeLoader itself.
        echo Unmodified BlazeLoader sources will be included with getChangedSrc and reobfuscate scripts.
        set setupmode=bl
    ) else (
        echo MCP setup canceled.
        exit /b -1
    )
    if not exist "%cd%/temp/setup" mkdir "%cd%\temp\setup\"
    echo.
    echo Extracting downloader script...
REM begin embedded VBScript file
    echo strURL = WScript.Arguments.Item(0^)>"%cd%/temp/setup/bl_downloader.vbs"
    echo strPath = WScript.Arguments.Item(1^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo dim xHttp: Set xHttp = createobject("MSXML2.ServerXMLHTTP.6.0"^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo dim bStrm: Set bStrm = createobject("Adodb.Stream"^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo xHttp.Open "GET", strURL, False>>"%cd%/temp/setup/bl_downloader.vbs"
    echo xHttp.Send>>"%cd%/temp/setup/bl_downloader.vbs"
    echo with bStrm>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .type = 1 1>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .open>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .write xHttp.responseBody>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .savetofile strPath, 2 1>>"%cd%/temp/setup/bl_downloader.vbs"
    echo end with>>"%cd%/temp/setup/bl_downloader.vbs"
    echo WScript.Quit>>"%cd%/temp/setup/bl_downloader.vbs"
REM end embedded VBScript file
    if exist "%cd%/temp/setup/bl_downloader.vbs" (
        echo Done.
    ) else (
        echo Unable to extract downloader script, aborting install!
        exit /b 3
    )
    echo.
    echo Downloading BlazeLoader from "http://github.com/warriordog/BlazeLoader/archive/master.zip"...
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://github.com/warriordog/BlazeLoader/archive/master.zip "%cd%/temp/setup/BlazeLoader_repo.zip"
    echo Done.
    echo.
    echo Downloading 7-Zip from "http://www.acomputerdog.net/BL_STORE/7-zip_package.exe"...
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://www.acomputerdog.net/BL_STORE/7-zip_package.exe "%cd%/temp/setup/7-zip_package.exe"
    echo Done.
    echo.
    echo Extracting 7-Zip...
    "%cd%/temp/setup/7-zip_package.exe" /q:a /t:"%cd%\temp\setup\7-zip\" /c /r:n
    if exist "%cd%/temp/setup/7-zip/7z.exe" (
        echo Done.
    ) else (
        echo 7-zip was not extracted! (you may need to disable your antivirus if the self-extracting archive was blocked^)
        echo Unable to extract BlazeLoader, aborting install!
        exit /b 1
    )
    echo.
    echo Extracting BlazeLoader...
    "%cd%/temp/setup/7-zip/7z.exe" e -o"%cd%/BlazeLoader/" -y "%cd%/temp/setup/BlazeLoader_repo.zip" mcp.ver
    "%cd%/temp/setup/7-zip/7z.exe" x -o"%cd%/temp/setup/" -y "%cd%/temp/setup/BlazeLoader_repo.zip"
    xcopy /I /Y /E /C /Q "%cd%\temp\setup\BlazeLoader-master\*" "%cd%\BlazeLoader"
    rmdir /S /Q "%cd%\temp\setup\BlazeLoader-master"
    timeout /t 2 >nul
    echo Done.
    if exist "%cd%/BlazeLoader/mcp.ver" (
        set /p mcpver=<"%cd%/BlazeLoader/mcp.ver"
        if [%mcpver%] == [] (
            echo.
            echo Unable to detect MCP version, defaulting to MCP version 903.
            set mcpver=903
        )
    ) else (
        echo.
        echo Unable to detect MCP version, defaulting to MCP version 903.
        set mcpver=903
    )
    if not exist "%cd%/temp/setup/mcp%mcpver%.zip" (
        echo.
        echo Downloading MCP...
        cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://mcp.ocean-labs.de/files/archive/mcp%mcpver%.zip "%cd%/temp/setup/mcp%mcpver%.zip"
        echo Done.
    ) else (
        echo MCP already downloaded; skipping download.
    )
    echo.
    echo Extracting MCP...
    "%cd%/temp/setup/7-zip/7z.exe" x -bd -ba -o"%cd%" -y "%cd%/temp/setup/mcp%mcpver%.zip"
    if exist "%cd%/decompile.bat" (
        echo Done.
    ) else (
        echo MCP version %mcpver% was not found, provide it manually to %cd%/temp/setup/mcp%mcpver%.zip!  Aborting install!
        exit /b 2
    )
    echo.
    REM TODO: find a way to do this without hardcoding anything.  Maybe reuse Libaries.txt, or write a batch JSON parser(If I go insane)?
    echo Downloading and copying libraries...
    if not exist "%cd%/lib/" mkdir "%cd%/lib/"
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" "http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/4.1/asm-debug-all-4.1.jar" "%cd%/lib/asm-debug-all-4.1.jar"
    xcopy /Y "%appdata%\.minecraft\libraries\net\minecraft\launchwrapper\1.9\*.jar" "%cd%\lib\"
    echo Done.
    echo.
    echo Applying AccessTransformer...
    if not exist "%cd%/jars/libraries/org/ow2/asm/asm-debug-all/4.1/" mkdir "%cd%/jars/libraries/org/ow2/asm/asm-debug-all/4.1/"
    xcopy /I /Y "%cd%\lib\asm-debug-all-4.1.jar" "%cd%\jars\libraries\org\ow2\asm\asm-debug-all\4.1\"
    "%cd%/BlazeLoader/apply_at.bat"
    echo Done.
    echo.
    echo Decompiling...
    "%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/decompile.py"
    echo Done.
    echo.
    echo Copying BlazeLoader sources...
    xcopy /I /Y /E /C /Q "%cd%\BlazeLoader\source\core\*" "%cd%\src\minecraft\"
    xcopy /I /Y /E /C /Q "%cd%\BlazeLoader\source\vanilla\*" "%cd%\src\minecraft\"
    echo Done.
    echo.
    if "%setupmode%" == "bl" (
        echo Recompiling...
        "%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/recompile.py"
    ) else (
        echo Updating MD5s...
        echo yes|"%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/updatemd5.py"
    )
    echo Done.
    echo.
    echo %date%-%time%>"%cd%/BlazeLoader/instlflg"
    echo MCP setup complete!
    echo.
) else (
    echo MCP has already been set up!
    exit /b -2
)
pause

@echo off
REM BL-MCP version 1.1
REM @author acomputerdog 1-25-14
REM TODO:
REM * get blazeloader sources that are not the newest dev version.
REM * get libraries without hardcoding them
if not exist "%cd%/BlazeLoader/instlflg" (
    echo --- MCP and BL setup script ---
    echo Please select an install type:
    echo 1 - Cancel install
    echo 2 - Setup MCP for developing BlazeLoader itself
    echo 3 - Setup MCP for developing BlazeLoader mods
    choice /C 123
    echo.
    if errorlevel 3 (
        echo Setting up MCP to develop BlazeLoader mods.
        echo Unmodified BlazeLoader sources will be excluded from getChangedSrc and reobfuscate scripts.
        set setupmode=mod
    ) else if errorlevel 2 (
        echo Setting up MCP to develop BlazeLoader itself.
        echo Unmodified BlazeLoader sources will be included with getChangedSrc and reobfuscate scripts.
        set setupmode=bl
    ) else (
        echo MCP setup canceled.
        exit /b -1
    )
    if not exist "%cd%/temp/setup" mkdir "%cd%\temp\setup\"
    echo.
    echo Extracting downloader script...
REM begin embedded VBScript file
    echo strURL = WScript.Arguments.Item(0^)>"%cd%/temp/setup/bl_downloader.vbs"
    echo strPath = WScript.Arguments.Item(1^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo dim xHttp: Set xHttp = createobject("MSXML2.ServerXMLHTTP.6.0"^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo dim bStrm: Set bStrm = createobject("Adodb.Stream"^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo xHttp.Open "GET", strURL, False>>"%cd%/temp/setup/bl_downloader.vbs"
    echo xHttp.Send>>"%cd%/temp/setup/bl_downloader.vbs"
    echo with bStrm>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .type = 1 1>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .open>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .write xHttp.responseBody>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .savetofile strPath, 2 1>>"%cd%/temp/setup/bl_downloader.vbs"
    echo end with>>"%cd%/temp/setup/bl_downloader.vbs"
    echo WScript.Quit>>"%cd%/temp/setup/bl_downloader.vbs"
REM end embedded VBScript file
    if exist "%cd%/temp/setup/bl_downloader.vbs" (
        echo Done.
    ) else (
        echo Unable to extract downloader script, aborting install!
        exit /b 3
    )
    echo.
    echo Downloading BlazeLoader from "http://github.com/warriordog/BlazeLoader/archive/master.zip"...
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://github.com/warriordog/BlazeLoader/archive/master.zip "%cd%/temp/setup/BlazeLoader_repo.zip"
    echo Done.
    echo.
    echo Downloading 7-Zip from "http://www.acomputerdog.net/BL_STORE/7-zip_package.exe"...
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://www.acomputerdog.net/BL_STORE/7-zip_package.exe "%cd%/temp/setup/7-zip_package.exe"
    echo Done.
    echo.
    echo Extracting 7-Zip...
    "%cd%/temp/setup/7-zip_package.exe" /q:a /t:"%cd%\temp\setup\7-zip\" /c /r:n
    if exist "%cd%/temp/setup/7-zip/7z.exe" (
        echo Done.
    ) else (
        echo 7-zip was not extracted! (you may need to disable your antivirus if the self-extracting archive was blocked^)
        echo Unable to extract BlazeLoader, aborting install!
        exit /b 1
    )
    echo.
    echo Extracting BlazeLoader...
    "%cd%/temp/setup/7-zip/7z.exe" e -o"%cd%/BlazeLoader/" -y "%cd%/temp/setup/BlazeLoader_repo.zip" mcp.ver
    "%cd%/temp/setup/7-zip/7z.exe" x -o"%cd%/temp/setup/" -y "%cd%/temp/setup/BlazeLoader_repo.zip"
    xcopy /I /Y /E /C /Q "%cd%\temp\setup\BlazeLoader-master\*" "%cd%\BlazeLoader"
    rmdir /S /Q "%cd%\temp\setup\BlazeLoader-master"
    timeout /t 2 >nul
    echo Done.
    if exist "%cd%/BlazeLoader/mcp.ver" (
        set /p mcpver=<"%cd%/BlazeLoader/mcp.ver"
        if [%mcpver%] == [] (
            echo.
            echo Unable to detect MCP version, defaulting to MCP version 903.
            set mcpver=903
        )
    ) else (
        echo.
        echo Unable to detect MCP version, defaulting to MCP version 903.
        set mcpver=903
    )
    if not exist "%cd%/temp/setup/mcp%mcpver%.zip" (
        echo.
        echo Downloading MCP...
        cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://mcp.ocean-labs.de/files/archive/mcp%mcpver%.zip "%cd%/temp/setup/mcp%mcpver%.zip"
        echo Done.
    ) else (
        echo MCP already downloaded; skipping download.
    )
    echo.
    echo Extracting MCP...
    "%cd%/temp/setup/7-zip/7z.exe" x -bd -ba -o"%cd%" -y "%cd%/temp/setup/mcp%mcpver%.zip"
    if exist "%cd%/decompile.bat" (
        echo Done.
    ) else (
        echo MCP version %mcpver% was not found, provide it manually to %cd%/temp/setup/mcp%mcpver%.zip!  Aborting install!
        exit /b 2
    )
    echo.
    REM TODO: find a way to do this without hardcoding anything.  Maybe reuse Libaries.txt, or write a batch JSON parser(If I go insane)?
    echo Downloading and copying libraries...
    if not exist "%cd%/lib/" mkdir "%cd%/lib/"
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" "http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/4.1/asm-debug-all-4.1.jar" "%cd%/lib/asm-debug-all-4.1.jar"
    xcopy /Y "%appdata%\.minecraft\libraries\net\minecraft\launchwrapper\1.9\*.jar" "%cd%\lib\"
    echo Done.
    echo.
    echo Applying AccessTransformer...
    if not exist "%cd%/jars/libraries/org/ow2/asm/asm-debug-all/4.1/" mkdir "%cd%/jars/libraries/org/ow2/asm/asm-debug-all/4.1/"
    xcopy /I /Y "%cd%\lib\asm-debug-all-4.1.jar" "%cd%\jars\libraries\org\ow2\asm\asm-debug-all\4.1\"
    "%cd%/BlazeLoader/apply_at.bat"
    echo Done.
    echo.
    echo Decompiling...
    "%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/decompile.py"
    echo Done.
    echo.
    echo Copying BlazeLoader sources...
    xcopy /I /Y /E /C /Q "%cd%\BlazeLoader\source\core\*" "%cd%\src\minecraft\"
    xcopy /I /Y /E /C /Q "%cd%\BlazeLoader\source\vanilla\*" "%cd%\src\minecraft\"
    echo Done.
    echo.
    if "%setupmode%" == "bl" (
        echo Recompiling...
        "%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/recompile.py"
    ) else (
        echo Updating MD5s...
        echo yes|"%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/updatemd5.py"
    )
    echo Done.
    echo.
    echo %date%-%time%>"%cd%/BlazeLoader/instlflg"
    echo MCP setup complete!
    echo.
) else (
    echo MCP has already been set up!
    exit /b -2
)
pause

Fix misplaced comments

Fix misplaced comments


@echo off
REM BL-MCP version 1.3
REM @author acomputerdog 2-14-14
REM TODO:
REM * get blazeloader sources that are not the newest dev version.
REM * get libraries without hardcoding them
if not exist "%cd%/BlazeLoader/instlflg" (
    setlocal EnableDelayedExpansion
    echo --- MCP and BL setup script ---
    echo Please select an install type:
    echo 1 - Cancel install
    echo 2 - Setup MCP for developing BlazeLoader itself
    echo 3 - Setup MCP for developing BlazeLoader mods
    choice /C 123
    echo.
    if errorlevel 3 (
        echo Setting up MCP to develop BlazeLoader mods.
        echo Unmodified BlazeLoader sources will be excluded from getChangedSrc and reobfuscate scripts.
        set setupmode=mod
    ) else if errorlevel 2 (
        echo Setting up MCP to develop BlazeLoader itself.
        echo Unmodified BlazeLoader sources will be included with getChangedSrc and reobfuscate scripts.
        set setupmode=bl
    ) else (
        echo MCP setup canceled.
        pause
        exit /b -1
    )
    if not exist "%cd%/temp/setup" mkdir "%cd%\temp\setup\"
    echo.
    echo Extracting downloader script...
REM begin embedded VBScript file
    echo strURL = WScript.Arguments.Item(0^)>"%cd%/temp/setup/bl_downloader.vbs"
    echo strPath = WScript.Arguments.Item(1^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo dim xHttp: Set xHttp = createobject("MSXML2.ServerXMLHTTP.6.0"^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo dim bStrm: Set bStrm = createobject("Adodb.Stream"^)>>"%cd%/temp/setup/bl_downloader.vbs"
    echo xHttp.Open "GET", strURL, False>>"%cd%/temp/setup/bl_downloader.vbs"
    echo xHttp.Send>>"%cd%/temp/setup/bl_downloader.vbs"
    echo with bStrm>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .type = 1 1>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .open>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .write xHttp.responseBody>>"%cd%/temp/setup/bl_downloader.vbs"
    echo     .savetofile strPath, 2 1>>"%cd%/temp/setup/bl_downloader.vbs"
    echo end with>>"%cd%/temp/setup/bl_downloader.vbs"
    echo WScript.Quit>>"%cd%/temp/setup/bl_downloader.vbs"
REM end embedded VBScript file
    if exist "%cd%/temp/setup/bl_downloader.vbs" (
        echo Done.
    ) else (
        echo Unable to extract downloader script, aborting install!
        pause
        exit /b 3
    )
    echo.
    echo Downloading BlazeLoader from "http://github.com/warriordog/BlazeLoader/archive/master.zip"...
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://github.com/warriordog/BlazeLoader/archive/master.zip "%cd%/temp/setup/BlazeLoader_repo.zip"
    echo Done.
    echo.
    echo Downloading 7-Zip from "http://www.acomputerdog.net/BL_STORE/7-zip_package.exe"...
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://www.acomputerdog.net/BL_STORE/7-zip_package.exe "%cd%/temp/setup/7-zip_package.exe"
    echo Done.
    echo.
    echo Extracting 7-Zip...
    "%cd%/temp/setup/7-zip_package.exe" /q:a /t:"%cd%\temp\setup\7-zip\" /c /r:n
    if exist "%cd%/temp/setup/7-zip/7z.exe" (
        echo Done.
    ) else (
        echo 7-zip was not extracted! (you may need to disable your antivirus if the self-extracting archive was blocked^)
        echo Unable to extract BlazeLoader, aborting install!
        pause
        exit /b 1
    )
    echo.
    echo Extracting BlazeLoader...
    "%cd%/temp/setup/7-zip/7z.exe" e -o"%cd%/BlazeLoader/" -y "%cd%/temp/setup/BlazeLoader_repo.zip" mcp.ver
    "%cd%/temp/setup/7-zip/7z.exe" x -o"%cd%/temp/setup/" -y "%cd%/temp/setup/BlazeLoader_repo.zip"
    xcopy /I /Y /E /C /Q "%cd%\temp\setup\BlazeLoader-master\*" "%cd%\BlazeLoader"
    rmdir /S /Q "%cd%\temp\setup\BlazeLoader-master"
    echo Done.
    set /p mcpver=<"%cd%/BlazeLoader/mcp.ver"
    if not exist "%cd%/temp/setup/mcp!mcpver!.zip" (
        echo.
        echo Downloading MCP...
        cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" http://mcp.ocean-labs.de/files/archive/mcp%mcpver%.zip "%cd%/temp/setup/mcp!mcpver!.zip"
        echo Done.
    ) else (
        echo MCP already downloaded; skipping download.
    )
    echo.
    echo Extracting MCP...
    "%cd%/temp/setup/7-zip/7z.exe" x -bd -ba -o"%cd%" -y "%cd%/temp/setup/mcp!mcpver!.zip"
    if exist "%cd%/decompile.bat" (
        echo Done.
    ) else (
        echo MCP version !mcpver! was not found, provide it manually to %cd%/temp/setup/mcp!mcpver!.zip!  Aborting install!
        pause
        exit /b 2
    )
    echo.
    REM TODO: find a way to do this without hardcoding anything.  Maybe reuse Libaries.txt, or write a batch JSON parser(If I go insane)?
    echo Downloading and copying libraries...
    if not exist "%cd%/lib/" mkdir "%cd%/lib/"
    cscript.exe //B "%cd%/temp/setup/bl_downloader.vbs" "http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/4.1/asm-debug-all-4.1.jar" "%cd%/lib/asm-debug-all-4.1.jar"
    xcopy /Y "%appdata%\.minecraft\libraries\net\minecraft\launchwrapper\1.9\*.jar" "%cd%\lib\"
    echo Done.
    echo.
    echo Applying AccessTransformer...
    if not exist "%cd%/jars/libraries/org/ow2/asm/asm-debug-all/4.1/" mkdir "%cd%/jars/libraries/org/ow2/asm/asm-debug-all/4.1/"
    xcopy /I /Y "%cd%\lib\asm-debug-all-4.1.jar" "%cd%\jars\libraries\org\ow2\asm\asm-debug-all\4.1\"
    "%cd%/BlazeLoader/apply_at.bat"
    echo Done.
    echo.
    echo Decompiling...
    "%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/decompile.py"
    echo Done.
    echo.
    echo Copying BlazeLoader sources...
    xcopy /I /Y /E /C /Q "%cd%\BlazeLoader\source\core\*" "%cd%\src\minecraft\"
    xcopy /I /Y /E /C /Q "%cd%\BlazeLoader\source\vanilla\*" "%cd%\src\minecraft\"
    echo Done.
    echo.
    if "%setupmode%" == "bl" (
        echo Recompiling...
        "%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/recompile.py"
    ) else (
        echo Updating MD5s...
        echo yes|"%cd%/runtime/bin/python/python_mcp.exe" "%cd%/runtime/updatemd5.py"
    )
    echo Done.
    echo.
    echo %date%-%time%>"%cd%/BlazeLoader/instlflg"
    echo MCP setup complete!
    echo.
	pause
) else (
    echo MCP has already been set up!
    pause
    exit /b -2
)

Fix a bunch of bugs with installer * Fix always attempting to use mcp version blank * Fix closing on crashes * Fix 3-second delay in script


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

ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif

ifeq ($(TARGDIR),)
TARGDIR:=$(QUOTED_GOBIN)
endif

all: $(TARG)

include $(QUOTED_GOROOT)/src/Make.common

PREREQ+=$(patsubst %,%.make,$(DEPS))

$(TARG): _go_.$O
	$(LD) $(LDIMPORTS) -o $@ _go_.$O

_go_.$O: $(GOFILES) $(PREREQ)
	$(GC) $(GCIMPORTS) -o $@ $(GOFILES)

install: $(TARGDIR)/$(TARG)

$(TARGDIR)/$(TARG): $(TARG)
	cp -f $(TARG) $(TARGDIR)

CLEANFILES+=$(TARG) _test _testmain.go

nuke: clean
	rm -f $(TARGDIR)/$(TARG)

# for gotest
testpackage: _test/main.a

testpackage-clean:
	rm -f _test/main.a _gotest_.$O

_test/main.a: _gotest_.$O
	@mkdir -p _test
	rm -f $@
	gopack grc $@ _gotest_.$O

_gotest_.$O: $(GOFILES) $(GOTESTFILES)
	$(GC) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)

importpath:
	echo main

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

ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif

ifeq ($(TARGDIR),)
TARGDIR:=$(QUOTED_GOBIN)
endif

all: $(TARG)

include $(QUOTED_GOROOT)/src/Make.common

PREREQ+=$(patsubst %,%.make,$(DEPS))

$(TARG): _go_.$O
	$(LD) $(LDIMPORTS) -o $@ _go_.$O

_go_.$O: $(GOFILES) $(PREREQ)
	$(GC) $(GCIMPORTS) -o $@ $(GOFILES)

install: $(TARGDIR)/$(TARG)

$(TARGDIR)/$(TARG): $(TARG)
	mkdir -p $(TARGDIR) && cp -f $(TARG) $(TARGDIR)

CLEANFILES+=$(TARG) _test _testmain.go

nuke: clean
	rm -f $(TARGDIR)/$(TARG)

# for gotest
testpackage: _test/main.a

testpackage-clean:
	rm -f _test/main.a _gotest_.$O

_test/main.a: _gotest_.$O
	@mkdir -p _test
	rm -f $@
	gopack grc $@ _gotest_.$O

_gotest_.$O: $(GOFILES) $(GOTESTFILES)
	$(GC) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)

importpath:
	echo main

create TARGDIR if necessary

Make.cmd: create TARGDIR if necessary

Fixes issue 1771.

R=adg, rsc1
CC=golang-dev
http://codereview.appspot.com/4437089


@echo off

:: Hammer does not need this variable but the unit
:: tests do.
set OMAHA_PSEXEC_DIR=%ProgramFiles(x86)%

setlocal

rem -- Set all environment variables used by Hammer and Omaha. --

:: VS2003/VC71 is 1310 (not supported by the current build).
:: VS2005/VC80 is 1400 (not supported by the current build).
:: VS2008/VC90 is 1500 (not supported by the current build).
:: VS2010/VC10 is 1600 (not supported by the current build).
:: VS2012/VC11 is 1700 (not supported by the current build).
:: VS2013/VC12 is 1800.
:: VS2015/VC14 is 1900.

if "%VisualStudioVersion%"=="" goto error_no_vc
if "%VisualStudioVersion%"=="12.0" goto vc120
if "%VisualStudioVersion%"=="14.0" goto vc140
goto error_vc_not_supported

:vc120
set OMAHA_MSC_VER=1800
goto set_env_variables

:vc140
set OMAHA_MSC_VER=1900
goto set_env_variables

:set_env_variables
set GOROOT=%ProgramFiles(x86)%\go\files
set OMAHA_ATL_SERVER_DIR=c:\atl_server\files
set OMAHA_NET_DIR=%WINDIR%\Microsoft.NET\Framework\v2.0.50727
set OMAHA_NETFX_TOOLS_DIR=%WindowsSDK_ExecutablePath_x86%
set OMAHA_PYTHON_DIR=C:\Python24
set OMAHA_WIX_DIR=%ProgramFiles(x86)%\WiX Toolset v3.8\bin
set OMAHA_WTL_DIR=C:\wtl\files
set OMAHA_PLATFORM_SDK_DIR=%WindowsSdkDir%\
set OMAHA_WINDOWS_SDK_10_0_VERSION=%WindowsSDKVersion:~0,-1%
set OMAHA_SIGNTOOL_SDK_DIR=%WindowsSdkDir%\bin\x86
set PYTHONPATH=%OMAHA_PYTHON_DIR%
set SCONS_DIR=C:\Python24\Lib\site-packages\scons-1.3.1
set SCT_DIR=C:\swtoolkit

set PROXY_CLSID_TARGET=%~dp0proxy_clsids.txt
set CUSTOMIZATION_UT_TARGET=%~dp0common\omaha_customization_proxy_clsid.h

rem Force Hammer to use Python 2.4.  (The default of Python 2.6 exposes some
rem bugs in Scons 1.2, which we currently use.)
set PYTHON_TO_USE=python_24
call "%SCT_DIR%\hammer.bat" %*

if /i {%1} == {-c} (
  del /q /f "%PROXY_CLSID_TARGET%" 2> NUL
  del /q /f "%CUSTOMIZATION_UT_TARGET%" 2> NUL
)

goto end

:error_no_vc
echo VisualStudioVersion variable is not set. Have you run vcvarsall.bat before running this script?
goto end

:error_vc_not_supported
echo Visual Studio version %VisualStudioVersion% is not supported.
goto end

:end

@echo off

:: Hammer does not need this variable but the unit
:: tests do.
set OMAHA_PSEXEC_DIR=%ProgramFiles(x86)%

setlocal

rem -- Set all environment variables used by Hammer and Omaha. --

:: VS2003/VC71 is 1310 (not supported by the current build).
:: VS2005/VC80 is 1400 (not supported by the current build).
:: VS2008/VC90 is 1500 (not supported by the current build).
:: VS2010/VC10 is 1600 (not supported by the current build).
:: VS2012/VC11 is 1700 (not supported by the current build).
:: VS2013/VC12 is 1800.
:: VS2015/VC14 is 1900.

if "%VisualStudioVersion%"=="" goto error_no_vc
if "%VisualStudioVersion%"=="12.0" goto vc120
if "%VisualStudioVersion%"=="14.0" goto vc140
goto error_vc_not_supported

:vc120
set OMAHA_MSC_VER=1800
goto set_env_variables

:vc140
set OMAHA_MSC_VER=1900
goto set_env_variables

:set_env_variables

:: Change these variables to match the local build environment.

:: Directory where the Go programming language toolchain is installed.
set GOROOT=%ProgramFiles(x86)%\go\files

:: Directory where AtlServer files are.
set OMAHA_ATL_SERVER_DIR=c:\atl_server\files

:: This will depend on your OS. If this version of the .Net framework came with
:: the OS, then set it to the framework directory
:: (something like C:\Windows\Microsoft.NET\Framework\v2.0.50727).
:: Otherwise, set it to the directory where the .NET framework is installed.
set OMAHA_NET_DIR=%WINDIR%\Microsoft.NET\Framework\v2.0.50727

:: This directory is needed to find mage.exe tool, which is the .Net manifest
:: generating tool. This tool ships as part of the Windows SDK.
:: However, newer versions of mage.exe can't targer older versions of .Net
:: framework. If there is a need for the click-once application to run on older
:: versions of the .Net framework, then an older version of the Windows SDK
:: needs to be installed and this environment variable point to that directory.
set OMAHA_NETFX_TOOLS_DIR=%WindowsSDK_ExecutablePath_x86%

:: Directory where Python (python.exe) is installed.
set OMAHA_PYTHON_DIR=C:\Python24

:: Directory in WiX where candle.exe and light.exe are installed.
set OMAHA_WIX_DIR=%ProgramFiles(x86)%\WiX Toolset v3.8\bin

:: Root directory of the WTL installation.
set OMAHA_WTL_DIR=C:\wtl\files

set OMAHA_PLATFORM_SDK_DIR=%WindowsSdkDir%\
set OMAHA_WINDOWS_SDK_10_0_VERSION=%WindowsSDKVersion:~0,-1%

:: Directory which includes the sign.exe tool for Authenticode signing.
set OMAHA_SIGNTOOL_SDK_DIR=%WindowsSdkDir%\bin\x86
set PYTHONPATH=%OMAHA_PYTHON_DIR%

:: Directory of Scons (http://www.scons.org/).
set SCONS_DIR=C:\Python24\Lib\site-packages\scons-1.3.1

:: Directory of the Google's Software Construction Toolkit.
set SCT_DIR=C:\swtoolkit

set PROXY_CLSID_TARGET=%~dp0proxy_clsids.txt
set CUSTOMIZATION_UT_TARGET=%~dp0common\omaha_customization_proxy_clsid.h

rem Force Hammer to use Python 2.4.  (The default of Python 2.6 exposes some
rem bugs in Scons 1.2, which we currently use.)
set PYTHON_TO_USE=python_24
call "%SCT_DIR%\hammer.bat" %*

if /i {%1} == {-c} (
  del /q /f "%PROXY_CLSID_TARGET%" 2> NUL
  del /q /f "%CUSTOMIZATION_UT_TARGET%" 2> NUL
)

goto end

:error_no_vc
echo VisualStudioVersion variable is not set. Have you run vcvarsall.bat before running this script?
goto end

:error_vc_not_supported
echo Visual Studio version %VisualStudioVersion% is not supported.
goto end

:end

Document env vars in hammer.bat

Document env vars in hammer.bat


add bat file with update src.

add bat file with update src.


@rem Copyright 2016, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem     * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem     * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem     * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;%PATH%

pip install --upgrade six
pip install --upgrade setuptools
pip install -rrequirements.txt

@rem Because this is windows and *everything seems to hate Windows* we have to
@rem set all of these flags ourselves because Python won't help us (see the
@rem setup.py of the grpcio_tools project).
set GRPC_PYTHON_CFLAGS=-fno-wrapv -frtti -std=c++11

@rem See https://sourceforge.net/p/mingw-w64/bugs/363/
if %2 == 32 (
  set GRPC_PYTHON_CFLAGS=%GRPC_PYTHON_CFLAGS% -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s
) else (
  set GRPC_PYTHON_CFLAGS=%GRPC_PYTHON_CFLAGS% -D_ftime=_ftime64 -D_timeb=__timeb64
)

@rem Further confusing things, MSYS2's mingw64 tries to dynamically link
@rem libgcc, libstdc++, and winpthreads. We have to override this or our
@rem extensions end up linking to MSYS2 DLLs, which the normal Python on
@rem Windows user won't have... and ON TOP OF THIS, there's MinGW's GCC default
@rem behavior of linking msvcrt.dll as the C runtime library, which we need to
@rem override so that Python's distutils doesn't link us against multiple C
@rem runtimes.
python -c "from distutils.cygwinccompiler import get_msvcr; print(get_msvcr()[0])" > temp.txt
set /p PYTHON_MSVCR=<temp.txt
set GRPC_PYTHON_LDFLAGS=-static-libgcc -static-libstdc++ -mcrtdll=%PYTHON_MSVCR% -static -lpthread

set GRPC_PYTHON_BUILD_WITH_CYTHON=1

@rem Set up gRPC Python tools
python tools\distrib\python\make_grpcio_tools.py

@rem Build gRPC Python extensions
python setup.py build_ext -c mingw32
python tools\distrib\python\grpcio_tools\setup.py build_ext -c mingw32

@rem Build gRPC Python distributions
python setup.py bdist_wheel
python tools\distrib\python\grpcio_tools\setup.py bdist_wheel

mkdir artifacts
xcopy /Y /I /S dist\* artifacts\ || goto :error
xcopy /Y /I /S tools\distrib\python\grpcio_tools\dist\* artifacts\ || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2016, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem     * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem     * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem     * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;%PATH%

pip install --upgrade six
pip install --upgrade setuptools
pip install -rrequirements.txt

@rem Because this is windows and *everything seems to hate Windows* we have to
@rem set all of these flags ourselves because Python won't help us (see the
@rem setup.py of the grpcio_tools project).
set GRPC_PYTHON_CFLAGS=-fno-wrapv -frtti -std=c++11

@rem See https://sourceforge.net/p/mingw-w64/bugs/363/
if %2 == 32 (
  set GRPC_PYTHON_CFLAGS=%GRPC_PYTHON_CFLAGS% -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s
) else (
  set GRPC_PYTHON_CFLAGS=%GRPC_PYTHON_CFLAGS% -D_ftime=_ftime64 -D_timeb=__timeb64
)

@rem Further confusing things, MSYS2's mingw64 tries to dynamically link
@rem libgcc, libstdc++, and winpthreads. We have to override this or our
@rem extensions end up linking to MSYS2 DLLs, which the normal Python on
@rem Windows user won't have... and ON TOP OF THIS, there's MinGW's GCC default
@rem behavior of linking msvcrt.dll as the C runtime library, which we need to
@rem override so that Python's distutils doesn't link us against multiple C
@rem runtimes.
python -c "from distutils.cygwinccompiler import get_msvcr; print(get_msvcr()[0])" > temp.txt
set /p PYTHON_MSVCR=<temp.txt
set GRPC_PYTHON_LDFLAGS=-static-libgcc -static-libstdc++ -mcrtdll=%PYTHON_MSVCR% -static -lpthread

set GRPC_PYTHON_BUILD_WITH_CYTHON=1

@rem Set up gRPC Python tools
python tools\distrib\python\make_grpcio_tools.py

@rem Build gRPC Python extensions
python setup.py build_ext -c mingw32

pushd tools\distrib\python\grpcio_tools
python setup.py build_ext -c mingw32
popd

@rem Build gRPC Python distributions
python setup.py bdist_wheel

pushd tools\distrib\python\grpcio_tools
python setup.py bdist_wheel
popd

mkdir artifacts
xcopy /Y /I /S dist\* artifacts\ || goto :error
xcopy /Y /I /S tools\distrib\python\grpcio_tools\dist\* artifacts\ || goto :error

goto :EOF

:error
exit /b 1

Change directory when building grpcio-tools


REM Use `git archive` to export with versioneer version.
set ARCHIVE_NAME=%PKG_NAME%-%PKG_VERSION%
git archive master -o %ARCHIVE_NAME%.tar --format tar
mkdir %ARCHIVE_NAME%
tar xvf %ARCHIVE_NAME%.tar -C %ARCHIVE_NAME%

cd %ARCHIVE_NAME%

REM Generate `setup.py` from `pavement.py` definition.
"%PYTHON%" -m paver generate_setup

REM **Workaround** `conda build` runs a copy of `setup.py` named
REM `conda-build-script.py` with the recipe directory as the only argument.
REM This causes paver to fail, since the recipe directory is not a valid paver
REM task name.
REM
REM We can work around this by wrapping the original contents of `setup.py` in
REM an `if` block to only execute during package installation.
"%PYTHON%" -c "input_ = open('setup.py', 'r'); data = input_.read(); input_.close(); output_ = open('setup.py', 'w'); output_.write('\n'.join(['import sys', 'import path_helpers as ph', '''if ph.path(sys.argv[0]).name == 'conda-build-script.py':''', '    sys.argv.pop()', 'else:', '\n'.join([('    ' + d) for d in data.splitlines()])])); output_.close(); print open('setup.py', 'r').read()"

REM Install source directory as Python package.
"%PYTHON%" -m pip install --no-cache --find-links http://192.99.4.95/wheels --trusted-host 192.99.4.95 .
REM TODO: Find way to get source directory path from within appveyor
REM nosetests "%SRC_DIR%" -vv --with-xunit
REM if errorlevel 1 (
REM   IF DEFINED PROJECT_DIRECTORY (
REM     cp .\\nosetests.xml "%PROJECT_DIRECTORY%"\\nosetests.xml
REM     dir "%PROJECT_DIRECTORY%"
REM   )
REM   exit 1
REM )
REM
REM REM If a project directory specified, then copy results into the directory
REM IF DEFINED PROJECT_DIRECTORY (
REM   cp .\\nosetests.xml "%PROJECT_DIRECTORY%"\\nosetests.xml
REM   dir "%PROJECT_DIRECTORY%"
REM )
if errorlevel 1 exit 1

use git archive to populate version

fix(build): use git archive to populate version


test nosetests

test nosetests


@set BITS=64

@if "%AV_BUILD%"=="true" (
  call pkg_set_env_av.cmd
  set M_JOBS=%NUMBER_OF_PROCESSORS%
) else (
  call pkg_set_env.cmd
  set M_JOBS=3
)

@TITLE pkg_build_64 %R_DATE% %R_SVN% %R_VERS%

@set ORIG_PATH=%PATH%

@set SUFFIX=%R_VERS_2%_64
@set LOG_PATH_NAME=%DP0%ruby%SUFFIX%-%R_VERS%-1-x86_64
@set PKG_RUBY=%DP0%pkg/ruby%SUFFIX%/ruby%SUFFIX%

@rem --- git in path for bundled gems with gemspec using git ls-files ?
@PATH=%MSYS2_DIR%/mingw64/bin;%GIT_PATH%;%MSYS2_DIR%/usr/bin;%PATH%
@echo on

@attrib -r %DP0%src/*.* /s /d

@rem ————————————————————————————————————————————————————————————————————— Build
bash.exe --login -c  "cd '%DP0%'; MINGW_INSTALLS=mingw64 makepkg-mingw --nocheck --skippgpcheck -dLf -p PKGBUILD"
@if ERRORLEVEL 1 exit
@set /a ERROR_BLD=ERRORLEVEL

@@PATH=%MSYS2_DIR%/mingw64/bin;%MSYS2_DIR%/usr/bin;%GIT_PATH%;%ORIG_PATH%

@attrib +r %PKG_RUBY%/*.* /s
@rem --- Set bin & gem folders to rw
@attrib -r %PKG_RUBY%/bin/*
@attrib -r %PKG_RUBY%/bin/*.cmd
@attrib -r %PKG_RUBY%/bin/*.bat
@attrib -r %PKG_RUBY%/bin/*.ps1
@attrib -r %PKG_RUBY%/lib/ruby/gems/%R_VERS_INT%/*.* /s /d

@rem --- rename readline.rb so extension is used for tests (ren only works with backslashes)
@ren %~dp0pkg\ruby%SUFFIX%\ruby%SUFFIX%\lib\ruby\site_ruby\readline.rb readline.rb_

@echo.
@echo ——————————————————————————————————————————————————————————————————————————————— Running Tests

@set SSL_CERT_FILE=%PKG_RUBY%/ssl/cert.pem
@set TEST_SSL=TRUE
@cd %DP0%src/build%SUFFIX%

@rem —————————————————————————————————————————————————————————————————— test-all
@echo test-all

@if "%R_VERS_2%" GEQ "25" (
  set RUBY_FORCE_TEST_JIT=1
  timeout.exe 25m make test-all "TESTOPTS=-a -j%M_JOBS% --job-status=normal --show-skip --retry --subprocess-timeout-scale=1.5" > %LOG_PATH_NAME%-test-all.log 2>&1
) else (
  make.exe test-all "TESTOPTS=-v --show-skip --retry" > %LOG_PATH_NAME%-test-all.log 2>&1
)

@rem ————————————————————————————————————————————————————————— btest, test-basic
@cd %DP0%src/build%SUFFIX%
@if "%R_VERS_2%" GEQ "24" (
  @echo btest
  make.exe -j 1 "TESTOPTS=-v -j%M_JOBS%" btest      > %LOG_PATH_NAME%-test-btest.log 2>&1
  @echo test-basic
  make.exe -j 1 "TESTOPTS=-v -j%M_JOBS%" test-basic > %LOG_PATH_NAME%-test-basic.log 2>&1
) else (
  @echo test
  make.exe -j 1 "TESTOPTS=-v -j%M_JOBS%" test       > %LOG_PATH_NAME%-test.log 2>&1
)

@rem —————————————————————————————————————————————————————————————————————— spec
@attrib -r %DP0%src/build%SUFFIX%/*.* /s /d

@rem just in case...
@@PATH=%MSYS2_DIR%/mingw64/bin;%MSYS2_DIR%/usr/bin;%GIT_PATH%;%ORIG_PATH%

@if "%R_VERS_2%" GEQ "25" (
  @echo test-spec
  make.exe "MSPECOPT=-j" test-spec > %LOG_PATH_NAME%-test-spec.log 2>&1
) else (
  @echo test-rubyspec
  make.exe test-rubyspec > %LOG_PATH_NAME%-test-spec.log 2>&1
)

@rem ————————————————————————————————————————————————————————————————————— mspec
@attrib -r %DP0%src/ruby/spec/*.* /s /d
@attrib -r %DP0%src/ruby/spec/ruby/*.* /s /d

@PATH=%PKG_RUBY%/bin;%GIT_PATH%;%ORIG_PATH%

@cd %REPO_RUBY%/spec/ruby
@echo mspec
@call ..\mspec\bin\mspec -rdevkit -j > %LOG_PATH_NAME%-test-mspec.log 2>&1

@PATH=%PKG_RUBY%/bin;%GIT_PATH%;%ORIG_PATH%

@cd %~dp0

@set R_NAME=ruby%SUFFIX%

@rem Parse spec files, add total time file, and zip
@echo.
@echo ——————————————————————————————————————————————————————————————————————————————— Build ^& Test Times
@call time_log_64.cmd

@if "%AV_BUILD%" NEQ "true" ( ruby test_script.rb )

@rem --- rename readline.rb_ back to readline.rb
@attrib -r %PKG_RUBY%/lib/ruby/site_ruby/readline.rb_
@rem --- rename seems to only work with backslashes
@ren %~dp0pkg\ruby%SUFFIX%\ruby%SUFFIX%\lib\ruby\site_ruby\readline.rb_ readline.rb
@attrib +r %PKG_RUBY%/lib/ruby/site_ruby/readline.rb

@exit /b 0

@set BITS=64

@if "%AV_BUILD%"=="true" (
  call pkg_set_env_av.cmd
  set M_JOBS=%NUMBER_OF_PROCESSORS%
) else (
  call pkg_set_env.cmd
  set M_JOBS=3
)

@TITLE pkg_build_64 %R_DATE% %R_SVN% %R_VERS%

@set ORIG_PATH=%PATH%

@set SUFFIX=%R_VERS_2%_64
@set LOG_PATH_NAME=%DP0%ruby%SUFFIX%-%R_VERS%-1-x86_64
@set PKG_RUBY=%DP0%pkg/ruby%SUFFIX%/ruby%SUFFIX%

@rem --- git in path for bundled gems with gemspec using git ls-files ?
@PATH=%MSYS2_DIR%/mingw64/bin;%GIT_PATH%;%MSYS2_DIR%/usr/bin;%PATH%
@echo on

@attrib -r %DP0%src/*.* /s /d

@rem ————————————————————————————————————————————————————————————————————— Build
bash.exe --login -c  "cd '%DP0%'; MINGW_INSTALLS=mingw64 makepkg-mingw --nocheck --skippgpcheck -dLf -p PKGBUILD"
@if ERRORLEVEL 1 exit
@set /a ERROR_BLD=ERRORLEVEL

@@PATH=%MSYS2_DIR%/mingw64/bin;%MSYS2_DIR%/usr/bin;%GIT_PATH%;%ORIG_PATH%

@attrib +r %PKG_RUBY%/*.* /s
@rem --- Set bin & gem folders to rw
@attrib -r %PKG_RUBY%/bin/*
@attrib -r %PKG_RUBY%/bin/*.cmd
@attrib -r %PKG_RUBY%/bin/*.bat
@attrib -r %PKG_RUBY%/bin/*.ps1
@attrib -r %PKG_RUBY%/lib/ruby/gems/%R_VERS_INT%/*.* /s /d

@rem --- rename readline.rb so extension is used for tests (ren only works with backslashes)
@ren %~dp0pkg\ruby%SUFFIX%\ruby%SUFFIX%\lib\ruby\site_ruby\readline.rb readline.rb_

@echo.
@echo ——————————————————————————————————————————————————————————————————————————————— Running Tests

@set SSL_CERT_FILE=%PKG_RUBY%/ssl/cert.pem
@set TEST_SSL=TRUE
@cd %DP0%src/build%SUFFIX%

@rem —————————————————————————————————————————————————————————————————— test-all
@echo test-all

@if "%R_VERS_2%" GEQ "25" (
  set RUBY_FORCE_TEST_JIT=1
@rem  timeout.exe 25m make test-all "TESTOPTS=-a -j%M_JOBS% --job-status=normal --show-skip --retry --subprocess-timeout-scale=1.5" > %LOG_PATH_NAME%-test-all.log 2>&1
	timeout.exe 25m make test-all "TESTOPTS=--verbose -j%M_JOBS% --job-status=normal --show-skip --retry --subprocess-timeout-scale=1.5"
) else (
  make.exe test-all "TESTOPTS=-v --show-skip --retry" > %LOG_PATH_NAME%-test-all.log 2>&1
)

@rem ————————————————————————————————————————————————————————— btest, test-basic
@cd %DP0%src/build%SUFFIX%
@if "%R_VERS_2%" GEQ "24" (
  @echo btest
  make.exe -j 1 "TESTOPTS=-v -j%M_JOBS%" btest      > %LOG_PATH_NAME%-test-btest.log 2>&1
  @echo test-basic
  make.exe -j 1 "TESTOPTS=-v -j%M_JOBS%" test-basic > %LOG_PATH_NAME%-test-basic.log 2>&1
) else (
  @echo test
  make.exe -j 1 "TESTOPTS=-v -j%M_JOBS%" test       > %LOG_PATH_NAME%-test.log 2>&1
)

@rem —————————————————————————————————————————————————————————————————————— spec
@attrib -r %DP0%src/build%SUFFIX%/*.* /s /d

@rem just in case...
@@PATH=%MSYS2_DIR%/mingw64/bin;%MSYS2_DIR%/usr/bin;%GIT_PATH%;%ORIG_PATH%

@if "%R_VERS_2%" GEQ "25" (
  @echo test-spec
  make.exe "MSPECOPT=-j" test-spec > %LOG_PATH_NAME%-test-spec.log 2>&1
) else (
  @echo test-rubyspec
  make.exe test-rubyspec > %LOG_PATH_NAME%-test-spec.log 2>&1
)

@rem ————————————————————————————————————————————————————————————————————— mspec
@attrib -r %DP0%src/ruby/spec/*.* /s /d
@attrib -r %DP0%src/ruby/spec/ruby/*.* /s /d

@PATH=%PKG_RUBY%/bin;%GIT_PATH%;%ORIG_PATH%

@cd %REPO_RUBY%/spec/ruby
@echo mspec
@call ..\mspec\bin\mspec -rdevkit -j > %LOG_PATH_NAME%-test-mspec.log 2>&1

@PATH=%PKG_RUBY%/bin;%GIT_PATH%;%ORIG_PATH%

@cd %~dp0

@set R_NAME=ruby%SUFFIX%

@rem Parse spec files, add total time file, and zip
@echo.
@echo ——————————————————————————————————————————————————————————————————————————————— Build ^& Test Times
@call time_log_64.cmd

@if "%AV_BUILD%" NEQ "true" ( ruby test_script.rb )

@rem --- rename readline.rb_ back to readline.rb
@attrib -r %PKG_RUBY%/lib/ruby/site_ruby/readline.rb_
@rem --- rename seems to only work with backslashes
@ren %~dp0pkg\ruby%SUFFIX%\ruby%SUFFIX%\lib\ruby\site_ruby\readline.rb_ readline.rb
@attrib +r %PKG_RUBY%/lib/ruby/site_ruby/readline.rb

@exit /b 0

Switch on console for test-all freeze

Switch on console for test-all freeze