:: Start with bootstrap
cd .\tools\build
dir .
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
:: dir .
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%

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

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

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

:: Start with bootstrap
cd .\tools\build
dir .
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
dir .
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
dir .

:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%

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

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

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

Update bld.bat

Update bld.bat


:: Start with bootstrap
cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat mingw
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1

:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%
::
:: Build step
:: CALL b2 install ^
::     --build-dir=buildboost ^
::     --prefix=%LIBRARY_PREFIX% ^
::     toolset=gcc ^
::     address-model=%ARCH% ^
::     variant=release ^
::     threading=multi ^
::     link=shared ^
::     -j%CPU_COUNT% ^
::     -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::     -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::     --with-python
:: IF errorlevel 1 exit 1
::
:: :: Install fix-up for a non version-specific boost include
:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1
::
:: Move dll's to LIBRARY_BIN
:: move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
:: IF errorlevel 1 exit 1
:: Status API Training Shop Blog About

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

:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%
::
:: Build step
:: CALL b2 install ^
::     --build-dir=buildboost ^
::     --prefix=%LIBRARY_PREFIX% ^
::     toolset=gcc ^
::     address-model=%ARCH% ^
::     variant=release ^
::     threading=multi ^
::     link=shared ^
::     -j%CPU_COUNT% ^
::     -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::     -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::     --with-python
:: IF errorlevel 1 exit 1
::
:: :: Install fix-up for a non version-specific boost include
:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1
::
:: Move dll's to LIBRARY_BIN
:: move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
:: IF errorlevel 1 exit 1
:: Status API Training Shop Blog About

Update bld.bat

Update bld.bat


@echo off

rem   Licensed to the Apache Software Foundation (ASF) under one or more
rem   contributor license agreements.  See the NOTICE file distributed with
rem   this work for additional information regarding copyright ownership.
rem   The ASF licenses this file to You under the Apache License, Version 2.0
rem   (the "License"); you may not use this file except in compliance with
rem   the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem   Unless required by applicable law or agreed to in writing, 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   Environment variables that can be defined externally:
rem
rem   JMETER_BIN - JMeter bin directory (must end in \)
rem   JM_LAUNCH - java.exe (default) or javaw.exe
rem   JVM_ARGS - additional java options, e.g. -Dprop=val
rem
rem   =====================================================

if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe

if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal

rem Need to check if we are using the 4NT shell...
if "%eval[2+2]" == "4" goto setup4NT

if exist jmeter.bat goto winNT1
if .%JMETER_BIN% == . set JMETER_BIN=%~dp0

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*
goto doneStart

:setup4NT
set JMETER_CMD_LINE_ARGS=%$
goto doneStart

:win9xStart
rem Slurp the command line arguments.  This loop allows for an unlimited number of
rem arguments (up to the command line limit, anyway).

set JMETER_CMD_LINE_ARGS=

:setupArgs
if %1a==a goto doneStart
set JMETER_CMD_LINE_ARGS=%JMETER_CMD_LINE_ARGS% %1
shift
goto setupArgs

:doneStart
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

rem The following link describes the -XX options:
rem http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
rem http://java.sun.com/developer/TechTips/2000/tt1222.html has some more descriptions
rem Unfortunately TechTips no longer seem to be available

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m
rem set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://java.sun.com/products/java-media/2D/perf_graphics.html

set DDRAW=
rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

rem Setting this flag to true enables hardware-accelerated scaling.
rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DDRAW%

%JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

@echo off

rem   Licensed to the Apache Software Foundation (ASF) under one or more
rem   contributor license agreements.  See the NOTICE file distributed with
rem   this work for additional information regarding copyright ownership.
rem   The ASF licenses this file to You under the Apache License, Version 2.0
rem   (the "License"); you may not use this file except in compliance with
rem   the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem   Unless required by applicable law or agreed to in writing, 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   Environment variables that can be defined externally:
rem
rem   JMETER_BIN - JMeter bin directory (must end in \)
rem   JM_LAUNCH - java.exe (default) or javaw.exe
rem   JVM_ARGS - additional java options, e.g. -Dprop=val
rem
rem   =====================================================

if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe

if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal

rem Need to check if we are using the 4NT shell...
if "%eval[2+2]" == "4" goto setup4NT

if exist jmeter.bat goto winNT1
if .%JMETER_BIN% == . set JMETER_BIN=%~dp0

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*
goto doneStart

:setup4NT
set JMETER_CMD_LINE_ARGS=%$
goto doneStart

:win9xStart
rem Slurp the command line arguments.  This loop allows for an unlimited number of
rem arguments (up to the command line limit, anyway).

set JMETER_CMD_LINE_ARGS=

:setupArgs
if %1a==a goto doneStart
set JMETER_CMD_LINE_ARGS=%JMETER_CMD_LINE_ARGS% %1
shift
goto setupArgs

:doneStart
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

rem The following link describes the -XX options:
rem http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
rem http://java.sun.com/developer/TechTips/2000/tt1222.html has some more descriptions
rem Unfortunately TechTips no longer seem to be available

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=64m -XX:MaxPermSize=128m -XX:+CMSClassUnloadingEnabled
rem set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://java.sun.com/products/java-media/2D/perf_graphics.html

set DDRAW=
rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

rem Setting this flag to true enables hardware-accelerated scaling.
rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DDRAW%

%JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

Synchronise settings with Unix version

Synchronise settings with Unix version

git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1507623 13f79535-47bb-0310-9956-ffa450edef68


@echo OFF
@setlocal

set VERSION=2.4.0
set TFDIR=C:\TreeFrog\%VERSION%
set MONBOC_VERSION=1.21.2
set LZ4_VERSION=1.9.3
set BASEDIR=%~dp0

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop

:help
  echo Usage: %0 [OPTION]... [VAR=VALUE]...
  echo;
  echo Configuration:
  echo   -h, --help          display this help and exit
  echo   --enable-debug      compile with debugging information
  echo   --enable-gui-mod    compile and link with QtGui module
  echo;
  echo Installation directories:
  echo   --prefix=PREFIX     install files in PREFIX [%TFDIR%]
  goto :exit

:prefix
  shift
  if "%1" == "" goto :help
  set TFDIR=%1
  goto :continue

:enable_debug
  set DEBUG=yes
  goto :continue

:enable_gui_mod
  set USE_GUI=use_gui=1
  goto :continue

:start
if "%DEBUG%" == "yes" (
  set OPT="CONFIG+=debug"
) else (
  set OPT="CONFIG+=release"
)

::
:: Generates tfenv.bat
::
for %%I in (qmake.exe)  do if exist %%~$path:I set QMAKE=%%~$path:I
for %%I in (cmake.exe)  do if exist %%~$path:I set CMAKE=%%~$path:I
for %%I in (cl.exe)     do if exist %%~$path:I set MSCOMPILER=%%~$path:I
for %%I in (devenv.exe) do if exist %%~$path:I set DEVENV=%%~$path:I

if "%QMAKE%" == "" (
  echo Qt environment not found
  exit /b
)
if "%CMAKE%" == "" (
  echo CMake not found
  exit /b
)
if "%MSCOMPILER%" == "" if "%DEVENV%"  == "" (
  echo MSVC Compiler not found
  exit /b
)

:: get qt install prefix
for /f usebackq %%I in (`qtpaths.exe --install-prefix`) do (
  set QT_INSTALL_PREFIX=%%I
  goto :break
)
:break

:: vcvarsall.bat setup
set MAKE=nmake
if /i "%Platform%" == "x64" (
  set VCVARSOPT=amd64
  set BUILDTARGET=x64
  set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
) else (
  set VCVARSOPT=x86
  set BUILDTARGET=win32
  set ENVSTR=Environment to build for 32-bit executable  MSVC / Qt
)

echo %QT_INSTALL_PREFIX% | find "msvc2019" >NUL
if not ERRORLEVEL 1 (
  set VSVER=2019
  if /i "%Platform%" == "x64" (
    set CMAKEOPT=-G"Visual Studio 16 2019" -A x64
  ) else (
    set CMAKEOPT=-G"Visual Studio 16 2019" -A Win32
  )
) else (
  echo %QT_INSTALL_PREFIX% | find "msvc2017" >NUL
  if not ERRORLEVEL 1 (
    set VSVER=2017
    if /i "%Platform%" == "x64" (
      set CMAKEOPT=-G"Visual Studio 15 2017 Win64"
    ) else (
      set CMAKEOPT=-G"Visual Studio 15 2017"
    )
  ) else (
    set VSVER=2015
    if /i "%Platform%" == "x64" (
      set CMAKEOPT=-G"Visual Studio 14 2015 Win64"
    ) else (
      set CMAKEOPT=-G"Visual Studio 14 2015"
    )
  )
)

