echo off
IF EXIST dist del /Q dist\*.*

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

:default_value:
IF NOT EXIST c:\Python34 GOTO checkinstall64:

:checkinstall:
IF EXIST c:\Python34vir GOTO nexta:
mkdir c:\Python34vir

:nexta:
IF EXIST c:\Python34vir\install GOTO fullsetupa:
c:\Python34\Scripts\virtualenv c:\Python34vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupa:
echo #######################################################
c:\Python34vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:checkinstall64:
IF EXIST c:\Python34_64vir GOTO nextb:
mkdir c:\Python34_64vir

:nextb:
IF EXIST c:\Python34_64vir\install GOTO fullsetupb:
c:\Python34_x64\Scripts\virtualenv c:\Python34_64vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupb:
echo #######################################################
c:\Python34_64vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup33:
IF NOT EXIST c:\Python33 GOTO setup33_64:
set pythonexe="c:\Python33\python"
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py bdist_wininst
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup33_64:
IF NOT EXIST c:\Python33_x64 GOTO setup34:
set pythonexe="c:\Python33_x64\python"
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34:
IF NOT EXIST c:\Python34 GOTO setup34_x64_msi_wheel:
set pythonexe="c:\Python34\python"
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:utpy34_64:
set pythonexe="c:\Python34_x64\python"
%pythonexe% -u setup.py clean_space
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% -u setup.py unittests
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34_x64_msi_wheel:
set pythonexe="c:\Python34_x64\python"
:custom_python:
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_msi
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wheel
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:documentation:
%pythonexe% -u setup.py build_sphinx
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:copyfiles:
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html
if %errorlevel% neq 0 exit /b %errorlevel%

echo off
IF EXIST dist del /Q dist\*.*

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

:default_value:
IF NOT EXIST c:\Python34 GOTO checkinstall64:

:checkinstall:
IF EXIST c:\Python34vir GOTO nexta:
mkdir c:\Python34vir

:nexta:
IF EXIST c:\Python34vir\install GOTO fullsetupa:
c:\Python34\Scripts\virtualenv c:\Python34vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupa:
echo #######################################################
c:\Python34vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:checkinstall64:
IF EXIST c:\Python34_64vir GOTO nextb:
mkdir c:\Python34_64vir

:nextb:
IF EXIST c:\Python34_64vir\install GOTO fullsetupb:
c:\Python34_x64\Scripts\virtualenv c:\Python34_64vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupb:
echo #######################################################
c:\Python34_64vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup33:
IF NOT EXIST c:\Python33 GOTO setup33_64:
set pythonexe="c:\Python33\python"
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py bdist_wininst
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup33_64:
IF NOT EXIST c:\Python33_x64 GOTO setup34:
set pythonexe="c:\Python33_x64\python"
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34:
IF NOT EXIST c:\Python34 GOTO utpy34_64:
set pythonexe="c:\Python34\python"
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:utpy34_64:
set pythonexe="c:\Python34_x64\python"
%pythonexe% -u setup.py clean_space
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% -u setup.py unittests
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34_x64_msi_wheel:
set pythonexe="c:\Python34_x64\python"
:custom_python:
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_msi
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wheel
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:documentation:
%pythonexe% -u setup.py build_sphinx
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:copyfiles:
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html
if %errorlevel% neq 0 exit /b %errorlevel%

fix setup batch

fix setup batch


@rem ##########################################################################
@rem
@rem Script to set up Kokoro worker and run Windows tests
@rem
@rem ##########################################################################

@rem Enter repo root
cd /d %~dp0\..\..

set WORKSPACE=T:\src\github\grpc-java
set ESCWORKSPACE=%WORKSPACE:\=\\%

mkdir grpc-java-helper

cd grpc-java-helper

set PATH=C:\Program Files\java\jdk1.8.0_152\bin;%PATH%
call "%VS120COMNTOOLS%\vsvars32.bat"
call "%WORKSPACE%\buildscripts\make_dependencies.bat"

cd "%WORKSPACE%"

echo targetArch=x86_32> gradle.properties
echo failOnWarnings=true>> gradle.properties
echo vcProtobufLibs=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-%PROTOBUF_VER%\\cmake\\build\\Release>> gradle.properties
echo vcProtobufInclude=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-%PROTOBUF_VER%\\cmake\\build\\include>> gradle.properties

cmd.exe /C "%WORKSPACE%\gradlew.bat build"
set GRADLEEXIT=%ERRORLEVEL%

@rem Rename test results .xml files to format parsable by Kokoro
@echo off
for /r %%F in (TEST-*.xml) do (
  mkdir "%%~dpnF"
  move "%%F" "%%~dpnF\sponge_log.xml" >NUL
)
@echo on

exit %GRADLEEXIT%

@rem ##########################################################################
@rem
@rem Script to set up Kokoro worker and run Windows tests
@rem
@rem ##########################################################################

@rem Enter repo root
cd /d %~dp0\..\..

set WORKSPACE=T:\src\github\grpc-java
set ESCWORKSPACE=%WORKSPACE:\=\\%

mkdir grpc-java-helper

cd grpc-java-helper

@rem Clear JAVA_HOME to prevent a different Java version from being used
set JAVA_HOME=
set PATH=C:\Program Files\java\jdk1.8.0_152\bin;%PATH%
call "%VS120COMNTOOLS%\vsvars32.bat"
call "%WORKSPACE%\buildscripts\make_dependencies.bat"

cd "%WORKSPACE%"

echo targetArch=x86_32> gradle.properties
echo failOnWarnings=true>> gradle.properties
echo vcProtobufLibs=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-%PROTOBUF_VER%\\cmake\\build\\Release>> gradle.properties
echo vcProtobufInclude=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-%PROTOBUF_VER%\\cmake\\build\\include>> gradle.properties

cmd.exe /C "%WORKSPACE%\gradlew.bat build"
set GRADLEEXIT=%ERRORLEVEL%

@rem Rename test results .xml files to format parsable by Kokoro
@echo off
for /r %%F in (TEST-*.xml) do (
  mkdir "%%~dpnF"
  move "%%F" "%%~dpnF\sponge_log.xml" >NUL
)
@echo on

exit %GRADLEEXIT%

clear JAVA_HOME

clear JAVA_HOME


@ECHO OFF
SETLOCAL
SET EL=0

ECHO =========== %~f0 ===========

SET MAPNIK_GIT=
FOR /F "tokens=*" %%i in ('node -e "console.log(require(""./package.json"").mapnik_version)"') DO SET MAPNIK_GIT=%%i

:: use 64 bit python if platform is 64 bit
IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
:: put 7z on path (needed for unpacking mapnik sdk)
SET PATH=C:\Program Files\7-Zip;%PATH%

:: TODO - dist/dev/ is intended for dev releases of mapnik
:: We ideally want to get in the habit of only using Mapnik official releases
:: which will be uploaded to dist/
SET MAPNIK_SDK_URL=https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-%MAPNIK_GIT%-%platform%-%msvs_toolset%.0.7z
ECHO fetching mapnik sdk^: %MAPNIK_SDK_URL%
IF EXIST mapnik-sdk.7z (ECHO already downloaded) ELSE (powershell Invoke-WebRequest "${env:MAPNIK_SDK_URL}" -OutFile mapnik-sdk.7z)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO extracting mapnik sdk
IF EXIST mapnik-sdk (ECHO already extracted) ELSE (7z -y x mapnik-sdk.7z | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: replace installed node.exe with Mapbox node.exe
:: so that the binaries based on Visual Studio 2015
:: and built by https://travis-ci.org/mapbox/node-cpp11 are used
SET ARCHPATH=
IF /I %platform% == x64 (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
ECHO fetching node.exe^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: we replace the existing node.exe with our own
:: we do this in place so that the npm path logic
:: is preserved. The alternative might be to put
:: our custom node.exe on PATH from a custom location
:: and then pass `--prefix` to npm - but this is untested
ECHO deleting node.exe programfiles x64
IF EXIST "%ProgramFiles%\nodejs" IF EXIST "%ProgramFiles%\nodejs\node.exe" ECHO found "%ProgramFiles%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO copying node.exe to programfiles x64
IF EXIST %ProgramFiles%\nodejs ECHO copying to "%ProgramFiles%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node.exe programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" IF EXIST "%ProgramFiles(x86)%\nodejs\node.exe" ECHO "found %ProgramFiles(x86)%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles(x86)%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO copying node.exe to programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copying to "%ProgramFiles(x86)%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles(x86)%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::delete node.exe in current directory, that newer npm versions put stuff into the right directories
IF EXIST node.exe DEL node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST node.pdb DEL node.pdb
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: this is not needed on a fresh machine without previous installs
:: but is important on a machine that already has compiled for a given
:: node version. So, we have to clear to ensure that the Visual Studio 2015
:: binaries are used rather than the ones from joyent (which are built with Visual Studio 2013)
ECHO clear out node-gyp binary cache to ensure vs 2015 binaries are linked
IF "%msvs_toolset%" == "14" IF EXIST %USERPROFILE%\.node-gyp rd /s /q %USERPROFILE%\.node-gyp

::upgrade npm to get consistent behaviour with older node versions
powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm install -g npm-windows-upgrade@0.5.3
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm-windows-upgrade --version:3.3.2 --no-dns-check --no-prompt
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO activating VS command prompt...
IF /I %platform% == x64 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I %platform% == x86 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86

ECHO available node.exe:
where node
ECHO available npm^:
where npm

ECHO node -v && CALL node -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO node that gets called && CALL node -e "console.log(process.arch,process.execPath)"
ECHO npm -v && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

:: install node-gyp globally to:
:: 1) ensure node-gyp can find it (probably optional)
:: 2) ensure we have recent enough node-gyp to understand VS 2015 (needed for node v0.10.x certainly)
ECHO installing node-gyp
CALL npm install -g node-gyp
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO ERRORLEVEL^: %ERRORLEVEL%

:: get ready to build agains the mapnik SDK
SET MAPNIK_SDK=%CD%\mapnik-sdk
SET PATH=%MAPNIK_SDK%\bin;%MAPNIK_SDK%\lib;%PATH%
SET PROJ_LIB=%MAPNIK_SDK%\share\proj
SET GDAL_DATA=%MAPNIK_SDK%\share\gdal
SET ICU_DATA=%MAPNIK_SDK%\share\icu

:: actually install deps + compile node-mapnik
ECHO building node-mapnik
CALL npm install --build-from-source --msvs_version=2015 %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module_path --silent') DO SET NODEMAPNIK_BINDING_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO NODEMAPNIK_BINDING_DIR^: %NODEMAPNIK_BINDING_DIR%
IF "%NODEMAPNIK_BINDING_DIR%"=="" ECHO ERROR could not determine binding dir && SET ERRORLEVEL=1 && GOTO ERROR

powershell scripts\build_against_sdk_02-copy-deps-to-bindingdir.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\show_module_runtime.ps1 %CD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\build_against_sdk_03-write-mapnik.settings.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL npm test
:: uncomment to allow build to work even if tests do not pass
::SET ERRORLEVEL=0
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE%
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 unpublish publish %TOOLSET_ARGS%) ELSE (ECHO not republishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO =========== ERROR %~f0 ===========
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO =========== DONE %~f0 ===========

EXIT /b %EL%

@ECHO OFF
SETLOCAL
SET EL=0

ECHO =========== %~f0 ===========

SET MAPNIK_GIT=
FOR /F "tokens=*" %%i in ('node -e "console.log(require(""./package.json"").mapnik_version)"') DO SET MAPNIK_GIT=%%i

:: use 64 bit python if platform is 64 bit
IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
:: put 7z on path (needed for unpacking mapnik sdk)
SET PATH=C:\Program Files\7-Zip;%PATH%

:: TODO - dist/dev/ is intended for dev releases of mapnik
:: We ideally want to get in the habit of only using Mapnik official releases
:: which will be uploaded to dist/
SET MAPNIK_SDK_URL=https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-v%MAPNIK_GIT%-%platform%-%msvs_toolset%.0.7z
ECHO fetching mapnik sdk^: %MAPNIK_SDK_URL%
IF EXIST mapnik-sdk.7z (ECHO already downloaded) ELSE (powershell Invoke-WebRequest "${env:MAPNIK_SDK_URL}" -OutFile mapnik-sdk.7z)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO extracting mapnik sdk
IF EXIST mapnik-sdk (ECHO already extracted) ELSE (7z -y x mapnik-sdk.7z | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: replace installed node.exe with Mapbox node.exe
:: so that the binaries based on Visual Studio 2015
:: and built by https://travis-ci.org/mapbox/node-cpp11 are used
SET ARCHPATH=
IF /I %platform% == x64 (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
ECHO fetching node.exe^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: we replace the existing node.exe with our own
:: we do this in place so that the npm path logic
:: is preserved. The alternative might be to put
:: our custom node.exe on PATH from a custom location
:: and then pass `--prefix` to npm - but this is untested
ECHO deleting node.exe programfiles x64
IF EXIST "%ProgramFiles%\nodejs" IF EXIST "%ProgramFiles%\nodejs\node.exe" ECHO found "%ProgramFiles%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO copying node.exe to programfiles x64
IF EXIST %ProgramFiles%\nodejs ECHO copying to "%ProgramFiles%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node.exe programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" IF EXIST "%ProgramFiles(x86)%\nodejs\node.exe" ECHO "found %ProgramFiles(x86)%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles(x86)%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO copying node.exe to programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copying to "%ProgramFiles(x86)%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles(x86)%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::delete node.exe in current directory, that newer npm versions put stuff into the right directories
IF EXIST node.exe DEL node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST node.pdb DEL node.pdb
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: this is not needed on a fresh machine without previous installs
:: but is important on a machine that already has compiled for a given
:: node version. So, we have to clear to ensure that the Visual Studio 2015
:: binaries are used rather than the ones from joyent (which are built with Visual Studio 2013)
ECHO clear out node-gyp binary cache to ensure vs 2015 binaries are linked
IF "%msvs_toolset%" == "14" IF EXIST %USERPROFILE%\.node-gyp rd /s /q %USERPROFILE%\.node-gyp

::upgrade npm to get consistent behaviour with older node versions
powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm install -g npm-windows-upgrade@0.5.3
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm-windows-upgrade --version:3.3.2 --no-dns-check --no-prompt
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO activating VS command prompt...
IF /I %platform% == x64 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I %platform% == x86 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86

ECHO available node.exe:
where node
ECHO available npm^:
where npm

ECHO node -v && CALL node -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO node that gets called && CALL node -e "console.log(process.arch,process.execPath)"
ECHO npm -v && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

:: install node-gyp globally to:
:: 1) ensure node-gyp can find it (probably optional)
:: 2) ensure we have recent enough node-gyp to understand VS 2015 (needed for node v0.10.x certainly)
ECHO installing node-gyp
CALL npm install -g node-gyp
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO ERRORLEVEL^: %ERRORLEVEL%

:: get ready to build agains the mapnik SDK
SET MAPNIK_SDK=%CD%\mapnik-sdk
SET PATH=%MAPNIK_SDK%\bin;%MAPNIK_SDK%\lib;%PATH%
SET PROJ_LIB=%MAPNIK_SDK%\share\proj
SET GDAL_DATA=%MAPNIK_SDK%\share\gdal
SET ICU_DATA=%MAPNIK_SDK%\share\icu

:: actually install deps + compile node-mapnik
ECHO building node-mapnik
CALL npm install --build-from-source --msvs_version=2015 %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module_path --silent') DO SET NODEMAPNIK_BINDING_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO NODEMAPNIK_BINDING_DIR^: %NODEMAPNIK_BINDING_DIR%
IF "%NODEMAPNIK_BINDING_DIR%"=="" ECHO ERROR could not determine binding dir && SET ERRORLEVEL=1 && GOTO ERROR

powershell scripts\build_against_sdk_02-copy-deps-to-bindingdir.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\show_module_runtime.ps1 %CD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\build_against_sdk_03-write-mapnik.settings.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL npm test
:: uncomment to allow build to work even if tests do not pass
::SET ERRORLEVEL=0
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE%
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 unpublish publish %TOOLSET_ARGS%) ELSE (ECHO not republishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO =========== ERROR %~f0 ===========
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO =========== DONE %~f0 ===========

EXIT /b %EL%

fix url for mapnik win sdk

fix url for mapnik win sdk


SET AIR_SDK=%USERPROFILE%\Documents\AdobeAIRSDK
set STEAM_SDK=%USERPROFILE%\Documents\Steam\sdk
SET ANE_PATH=..\..\FRESteamWorksLib\bin

copy "%STEAM_SDK%\redistributable_bin\steam_api.dll" .
copy "%STEAM_SDK%\redistributable_bin\osx32\libsteam_api.dylib" .

call "%AIR_SDK%\bin\adt.bat" -package -XnoAneValidate -tsa none ^
                             -storetype pkcs12 -keystore CertificateTest.p12 ^
                             -storepass test -target bundle FRESteamWorksTest ^
                             FRESteamWorksTest-app.xml FRESteamWorksTest.swf ^
                             steam_api.dll libsteam_api.dylib steam_appid.txt^
                             -extdir "%ANE_PATH%"

del steam_api.dll libsteam_api.dylib

SET AIR_SDK=%USERPROFILE%\Documents\AdobeAIRSDK
set STEAM_SDK=%USERPROFILE%\Documents\Steam\sdk
SET ANE_PATH=..\..\lib\bin

copy "%STEAM_SDK%\redistributable_bin\steam_api.dll" .
copy "%STEAM_SDK%\redistributable_bin\osx32\libsteam_api.dylib" .

call "%AIR_SDK%\bin\adt.bat" -package -XnoAneValidate -tsa none ^
                             -storetype pkcs12 -keystore CertificateTest.p12 ^
                             -storepass test -target bundle FRESteamWorksTest ^
                             FRESteamWorksTest-app.xml FRESteamWorksTest.swf ^
                             steam_api.dll libsteam_api.dylib steam_appid.txt^
                             -extdir "%ANE_PATH%"

del steam_api.dll libsteam_api.dylib

Fix the (hopefully) last path

Fix the (hopefully) last path


@echo off

set config=%1
set zipcmd=%~dp0\tools\7z\7z.exe

pushd %~dp0

echo ============ Cleaning up ============
rmdir /S /Q appleseed-max2015 2>nul
rmdir /S /Q appleseed-max2016 2>nul
rmdir /S /Q appleseed-max2017 2>nul
rmdir /S /Q appleseed-max2018 2>nul
rmdir /S /Q appleseed-max2019 2>nul
del appleseed-max2015-x.x.x-yyyy.zip 2>nul
del appleseed-max2016-x.x.x-yyyy.zip 2>nul
del appleseed-max2017-x.x.x-yyyy.zip 2>nul
del appleseed-max2018-x.x.x-yyyy.zip 2>nul
del appleseed-max2019-x.x.x-yyyy.zip 2>nul
echo.

echo ============ Creating 3ds Max 2015 archive ============
mkdir appleseed-max2015
xcopy /S ..\sandbox\max2015\%config%\*.* appleseed-max2015
%zipcmd% a -r -mx=9 appleseed-max2015-x.x.x-yyyy.zip appleseed-max2015
rmdir /S /Q appleseed-max2015
echo.

echo ============ Creating 3ds Max 2016 archive ============
mkdir appleseed-max2016
xcopy /S ..\sandbox\max2016\%config%\*.* appleseed-max2016
%zipcmd% a -r -mx=9 appleseed-max2016-x.x.x-yyyy.zip appleseed-max2016
rmdir /S /Q appleseed-max2016
echo.

echo ============ Creating 3ds Max 2017 archive ============
mkdir appleseed-max2017
xcopy /S ..\sandbox\max2017\%config%\*.* appleseed-max2017
%zipcmd% a -r -mx=9 appleseed-max2017-x.x.x-yyyy.zip appleseed-max2017
rmdir /S /Q appleseed-max2017
echo.

echo ============ Creating 3ds Max 2018 archive ============
mkdir appleseed-max2018
xcopy /S ..\sandbox\max2018\%config%\*.* appleseed-max2018
%zipcmd% a -r -mx=9 appleseed-max2018-x.x.x-yyyy.zip appleseed-max2018
rmdir /S /Q appleseed-max2018
echo.

echo ============ Creating 3ds Max 2019 archive ============
mkdir appleseed-max2019
xcopy /S ..\sandbox\max2019\%config%\*.* appleseed-max2019
%zipcmd% a -r -mx=9 appleseed-max2019-x.x.x-yyyy.zip appleseed-max2019
rmdir /S /Q appleseed-max2019
echo.

popd

pause

@echo off

set config=%1
set zipcmd=%~dp0\tools\7z\7z.exe

pushd %~dp0

echo ============ Cleaning up ============
rmdir /S /Q appleseed-max2016 2>nul
rmdir /S /Q appleseed-max2017 2>nul
rmdir /S /Q appleseed-max2018 2>nul
rmdir /S /Q appleseed-max2019 2>nul
del appleseed-max2016-x.x.x-yyyy.zip 2>nul
del appleseed-max2017-x.x.x-yyyy.zip 2>nul
del appleseed-max2018-x.x.x-yyyy.zip 2>nul
del appleseed-max2019-x.x.x-yyyy.zip 2>nul
echo.

echo ============ Creating 3ds Max 2016 archive ============
mkdir appleseed-max2016
xcopy /S ..\sandbox\max2016\%config%\*.* appleseed-max2016
%zipcmd% a -r -mx=9 appleseed-max2016-x.x.x-yyyy.zip appleseed-max2016
rmdir /S /Q appleseed-max2016
echo.

echo ============ Creating 3ds Max 2017 archive ============
mkdir appleseed-max2017
xcopy /S ..\sandbox\max2017\%config%\*.* appleseed-max2017
%zipcmd% a -r -mx=9 appleseed-max2017-x.x.x-yyyy.zip appleseed-max2017
rmdir /S /Q appleseed-max2017
echo.

echo ============ Creating 3ds Max 2018 archive ============
mkdir appleseed-max2018
xcopy /S ..\sandbox\max2018\%config%\*.* appleseed-max2018
%zipcmd% a -r -mx=9 appleseed-max2018-x.x.x-yyyy.zip appleseed-max2018
rmdir /S /Q appleseed-max2018
echo.

echo ============ Creating 3ds Max 2019 archive ============
mkdir appleseed-max2019
xcopy /S ..\sandbox\max2019\%config%\*.* appleseed-max2019
%zipcmd% a -r -mx=9 appleseed-max2019-x.x.x-yyyy.zip appleseed-max2019
rmdir /S /Q appleseed-max2019
echo.

popd

pause

Remove support of 3ds Max 2015 from make-package script


:: LEAN IB Gateway Launcher

:: IB Controller Sourced-Modified from https://github.com/ib-controller/ib-controller
@echo off
set TWS_MAJOR_VRSN=952
set TRADING_MODE=

set IBC_PATH=%1
set TWS_PATH=%2
set TWSUSERID=%3
set TWSPASSWORD=%4
set APP=%5

set IBC_INI=%IBC_PATH%\IBController.ini
set LOG_PATH=%IBC_PATH%\Logs

set TITLE=IBController (%APP% %TWS_MAJOR_VRSN%)
set MIN=
if not defined LOG_PATH set MIN=/Min
set WAIT=
if /I "%~1" == "/WAIT" set WAIT=/wait
@echo on
start "%TITLE%" %MIN% %WAIT% "%IBC_PATH%\Scripts\DisplayBannerAndLaunch.bat"

:: clear out our history and the screen
doskey /reinstall
cls

:: leave this window running so we can find it later and close its child processes
pause

:: LEAN IB Gateway Launcher

:: IB Controller Sourced-Modified from https://github.com/ib-controller/ib-controller
@echo off
set TWS_MAJOR_VRSN=960
set TRADING_MODE=

set IBC_PATH=%1
set TWS_PATH=%2
set TWSUSERID=%3
set TWSPASSWORD=%4
set APP=%5

set IBC_INI=%IBC_PATH%\IBController.ini
set LOG_PATH=%IBC_PATH%\Logs

set TITLE=IBController (%APP% %TWS_MAJOR_VRSN%)
set MIN=
if not defined LOG_PATH set MIN=/Min
set WAIT=
if /I "%~1" == "/WAIT" set WAIT=/wait
@echo on
start "%TITLE%" %MIN% %WAIT% "%IBC_PATH%\Scripts\DisplayBannerAndLaunch.bat"

:: clear out our history and the screen
doskey /reinstall
cls

:: leave this window running so we can find it later and close its child processes
pause

Bump version of IB TWS in run-ib-controller.bat


@ECHO OFF
set SCISRC=..\scintilla

rem create the objects and output directory and delete any files from previous build
md "%OBJDIR%" >NUL 2>&1
del "%OUTDIR%\Notepad2.exe" >NUL 2>&1
del "%OBJDIR%\*.idb" >NUL 2>&1
del "%OBJDIR%\*.obj" >NUL 2>&1
del "%OBJDIR%\*.pdb" >NUL 2>&1

ECHO. && ECHO:______________________________
ECHO:[INFO] compiling stage...
ECHO:______________________________ && ECHO.

rem compiler command line
IF /I "%1"=="x86" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WIN32_WINNT=0x0501"
)
IF /I "%1"=="x64" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_WIN64" /D "_WIN32_WINNT=0x0502" /wd4133 /wd4244 /wd4267
)