SET /P X="%ENVSTR%"<NUL
qtpaths.exe --qt-version

for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo set VCVARSBAT="">> %TFENV%
echo set VSVER=%VSVER%>> %TFENV%
echo set VSWHERE="%%ProgramFiles(x86)%%\Microsoft Visual Studio\Installer\vswhere.exe">> %TFENV%
echo;>> %TFENV%
echo if exist %%QTENV%% call %%QTENV%%>> %TFENV%
echo if exist %%VSWHERE%% ^(>> %TFENV%
echo   for /f "usebackq tokens=*" %%%%i in ^(`%%VSWHERE%% -find  **\vcvarsall.bat`^) do ^(>> %TFENV%
echo     echo %%%%i ^| find "%%VSVER%%" ^>NUL>> %TFENV%
echo     if not ERRORLEVEL 1 ^(>> %TFENV%
echo       set VCVARSBAT="%%%%i">> %TFENV%
echo       goto :break>> %TFENV%
echo     ^)>> %TFENV%
echo   ^)>> %TFENV%
echo ^)>> %TFENV%
echo :break>> %TFENV%
echo if exist %%VCVARSBAT%% ^(>> %TFENV%
echo   echo Setting up environment for MSVC usage...>> %TFENV%
echo   call %%VCVARSBAT%% %VCVARSOPT%>> %TFENV%
echo ^)>> %TFENV%
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%

set TFDIR=%TFDIR:\=/%
del /f /q .qmake.stash src\.qmake.stash tools\.qmake.stash >nul 2>&1

:: Builds MongoDB driver
cd /d %BASEDIR%3rdparty
rd /s /q  mongo-driver >nul 2>&1
del /f /q mongo-driver >nul 2>&1
mklink /j mongo-driver mongo-c-driver-%MONBOC_VERSION% >nul 2>&1

cd %BASEDIR%3rdparty\mongo-driver
del /f /q CMakeCache.txt cmake_install.cmake CMakeFiles Makefile >nul 2>&1
set CMAKECMD=cmake %CMAKEOPT% -DCMAKE_CONFIGURATION_TYPES=Release -DENABLE_STATIC=ON -DENABLE_SSL=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZLIB=OFF -DENABLE_ZSTD=OFF -DENABLE_SRV=OFF -DENABLE_SASL=OFF -DENABLE_ZLIB=OFF -DENABLE_SHM_COUNTERS=OFF -DENABLE_TESTS=OFF .
echo %CMAKECMD%
%CMAKECMD%

echo Compiling MongoDB driver library ...
set DEVENVCMD=devenv mongo-c-driver.sln /project mongoc_static /rebuild Release
echo %DEVENVCMD%
%DEVENVCMD% >nul 2>&1
if ERRORLEVEL 1 (
  :: Shows error
  %DEVENVCMD%
  echo;
  echo Build failed.
  echo MongoDB driver not available.
  exit /b
)

:: Builds LZ4
cd %BASEDIR%3rdparty
echo Compiling LZ4 library ...
rd /s /q  lz4 >nul 2>&1
del /f /q lz4 >nul 2>&1
mklink /j lz4 lz4-%LZ4_VERSION% >nul 2>&1
for /F %%i in ('qtpaths.exe --install-prefix') do echo %%i | find "msvc2015" >NUL
if not ERRORLEVEL 1 (
  set VS=VS2015
) else (
  set VS=VS2017
)
set DEVENVCMD=devenv lz4\build\%VS%\lz4.sln /project liblz4 /rebuild "Release|%BUILDTARGET%"
echo %DEVENVCMD%
%DEVENVCMD% >nul 2>&1
if ERRORLEVEL 1 (
  :: Shows error
  %DEVENVCMD%
  echo;
  echo Build failed.
  echo LZ4 not available.
  exit /b
)

cd %BASEDIR%src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%

cd %BASEDIR%tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake

echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

@echo OFF
@setlocal

set VERSION=2.4.0
set TFDIR=C:\TreeFrog\%VERSION%
set MONBOC_VERSION=1.21.2
set LZ4_VERSION=1.9.3
set BASEDIR=%~dp0

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop

:help
  echo Usage: %0 [OPTION]... [VAR=VALUE]...
  echo;
  echo Configuration:
  echo   -h, --help          display this help and exit
  echo   --enable-debug      compile with debugging information
  echo   --enable-gui-mod    compile and link with QtGui module
  echo;
  echo Installation directories:
  echo   --prefix=PREFIX     install files in PREFIX [%TFDIR%]
  goto :exit

:prefix
  shift
  if "%1" == "" goto :help
  set TFDIR=%1
  goto :continue

:enable_debug
  set DEBUG=yes
  goto :continue

:enable_gui_mod
  set USE_GUI=use_gui=1
  goto :continue

:start
if "%DEBUG%" == "yes" (
  set OPT="CONFIG+=debug"
) else (
  set OPT="CONFIG+=release"
)

::
:: Generates tfenv.bat
::
for %%I in (qmake.exe)  do if exist %%~$path:I set QMAKE=%%~$path:I
for %%I in (cmake.exe)  do if exist %%~$path:I set CMAKE=%%~$path:I
for %%I in (cl.exe)     do if exist %%~$path:I set MSCOMPILER=%%~$path:I
for %%I in (devenv.com) do if exist %%~$path:I set DEVENV=%%~$path:I

if "%QMAKE%" == "" (
  echo Qt environment not found
  exit /b
)
if "%CMAKE%" == "" (
  echo CMake not found
  exit /b
)
if "%MSCOMPILER%" == "" if "%DEVENV%"  == "" (
  echo Visual Studio compiler not found
  exit /b
)

:: vcvarsall.bat setup
set MAKE=nmake
if /i "%Platform%" == "x64" (
  set VCVARSOPT=amd64
  set BUILDTARGET=x64
  set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
) else (
  set VCVARSOPT=x86
  set BUILDTARGET=win32
  set ENVSTR=Environment to build for 32-bit executable  MSVC / Qt
)

"%DEVENV%" /? | find "Visual Studio 2022" >NUL
if not ERRORLEVEL 1 (
  set VSVER=2022
  if /i "%Platform%" == "x64" (
    set CMAKEOPT=-G"Visual Studio 17 2022" -A x64
  ) else (
    set CMAKEOPT=-G"Visual Studio 17 2022" -A Win32
  )
  goto :step2
)

"%DEVENV%" /? | find "Visual Studio 2019" >NUL
if not ERRORLEVEL 1 (
  set VSVER=2019
  if /i "%Platform%" == "x64" (
    set CMAKEOPT=-G"Visual Studio 16 2019" -A x64
  ) else (
    set CMAKEOPT=-G"Visual Studio 16 2019" -A Win32
  )
  goto :step2
)

"%DEVENV%" /? | find "Visual Studio 2017" >NUL
if not ERRORLEVEL 1 (
  set VSVER=2017
  if /i "%Platform%" == "x64" (
    set CMAKEOPT=-G"Visual Studio 15 2017 Win64"
  ) else (
    set CMAKEOPT=-G"Visual Studio 15 2017"
  )
  goto :step2
)

"%DEVENV%" /? | find "Visual Studio 2015" >NUL
if not ERRORLEVEL 1 (
  set VSVER=2015
  if /i "%Platform%" == "x64" (
    set CMAKEOPT=-G"Visual Studio 14 2015 Win64"
  ) else (
    set CMAKEOPT=-G"Visual Studio 14 2015"
  )
  goto :step2
)

:step2
SET /P X="%ENVSTR%"<NUL
qtpaths.exe --qt-version

for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo set VCVARSBAT="">> %TFENV%
echo set VSVER=%VSVER%>> %TFENV%
echo set VSWHERE="%%ProgramFiles(x86)%%\Microsoft Visual Studio\Installer\vswhere.exe">> %TFENV%
echo;>> %TFENV%
echo if exist %%QTENV%% call %%QTENV%%>> %TFENV%
echo if exist %%VSWHERE%% ^(>> %TFENV%
echo   for /f "usebackq tokens=*" %%%%i in ^(`%%VSWHERE%% -find  **\vcvarsall.bat`^) do ^(>> %TFENV%
echo     echo %%%%i ^| find "%%VSVER%%" ^>NUL>> %TFENV%
echo     if not ERRORLEVEL 1 ^(>> %TFENV%
echo       set VCVARSBAT="%%%%i">> %TFENV%
echo       goto :break>> %TFENV%
echo     ^)>> %TFENV%
echo   ^)>> %TFENV%
echo ^)>> %TFENV%
echo :break>> %TFENV%
echo if exist %%VCVARSBAT%% ^(>> %TFENV%
echo   echo Setting up environment for MSVC usage...>> %TFENV%
echo   call %%VCVARSBAT%% %VCVARSOPT%>> %TFENV%
echo ^)>> %TFENV%
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%