cl /Fo"%OBJDIR%/" /I "%SCISRC%\include" /I "%SCISRC%\src" /I "%SCISRC%\win32" %CLADDCMD% /c /EHsc /MD /O2 /GS /GT /GL /W3 /MP^
 /Tp "%SCISRC%\src\AutoComplete.cxx" /Tp "%SCISRC%\src\CallTip.cxx" /Tp "%SCISRC%\src\CellBuffer.cxx"^
 /Tp "%SCISRC%\src\CharClassify.cxx" /Tp "%SCISRC%\src\ContractionState.cxx" /Tp "%SCISRC%\src\Decoration.cxx"^
 /Tp "%SCISRC%\src\Document.cxx" /Tp "%SCISRC%\src\DocumentAccessor.cxx" /Tp "%SCISRC%\src\Editor.cxx"^
 /Tp "%SCISRC%\src\ExternalLexer.cxx" /Tp "%SCISRC%\src\Indicator.cxx" /Tp "%SCISRC%\src\KeyMap.cxx"^
 /Tp "%SCISRC%\src\KeyWords.cxx" /Tp "%SCISRC%\src\LexAsm.cxx" /Tp "%SCISRC%\src\LexAU3.cxx"^
 /Tp "%SCISRC%\src\LexBash.cxx" /Tp "%SCISRC%\src\LexConf.cxx" /Tp "%SCISRC%\src\LexCPP.cxx"^
 /Tp "%SCISRC%\src\LexCSS.cxx" /Tp "%SCISRC%\src\LexHTML.cxx" /Tp "%SCISRC%\src\LexLua.cxx"^
 /Tp "%SCISRC%\src\LexInno.cxx" /Tp "%SCISRC%\src\LexNsis.cxx" /Tp "%SCISRC%\src\LexOthers.cxx"^
 /Tp "%SCISRC%\src\LexPascal.cxx" /Tp "%SCISRC%\src\LexPerl.cxx" /Tp "%SCISRC%\src\LexPowerShell.cxx"^
 /Tp "%SCISRC%\src\LexPython.cxx" /Tp "%SCISRC%\src\LexRuby.cxx" /Tp "%SCISRC%\src\LexSQL.cxx"^
 /Tp "%SCISRC%\src\LexTCL.cxx" /Tp "%SCISRC%\src\LexVB.cxx" /Tp "%SCISRC%\src\LineMarker.cxx"^
 /Tp "%SCISRC%\src\PerLine.cxx" /Tp "%SCISRC%\src\PositionCache.cxx" /Tp "%SCISRC%\src\PropSet.cxx"^
 /Tp "%SCISRC%\src\RESearch.cxx" /Tp "%SCISRC%\src\RunStyles.cxx" /Tp "%SCISRC%\src\ScintillaBase.cxx"^
 /Tp "%SCISRC%\src\Selection.cxx" /Tp "%SCISRC%\src\Style.cxx" /Tp "%SCISRC%\src\StyleContext.cxx"^
 /Tp "%SCISRC%\src\UniConversion.cxx" /Tp "%SCISRC%\src\ViewStyle.cxx" /Tp "%SCISRC%\src\WindowAccessor.cxx"^
 /Tp "%SCISRC%\src\XPM.cxx" /Tp "%SCISRC%\win32\PlatWin.cxx" /Tp "%SCISRC%\win32\ScintillaWin.cxx"^
 /Tc "..\src\Dialogs.c" /Tc "..\src\Dlapi.c" /Tc "..\src\Edit.c" /Tc "..\src\Helpers.c"^
 /Tc "..\src\Notepad2.c" /Tc "..\src\Styles.c" /Tp "..\src\Print.cpp"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] resource compiler stage...
ECHO:______________________________ && ECHO.

rem resource compiler command line
IF /I "%1"=="x86" (
set RCADDCMD=/d "WIN32"
)
IF /I "%1"=="x64" (
set RCADDCMD=/d "_WIN64"
)

rc /d "_UNICODE" /d "UNICODE" %RCADDCMD% /fo"%OBJDIR%/Notepad2.res" "..\src\Notepad2.rc"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] linking stage...
ECHO:______________________________ && ECHO.

rem linker command line
IF /I "%1"=="x86" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.01 /MACHINE:X86
set WDK_LIB=msvcrt_winxp.obj
)
IF /I "%1"=="x64" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.02 /MACHINE:X64
set WDK_LIB=msvcrt_win2003.obj
)

link /OUT:"%OUTDIR%/Notepad2.exe" /INCREMENTAL:NO /RELEASE %LNKADDCMD% /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT^
 /MERGE:.rdata=.text /LTCG kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib shlwapi.lib comdlg32.lib^
 comctl32.lib winspool.lib imm32.lib ole32.lib oleaut32.lib psapi.lib^
 "%OBJDIR%\AutoComplete.obj" "%OBJDIR%\CallTip.obj" "%OBJDIR%\CellBuffer.obj" "%OBJDIR%\CharClassify.obj"^
 "%OBJDIR%\ContractionState.obj" "%OBJDIR%\Decoration.obj" "%OBJDIR%\Dialogs.obj" "%OBJDIR%\Dlapi.obj"^
 "%OBJDIR%\Document.obj" "%OBJDIR%\DocumentAccessor.obj" "%OBJDIR%\Edit.obj" "%OBJDIR%\Editor.obj"^
 "%OBJDIR%\ExternalLexer.obj" "%OBJDIR%\Helpers.obj" "%OBJDIR%\Indicator.obj" "%OBJDIR%\KeyMap.obj"^
 "%OBJDIR%\KeyWords.obj" "%OBJDIR%\LexAsm.obj" "%OBJDIR%\LexAU3.obj" "%OBJDIR%\LexBash.obj" "%OBJDIR%\LexConf.obj"^
 "%OBJDIR%\LexCPP.obj" "%OBJDIR%\LexCSS.obj" "%OBJDIR%\LexHTML.obj" "%OBJDIR%\LexInno.obj" "%OBJDIR%\LexLua.obj"^
 "%OBJDIR%\LexNsis.obj" "%OBJDIR%\LexOthers.obj" "%OBJDIR%\LexPascal.obj" "%OBJDIR%\LexPerl.obj" "%OBJDIR%\LexPowerShell.obj"^
 "%OBJDIR%\LexPython.obj" "%OBJDIR%\LexRuby.obj" "%OBJDIR%\LexSQL.obj" "%OBJDIR%\LexTCL.obj" "%OBJDIR%\LexVB.obj"^
 "%OBJDIR%\LineMarker.obj" "%OBJDIR%\Notepad2.obj" "%OBJDIR%\Notepad2.res" "%OBJDIR%\PerLine.obj" "%OBJDIR%\PlatWin.obj"^
 "%OBJDIR%\PositionCache.obj" "%OBJDIR%\Print.obj" "%OBJDIR%\PropSet.obj" "%OBJDIR%\RESearch.obj" "%OBJDIR%\RunStyles.obj"^
 "%OBJDIR%\ScintillaBase.obj" "%OBJDIR%\ScintillaWin.obj" "%OBJDIR%\Selection.obj" "%OBJDIR%\Style.obj"^
 "%OBJDIR%\StyleContext.obj" "%OBJDIR%\Styles.obj" "%OBJDIR%\UniConversion.obj" "%OBJDIR%\ViewStyle.obj"^
 "%OBJDIR%\WindowAccessor.obj" "%OBJDIR%\XPM.obj" "%WDK_LIB%"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] manifest stage...
ECHO:______________________________ && ECHO.

rem manifest tool command line
"%SDKDIR%\Bin\mt.exe" -manifest "..\res\Notepad2.exe.manifest" -outputresource:"%OUTDIR%\Notepad2.exe;#1"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________

@ECHO OFF

rem create the objects and output directory and delete any files from previous build
md "%OBJDIR%" >NUL 2>&1
del "%OUTDIR%\Notepad2.exe" >NUL 2>&1
del "%OBJDIR%\*.idb" >NUL 2>&1
del "%OBJDIR%\*.obj" >NUL 2>&1
del "%OBJDIR%\*.pdb" >NUL 2>&1

ECHO. && ECHO:______________________________
ECHO:[INFO] compiling stage...
ECHO:______________________________ && ECHO.

rem compiler command line
IF /I "%1"=="x86" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WIN32_WINNT=0x0501"
)
IF /I "%1"=="x64" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_WIN64" /D "_WIN32_WINNT=0x0502" /wd4133 /wd4244 /wd4267
)

cl /Fo"%OBJDIR%/" /I "..\scintilla\include" /I "..\scintilla\src" /I "..\scintilla\win32" %CLADDCMD% /c /EHsc /MD /O2 /GS /GT /GL /W3 /MP^
 /Tp "..\scintilla\src\AutoComplete.cxx"^
 /Tp "..\scintilla\src\CallTip.cxx"^
 /Tp "..\scintilla\src\CellBuffer.cxx"^
 /Tp "..\scintilla\src\CharClassify.cxx"^
 /Tp "..\scintilla\src\ContractionState.cxx"^
 /Tp "..\scintilla\src\Decoration.cxx"^
 /Tp "..\scintilla\src\Document.cxx"^
 /Tp "..\scintilla\src\DocumentAccessor.cxx"^
 /Tp "..\scintilla\src\Editor.cxx"^
 /Tp "..\scintilla\src\ExternalLexer.cxx"^
 /Tp "..\scintilla\src\Indicator.cxx"^
 /Tp "..\scintilla\src\KeyMap.cxx"^
 /Tp "..\scintilla\src\KeyWords.cxx"^
 /Tp "..\scintilla\src\LexAsm.cxx"^
 /Tp "..\scintilla\src\LexAU3.cxx"^
 /Tp "..\scintilla\src\LexBash.cxx"^
 /Tp "..\scintilla\src\LexConf.cxx"^
 /Tp "..\scintilla\src\LexCPP.cxx"^
 /Tp "..\scintilla\src\LexCSS.cxx"^
 /Tp "..\scintilla\src\LexHTML.cxx"^
 /Tp "..\scintilla\src\LexLua.cxx"^
 /Tp "..\scintilla\src\LexInno.cxx"^
 /Tp "..\scintilla\src\LexNsis.cxx"^
 /Tp "..\scintilla\src\LexOthers.cxx"^
 /Tp "..\scintilla\src\LexPascal.cxx"^
 /Tp "..\scintilla\src\LexPerl.cxx"^
 /Tp "..\scintilla\src\LexPowerShell.cxx"^
 /Tp "..\scintilla\src\LexPython.cxx"^
 /Tp "..\scintilla\src\LexRuby.cxx"^
 /Tp "..\scintilla\src\LexSQL.cxx"^
 /Tp "..\scintilla\src\LexTCL.cxx"^
 /Tp "..\scintilla\src\LexVB.cxx"^
 /Tp "..\scintilla\src\LineMarker.cxx"^
 /Tp "..\scintilla\src\PerLine.cxx"^
 /Tp "..\scintilla\src\PositionCache.cxx"^
 /Tp "..\scintilla\src\PropSet.cxx"^
 /Tp "..\scintilla\src\RESearch.cxx"^
 /Tp "..\scintilla\src\RunStyles.cxx"^
 /Tp "..\scintilla\src\ScintillaBase.cxx"^
 /Tp "..\scintilla\src\Selection.cxx"^
 /Tp "..\scintilla\src\Style.cxx"^
 /Tp "..\scintilla\src\StyleContext.cxx"^
 /Tp "..\scintilla\src\UniConversion.cxx"^
 /Tp "..\scintilla\src\ViewStyle.cxx"^
 /Tp "..\scintilla\src\WindowAccessor.cxx"^
 /Tp "..\scintilla\src\XPM.cxx"^
 /Tp "..\scintilla\win32\PlatWin.cxx"^
 /Tp "..\scintilla\win32\ScintillaWin.cxx"^
 /Tc "..\src\Dialogs.c"^
 /Tc "..\src\Dlapi.c"^
 /Tc "..\src\Edit.c"^
 /Tc "..\src\Helpers.c"^
 /Tc "..\src\Notepad2.c"^
 /Tc "..\src\Styles.c"^
 /Tp "..\src\Print.cpp"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] resource compiler stage...
ECHO:______________________________ && ECHO.

rem resource compiler command line
IF /I "%1"=="x86" (
set RCADDCMD=/d "WIN32"
)
IF /I "%1"=="x64" (
set RCADDCMD=/d "_WIN64"
)

rc /d "_UNICODE" /d "UNICODE" %RCADDCMD% /fo"%OBJDIR%/Notepad2.res" "..\src\Notepad2.rc"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] linking stage...
ECHO:______________________________ && ECHO.

rem linker command line
IF /I "%1"=="x86" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.01 /MACHINE:X86
set WDK_LIB=msvcrt_winxp.obj
)
IF /I "%1"=="x64" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.02 /MACHINE:X64
set WDK_LIB=msvcrt_win2003.obj
)

link /OUT:"%OUTDIR%/Notepad2.exe" /INCREMENTAL:NO /RELEASE %LNKADDCMD% /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT^
 /MERGE:.rdata=.text /LTCG kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib shlwapi.lib comdlg32.lib^
 comctl32.lib winspool.lib imm32.lib ole32.lib oleaut32.lib psapi.lib^
 "%OBJDIR%\AutoComplete.obj"^
 "%OBJDIR%\CallTip.obj"^
 "%OBJDIR%\CellBuffer.obj"^
 "%OBJDIR%\CharClassify.obj"^
 "%OBJDIR%\ContractionState.obj"^
 "%OBJDIR%\Decoration.obj"^
 "%OBJDIR%\Dialogs.obj"^
 "%OBJDIR%\Dlapi.obj"^
 "%OBJDIR%\Document.obj"^
 "%OBJDIR%\DocumentAccessor.obj"^
 "%OBJDIR%\Edit.obj"^
 "%OBJDIR%\Editor.obj"^
 "%OBJDIR%\ExternalLexer.obj"^
 "%OBJDIR%\Helpers.obj"^
 "%OBJDIR%\Indicator.obj"^
 "%OBJDIR%\KeyMap.obj"^
 "%OBJDIR%\KeyWords.obj"^
 "%OBJDIR%\LexAsm.obj"^
 "%OBJDIR%\LexAU3.obj"^
 "%OBJDIR%\LexBash.obj"^
 "%OBJDIR%\LexConf.obj"^
 "%OBJDIR%\LexCPP.obj"^
 "%OBJDIR%\LexCSS.obj"^
 "%OBJDIR%\LexHTML.obj"^
 "%OBJDIR%\LexInno.obj"^
 "%OBJDIR%\LexLua.obj"^
 "%OBJDIR%\LexNsis.obj"^
 "%OBJDIR%\LexOthers.obj"^
 "%OBJDIR%\LexPascal.obj"^
 "%OBJDIR%\LexPerl.obj"^
 "%OBJDIR%\LexPowerShell.obj"^
 "%OBJDIR%\LexPython.obj"^
 "%OBJDIR%\LexRuby.obj"^
 "%OBJDIR%\LexSQL.obj"^
 "%OBJDIR%\LexTCL.obj"^
 "%OBJDIR%\LexVB.obj"^
 "%OBJDIR%\LineMarker.obj"^
 "%OBJDIR%\Notepad2.obj"^
 "%OBJDIR%\Notepad2.res"^
 "%OBJDIR%\PerLine.obj"^
 "%OBJDIR%\PlatWin.obj"^
 "%OBJDIR%\PositionCache.obj"^
 "%OBJDIR%\Print.obj"^
 "%OBJDIR%\PropSet.obj"^
 "%OBJDIR%\RESearch.obj"^
 "%OBJDIR%\RunStyles.obj"^
 "%OBJDIR%\ScintillaBase.obj"^
 "%OBJDIR%\ScintillaWin.obj"^
 "%OBJDIR%\Selection.obj"^
 "%OBJDIR%\Style.obj"^
 "%OBJDIR%\StyleContext.obj"^
 "%OBJDIR%\Styles.obj"^
 "%OBJDIR%\UniConversion.obj"^
 "%OBJDIR%\ViewStyle.obj"^
 "%OBJDIR%\WindowAccessor.obj"^
 "%OBJDIR%\XPM.obj"^
 "%WDK_LIB%"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] manifest stage...
ECHO:______________________________ && ECHO.

rem manifest tool command line
"%SDKDIR%\Bin\mt.exe" -manifest "..\res\Notepad2.exe.manifest" -outputresource:"%OUTDIR%\Notepad2.exe;#1"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________

break compiler and linker files for better readability

git-svn-id: 756506b3b0ea8c31733a8f0a5bb416c7e269da3d@129 28bd50df-7adb-d945-0439-6e466c6a13cc


call setExampleEnv.bat

set XAP_LOOKUP_GROUPS=US

rem PLEASE replace localhost with relevant HOSTNAME in production
set XAP_LOOKUP_LOCATORS=localhost:4266

set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.sun.jini.reggie.initialUnicastDiscoveryPort=4266
set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.gigaspaces.system.registryPort=10198
set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.gigaspaces.start.httpPort=9913
set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.gs.zones=US

rem Modify this as needed
set GSC_JAVA_OPTIONS=-Xmx128m

%GS_HOME%\bin\gs-agent.bat gsa.gsm 1 gsa.gsc 2

call setExampleEnv.bat

set XAP_LOOKUP_GROUPS=US

rem PLEASE replace localhost with relevant HOSTNAME in production
set XAP_LOOKUP_LOCATORS=localhost:4266

set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.sun.jini.reggie.initialUnicastDiscoveryPort=4266
set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.gigaspaces.system.registryPort=10198
set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.gigaspaces.start.httpPort=9913
set EXT_JAVA_OPTIONS=%EXT_JAVA_OPTIONS% -Dcom.gs.zones=US

rem Modify this as needed
set XAP_GSC_OPTIONS=-Xmx128m

%GS_HOME%\bin\gs-agent.bat gsa.gsm 1 gsa.gsc 2

Update startAgent-US.bat

Update startAgent-US.bat


##
## Skeleton for the CronTab Tests
## The perl script will insert what universe the job will be
## This file SHOULD NOT contain "Queue" at the end
##
Executable		= ./x_time.pl
Notification	= NEVER
Arguments		= 20