set TFDIR=%TFDIR:\=/%
del /f /q .qmake.stash src\.qmake.stash tools\.qmake.stash >nul 2>&1

:: Builds MongoDB driver
cd /d %BASEDIR%3rdparty
rd /s /q  mongo-driver >nul 2>&1
del /f /q mongo-driver >nul 2>&1
mklink /j mongo-driver mongo-c-driver-%MONBOC_VERSION% >nul 2>&1

cd %BASEDIR%3rdparty\mongo-driver
del /f /q CMakeCache.txt cmake_install.cmake CMakeFiles Makefile >nul 2>&1
set CMAKECMD=cmake %CMAKEOPT% -DCMAKE_CONFIGURATION_TYPES=Release -DENABLE_STATIC=ON -DENABLE_SSL=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZLIB=OFF -DENABLE_ZSTD=OFF -DENABLE_SRV=OFF -DENABLE_SASL=OFF -DENABLE_ZLIB=OFF -DENABLE_SHM_COUNTERS=OFF -DENABLE_TESTS=OFF .
echo %CMAKECMD%
%CMAKECMD%

echo Compiling MongoDB driver library ...
set DEVENVCMD=devenv mongo-c-driver.sln /project mongoc_static /rebuild Release
echo %DEVENVCMD%
%DEVENVCMD% >nul 2>&1
if ERRORLEVEL 1 (
  :: Shows error
  %DEVENVCMD%
  echo;
  echo Build failed.
  echo MongoDB driver not available.
  exit /b
)

:: Builds LZ4
cd %BASEDIR%3rdparty
echo Compiling LZ4 library ...
rd /s /q  lz4 >nul 2>&1
del /f /q lz4 >nul 2>&1
mklink /j lz4 lz4-%LZ4_VERSION% >nul 2>&1
for /F %%i in ('qtpaths.exe --install-prefix') do echo %%i | find "msvc2015" >NUL
if not ERRORLEVEL 1 (
  set VS=VS2015
) else (
  set VS=VS2017
)
set DEVENVCMD=devenv lz4\build\%VS%\lz4.sln /project liblz4 /rebuild "Release|%BUILDTARGET%"
echo %DEVENVCMD%
%DEVENVCMD% >nul 2>&1
if ERRORLEVEL 1 (
  :: Shows error
  %DEVENVCMD%
  echo;
  echo Build failed.
  echo LZ4 not available.
  exit /b
)

cd %BASEDIR%src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%

cd %BASEDIR%tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake

echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

add msvc 2022 env

add msvc 2022 env


call mqsistop TESTNODE_John
call mqsideletebroker TESTNODE_John
@rem start queue manager
set PATH=%PATH%;"C:\Program Files (x86)\IBM\WebSphere MQ\bin"
strmqm IB9QMGR

 call mqsicreatebroker TESTNODE_John
 call mqsistart TESTNODE_John
 call mqsicreateexecutiongroup TESTNODE_John -e default

@rem set up environment for SAP nodes
call mqsichangeproperties TESTNODE_John -c EISProviders -o SAP -n nativeLibs,jarsURL -v "C:\John\sapjco3\308\64","C:\John\sapjco3\308\64"
call mqsisetdbparms TESTNODE_John -n MQTT::iotFoundation -u "a-3siysh-fiux9wzyex" -p "bftwcV9@*TZy(iwF)1"
mkdir C:\ProgramData\IBM\MQSI\components\TESTNODE_John\policies\docs\MQTTSubscribe
mkdir C:\ProgramData\IBM\MQSI\components\TESTNODE_John\policies\docs\MQTTPublish
cp ..\policy\InternalBroker.policy C:\ProgramData\IBM\MQSI\components\TESTNODE_John\policies\docs\MQTTPublish\InternalBroker
cp ..\policy\BusEvents.policy C:\ProgramData\IBM\MQSI\components\TESTNODE_John\policies\docs\MQTTSubscribe\BusEvents
mqsichangeproperties TESTNODE_John -b pubsub -o BusinessEvents/MQTT -n policyUrl -v /MQTTPublish/InternalBroker.policy
mqsichangeproperties TESTNODE_John -b pubsub -o BusinessEvents/MQTT -n enabled -v true
call mqsistop TESTNODE_John
call mqsistart TESTNODE_John
@rem build bar file
mkdir output
call mqsipackagebar -a output\demo.bar -w ..\ad -y VehicleMaintenance -k PredictiveMaintenance
call mqsideploy -a output\demo.bar TESTNODE_John -e default
@rem activate flow monitoring
call mqsichangeresourcestats TESTNODE_John -e default -c active
call mqsichangeflowmonitoring TESTNODE_John -e default -c active -j -k PredictiveMaintenance
call mqsichangeflowstats TESTNODE_John -g -c active -j -k PredictiveMaintenance -s -o json -n advanced
@rem call mqsichangeflowstats TESTNODE_John -g -c active -j -k PredictiveMaintenance -a -o json -n advanced

@rem deploy policy
@rem mqsicreatepolicy TESTNODE_John -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
@rem mqsichangeproperties TESTNODE_John -e default -o ComIbmJVMManager -n jvmDebugPort -v 1818

call mqsistop TESTNODE_John
call mqsideletebroker TESTNODE_John
@rem start queue manager
set PATH=%PATH%;"C:\Program Files (x86)\IBM\WebSphere MQ\bin"
strmqm IB9QMGR

 call mqsicreatebroker TESTNODE_John
 call mqsistart TESTNODE_John
 call mqsicreateexecutiongroup TESTNODE_John -e default

@rem set up environment for SAP nodes
call mqsichangeproperties TESTNODE_John -c EISProviders -o SAP -n nativeLibs,jarsURL -v "C:\John\sapjco3\308\64","C:\John\sapjco3\308\64"
call mqsisetdbparms TESTNODE_John -n MQTT::iotFoundation -u "a-3siysh-fiux9wzyex" -p "bftwcV9@*TZy(iwF)1"
mkdir C:\ProgramData\IBM\MQSI\components\TESTNODE_John\policies\docs\MQTTSubscribe
mkdir C:\ProgramData\IBM\MQSI\components\TESTNODE_John\policies\docs\MQTTPublish
call mqsicreatepolicy TESTNODE_John -t MQTTPublish -f ..\policy\InternalBroker.policy -l InternalBroker
call mqsicreatepolicy TESTNODE_John -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
call mqsichangeproperties TESTNODE_John -b pubsub -o BusinessEvents/MQTT -n policyUrl -v /MQTTPublish/InternalBroker.policy
call mqsichangeproperties TESTNODE_John -b pubsub -o BusinessEvents/MQTT -n enabled -v true
call mqsistop TESTNODE_John
call mqsistart TESTNODE_John
@rem build bar file
mkdir output
call mqsipackagebar -a output\demo.bar -w ..\ad -y VehicleMaintenance -k PredictiveMaintenance
call mqsideploy -a output\demo.bar TESTNODE_John -e default
@rem activate flow monitoring
call mqsichangeresourcestats TESTNODE_John -e default -c active
call mqsichangeflowmonitoring TESTNODE_John -e default -c active -j -k PredictiveMaintenance
call mqsichangeflowstats TESTNODE_John -g -c active -j -k PredictiveMaintenance -s -o json -n advanced
@rem call mqsichangeflowstats TESTNODE_John -g -c active -j -k PredictiveMaintenance -a -o json -n advanced

@rem deploy policy
@rem mqsicreatepolicy TESTNODE_John -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
@rem mqsichangeproperties TESTNODE_John -e default -o ComIbmJVMManager -n jvmDebugPort -v 1818

remove workaround

remove workaround


@echo off

setlocal

set PATH=%PATH%;%CD%\tools

set WGET_ARGS=--no-check-certificate
set UNZIP_ARGS=-q

set BASEURL=https://s3.amazonaws.com/rstudio-buildtools/
set BOOST_FILE=boost-1.44-win.zip
set MINGW_FILE=mingw64-2010-10-03.zip
set GIN_FILE=gin-1.5.zip
set GWT_FILE=gwt-2.4.0.zip
set JUNIT_FILE=junit-4.9b3.jar
set GNUDIFF_FILE=gnudiff.zip
set GNUGREP_FILE=gnugrep-2.5.4.zip
set MSYS_SSH_FILE=msys_ssh.zip