##
## The job will run every 3 minutes
##
CronHour		= *
CronMinute		= */3
CronDayOfMonth	= *
CronMonth		= *
CronDayOfWeek	= *

##
## Preparation Time
##
CronPrepTime	= 90

##
## We only want to run it 2 times
##
OnExitRemove	= NumJobStarts >= 1

##
## Skeleton for the CronTab Tests
## The perl script will insert what universe the job will be
## This file SHOULD NOT contain "Queue" at the end
##
Executable		= ./x_time.pl
Notification	= NEVER
Arguments		= 20

##
## The job will run every 3 minutes
##
CronHour		= *
CronMinute		= */3
CronDayOfMonth	= *
CronMonth		= *
CronDayOfWeek	= *

##
## Preparation Time
##
CronPrepTime	= 90

#
# Deferral window
# Give it 5 seconds leeway to run, so if it gets there late,it
# is still ok
deferral_window = 5

##
## We only want to run it 2 times
##
OnExitRemove	= NumJobStarts >= 1

add deferral_window to crontab tests. This avoids race conditions when condor_submit sends the schedd the cron job immediately before it is supposed to run. Even a small delay (e.g. with job_start_delay) will cause the job to miss its execution time and be put on hold. To fix this, give a five second deferal window, assuming that it should never take more than five seconds for the schedd to start a job in this personal condor


SETLOCAL EnableExtensions

for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set ldt=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2% %ldt:~8,2%:%ldt:~10,2%:%ldt:~12,6%

:: Update with your license key
SET LICENSE_KEY=REPLACE_WITH_LICENSE_KEY

SET NR_ERROR_LEVEL=0

CALL:INSTALL_NEWRELIC_AGENT
CALL:INSTALL_NEWRELIC_SERVER_MONITOR

IF %ERRORLEVEL% EQU 0 (
	EXIT /B 0
) ELSE (
	EXIT %NR_ERROR_LEVEL%
)

:: --------------
:: Functions
:: --------------
:INSTALL_NEWRELIC_AGENT
	ECHO %ldt% : Begin installing the New Relic .net Agent >> "%RoleRoot%\nr.log" 2>&1

	:: Current version of the installer
	SET NR_INSTALLER_NAME=NewRelicAgent_x64_2.19.3.0.msi
	:: Path used for custom configuration and worker role environment varibles
	SET NR_HOME=%ALLUSERSPROFILE%\New Relic\.NET Agent\

	ECHO Installing the New Relic .net Agent. >> "%RoleRoot%\nr.log" 2>&1

	IF "%IsWorkerRole%" EQU "true" (
	    msiexec.exe /i %NR_INSTALLER_NAME% /norestart /quiet NR_LICENSE_KEY=%LICENSE_KEY% INSTALLLEVEL=50 /lv* %RoleRoot%\nr_install.log
	) ELSE (
	    msiexec.exe /i %NR_INSTALLER_NAME% /norestart /quiet NR_LICENSE_KEY=%LICENSE_KEY% /lv* %RoleRoot%\nr_install.log
	)

	:: CUSTOM newrelic.xml : Uncomment the line below if you want to copy a custom newrelic.xml file into your instance
	REM copy /Y "newrelic.xml" "%NR_HOME%" >> %RoleRoot%\nr.log

	:: CUSTOM INSTRUMENTATION : Uncomment the line below to copy custom instrumentation into the agent directory.
	REM copy /Y "CustomInstrumentation.xml" "%NR_HOME%\extensions" >> %RoleRoot%\nr.log

	:: WEB ROLES : Restart the service to pick up the new environment variables
	:: 	if we are in a Worker Role then there is no need to restart W3SVC _or_
	:: 	if we are emulating locally then do not restart W3SVC
	IF "%IsWorkerRole%" EQU "false" IF "%EMULATED%" EQU "false" (
		ECHO Restarting IIS and W3SVC to pick up the new environment variables >> "%RoleRoot%\nr.log" 2>&1
		IISRESET
		NET START W3SVC
	)

	IF %ERRORLEVEL% EQU 0 (
	  REM  The New Relic .net Agent installed ok and does not need to be installed again.
	  ECHO New Relic .net Agent was installed successfully. >> "%RoleRoot%\nr.log" 2>&1

	) ELSE (
	  REM   An error occurred. Log the error to a separate log and exit with the error code.
	  ECHO  An error occurred installing the New Relic .net Agent 1. Errorlevel = %ERRORLEVEL%. >> "%RoleRoot%\nr_error.log" 2>&1

	  SET NR_ERROR_LEVEL=%ERRORLEVEL%
	)

GOTO:EOF

:INSTALL_NEWRELIC_SERVER_MONITOR
	ECHO %ldt% : Begin installing the New Relic Server Monitor >> "%RoleRoot%\nr_server.log" 2>&1

	:: Current version of the installer
	SET NR_INSTALLER_NAME=NewRelicServerMonitor_x64_3.0.219.0.msi

	ECHO Installing the New Relic Server Monitor. >> "%RoleRoot%\nr_server.log" 2>&1
	msiexec.exe /i %NR_INSTALLER_NAME% /norestart /quiet NR_LICENSE_KEY=%LICENSE_KEY% /lv* %RoleRoot%\nr_server_install.log

	IF %ERRORLEVEL% EQU 0 (
	  REM  The New Relic Server Monitor installed ok and does not need to be installed again.
	  ECHO New Relic Server Monitor was installed successfully. >> "%RoleRoot%\nr_server.log" 2>&1

	) ELSE (
	  REM   An error occurred. Log the error to a separate log and exit with the error code.
	  ECHO  An error occurred installing the New Relic Server Monitor 1. Errorlevel = %ERRORLEVEL%. >> "%RoleRoot%\nr_server_error.log" 2>&1

	  SET NR_ERROR_LEVEL=%ERRORLEVEL%
	)

GOTO:EOF

SETLOCAL EnableExtensions

for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set ldt=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2% %ldt:~8,2%:%ldt:~10,2%:%ldt:~12,6%

:: Update with your license key
SET LICENSE_KEY=REPLACE_WITH_LICENSE_KEY

SET NR_ERROR_LEVEL=0

CALL:INSTALL_NEWRELIC_AGENT
CALL:INSTALL_NEWRELIC_SERVER_MONITOR

IF %NR_ERROR_LEVEL% EQU 0 (
	EXIT /B 0
) ELSE (
	EXIT %NR_ERROR_LEVEL%
)

:: --------------
:: Functions
:: --------------
:INSTALL_NEWRELIC_AGENT
	ECHO %ldt% : Begin installing the New Relic .net Agent >> "%RoleRoot%\nr.log" 2>&1

	:: Current version of the installer
	SET NR_INSTALLER_NAME=NewRelicAgent_x64_2.19.3.0.msi
	:: Path used for custom configuration and worker role environment varibles
	SET NR_HOME=%ALLUSERSPROFILE%\New Relic\.NET Agent\

	ECHO Installing the New Relic .net Agent. >> "%RoleRoot%\nr.log" 2>&1

	IF "%IsWorkerRole%" EQU "true" (
	    msiexec.exe /i %NR_INSTALLER_NAME% /norestart /quiet NR_LICENSE_KEY=%LICENSE_KEY% INSTALLLEVEL=50 /lv* %RoleRoot%\nr_install.log
	) ELSE (
	    msiexec.exe /i %NR_INSTALLER_NAME% /norestart /quiet NR_LICENSE_KEY=%LICENSE_KEY% /lv* %RoleRoot%\nr_install.log
	)

	:: CUSTOM newrelic.xml : Uncomment the line below if you want to copy a custom newrelic.xml file into your instance
	REM copy /Y "newrelic.xml" "%NR_HOME%" >> %RoleRoot%\nr.log

	:: CUSTOM INSTRUMENTATION : Uncomment the line below to copy custom instrumentation into the agent directory.
	REM copy /Y "CustomInstrumentation.xml" "%NR_HOME%\extensions" >> %RoleRoot%\nr.log

	:: WEB ROLES : Restart the service to pick up the new environment variables
	:: 	if we are in a Worker Role then there is no need to restart W3SVC _or_
	:: 	if we are emulating locally then do not restart W3SVC
	IF "%IsWorkerRole%" EQU "false" IF "%EMULATED%" EQU "false" (
		ECHO Restarting IIS and W3SVC to pick up the new environment variables >> "%RoleRoot%\nr.log" 2>&1
		IISRESET
		NET START W3SVC
	)

	IF %ERRORLEVEL% EQU 0 (
	  REM  The New Relic .net Agent installed ok and does not need to be installed again.
	  ECHO New Relic .net Agent was installed successfully. >> "%RoleRoot%\nr.log" 2>&1

	) ELSE (
	  REM   An error occurred. Log the error to a separate log and exit with the error code.
	  ECHO  An error occurred installing the New Relic .net Agent 1. Errorlevel = %ERRORLEVEL%. >> "%RoleRoot%\nr_error.log" 2>&1

	  SET NR_ERROR_LEVEL=%ERRORLEVEL%
	)

GOTO:EOF

:INSTALL_NEWRELIC_SERVER_MONITOR
	ECHO %ldt% : Begin installing the New Relic Server Monitor >> "%RoleRoot%\nr_server.log" 2>&1

	:: Current version of the installer
	SET NR_INSTALLER_NAME=NewRelicServerMonitor_x64_3.0.219.0.msi

	ECHO Installing the New Relic Server Monitor. >> "%RoleRoot%\nr_server.log" 2>&1
	msiexec.exe /i %NR_INSTALLER_NAME% /norestart /quiet NR_LICENSE_KEY=%LICENSE_KEY% /lv* %RoleRoot%\nr_server_install.log

	IF %ERRORLEVEL% EQU 0 (
	  REM  The New Relic Server Monitor installed ok and does not need to be installed again.
	  ECHO New Relic Server Monitor was installed successfully. >> "%RoleRoot%\nr_server.log" 2>&1

	) ELSE (
	  REM   An error occurred. Log the error to a separate log and exit with the error code.
	  ECHO  An error occurred installing the New Relic Server Monitor 1. Errorlevel = %ERRORLEVEL%. >> "%RoleRoot%\nr_server_error.log" 2>&1

	  SET NR_ERROR_LEVEL=%ERRORLEVEL%
	)

GOTO:EOF

Fix error level variable check in newrelic.cmd.


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

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

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

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

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

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

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

Revert "Delete gradlew.bat"

Revert "Delete gradlew.bat"

This reverts commit c14926631ca90f66f71d363f2acff5d7d8f0bfe2.


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

set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 8.0.0

set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0

set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm

del /f /q BUILD || rmdir build /s /q

call npm update || goto :error

mkdir -p %ARTIFACTS_OUT%

for %%v in (%node_versions%) do (
  call .\node_modules\.bin\node-pre-gyp.cmd configure build --target=%%v --target_arch=%1

@rem Try again after removing openssl headers
  rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\%%v\include\node\openssl" /S /Q
  rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\iojs-%%v\include\node\openssl" /S /Q
  call .\node_modules\.bin\node-pre-gyp.cmd build package --target=%%v --target_arch=%1 || goto :error

  xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
)

for %%v in (%electron_versions%) do (
  cmd /V /C "set "HOME=%HOMEDRIVE%%HOMEPATH%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error

  xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
)
if %errorlevel% neq 0 exit /b %errorlevel%

goto :EOF

:error
exit /b 1

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

set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 8.0.0

set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0

set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm

del /f /q BUILD || rmdir build /s /q

call npm update || goto :error

mkdir -p %ARTIFACTS_OUT%

for %%v in (%node_versions%) do (
  call .\node_modules\.bin\node-pre-gyp.cmd configure build --target=%%v --target_arch=%1

@rem Try again after removing openssl headers
  rmdir "%USERPROFILE%\.node-gyp\%%v\include\node\openssl" /S /Q
  rmdir "%USERPROFILE%\.node-gyp\iojs-%%v\include\node\openssl" /S /Q
  call .\node_modules\.bin\node-pre-gyp.cmd build package --target=%%v --target_arch=%1 || goto :error

  xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
)

for %%v in (%electron_versions%) do (
  cmd /V /C "set "HOME=%USERPROFILE%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error

  xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
)
if %errorlevel% neq 0 exit /b %errorlevel%

goto :EOF

:error
exit /b 1

fix node artifact build on kokoro

fix node artifact build on kokoro


mkdir updater
mkdir updater\plugins
mkdir updater\scripting
mkdir updater\scripting\servertools
mkdir updater\docs

mkdir package
mkdir package\server
mkdir package\server\configs
mkdir package\server\plugins
mkdir package\server\docs
mkdir package\server\scripting
mkdir package\server\scripting\servertools
mkdir package\remote
mkdir package\stc
mkdir package\stc\win32

copy plugin\servertools.sp updater\scripting\ /Y
copy plugin\servertools\* updater\scripting\servertools\ /Y
copy plugin\servertools.smx updater\plugins\ /Y
copy docs\servertools3.txt updater\docs\ /Y

copy docs\servertools3.txt package\ /Y
copy docs\servertools3.txt package\server\docs /Y
copy plugin\servertools.smx package\server\plugins /Y
copy plugin\servertools.sp package\server\scripting /Y
copy plugin\servertools\* package\server\scripting\servertools\ /Y
copy servertools.cfg.example package\server\configs /Y
copy servertools_id.cfg.example package\server\configs /Y
copy web\listing.php package\remote /Y
copy stc\autoexec_stock.cfg package\stc\win32\autoexec.cfg /Y
copy stc\Release\stc.exe package\stc\win32 /Y
copy stc\LICENSE_1_0.txt package\stc\win32 /Y

@echo off
echo ***
echo ***
echo *** don't forget to set version in servertools_update.txt ***
echo *** and compile smx! ***
echo ***
echo ***
echo (all done)
echo -----------------------

pause

mkdir updater
mkdir updater\plugins
mkdir updater\scripting
mkdir updater\scripting\servertools
mkdir updater\docs

mkdir package
mkdir package\server
mkdir package\server\configs
mkdir package\server\plugins
mkdir package\server\docs
mkdir package\server\scripting
mkdir package\server\scripting\servertools
mkdir package\remote
mkdir package\stc
mkdir package\stc\win32

copy plugin\servertools.sp updater\scripting\ /Y
copy plugin\servertools\* updater\scripting\servertools\ /Y
copy plugin\servertools.smx updater\plugins\ /Y
copy docs\servertools3.txt updater\docs\ /Y

copy docs\servertools3.txt package\ /Y
copy docs\servertools3.txt package\server\docs /Y
copy plugin\servertools.smx package\server\plugins /Y
copy plugin\servertools.sp package\server\scripting /Y
copy plugin\servertools\* package\server\scripting\servertools\ /Y
copy servertools.cfg.example package\server\configs /Y
copy servertools_id.cfg.example package\server\configs /Y
copy web\listing.php package\remote /Y
copy web\setkey.php package\remote /Y
copy stc\autoexec_stock.cfg package\stc\win32\autoexec.cfg /Y
copy stc\Release\stc.exe package\stc\win32 /Y
copy stc\LICENSE_1_0.txt package\stc\win32 /Y

@echo off
echo ***
echo ***
echo *** don't forget to set version in servertools_update.txt ***
echo *** and compile smx! ***
echo ***
echo ***
echo (all done)
echo -----------------------

pause

package setkey.php

package setkey.php


pushd %~dp0
rmdir /s /q .\lib
mkdir .\lib\net45
mkdir .\lib\netstandard2.0
pushd ..\..
del /q /f *.nupkg
copy .\lib\bin\Release\Microsoft.WindowsAzure.Storage.DataMovement.dll .\tools\nupkg\lib\net45
copy .\lib\bin\Release\Microsoft.WindowsAzure.Storage.DataMovement.pdb .\tools\nupkg\lib\net45
copy .\lib\bin\Release\Microsoft.WindowsAzure.Storage.DataMovement.XML .\tools\nupkg\lib\net45
copy .\netcore\Microsoft.WindowsAzure.Storage.DataMovement\bin\Release\netstandard2.0\Microsoft.WindowsAzure.Storage.DataMovement.dll .\tools\nupkg\lib\netstandard2.0
copy .\netcore\Microsoft.WindowsAzure.Storage.DataMovement\bin\Release\netstandard2.0\Microsoft.WindowsAzure.Storage.DataMovement.pdb .\tools\nupkg\lib\netstandard2.0
copy .\netcore\Microsoft.WindowsAzure.Storage.DataMovement\bin\Release\netstandard2.0\Microsoft.WindowsAzure.Storage.DataMovement.xml .\tools\nupkg\lib\netstandard2.0
.\.nuget\nuget.exe pack .\tools\nupkg\Microsoft.Azure.Storage.DataMovement.nuspec
popd
rmdir /s /q .\lib
popd

pushd %~dp0
rmdir /s /q .\package
mkdir .\package\lib\net45
mkdir .\package\lib\netstandard2.0
pushd ..\..
del /q /f *.nupkg
copy .\lib\bin\Release\Microsoft.WindowsAzure.Storage.DataMovement.dll .\tools\nupkg\package\lib\net45
copy .\lib\bin\Release\Microsoft.WindowsAzure.Storage.DataMovement.pdb .\tools\nupkg\package\lib\net45
copy .\lib\bin\Release\Microsoft.WindowsAzure.Storage.DataMovement.XML .\tools\nupkg\package\lib\net45
copy .\netcore\Microsoft.WindowsAzure.Storage.DataMovement\bin\Release\netstandard2.0\Microsoft.WindowsAzure.Storage.DataMovement.dll .\tools\nupkg\package\lib\netstandard2.0
copy .\netcore\Microsoft.WindowsAzure.Storage.DataMovement\bin\Release\netstandard2.0\Microsoft.WindowsAzure.Storage.DataMovement.pdb .\tools\nupkg\package\lib\netstandard2.0
copy .\netcore\Microsoft.WindowsAzure.Storage.DataMovement\bin\Release\netstandard2.0\Microsoft.WindowsAzure.Storage.DataMovement.xml .\tools\nupkg\package\lib\netstandard2.0
copy .\tools\nupkg\Microsoft.Azure.Storage.DataMovement.nuspec .\tools\nupkg\package
.\.nuget\nuget.exe pack .\tools\nupkg\package\Microsoft.Azure.Storage.DataMovement.nuspec
popd
rmdir /s /q .\package
popd

Exclude nupkg script from DMLib's nuget package.


@echo off

cd maven-mboot2

call .\build

cd ..

%JAVA_HOME%\bin\java -jar mboot.jar

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

@REM ----------------------------------------------------------------------------
@REM Maven2 Bootstrap Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM M2_HOME - location of maven2's installed home dir
@REM
@REM Optional ENV vars
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven2 bootstrap
@REM     e.g. to run in offline mode, use
@REM set MAVEN_OPTS=-Dmaven.online=false
@REM ----------------------------------------------------------------------------

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

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

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

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

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

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

:chkMHome
if not "%M2_HOME%"=="" goto init

echo.
echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set MAVEN_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set MAVEN_CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of agruments (up to the command line limit, anyway).
set MAVEN_CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

@REM Build MBoot2
cd maven-mboot2

call .\build

@REM Build Maven2
cd ..

%MAVEN_JAVA_EXE% %MAVEN_CMD_LINE_ARGS% -jar mboot.jar

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set MAVEN_JAVA_EXE=
set MAVEN_CMD_LINE_ARGS=
goto postExec

:endNT
@endlocal

:postExec
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

Make useable for all windows platforms.

Make useable for all windows platforms.

git-svn-id: 2c527eb49caa05e19d6b2be874bf74fa9d7ea670@163037 13f79535-47bb-0310-9956-ffa450edef68


call setRepoEnvVar
sed -i "s/SIPXTAPI_BUILDNUMBER.*\".*\"/SIPXTAPI_BUILDNUMBER \"%REPRO_VERSION%\"/g" ..\..\include\tapi\sipXtapi.h
sed -i "s/SIPXTAPI_BUILD_WORD.*/SIPXTAPI_BUILD_WORD 2,9,1,%REPRO_VERSION%/g" ..\..\include\tapi\sipXtapi.h
sed -i "s/SIPXTAPI_FULL_VERSION.*\".*\"/SIPXTAPI_FULL_VERSION \"2.9.1.%REPRO_VERSION%\"/g" ..\..\include\tapi\sipXtapi.h
sed -i "s/SIPXTAPI_BUILDDATE.*\".*\"/SIPXTAPI_BUILDDATE \"%date:~10,4%-%date:~4,2%-%date:~7,2%\"/g" ..\..\include\tapi\sipXtapi.h

call setRepoEnvVar
sed -i "s/SIPXTAPI_BUILDNUMBER.*\".*\"/SIPXTAPI_BUILDNUMBER \"%REPRO_VERSION%\"/g" ..\..\include\tapi\sipXtapi.h
sed -i "s/SIPXTAPI_BUILD_WORD [0-9,,]*/SIPXTAPI_BUILD_WORD 2,9,1,%REPRO_VERSION%/g" ..\..\include\tapi\sipXtapi.h
sed -i "s/SIPXTAPI_FULL_VERSION.*\".*\"/SIPXTAPI_FULL_VERSION \"2.9.1.%REPRO_VERSION%\"/g" ..\..\include\tapi\sipXtapi.h
sed -i "s/SIPXTAPI_BUILDDATE.*\".*\"/SIPXTAPI_BUILDDATE \"%date:~10,4%-%date:~4,2%-%date:~7,2%\"/g" ..\..\include\tapi\sipXtapi.h

Tweak to the script used to modified the version in sipXtapi.h -- it removed the start of comment resulting in compiler errors.

git-svn-id: 5274dacc98e2a95d0b0452670772bfdffe61ca90@7201 a612230a-c5fa-0310-af8b-88eea846685b