if not exist boost-win (
  wget %WGET_ARGS% "%BASEURL%%BOOST_FILE%"
  echo Unzipping %BOOST_FILE%
  unzip %UNZIP_ARGS% "%BOOST_FILE%"
  del "%BOOST_FILE%"
)

if not exist mingw64 (
  wget %WGET_ARGS% "%BASEURL%%MINGW_FILE%"
  echo Unzipping %MINGW_FILE%
  unzip %UNZIP_ARGS% "%MINGW_FILE%"
  del "%MINGW_FILE%"
)

if not exist gnudiff (
  wget %WGET_ARGS% "%BASEURL%%GNUDIFF_FILE%"
  mkdir gnudiff
  echo Unzipping %GNUDIFF_FILE%
  unzip %UNZIP_ARGS% "%GNUDIFF_FILE%" -d gnudiff
  del "%GNUDIFF_FILE%"
)

if not exist gnugrep (
  wget %WGET_ARGS% "%BASEURL%%GNUGREP_FILE%"
  mkdir gnugrep
  echo Unzipping %GNUGREP_FILE%
  unzip %UNZIP_ARGS% "%GNUGREP_FILE%" -d gnugrep
  del "%GNUGREP_FILE%"
)

if not exist msys_ssh (
  wget %WGET_ARGS% "%BASEURL%%MSYS_SSH_FILE%"
  mkdir msys_ssh
  echo Unzipping %MSYS_SSH_FILE%
  unzip %UNZIP_ARGS% "%MSYS_SSH_FILE%" -d msys_ssh
  del "%MSYS_SSH_FILE%"
)

if not exist ..\..\src\gwt\lib (
  mkdir ..\..\src\gwt\lib
)
pushd ..\..\src\gwt\lib

if not exist gin\1.5 (
  wget %WGET_ARGS% "%BASEURL%%GIN_FILE%"
  mkdir gin\1.5
  echo Unzipping %GIN_FILE%
  unzip %UNZIP_ARGS% "%GIN_FILE%" -d gin\1.5
  del "%GIN_FILE%"
)

if not exist gwt\2.4.0 (
  wget %WGET_ARGS% "%BASEURL%%GWT_FILE%"
  echo Unzipping %GWT_FILE%
  unzip %UNZIP_ARGS% "%GWT_FILE%"
  mkdir gwt
  move gwt-2.4.0 gwt\2.4.0
  del "%GWT_FILE%"
)

if not exist %JUNIT_FILE% (
  wget %WGET_ARGS% "%BASEURL%%JUNIT_FILE%"
)

popd

pushd ..\common
set CORE_DICTIONARIES=core-dictionaries.zip
if not exist "dictionaries\en_US.dic" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-dictionaries/%CORE_DICTIONARIES%"
  if exist "%CORE_DICTIONARIES%" (
     mkdir dictionaries
     echo Unzipping %CORE_DICTIONARIES%
     unzip %UNZIP_ARGS% "%CORE_DICTIONARIES%" -d dictionaries
     del "%CORE_DICTIONARIES%"
  )
)

install dictionaries for windows

install dictionaries for windows


:: build
setlocal

set qtplatform=%PLATFORM%
for %%* in (.) do set CurrDirName=%%~nx*

call %VC_DIR% %VC_VARSALL% || exit /B 1

mkdir build-%qtplatform%
cd build-%qtplatform%

C:\projects\Qt\%QT_VER%\%qtplatform%\bin\qmake ../ || exit /B 1
nmake qmake_all || exit /B 1
nmake || exit /B 1
nmake lrelease || exit /B 1
nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1

:: build and run test
if NOT "%NO_TESTS%" == "" goto no_tests
	nmake all || exit /B 1

	setlocal
	set PATH=C:\projects\Qt\%QT_VER%\%qtplatform%\bin;%CD%\lib;%PATH%;
	set QT_PLUGIN_PATH=%CD%\plugins;%QT_PLUGIN_PATH%;
	if "%TEST_DIR%" == "" (
		set TEST_DIR=.\tests\auto
	)
	cd %TEST_DIR%
	set QT_QPA_PLATFORM=minimal
	for /r %%f in (tst_*.exe) do (
		start /w call %%f ^> %CD%/test.log ^|^| echo FAIL ^> fail ^& exit || exit /B 1
		type test.log
		if exist fail exit /B 1
	)
	endlocal
	cd \projects\%CurrDirName%\build-%qtplatform%
:no_tests

:: build examples
if "%BUILD_EXAMPLES%" == "" goto no_examples
	nmake sub-examples || exit /B 1

	cd examples
	nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1
	cd ..
:no_examples

:: build documentation
if "%BUILD_DOC%" == "" goto no_doc
	nmake doxygen || exit /B 1

	cd doc
	nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1
	cd ..
:no_doc

Update build-msvc.bat

Update build-msvc.bat


@echo off
powershell -ExecutionPolicy ByPass -NoProfile %~dp0build.ps1 -inittools
powershell -ExecutionPolicy ByPass -NoProfile %~dp0common\msbuild.ps1 %~dp0..\build.proj %*
exit /b %ERRORLEVEL%

Add update-dependencies wrapper scripts for older maestro jobs


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

@echo off
setlocal EnableDelayedExpansion

SET bin=%~dp0
SET FLINK_HOME=%bin%..

"%FLINK_HOME%\bin\flink" run -v "%FLINK_HOME%"\opt\flink-python*.jar %*

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

@echo off
setlocal EnableDelayedExpansion

SET bin=%~dp0
SET FLINK_HOME=%bin%..

"%FLINK_HOME%\bin\flink" run -v "%FLINK_HOME%"\opt\flink-python_*.jar %*

[hotfix][dist] Use proper flink-python jar match pattern in pyflink.bat for Windows (FLINK-12409)


@echo off
REM
REM This script is used to load OTF mapping project data for the development
REM environment.  It loads the mini version of SNOMEDCT and assumes you have
REM acquired your data from http://mapping.snomedtools.org/data/dev.zip
REM

REM
REM Set environment variables at system level
REM
REM set MVN_HOME=C:/apache-maven-3.0.5
set OTF_MAPPING_HOME="C:/OTF-Mapping-Service"
set OTF_MAPPING_CONFIG="C:/data/config.properties.dev"
REM

echo ------------------------------------------------
echo Starting ...%date% %time%
echo ------------------------------------------------
if DEFINED MVN_HOME (echo MVN_HOME  = %MVN_HOME%) else (echo MVN_HOME must be defined
goto trailer)
if DEFINED OTF_MAPPING_HOME (echo OTF_MAPPING_HOME = %OTF_MAPPING_HOME%) else (echo OTF_MAPPING_HOME must be defined
goto trailer)
if DEFINED OTF_MAPPING_CONFIG (echo OTF_MAPPING_CONFIG = %OTF_MAPPING_CONFIG%) else (echo OTF_MAPPING_CONFIG must be defined
goto trailer)
set error=0

echo     Run updatedb with hibernate.hbm2ddl.auto = create ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/updatedb
call %MVN_HOME%/bin/mvn -Drun.config=%OTF_MAPPING_CONFIG% -Dhibernate.hbm2ddl.auto=create install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Clear indexes ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/lucene
call %MVN_HOME%/bin/mvn -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load SNOMEDCT ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PSNOMEDCT -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load ICPC ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PICPC -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log
echo     Load ICD10 ...%date% %time%

cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PICD10 -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load ICD9CM ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PICD9CM -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Import project data ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/import
call %MVN_HOME%/bin/mvn -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Create ICD10 and ICD9CM map records ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PCreateMapRecords -Drun.config=%OTF_MAPPING_CONFIG% -Drefset.id=447562003,447563008 install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load ICPC maps from file ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PMapRecords -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load map notes from file ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PMapNotes -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Compute workflow ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PComputeWorkflow -Drun.config=%OTF_MAPPING_CONFIG% -Drefset.id=447563008,447562003 install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

:trailer
echo ------------------------------------------------
IF %error% NEQ 0 (
echo There were one or more errors.  Please reference the mvn.log file for details.
set retval=-1
) else (
echo Completed without errors.
set retval=0
)
echo Starting ...%date% %time%
echo ------------------------------------------------

pause