@echo off
REM
REM Copyright (C) 2021 Grakn Labs
REM
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU Affero General Public License as
REM published by the Free Software Foundation, either version 3 of the
REM License, or (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU Affero General Public License for more details.
REM
REM You should have received a copy of the GNU Affero General Public License
REM along with this program.  If not, see <https://www.gnu.org/licenses/>.
REM

REM uninstall Java 12 installed by CircleCI
choco uninstall openjdk --limit-output --yes --no-progress

REM install dependencies needed for build
choco install .circleci\windows\dependencies.config  --limit-output --yes --no-progress

REM create a symlink python3.exe and make it available in %PATH%
mklink C:\Python37\python3.exe C:\Python37\python.exe
set PATH=%PATH%;C:\Python37

REM install runtime dependency for the build
C:\Python37\python.exe -m pip install wheel

REM permanently set variables for Bazel build
SETX BAZEL_SH "C:\Program Files\Git\usr\bin\bash.exe"
SETX BAZEL_PYTHON C:\Python37\python.exe

REM TODO: https://github.com/graknlabs/grakn/issues/6200
REM temporary workaround around "AsAbsoluteWindowsPath failed: Unix-style paths are unsupported" error
DEL .bazelrc

Fix test-assembly-windows-zip CI job (#6199)

## What is the goal of this PR?

Work around limitations of Bazel on Windows by removing `.bazelrc` file when building on this platform.

## What are the changes implemented in this PR?

Delete `.bazelrc` file before executing the job


::
:: script that builds and uploads everything on Windows Visual Studio 2015
:: (assumes CMake is set up properly, Python is installed, etc)
:: (assumes this is run on an administrator developer command prompt from the Klampt folder)
:: (assumes the zip command line tool is available.  See GnuWin32 zip.)

:: configuration variables
SET klamptversion=0.8.5
:: dependency libraries may be kept back to a prior version
SET klamptdepversion=0.8.5
::    this is used for Python build (VS 2015)
SET VS90COMNTOOLS=%VS140COMNTOOLS%
SET PYTHON27_32=D:\Python27\python.exe
SET PYTHON27_64=D:\Python27_x64\python.exe
SET PYTHON35_32=D:\Python35-32\python.exe
SET PYTHON35_64=D:\Python35\python.exe
SET PYTHON36_32=D:\Python36-32\python.exe
SET PYTHON36_64=D:\Python36\python.exe
SET PYTHON37_32=D:\Python37-32\python.exe
SET PYTHON37_64=D:\Python37\python.exe
SET PYTHON38_32=D:\Python38-32\python.exe
SET PYTHON38_64=D:\Python38\python.exe
SET PYTHON39_32=D:\Python39-32\python.exe
SET PYTHON39_64=D:\Python39\python.exe
SET PYTHON_32_VERSIONS=%PYTHON27_32% %PYTHON35_32% %PYTHON36_32% %PYTHON37_32% %PYTHON38_32% %PYTHON39_32%
SET PYTHON_64_VERSIONS=%PYTHON27_64% %PYTHON35_64% %PYTHON36_64% %PYTHON37_64% %PYTHON38_64% %PYTHON39_32%

for %%P in (%PYTHON_32_VERSIONS%) do (
  %%P --version
  )
for %%P in (%PYTHON_64_VERSIONS%) do (
  %%P --version
  )

:: update Klampt
:: git pull
:: if %errorlevel% neq 0 exit /b %errorlevel%

:: update KrisLibrary
pushd Cpp\Dependencies\KrisLibrary
:: git pull
if %errorlevel% neq 0 exit /b %errorlevel%
popd

:: 32 bit build
SET buildfolder=msvc

:: build KrisLibrary, both release and debug and copy into Cpp/Dependencies directory
pushd Cpp\Dependencies\KrisLibrary
devenv %buildfolder%\KrisLibrary.sln /build Release
if %errorlevel% neq 0 exit /b %errorlevel%
devenv %buildfolder%\KrisLibrary.sln /build Debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy /Y %buildfolder%\lib\Release\KrisLibrary.lib ..\
copy /Y %buildfolder%\lib\Debug\KrisLibraryd.lib ..\
popd

:: build Klamp't
devenv %buildfolder%\Klampt.sln /build Release
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%
devenv %buildfolder%\Klampt.sln /build Release /project PACKAGE
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%

SET errorlevel=0

:: build Klamp't Python bindings
copy /y %buildfolder%\Python\setup.py Python\
pushd Python
for %%P in (%PYTHON_32_VERSIONS%) do (
    %%P setup.py build_ext
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py install
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py bdist_wheel
    if %errorlevel% neq 0 exit /b %errorlevel%
  )
popd

:: 64 bit build
SET buildfolder=msvc64

:: build KrisLibrary, both release and debug and copy into Cpp/Dependencies directory
pushd Cpp\Dependencies\KrisLibrary
devenv %buildfolder%\KrisLibrary.sln /build Release
if %errorlevel% neq 0 exit /b %errorlevel%
devenv %buildfolder%\KrisLibrary.sln /build Debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy /Y %buildfolder%\lib\Release\KrisLibrary.lib ..\x64
copy /Y %buildfolder%\lib\Debug\KrisLibraryd.lib ..\x64
popd

:: build Klampt
:: Qt5 doesn't have a 64-bit build, don't build apps
devenv %buildfolder%\Klampt.sln /build Release /project Klampt
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%
:: devenv %buildfolder%\Klampt.sln /build Release /project PACKAGE
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%

:: build Klamp't Python bindings
copy /y %buildfolder%\Python\setup.py Python\
pushd Python
for %%P in (%PYTHON_64_VERSIONS%) do (
    %%P setup.py build_ext
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py install
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py bdist_wheel
    if %errorlevel% neq 0 exit /b %errorlevel%
  )
popd

:: zip dependency libraries
::   release
set depfolder=Klampt-%klamptdepversion%.win32-deps-vs2015
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (assimp.dll glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib KrisLibrary.lib ode_double.lib tinyxml_STL.lib libcurl.lib) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

::   debug
set depfolder=Klampt-%klamptdepversion%.win32-deps-vs2015d
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (assimpd.dll  glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib KrisLibraryd.lib ode_doubled.lib ode-0.14\lib\DebugDoubleLib\ode.pdb tinyxmld_STL.lib libcurl.lib) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

::   release x64
set depfolder=Klampt-%klamptdepversion%.win64-deps-vs2015
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (x64\assimp.dll glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib x64\KrisLibrary.lib x64\ode_double.lib x64\tinyxml_STL.lib x64\libcurl.lib ) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

::   debug x64
set depfolder=Klampt-%klamptdepversion%.win64-deps-vs2015d
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (x64\assimpd.dll glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib x64\KrisLibraryd.lib x64\ode_doubled.lib x64\tinyxmld_STL.lib x64\libcurl.lib ) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

:: upload files to motion website
copy msvc/Klampt-%klamptversion%-win32.msi d:\iml-webpage\software\klampt\0.8\
:: Qt5 doesn't have a 64-bit version
:: copy msvc64/Klampt-%klamptversion%-win64.msi d:\iml-webpage\software\klampt\0.8\
if %errorlevel% neq 0 exit /b %errorlevel%
copy Klampt-%klamptdepversion%.win32-deps-vs2015.zip d:\iml-webpage\software\klampt\0.8\
copy Klampt-%klamptdepversion%.win32-deps-vs2015d.zip d:\iml-webpage\software\klampt\0.8\
copy Klampt-%klamptdepversion%.win64-deps-vs2015.zip d:\iml-webpage\software\klampt\0.8\
copy Klampt-%klamptdepversion%.win64-deps-vs2015d.zip d:\iml-webpage\software\klampt\0.8\
if %errorlevel% neq 0 exit /b %errorlevel%

::
:: script that builds and uploads everything on Windows Visual Studio 2015
:: (assumes CMake is set up properly, Python is installed, etc)
:: (assumes this is run on an administrator developer command prompt from the Klampt folder)
:: (assumes the zip command line tool is available.  See GnuWin32 zip.)

:: configuration variables
SET klamptversion=0.8.6
:: dependency libraries may be kept back to a prior version
SET klamptdepversion=0.8.6
::    this is used for Python build (VS 2015)
SET VS90COMNTOOLS=%VS140COMNTOOLS%
SET PYTHON27_32=D:\Python27\python.exe
SET PYTHON27_64=D:\Python27_x64\python.exe
SET PYTHON35_32=D:\Python35-32\python.exe
SET PYTHON35_64=D:\Python35\python.exe
SET PYTHON36_32=D:\Python36-32\python.exe
SET PYTHON36_64=D:\Python36\python.exe
SET PYTHON37_32=D:\Python37-32\python.exe
SET PYTHON37_64=D:\Python37\python.exe
SET PYTHON38_32=D:\Python38-32\python.exe
SET PYTHON38_64=D:\Python38\python.exe
SET PYTHON39_32=D:\Python39-32\python.exe
SET PYTHON39_64=D:\Python39\python.exe
SET PYTHON_32_VERSIONS=%PYTHON27_32% %PYTHON35_32% %PYTHON36_32% %PYTHON37_32% %PYTHON38_32% %PYTHON39_32%
SET PYTHON_64_VERSIONS=%PYTHON27_64% %PYTHON35_64% %PYTHON36_64% %PYTHON37_64% %PYTHON38_64% %PYTHON39_32%

for %%P in (%PYTHON_32_VERSIONS%) do (
  %%P --version
  )
for %%P in (%PYTHON_64_VERSIONS%) do (
  %%P --version
  )

:: update Klampt
:: git pull
:: if %errorlevel% neq 0 exit /b %errorlevel%

:: update KrisLibrary
pushd Cpp\Dependencies\KrisLibrary
:: git pull
if %errorlevel% neq 0 exit /b %errorlevel%
popd

:: 32 bit build
SET buildfolder=msvc

:: build KrisLibrary, both release and debug and copy into Cpp/Dependencies directory
pushd Cpp\Dependencies\KrisLibrary
devenv %buildfolder%\KrisLibrary.sln /build Release
if %errorlevel% neq 0 exit /b %errorlevel%
devenv %buildfolder%\KrisLibrary.sln /build Debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy /Y %buildfolder%\lib\Release\KrisLibrary.lib ..\
copy /Y %buildfolder%\lib\Debug\KrisLibraryd.lib ..\
popd

:: build Klamp't
devenv %buildfolder%\Klampt.sln /build Release
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%
devenv %buildfolder%\Klampt.sln /build Release /project PACKAGE
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%

SET errorlevel=0

:: build Klamp't Python bindings
copy /y %buildfolder%\Python\setup.py Python\
pushd Python
for %%P in (%PYTHON_32_VERSIONS%) do (
    %%P setup.py build_ext
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py install
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py bdist_wheel
    if %errorlevel% neq 0 exit /b %errorlevel%
  )
popd

:: 64 bit build
SET buildfolder=msvc64

:: build KrisLibrary, both release and debug and copy into Cpp/Dependencies directory
pushd Cpp\Dependencies\KrisLibrary
devenv %buildfolder%\KrisLibrary.sln /build Release
if %errorlevel% neq 0 exit /b %errorlevel%
devenv %buildfolder%\KrisLibrary.sln /build Debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy /Y %buildfolder%\lib\Release\KrisLibrary.lib ..\x64
copy /Y %buildfolder%\lib\Debug\KrisLibraryd.lib ..\x64
popd

:: build Klampt
:: Qt5 doesn't have a 64-bit build, don't build apps
devenv %buildfolder%\Klampt.sln /build Release /project Klampt
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%
:: devenv %buildfolder%\Klampt.sln /build Release /project PACKAGE
:: (python doesnt build right here...) if %errorlevel% neq 0 exit /b %errorlevel%

:: build Klamp't Python bindings
copy /y %buildfolder%\Python\setup.py Python\
pushd Python
for %%P in (%PYTHON_64_VERSIONS%) do (
    %%P setup.py build_ext
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py install
    if %errorlevel% neq 0 exit /b %errorlevel%
    %%P setup.py bdist_wheel
    if %errorlevel% neq 0 exit /b %errorlevel%
  )
popd

:: zip dependency libraries
::   release
set depfolder=Klampt-%klamptdepversion%.win32-deps-vs2015
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (assimp.dll glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib KrisLibrary.lib ode_double.lib tinyxml_STL.lib libcurl.lib) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

::   debug
set depfolder=Klampt-%klamptdepversion%.win32-deps-vs2015d
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (assimpd.dll  glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib KrisLibraryd.lib ode_doubled.lib ode-0.14\lib\DebugDoubleLib\ode.pdb tinyxmld_STL.lib libcurl.lib) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

::   release x64
set depfolder=Klampt-%klamptdepversion%.win64-deps-vs2015
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (x64\assimp.dll glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib x64\KrisLibrary.lib x64\ode_double.lib x64\tinyxml_STL.lib x64\libcurl.lib ) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

::   debug x64
set depfolder=Klampt-%klamptdepversion%.win64-deps-vs2015d
mkdir %depfolder%
pushd Cpp\Dependencies
for %%I in (x64\assimpd.dll glpk_4_61.dll glpk_4_61.lib glew32.dll glew32.lib x64\KrisLibraryd.lib x64\ode_doubled.lib x64\tinyxmld_STL.lib x64\libcurl.lib ) do copy /Y %%I ..\..\%depfolder%
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %depfolder%
zip ..\%depfolder%.zip *
popd
if %errorlevel% neq 0 exit /b %errorlevel%

:: upload files to motion website
copy msvc/Klampt-%klamptversion%-win32.msi d:\iml-webpage\software\klampt\0.8\
:: Qt5 doesn't have a 64-bit version
:: copy msvc64/Klampt-%klamptversion%-win64.msi d:\iml-webpage\software\klampt\0.8\
if %errorlevel% neq 0 exit /b %errorlevel%
copy Klampt-%klamptdepversion%.win32-deps-vs2015.zip d:\iml-webpage\software\klampt\0.8\
copy Klampt-%klamptdepversion%.win32-deps-vs2015d.zip d:\iml-webpage\software\klampt\0.8\
copy Klampt-%klamptdepversion%.win64-deps-vs2015.zip d:\iml-webpage\software\klampt\0.8\
copy Klampt-%klamptdepversion%.win64-deps-vs2015d.zip d:\iml-webpage\software\klampt\0.8\
if %errorlevel% neq 0 exit /b %errorlevel%

Bump version

Bump version


@echo off

IF DEFINED JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) ELSE (
  FOR %%I IN (java.exe) DO set JAVA=%%~$PATH:I
)
IF NOT EXIST %JAVA% (
  ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
  EXIT /B 1
)

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

REM check in case a user was using this mechanism
if "%ES_CLASSPATH%" == "" (
set ES_CLASSPATH=!ES_HOME!/lib/*
) else (
ECHO Error: Don't modify the classpath with ES_CLASSPATH, Best is to add 1>&2
ECHO additional elements via the plugin mechanism, or if code must really be 1>&2
ECHO added to the main classpath, add jars to lib\, unsupported 1>&2
EXIT /B 1
)

%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker"

IF ERRORLEVEL 1 (
    ECHO Elasticsearch requires at least Java 8 but your Java version from %JAVA% does not meet this requirement
    EXIT /B 1
)

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

@echo off

IF DEFINED JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) ELSE (
  FOR %%I IN (java.exe) DO set JAVA="%%~$PATH:I"
)
IF NOT EXIST %JAVA% (
  ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
  EXIT /B 1
)

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

REM check in case a user was using this mechanism
if "%ES_CLASSPATH%" == "" (
set ES_CLASSPATH=!ES_HOME!/lib/*
) else (
ECHO Error: Don't modify the classpath with ES_CLASSPATH, Best is to add 1>&2
ECHO additional elements via the plugin mechanism, or if code must really be 1>&2
ECHO added to the main classpath, add jars to lib\, unsupported 1>&2
EXIT /B 1
)

%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker"

IF ERRORLEVEL 1 (
    ECHO Elasticsearch requires at least Java 8 but your Java version from %JAVA% does not meet this requirement
    EXIT /B 1
)

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

Fix use of spaces on Windows if JAVA_HOME not set

When JAVA_HOME is not set we try to detect the location of Java. If its
location contains a space, due to a lack of quoting we will be
unsuccessful in invoking Java. This commit adds the necessary quoting to
handle this case.

Relates #23822


Add batch script for starting jupyter notebook


@ECHO OFF
SETLOCAL
SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't specified; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0
SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\ReadMe-mod.txt" "temp_zip\Readme.txt" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "ReadMe.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD binaries\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe binaries\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\%BINDIR%\readme.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NP2_VER%.%VerRev% binaries\%BINDIR%\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\%BINDIR%\notepad2.inf >NUL
tools\cabutcd.exe binaries\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
devenv setup.sln /Rebuild "Lite|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

IF EXIST "%PERL_PATH%" (
  "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
)

MD ..\wdkbuild\packages >NUL 2>&1
IF EXIST "%PERL_PATH%" (
  MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
)
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.%BINDIR%.exe >NUL
MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.%BINDIR%.exe >NUL

rem Cleanup
RD setup.%BINDIR% >NUL 2>&1
RD /Q binaries >NUL 2>&1
RD /Q /S addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

@ECHO OFF
SETLOCAL
SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't specified; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0
SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\ReadMe-mod.txt" "temp_zip\Readme.txt" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "ReadMe.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NP2_VER%.%VerRev% temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL
tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
devenv setup.sln /Rebuild "Lite|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

IF EXIST "%PERL_PATH%" (
  "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
)

MD ..\wdkbuild\packages >NUL 2>&1
IF EXIST "%PERL_PATH%" (
  MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
)
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.%BINDIR%.exe >NUL
MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.%BINDIR%.exe >NUL

rem Cleanup
RD setup.%BINDIR% >NUL 2>&1
RD /Q temp >NUL 2>&1
RD /Q /S addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

update make_packages.bat

update make_packages.bat

git-svn-id: 756506b3b0ea8c31733a8f0a5bb416c7e269da3d@169 28bd50df-7adb-d945-0439-6e466c6a13cc


@echo off

:: install chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco feature enable -n allowGlobalConfirmation

:: general apps
choco upgrade chocolatey
choco upgrade 7zip 7zip.commandline putty filezilla adobereader slack javaruntime gimp paint.net
choco upgrade autoruns procexp procmon sdelete
choco upgrade curl optipng rsync unzip wget wput zip
choco upgrade inconsolata

:: dev apps
choco upgrade postgresql-9.3 pgadmin3
choco upgrade tortoisesvn git gitkraken
choco upgrade atom visualstudiocode
choco upgrade visualstudio2012professional -packageParameters "/Features:'OfficeTools'"
choco upgrade ankhsvn wixtoolset ilspy depends
choco upgrade dotnet4.6 dotnet4.5.2 dotnet4.5.1 dotnet4.5 dotnet3.5

@echo off

:: install chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco feature enable -n allowGlobalConfirmation

:: general apps
choco upgrade chocolatey
choco upgrade 7zip 7zip.commandline adobereader gimp javaruntime paint.net pencil slack vlc
choco upgrade filezilla putty
choco upgrade autoruns procexp procmon sdelete
choco upgrade curl optipng rsync unzip wget wput zip
choco upgrade inconsolata

:: dev apps
choco upgrade pgadmin3 postgresql-9.3
choco upgrade ankhsvn git gitkraken tortoisesvn
choco upgrade atom visualstudiocode
choco upgrade visualstudio2012professional -packageParameters "/Features:'OfficeTools'"
choco upgrade depends ilspy wixtoolset
choco upgrade dotnet4.6 dotnet4.5.2 dotnet4.5.1 dotnet4.5 dotnet3.5

Add vlc and pencil

Add vlc and pencil


Add magic.bat

Add magic.bat


set "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True"
set "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True"
set "GRPC_PYTHON_CFLAGS=/DPB_FIELD_16BIT"

"%PYTHON%" -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
if errorlevel 1 exit 1

Use zlib and openssl from conda-forge for windows


REM =====================================================================
REM Create the Portal primary administrator account
REM =====================================================================
echo.
echo.
echo %sectionBreak%
echo Create the Portal for ArcGIS primary administrator account...
echo.
echo ^- When the web browser opens the "Initial Administrator Account Required" page...
echo.
echo    1. Enter the required information to create the admin user.
echo.
echo    2. Click "Create".
echo.
echo    3. If creation of the admin account is successful,
echo       you will be directed to the "Sign In" page.
echo.
echo    4. Test if you can sign in.
echo.
echo    5. Sign Out of the portal.
echo.
echo    6. Close the web browser.
echo.
%ops_webBrowserExePath% https://%ops_FQDN%:7443/arcgis/home/signin.html?
PING 127.0.0.1 -n 3 > nul

REM =====================================================================
REM Create the Portal primary administrator account
REM =====================================================================
set ops_ChkErrLevelFile=%~dp0..\..\..\SupportFiles\BatchFiles\CheckErrorLevel.bat
echo.
echo.
echo %sectionBreak%
echo Create the Portal for ArcGIS primary administrator account...
echo.
echo ^- When the web browser opens the "Initial Administrator Account Required" page...
echo.
echo    1. Enter the required information to create the admin user.
echo.
echo    2. Click "Create".
echo.
echo    3. If creation of the admin account is successful,
echo       you will be directed to the "Sign In" page.
echo.
echo    4. Test if you can sign in.
echo.
echo    5. Sign Out of the portal.
echo.
echo    6. Close the web browser.
echo.
set execute=%ops_webBrowserExePath% https://%ops_FQDN%:7443/arcgis/home/signin.html?
echo %execute%
echo.
%execute%
Call %ops_ChkErrLevelFile% %ERRORLEVEL%
PING 127.0.0.1 -n 3 > nul

Fix to #74

Fix to #74