@echo off
REM
REM This script is used to load OTF mapping project data for the development
REM environment.  It loads the mini version of SNOMEDCT and assumes you have
REM acquired your data from http://mapping.snomedtools.org/data/dev.zip
REM

REM
REM Set environment variables at system level
REM
REM set MVN_HOME=C:/apache-maven-3.0.5
REM set OTF_MAPPING_HOME="C:/OTF-Mapping-Service"
REM set OTF_MAPPING_CONFIG="C:/data/config.properties.dev"
REM

echo ------------------------------------------------
echo Starting ...%date% %time%
echo ------------------------------------------------
if DEFINED MVN_HOME (echo MVN_HOME  = %MVN_HOME%) else (echo MVN_HOME must be defined
goto trailer)
if DEFINED OTF_MAPPING_HOME (echo OTF_MAPPING_HOME = %OTF_MAPPING_HOME%) else (echo OTF_MAPPING_HOME must be defined
goto trailer)
if DEFINED OTF_MAPPING_CONFIG (echo OTF_MAPPING_CONFIG = %OTF_MAPPING_CONFIG%) else (echo OTF_MAPPING_CONFIG must be defined
goto trailer)
set error=0

echo     Run updatedb with hibernate.hbm2ddl.auto = create ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/updatedb
call %MVN_HOME%/bin/mvn -Drun.config=%OTF_MAPPING_CONFIG% -Dhibernate.hbm2ddl.auto=create install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Clear indexes ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/lucene
call %MVN_HOME%/bin/mvn -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load SNOMEDCT ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PSNOMEDCT -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load ICPC ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PICPC -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log
echo     Load ICD10 ...%date% %time%

cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PICD10 -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load ICD9CM ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PICD9CM -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Import project data ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/import
call %MVN_HOME%/bin/mvn -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Create ICD10 and ICD9CM map records ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PCreateMapRecords -Drun.config=%OTF_MAPPING_CONFIG% -Drefset.id=447562003,447563008 install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load ICPC maps from file ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PMapRecords -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Load map notes from file ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PMapNotes -Drun.config=%OTF_MAPPING_CONFIG% install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

echo     Compute workflow ...%date% %time%
cd %OTF_MAPPING_HOME%/admin/loader
call %MVN_HOME%/bin/mvn -PComputeWorkflow -Drun.config=%OTF_MAPPING_CONFIG% -Drefset.id=447563008,447562003 install 1> mvn.log
IF %ERRORLEVEL% NEQ 0 (set error=1
goto trailer)
del /Q mvn.log

:trailer
echo ------------------------------------------------
IF %error% NEQ 0 (
echo There were one or more errors.  Please reference the mvn.log file for details.
set retval=-1
) else (
echo Completed without errors.
set retval=0
)
echo Starting ...%date% %time%
echo ------------------------------------------------

pause

revert setting of vars

CLEANUP: revert setting of vars


@echo off

set NaturalDocsParams=

rem Shift and loop so we can get more than nine parameters.
rem This is especially important if we have spaces in file names.

:MORE
if "%1"=="" goto NOMORE
set NaturalDocsParams=%NaturalDocsParams% %1
shift
goto MORE
:NOMORE

perl NaturalDocs %NaturalDocsParams%

set NaturalDocsParams=

Make the Wndows batch callable from any directory

The perl script NaturalDocs shuld be referred to with the same path
as the calling batch, otherwise the script would have to be in the
search path. The %~dp0 environment variable points to the directory
which the script is being executed in.

All batch arguments can bepassed to a nested batch by %*.


Add run.bat

Add run.bat


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

setlocal
set "PATH=c:\cygwin\bin;%PATH%"
bash -c "buildbot/buildbot_pnacl.sh %*"
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
endlocal

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

setlocal
:: Load the hermetic cygwin environment (downloading/installing/updating
:: it if necessary).
call "%~dp0cygwin_env.bat"
bash -c "buildbot/buildbot_pnacl.sh %*"
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
endlocal

Build Pnacl in hermetic cygwin
Use the same cygwin used for the GNU toolchain. This gets us a standard environment that is kept updated on the bots (see cygwin_env.bat).

R=jvoung@chromium.org,robertm@chromium.org,sehr@chromium.org
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2918

Review URL: https://chromiumcodereview.appspot.com/10837191

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@9429 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2


:: Build tcplotter command-line utilities using cmake

:: Change working directory to archive directory
cd "%PKG_NAME%"

:: Create build directory
cd "src"
mkdir build
if errorlevel 1 exit 1
cd build
if errorlevel 1 exit 1

:: Build with cmake
cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 --prefix=%PREFIX% ..
if errorlevel 1 exit 1
cmake --build .
if errorlevel 1 exit 1

:: Install executables to bin directory
cmake --install . --prefix=%PREFIX%
if errorlevel 1 exit 1

:: Install tcplotter
cd "%SRC_DIR%"
$PYTHON -m pip install . -vv

:: Build tcplotter command-line utilities using cmake

:: Change working directory to archive directory
cd "%PKG_NAME%"

:: Create build directory
cd "src"
mkdir build
if errorlevel 1 exit 1
cd build
if errorlevel 1 exit 1

:: Build with cmake
cmake -G "MinGW Makefiles" -D CMAKE_CXX_STANDARD=11 -D CMAKE_INSTALL_PREFIX=%PREFIX% ..
if errorlevel 1 exit 1
cmake --build .
if errorlevel 1 exit 1

:: Install executables to bin directory
cmake --build . --target install
if errorlevel 1 exit 1

:: Install tcplotter
cd "%SRC_DIR%"
$PYTHON -m pip install . -vv

Adjust build for windows to change how prefix is defined


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

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

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

set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools

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

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

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

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

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

:PYTHON_CHECK
:: If the batch file exists, skip the python check.
set ERRORLEVEL=0
if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
call python --version 2>nul 1>nul
if errorlevel 1 goto :PYTHON_INSTALL

:: We are done.
set ERRORLEVEL=0
goto :END

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

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

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

:END
call :returncode %ERRORLEVEL%

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

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

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

set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools

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

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

:GIT_CHECK
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\git.bat" goto :SVN_CHECK
if "%GIT_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
:: The normal initialization will happen here when we're ready to deploy.
goto :SVN_CHECK

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

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

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

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

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

:PYTHON_CHECK
:: If the batch file exists, skip the python check.
set ERRORLEVEL=0
if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
call python --version 2>nul 1>nul
if errorlevel 1 goto :PYTHON_INSTALL

:: We are done.
set ERRORLEVEL=0
goto :END

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

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

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

:END
call :returncode %ERRORLEVEL%

Install Git on Windows via depot tools.
Review URL: http://codereview.chromium.org/7035005

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


@echo off
rem
rem
rem    Licensed to the Apache Software Foundation (ASF) under one or more
rem    contributor license agreements.  See the NOTICE file distributed with
rem    this work for additional information regarding copyright ownership.
rem    The ASF licenses this file to You under the Apache License, Version 2.0
rem    (the "License"); you may not use this file except in compliance with
rem    the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem    Unless required by applicable law or agreed to in writing, 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 handle specific scripts; the SCRIPT_NAME is exactly the name of the Karaf
rem script; for example karaf.bat, start.bat, stop.bat, admin.bat, client.bat, ...
rem

if "%KARAF_SCRIPT%" == "start" (
   SET JAVA_MIN_MEM=1G
   SET JAVA_MAX_MEM=1G
 )

rem
rem general settings which should be applied for all scripts go here; please keep
rem in mind that it is possible that scripts might be executed more than once, e.g.
rem in example of the start script where the start script is executed first and the
rem karaf script afterwards.
rem

rem
rem The following section shows the possible configuration options for the default
rem karaf scripts
rem
rem Window name of the windows console
rem SET KARAF_TITLE
rem Minimum memory for the JVM
rem SET JAVA_MIN_MEM
rem Maximum memory for the JVM
rem SET JAVA_MAX_MEM
rem Minimum perm memory for the JVM
rem SET JAVA_PERM_MEM
rem Maximum memory for the JVM
rem SET JAVA_MAX_PERM_MEM
rem Karaf home folder
rem SET KARAF_HOME
rem Karaf data folder
rem SET KARAF_DATA
rem Karaf base folder
rem SET KARAF_BASE
rem Additional available Karaf options
rem SET KARAF_OPTS

@echo off
rem
rem
rem    Licensed to the Apache Software Foundation (ASF) under one or more
rem    contributor license agreements.  See the NOTICE file distributed with
rem    this work for additional information regarding copyright ownership.
rem    The ASF licenses this file to You under the Apache License, Version 2.0
rem    (the "License"); you may not use this file except in compliance with
rem    the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem    Unless required by applicable law or agreed to in writing, 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 handle specific scripts; the SCRIPT_NAME is exactly the name of the Karaf
rem script; for example karaf.bat, start.bat, stop.bat, admin.bat, client.bat, ...
rem

if %KARAF_SCRIPT% == "start.bat" (
   SET JAVA_MIN_MEM=1G
   SET JAVA_MAX_MEM=1G
 )

rem
rem general settings which should be applied for all scripts go here; please keep
rem in mind that it is possible that scripts might be executed more than once, e.g.
rem in example of the start script where the start script is executed first and the
rem karaf script afterwards.
rem

rem
rem The following section shows the possible configuration options for the default
rem karaf scripts
rem
rem Window name of the windows console
rem SET KARAF_TITLE
rem Minimum memory for the JVM
rem SET JAVA_MIN_MEM
rem Maximum memory for the JVM
rem SET JAVA_MAX_MEM
rem Minimum perm memory for the JVM
rem SET JAVA_PERM_MEM
rem Maximum memory for the JVM
rem SET JAVA_MAX_PERM_MEM
rem Karaf home folder
rem SET KARAF_HOME
rem Karaf data folder
rem SET KARAF_DATA
rem Karaf base folder
rem SET KARAF_BASE
rem Additional available Karaf options
rem SET KARAF_OPTS

fix windows setenv script

[ENTMQ-59] fix windows setenv script


@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 bootstrap\bootstrap-mini

call .\build

@REM Build Maven2
cd ..

%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar target\bootstrap-mini.jar install %MAVEN_CMD_LINE_ARGS%

cd bootstrap\bootstrap-installer
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar ..\bootstrap-installer.jar package %MAVEN_CMD_LINE_ARGS%
cd ..\..

set PLUGINS_DIR=..\plugins
if exist "%PLUGINS_DIR%\pom.xml" goto setArgs

set BUILD_ARGS=%MAVEN_CMD_LINE_ARGS%
goto doBuild

:setArgs
set BUILD_ARGS=%MAVEN_CMD_LINE_ARGS% --build-plugins --plugins-directory=%PLUGINS_DIR%

:doBuild

REM TODO: get rid of M2_HOME once integration tests are in here
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar bootstrap\bootstrap-installer\target\bootstrap-installer.jar --prefix=%M2_HOME%\.. %BUILD_ARGS%

REM TODO: should w ebe going back to the mini now that we have the real thing?
cd maven-core-it-verifier
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar ..\bootstrap\bootstrap-mini\target\bootstrap-mini.jar package %MAVEN_CMD_LINE_ARGS%

cd ..

echo
echo -----------------------------------------------------------------------
echo Running integration tests
echo -----------------------------------------------------------------------
cd maven-core-it
call maven-core-it %MAVEN_CMD_LINE_ARGS%
cd ..

: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

@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 bootstrap\bootstrap-mini

call .\build

%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar target\bootstrap-mini.jar install %MAVEN_CMD_LINE_ARGS%

cd ..\bootstrap-installer
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar ..\bootstrap-installer.jar package %MAVEN_CMD_LINE_ARGS%
cd ..\..

set PLUGINS_DIR=..\plugins
if exist "%PLUGINS_DIR%\pom.xml" goto setArgs

set BUILD_ARGS=%MAVEN_CMD_LINE_ARGS%
goto doBuild

:setArgs
set BUILD_ARGS=%MAVEN_CMD_LINE_ARGS% --build-plugins --plugins-directory=%PLUGINS_DIR%

:doBuild

REM TODO: get rid of M2_HOME once integration tests are in here
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar bootstrap\bootstrap-installer\target\bootstrap-installer.jar --prefix=%M2_HOME%\.. %BUILD_ARGS%

REM TODO: should w ebe going back to the mini now that we have the real thing?
cd maven-core-it-verifier
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -jar ..\bootstrap\bootstrap-mini\target\bootstrap-mini.jar package %MAVEN_CMD_LINE_ARGS%

cd ..

echo
echo -----------------------------------------------------------------------
echo Running integration tests
echo -----------------------------------------------------------------------
cd maven-core-it
call maven-core-it %MAVEN_CMD_LINE_ARGS%
cd ..

: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

fix paths

fix paths

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


rem set GYP_MSVS_VERSION=2010e
./tools/gyp/gyp --depth=./ picasso.gyp --generator-output=vcproj

Update build_win.bat

Update build_win.bat

fix window generate


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

@rem To run the script:
@rem verify-release-candidate.bat VERSION RC_NUM

@echo on

if not exist "C:\tmp\" mkdir C:\tmp
if exist "C:\tmp\arrow-verify-release" rd C:\tmp\arrow-verify-release /s /q
if not exist "C:\tmp\arrow-verify-release" mkdir C:\tmp\arrow-verify-release

set _VERIFICATION_DIR=C:\tmp\arrow-verify-release
set _VERIFICATION_DIR_UNIX=C:/tmp/arrow-verify-release
set _VERIFICATION_CONDA_ENV=%_VERIFICATION_DIR%\conda-env
set _DIST_URL=https://dist.apache.org/repos/dist/dev/arrow
set _TARBALL=apache-arrow-%1.tar.gz
set ARROW_SOURCE=%_VERIFICATION_DIR%\apache-arrow-%1
set INSTALL_DIR=%_VERIFICATION_DIR%\install

@rem Requires GNU Wget for Windows
wget -O %_TARBALL% %_DIST_URL%/apache-arrow-%1-rc%2/%_TARBALL%

tar xvf %_TARBALL% -C %_VERIFICATION_DIR_UNIX%

set PYTHON=3.6

@rem Using call with conda.bat seems necessary to avoid terminating the batch
@rem script execution
call conda create -p %_VERIFICATION_CONDA_ENV% -f -q -y python=%PYTHON% || exit /B

call activate %_VERIFICATION_CONDA_ENV%

call conda install -y ^
      six pytest setuptools numpy pandas cython ^
      thrift-cpp flatbuffers rapidjson ^
      cmake ^
      git ^
      boost-cpp ^
      snappy zlib brotli gflags lz4-c zstd -c conda-forge

set GENERATOR=Visual Studio 14 2015 Win64
set CONFIGURATION=release

pushd %ARROW_SOURCE%

set ARROW_BUILD_TOOLCHAIN=%CONDA_PREFIX%\Library

set ARROW_HOME=%INSTALL_DIR%
set PARQUET_HOME=%INSTALL_DIR%
set PATH=%INSTALL_DIR%\bin;%PATH%

@rem Build and test Arrow C++ libraries
mkdir %ARROW_SOURCE%\cpp\build
pushd %ARROW_SOURCE%\cpp\build

@rem This is the path for Visual Studio Community 2017
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64

cmake -G "%GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
      -DARROW_BOOST_USE_SHARED=OFF ^
      -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
      -DARROW_CXXFLAGS="/MP" ^
      -DARROW_PYTHON=ON ^
      -DARROW_PARQUET=ON ^
      ..  || exit /B
cmake --build . --target INSTALL --config %CONFIGURATION%  || exit /B

@rem Needed so python-test.exe works
set PYTHONPATH=%CONDA_PREFIX%\Lib;%CONDA_PREFIX%\Lib\site-packages;%CONDA_PREFIX%\python35.zip;%CONDA_PREFIX%\DLLs;%CONDA_PREFIX%;%PYTHONPATH%

ctest -VV  || exit /B
popd

@rem Build and import pyarrow
@rem parquet-cpp has some additional runtime dependencies that we need to figure out
@rem see PARQUET-1018
pushd %ARROW_SOURCE%\python

python setup.py build_ext --inplace --with-parquet --bundle-arrow-cpp bdist_wheel  || exit /B
py.test pyarrow -v -s --parquet || exit /B

popd

call deactivate

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

@rem To run the script:
@rem verify-release-candidate.bat VERSION RC_NUM

@echo on

if not exist "C:\tmp\" mkdir C:\tmp
if exist "C:\tmp\arrow-verify-release" rd C:\tmp\arrow-verify-release /s /q
if not exist "C:\tmp\arrow-verify-release" mkdir C:\tmp\arrow-verify-release

set _VERIFICATION_DIR=C:\tmp\arrow-verify-release
set _VERIFICATION_DIR_UNIX=C:/tmp/arrow-verify-release
set _VERIFICATION_CONDA_ENV=%_VERIFICATION_DIR%\conda-env
set _DIST_URL=https://dist.apache.org/repos/dist/dev/arrow
set _TARBALL=apache-arrow-%1.tar.gz
set ARROW_SOURCE=%_VERIFICATION_DIR%\apache-arrow-%1
set INSTALL_DIR=%_VERIFICATION_DIR%\install

@rem Requires GNU Wget for Windows
wget --no-check-certificate -O %_TARBALL% %_DIST_URL%/apache-arrow-%1-rc%2/%_TARBALL% || exit /B

tar xf %_TARBALL% -C %_VERIFICATION_DIR_UNIX%

set PYTHON=3.6

@rem Using call with conda.bat seems necessary to avoid terminating the batch
@rem script execution
call conda create -p %_VERIFICATION_CONDA_ENV% -f -q -y python=%PYTHON% || exit /B

call activate %_VERIFICATION_CONDA_ENV% || exit /B

call conda install -y ^
      six pytest setuptools numpy pandas cython ^
      thrift-cpp flatbuffers rapidjson ^
      cmake ^
      git ^
      boost-cpp ^
      snappy zlib brotli gflags lz4-c zstd -c conda-forge || exit /B

set GENERATOR=Visual Studio 14 2015 Win64
set CONFIGURATION=release

pushd %ARROW_SOURCE%

set ARROW_BUILD_TOOLCHAIN=%CONDA_PREFIX%\Library

set ARROW_HOME=%INSTALL_DIR%
set PARQUET_HOME=%INSTALL_DIR%
set PATH=%INSTALL_DIR%\bin;%PATH%

@rem Build and test Arrow C++ libraries
mkdir %ARROW_SOURCE%\cpp\build
pushd %ARROW_SOURCE%\cpp\build

@rem This is the path for Visual Studio Community 2017
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64

cmake -G "%GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
      -DARROW_BOOST_USE_SHARED=ON ^
      -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
      -DARROW_CXXFLAGS="/MP" ^
      -DARROW_PYTHON=ON ^
      -DARROW_PARQUET=ON ^
      ..  || exit /B
cmake --build . --target INSTALL --config %CONFIGURATION%  || exit /B

@rem Get testing datasets for Parquet unit tests
git clone https://github.com/apache/parquet-testing.git %_VERIFICATION_DIR%\parquet-testing
set PARQUET_TEST_DATA=%_VERIFICATION_DIR%\parquet-testing\data

@rem Needed so python-test.exe works
set PYTHONPATH=%CONDA_PREFIX%\Lib;%CONDA_PREFIX%\Lib\site-packages;%CONDA_PREFIX%\python35.zip;%CONDA_PREFIX%\DLLs;%CONDA_PREFIX%;%PYTHONPATH%

ctest -VV  || exit /B
popd

@rem Build and import pyarrow
@rem parquet-cpp has some additional runtime dependencies that we need to figure out
@rem see PARQUET-1018
pushd %ARROW_SOURCE%\python

python setup.py build_ext --inplace --with-parquet --bundle-arrow-cpp bdist_wheel  || exit /B
py.test pyarrow -v -s --parquet || exit /B

popd

call deactivate

ARROW-2337: Use Boost shared libraries in Windows release verification script. Parquet fixes

With these changes, the Windows verification script passes cleanly for me with 0.11.0 RC1

Author: Wes McKinney <wesm+git@apache.org>

Closes #2710 from wesm/ARROW-2337 and squashes the following commits:

d514d5c31 <Wes McKinney> Use Boost shared libraries in Windows release verification script. Fixes for Parquet migration


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages, bower, grunt, and bower packages
pushd "%DEPLOYMENT_TARGET%"

echo Installing npm packages...
call :ExecuteCmd !NPM_CMD! install
IF !ERRORLEVEL! NEQ 0 goto error

echo Installing grunt-cli...
call :ExecuteCmd !NPM_CMD! install grunt-cli -g
IF !ERRORLEVEL! NEQ 0 goto error

echo Installing bower...
call :ExecuteCmd !NPM_CMD! install bower -g
IF !ERRORLEVEL! NEQ 0 goto error

echo Running bower-install grunt task...
call :ExecuteCmd grunt bower-install
IF !ERRORLEVEL! NEQ 0 goto error
popd

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages, bower, grunt, and bower packages
pushd "%DEPLOYMENT_TARGET%\Resume"

echo Installing npm packages...
call :ExecuteCmd !NPM_CMD! install
IF !ERRORLEVEL! NEQ 0 goto error

echo Installing grunt-cli...
call :ExecuteCmd !NPM_CMD! install grunt-cli -g
IF !ERRORLEVEL! NEQ 0 goto error

echo Installing bower...
call :ExecuteCmd !NPM_CMD! install bower -g
IF !ERRORLEVEL! NEQ 0 goto error

echo Running bower-install grunt task...
call :ExecuteCmd grunt bower-install
IF !ERRORLEVEL! NEQ 0 goto error
popd

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

fix the deployment script

fix the deployment script


@REM Copyright (c) 2014 Object Computing, Inc.
@REM All rights reserved.
@REM See the file license.txt for licensing information.

REM Setting up HighQueue environment

@REM HighQueue depends on MPC V 3.6 or later. (http://www.ociweb.com/products/mpc)
@REM HQTest and HQPerformance depend on BOOST V 1.57.0 or later. (http://www.boost.org/) [earlier versions may work]
@REM Assumes Visual Studio installed in the default location (see VC_ROOT below) and VC..COMNTOOLS is set.

@REM Customize this file by setting variables to suit your environment
@REM Also you should customize HighQueue.features to enable particular features on your system.
@REM Delete the following line when you finishing customizing this file.
@echo See remarks in %0 for information about setting your build environment

@echo off

REM =====================================================================================
if "a" == "a%MPC_ROOT%" set MPC_ROOT=c:\MPC
if "a" == "a%BOOST_VERSION%" set BOOST_VERSION=boost_1_57_0
if "a" == "a%BOOST_ROOT%" set BOOST_ROOT=c:\boost\%BOOST_VERSION%
if "a" == "a%BOOST_LIB_DIRECTORY%" set BOOST_LIB_DIRECTORY=x64\lib
if "a" == "a%BOOST_LIB_PATH%" set BOOST_LIB_PATH=%BOOST_ROOT%\%BOOST_LIB_DIRECTORY%
REM END OF VALUES TO BE SET
REM =====================================================================================
REM Microsoft moved 32 bit apps to a new program files directory on 64 bit systems
set PROGRAM_FILES_X86=Program Files
if exist "C:\Program Files (x86)" set PROGRAM_FILES_X86=Program Files (x86)

REM Verify setup by checking for expected files/directories
set SETUP_CHECKING=MPC_ROOT=%MPC_ROOT%
if not exist "%MPC_ROOT%\mpc.pl" goto setup_is_bad

set SETUP_CHECKING=BOOST_ROOT=%BOOST_ROOT%
if not exist "%BOOST_ROOT%\boost" goto setup_is_bad

set SETUP_CHECKING=BOOST_LIB_PATH="%BOOST_LIB_PATH%"
if not exist "%BOOST_LIB_PATH%" goto setup_is_bad

REM Find visual studio.
REM You can short-circuit this by setting VCVER before running this
REM However this also avoids the check to see if VC is installed in the expected place.
set SETUP_CHECKING=Setup checking visual studio common tools
if not "a" == "a%VCVER%" goto setup_is_ok

set VCVER=15
set SETUP_CHECKING=VS150COMNTOOLS=%VS150COMNTOOLS%
if exist "%VS150COMNTOOLS%VSVARS32.BAT" goto setup_is_ok

set VCVER=14
set SETUP_CHECKING=VS140COMNTOOLS=%VS140COMNTOOLS%
if exist "%VS140COMNTOOLS%VSVARS32.BAT" goto setup_is_ok

set VCVER=12
set SETUP_CHECKING=VS120COMNTOOLS=%VS120COMNTOOLS%
if exist "%VS120COMNTOOLS%VSVARS32.BAT" goto setup_is_ok

set VCVER=11
set SETUP_CHECKING=VS110COMNTOOLS=%VS110COMNTOOLS%
if exist "%VS110COMNTOOLS%VSVARS32.BAT" goto setup_is_ok

set VCVER=10
set SETUP_CHECKING=VS100COMNTOOLS=%VS100COMNTOOLS%
if exist "%VS100COMNTOOLS%VSVARS32.BAT" goto setup_is_ok

REM goto setup_is_bad  (you are here)

:setup_is_bad
ECHO Setup check failed: %SETUP_CHECKING%
ECHO Edit the setup.cmd file or change environment variables
goto end

:setup_is_ok
set SETUP_CHECKING=

set HighQueue_ROOT=%CD%

rem must be outside the if because of the parens in the directory name [what was microsoft thinking?]
if %VCVER%==15 goto isVC15
if %VCVER%==14 goto isVC14
if %VCVER%==12 goto isVC12
if %VCVER%==11 goto isVC11
if %VCVER%==10 goto isVC10
echo "UNKNOWN OR UNSUPPORTED VISUAL STUDIO VERSION: %VCVER%
goto end

:isVC10
:isVC11
:isVC12
:isVC14
:isVC15
set VC_ROOT=C:\%PROGRAM_FILES_X86%\Microsoft Visual Studio %VCVER%.0\VC\bin
call "%VC_ROOT%\VCVARS32.BAT" >nul

:vcIsSet

echo Found MPC at: %MPC_ROOT%
echo Found BOOST at: %BOOST_ROOT%
echo Found Visual Studio version %VCVER%

REM: This avoids growing PATH and INCLUDE every time setup is run
if "a" == "a%BASE_PATH%" set BASE_PATH=%PATH%
if "a" == "a%BASE_INCLUDE%" set BASE_INCLUDE=%INCLUDE%

set RELEASE64_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Release;%MPC_ROOT%;%BOOST_ROOT%\x64\lib;%HighQueue_ROOT%\lib;%BASE_PATH%
set DEBUG64_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Debug;%MPC_ROOT%;%BOOST_ROOT%\x64\lib;%HighQueue_ROOT%\lib;%BASE_PATH%
set RELEASE32_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Release;%MPC_ROOT%;%BOOST_ROOT%\x86\lib;%HighQueue_ROOT%\lib;%BASE_PATH%
set DEBUG32_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Debug;%MPC_ROOT%;%BOOST_ROOT%\x86\lib;%HighQueue_ROOT%\lib;%BASE_PATH%
set PATH=%RELEASE64_PATH%
set INCLUDE=%BOOST_ROOT%;%BASE_INCLUDE%

title HighQueue
:end

@REM Copyright (c) 2014 Object Computing, Inc.
@REM All rights reserved.
@REM See the file license.txt for licensing information.

REM Setting up HighQueue environment

@REM HighQueue depends on MPC V 3.6 or later. (http://www.ociweb.com/products/mpc)
@REM HQTest and HQPerformance depend on BOOST V 1.57.0 or later. (http://www.boost.org/) [earlier versions may work]
@REM Assumes Visual Studio installed in the default location (see VC_ROOT below) and VC..COMNTOOLS is set.

@REM Customize this file by setting variables to suit your environment
@REM Also you should customize HighQueue.features to enable particular features on your system.
@REM Delete the following line when you finishing customizing this file.
@echo See remarks in %0 for information about setting your build environment

@echo off

REM =====================================================================================
if "a" == "a%MPC_ROOT%" set MPC_ROOT=c:\MPC\MPC
if "a" == "a%BOOST_VERSION%" set BOOST_VERSION=boost_1_61_0
if "a" == "a%BOOST_ROOT%" set BOOST_ROOT=c:\boost\%BOOST_VERSION%
REM END OF VALUES TO BE SET
REM =====================================================================================

REM Microsoft moved 32 bit apps to a new program files directory on 64 bit systems
set PROGRAM_FILES_X86=Program Files
if exist "C:\Program Files (x86)" set PROGRAM_FILES_X86=Program Files (x86)

REM Find visual studio.
REM You can short-circuit this by setting VCVER before running this
REM However this also avoids the check to see if VC is installed in the expected place.
set SETUP_CHECKING=Setup checking visual studio common tools
if not "a" == "a%VCVER%" goto vcver_is_ok

set VCVER=15
set SETUP_CHECKING=VS150COMNTOOLS=%VS150COMNTOOLS%
if exist "%VS150COMNTOOLS%VSVARS32.BAT" goto vcver_is_ok

set VCVER=14
set SETUP_CHECKING=VS140COMNTOOLS=%VS140COMNTOOLS%
if exist "%VS140COMNTOOLS%VSVARS32.BAT" goto vcver_is_ok

set VCVER=12
set SETUP_CHECKING=VS120COMNTOOLS=%VS120COMNTOOLS%
if exist "%VS120COMNTOOLS%VSVARS32.BAT" goto vcver_is_ok

set VCVER=11
set SETUP_CHECKING=VS110COMNTOOLS=%VS110COMNTOOLS%
if exist "%VS110COMNTOOLS%VSVARS32.BAT" goto vcver_is_ok

set VCVER=10
set SETUP_CHECKING=VS100COMNTOOLS=%VS100COMNTOOLS%
if exist "%VS100COMNTOOLS%VSVARS32.BAT" goto vcver_is_ok

goto setup_is_bad

:vcver_is_ok
rem must be outside the if because of the parens in the directory name [what was microsoft thinking?]
if %VCVER%==15 goto isVC15
if %VCVER%==14 goto isVC14
if %VCVER%==12 goto isVC12
if %VCVER%==11 goto isVC11
if %VCVER%==10 goto isVC10
echo "UNKNOWN OR UNSUPPORTED VISUAL STUDIO VERSION: %VCVER%
goto end

:isVC10
:isVC11
:isVC12
:isVC14
:isVC15
set VC_ROOT=C:\%PROGRAM_FILES_X86%\Microsoft Visual Studio %VCVER%.0\VC\bin
call "%VC_ROOT%\VCVARS32.BAT" >nul

:vcIsSet

if "a" == "a%BOOST_LIB_DIRECTORY%" set BOOST_LIB_DIRECTORY=lib64-msvc-%VCVER%.0
if "a" == "a%BOOST_LIB_PATH%" set BOOST_LIB_PATH=%BOOST_ROOT%\%BOOST_LIB_DIRECTORY%

REM Verify setup by checking for expected files/directories
set SETUP_CHECKING=MPC_ROOT=%MPC_ROOT%
if not exist "%MPC_ROOT%\mpc.pl" goto setup_is_bad

set SETUP_CHECKING=BOOST_ROOT=%BOOST_ROOT%
if not exist "%BOOST_ROOT%\boost" goto setup_is_bad

set SETUP_CHECKING=BOOST_LIB_PATH="%BOOST_LIB_PATH%"
if not exist "%BOOST_LIB_PATH%" goto setup_is_bad

set SETUP_CHECKING=

set HighQueue_ROOT=%CD%

echo Found MPC at: %MPC_ROOT%
echo Found BOOST at: %BOOST_ROOT%
echo Found Visual Studio version %VCVER%

REM: This avoids growing PATH and INCLUDE every time setup is run
if "a" == "a%BASE_PATH%" set BASE_PATH=%PATH%
if "a" == "a%BASE_INCLUDE%" set BASE_INCLUDE=%INCLUDE%

set RELEASE64_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Release;%MPC_ROOT%;%BOOST_LIB_PATH%;%HighQueue_ROOT%\lib;%BASE_PATH%
set DEBUG64_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Debug;%MPC_ROOT%;%BOOST_LIB_PATH%;%HighQueue_ROOT%\lib;%BASE_PATH%
set RELEASE32_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Release;%MPC_ROOT%;%BOOST_LIB_PATH%;%HighQueue_ROOT%\lib;%BASE_PATH%
set DEBUG32_PATH=%HighQueue_ROOT%\bin;%HighQueue_ROOT%\Output\Debug;%MPC_ROOT%;%BOOST_LIB_PATH%;%HighQueue_ROOT%\lib;%BASE_PATH%
set PATH=%RELEASE64_PATH%
set INCLUDE=%BOOST_ROOT%;%BASE_INCLUDE%

title HighQueue
goto end

:setup_is_bad
ECHO Setup check failed: %SETUP_CHECKING%
ECHO Edit` the setup.cmd file or change environment variables
goto end

:end

Update Setup file for new VC versions.

Update Setup file for new VC versions.


@echo off
if "%1"=="" goto default_value_python:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value_python:
set pythonexe="c:\Python363_x64\python"
if not exist %pythonexe% set pythonexe="c:\Python36_x64\python"
:custom_python:
@echo [python] %pythonexe%
%pythonexe% -u setup.py build_script
if %errorlevel% neq 0 exit /b %errorlevel%

@echo off
if "%1"=="" goto default_value_python:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value_python:
set pythonexe="c:\Python363_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python36_x64\python.exe"
:custom_python:
@echo [python] %pythonexe%
%pythonexe% -u setup.py build_script
if %errorlevel% neq 0 exit /b %errorlevel%

update script

update script