@echo off

mkdir build
cd build

rem Need to handle Python 3.x case at some point (Visual Studio 2010)
if %ARCH%==32 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008"
    set CMAKE_CONFIG="Release|Win32"
	set OPENCV_ARCH=x86
	set OPENCV_VC=vc9
  )
)
if %ARCH%==64 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"
    set CMAKE_CONFIG="Release|x64"
	set OPENCV_ARCH=x64
	set OPENCV_VC=vc9
  )
)

rem I had to take out the PNG_LIBRARY because it included
rem a Windows path which caused it to be wrongly escaped
rem and thus an error. Somehow though, CMAKE still finds
rem the correct png library...
cmake .. -G%CMAKE_GENERATOR%                        ^
    -DBUILD_TESTS=0                                 ^
    -DBUILD_DOCS=0                                  ^
    -DBUILD_PERF_TESTS=0                            ^
    -DBUILD_ZLIB=0                                  ^
    -DBUILD_TIFF=1                                  ^
    -DBUILD_PNG=0                                   ^
    -DBUILD_OPENEXR=0                               ^
    -DBUILD_JASPER=0                                ^
    -DBUILD_JPEG=0                                  ^
    -DJPEG_INCLUDE_DIR="%LIBRARY_INC%"                ^
    -DJPEG_LIBRARY="%LIBRARY_LIB%\libjpeg.lib"        ^
    -DPNG_PNG_INCLUDE_DIR="%LIBRARY_INC%"             ^
    -DZLIB_INCLUDE_DIR="%LIBRARY_INC%"                ^
    -DZLIB_LIBRARY="%LIBRARY_LIB%\zlib.lib"           ^
    -DPYTHON_EXECUTABLE="%PREFIX%\python.exe"         ^
    -DPYTHON_INCLUDE_PATH="%PREFIX%\include"          ^
    -DPYTHON_LIBRARY="%PREFIX%\libs\python27.lib"     ^
    -DPYTHON_PACKAGES_PATH="%SP_DIR%"                 ^
    -DWITH_CUDA=0                                   ^
    -DWITH_OPENCL=0                                 ^
    -DWITH_OPENNI=0                                 ^
    -DWITH_FFMPEG=0                                 ^
    -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"

cmake --build . --config %CMAKE_CONFIG% --target ALL_BUILD
cmake --build . --config %CMAKE_CONFIG% --target INSTALL

rem Let's just move the files around to a more sane structure (flat)
move "%LIBRARY_PREFIX%\%OPENCV_ARCH%\%OPENCV_VC%\bin\*.dll" "%LIBRARY_LIB%"
move "%LIBRARY_PREFIX%\%OPENCV_ARCH%\%OPENCV_VC%\bin\*.exe" "%LIBRARY_BIN%"
move "%LIBRARY_PREFIX%\%OPENCV_ARCH%\%OPENCV_VC%\lib\*.lib" "%LIBRARY_LIB%"
rmdir "%LIBRARY_PREFIX%\%OPENCV_ARCH%" /S /Q

rem By default cv.py is installed directly in site-packages
rem Therefore, we have to copy all of the dlls directly into it!
xcopy "%LIBRARY_LIB%\opencv*.dll" "%SP_DIR%"

rem We have to copy libpng.dll and zlib.dll for runtime
rem dependencies, similar to copying opencv above.
xcopy "%LIBRARY_BIN%\libpng15.dll" "%SP_DIR%"
xcopy "%LIBRARY_BIN%\zlib.dll" "%SP_DIR%"

@echo off

mkdir build
cd build

rem Need to handle Python 3.x case at some point (Visual Studio 2010)
if %ARCH%==32 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008"
    set CMAKE_CONFIG="Release"
	set OPENCV_ARCH=x86
	set OPENCV_VC=vc9
  )
)
if %ARCH%==64 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"
    set CMAKE_CONFIG="Release"
	set OPENCV_ARCH=x64
	set OPENCV_VC=vc9
  )
)

rem I had to take out the PNG_LIBRARY because it included
rem a Windows path which caused it to be wrongly escaped
rem and thus an error. Somehow though, CMAKE still finds
rem the correct png library...
cmake .. -G%CMAKE_GENERATOR%                        ^
    -DBUILD_TESTS=0                                 ^
    -DBUILD_DOCS=0                                  ^
    -DBUILD_PERF_TESTS=0                            ^
    -DBUILD_ZLIB=1                                  ^
    -DBUILD_TIFF=1                                  ^
    -DBUILD_PNG=1                                   ^
    -DBUILD_OPENEXR=1                               ^
    -DBUILD_JASPER=1                                ^
    -DBUILD_JPEG=1                                  ^
    -DPYTHON_EXECUTABLE="%PREFIX%\python.exe"         ^
    -DPYTHON_INCLUDE_PATH="%PREFIX%\include"          ^
    -DPYTHON_LIBRARY="%PREFIX%\libs\python27.lib"     ^
    -DPYTHON_PACKAGES_PATH="%SP_DIR%"                 ^
    -DWITH_CUDA=0                                   ^
    -DWITH_OPENCL=0                                 ^
    -DWITH_OPENNI=0                                 ^
    -DWITH_FFMPEG=0                                 ^
    -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"

cmake --build . --config %CMAKE_CONFIG% --target ALL_BUILD
cmake --build . --config %CMAKE_CONFIG% --target INSTALL

rem Let's just move the files around to a more sane structure (flat)
move "%LIBRARY_PREFIX%\%OPENCV_ARCH%\%OPENCV_VC%\bin\*.dll" "%LIBRARY_LIB%"
move "%LIBRARY_PREFIX%\%OPENCV_ARCH%\%OPENCV_VC%\bin\*.exe" "%LIBRARY_BIN%"
move "%LIBRARY_PREFIX%\%OPENCV_ARCH%\%OPENCV_VC%\lib\*.lib" "%LIBRARY_LIB%"
rmdir "%LIBRARY_PREFIX%\%OPENCV_ARCH%" /S /Q

rem By default cv.py is installed directly in site-packages
rem Therefore, we have to copy all of the dlls directly into it!
xcopy "%LIBRARY_LIB%\opencv*.dll" "%SP_DIR%"

Build image libraries rather than linking

This makes more sense that trying to link, since OpenCV already did all
the hard work to embed working external library versions. (only on
Windows)


@echo off

rem This needed for pkg-config to detect pcl and eigen3 pc files
set PKG_CONFIG_PATH=%LIBRARY_LIB%\pkgconfig

rem Override distutils VS detection
set DISTUTILS_USE_SDK=1
set MSSdk=1

rem Renames necessary for python-pcl to detect the libraries it needs
for %%x in (io registration segmentation features filters sample_consensus
  surface search kdtree octree common) do (
    copy /y %LIBRARY_LIB%\pcl_%%x_release.lib %LIBRARY_LIB%\pcl_%%x.lib > nul
    if errorlevel 1 exit 1
)

copy /y %LIBRARY_LIB%\flann_cpp_s.lib %LIBRARY_LIB%\flann_cpp.lib > nul
if errorlevel 1 exit 1

rem Compile extension
python setup.py config --compiler=msvc build --compiler=msvc install
if errorlevel 1 exit 1

rem Remove library renames
for %%x in (io registration segmentation features filters sample_consensus
  surface search kdtree octree common) do (
    del %LIBRARY_LIB%\pcl_%%x.lib
    if errorlevel 1 exit 1
)

del %LIBRARY_LIB%\flann_cpp.lib
if errorlevel 1 exit 1

@echo off

rem This is needed for pkg-config to detect pcl and eigen3 pc files
set PKG_CONFIG_PATH=%LIBRARY_LIB%\pkgconfig

rem Override distutils VS detection
set DISTUTILS_USE_SDK=1
set MSSdk=1

rem Renames necessary for python-pcl to detect the libraries it needs
for %%x in (io registration segmentation features filters sample_consensus
  surface search kdtree octree common) do (
    copy /y %LIBRARY_LIB%\pcl_%%x_release.lib %LIBRARY_LIB%\pcl_%%x.lib > nul
    if errorlevel 1 exit 1
)

copy /y %LIBRARY_LIB%\flann_cpp_s.lib %LIBRARY_LIB%\flann_cpp.lib > nul
if errorlevel 1 exit 1

rem Compile extension
python setup.py config --compiler=msvc build --compiler=msvc install
if errorlevel 1 exit 1

rem Remove library renames
for %%x in (io registration segmentation features filters sample_consensus
  surface search kdtree octree common) do (
    del %LIBRARY_LIB%\pcl_%%x.lib
    if errorlevel 1 exit 1
)

del %LIBRARY_LIB%\flann_cpp.lib
if errorlevel 1 exit 1

Fix grammar in a comment

Python-pcl: Fix grammar in a comment


@echo off

rem ----- Ignore system ANT_HOME variable
set ORIGINAL_ANT_HOME=%ANT_HOME%
set ANT_HOME=tools\apache-ant-1.6.5

call %ANT_HOME%\bin\ant -version
rem call %ANT_HOME%\bin\ant -f src\build\build.xml
call %ANT_HOME%\bin\ant -f src\build\build.xml config
rem call %ANT_HOME%\bin\ant -f src\build\build.xml -Djava.endorsed.dirs=lib\endorsed -logger org.apache.tools.ant.NoBannerLogger -emacs config

rem ----- Restore ANT_HOME
set ANT_HOME=%ORIGINAL_ANT_HOME%
set ORIGINAL_ANT_HOME=

Configure script ported to Windows

Configure script ported to Windows


@echo OFF
@setlocal

set VERSION=2.5.0
set TFDIR=C:\TreeFrog\%VERSION%
set MONBOC_VERSION=1.21.2
set LZ4_VERSION=1.9.3
set GLOG_VERSION=0.6.0
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
echo Compiling MongoDB driver library ...
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% >nul 2>&1

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
echo Compiling LZ4 library ...
cd %BASEDIR%3rdparty
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
)

:: Builds glog
echo Compiling glog library ...
cd %BASEDIR%3rdparty
rd /s /q  glog >nul 2>&1
del /f /q glog >nul 2>&1
mklink /j glog glog-%GLOG_VERSION% >nul 2>&1
cd %BASEDIR%3rdparty\glog
del /f /q build >nul 2>&1
set CMAKECMD=cmake -S . -B build
echo %CMAKECMD%
%CMAKECMD% >nul 2>&1
set CMAKECMD=cmake --build build
echo %CMAKECMD%
%CMAKECMD% >nul 2>&1
if ERRORLEVEL 1 (
  :: Shows error
  %CMAKECMD%
  echo;
  echo Build failed.
  echo glog not available.
  exit /b
)

:: Builds TreeFrog
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.5.0
set TFDIR=C:\TreeFrog\%VERSION%
set MONBOC_VERSION=1.21.2
set LZ4_VERSION=1.9.3
set GLOG_VERSION=0.6.0
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
echo Compiling MongoDB driver library ...
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% >nul 2>&1

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
echo Compiling LZ4 library ...
cd %BASEDIR%3rdparty
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
)

:: Builds glog
echo Compiling glog library ...
cd %BASEDIR%3rdparty
rd /s /q  glog >nul 2>&1
del /f /q glog >nul 2>&1
mklink /j glog glog-%GLOG_VERSION% >nul 2>&1
cd %BASEDIR%3rdparty\glog
del /f /q build >nul 2>&1
set CMAKECMD=cmake -S . -B build -DCMAKE_GENERATOR_PLATFORM=x64
echo %CMAKECMD%
%CMAKECMD% >nul 2>&1
set CMAKECMD=cmake --build build
echo %CMAKECMD%
%CMAKECMD% >nul 2>&1
if ERRORLEVEL 1 (
  :: Shows error
  %CMAKECMD%
  echo;
  echo Build failed.
  echo glog not available.
  exit /b
)

:: Builds TreeFrog
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

fix compilation error on windows.

fix compilation error on windows.


REM Copyright 2015 Brian Smith.
REM Copyright 2016 Cory Benfield.
REM
REM Permission to use, copy, modify, and/or distribute this software for any
REM purpose with or without fee is hereby granted, provided that the above
REM copyright notice and this permission notice appear in all copies.
REM
REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF

echo on
SetLocal EnableDelayedExpansion

REM This is the recommended way to choose the toolchain version, according to
REM Appveyor's documentation.
SET PATH=C:\Program Files (x86)\MSBuild\%TOOLCHAIN_VERSION%\Bin;%PATH%

set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%\VC\vcvarsall.bat"

if [%Platform%] NEQ [x64] goto win32
set TARGET_ARCH=x86_64
set TARGET_PROGRAM_FILES=%ProgramFiles%
call %VCVARSALL% amd64
if %ERRORLEVEL% NEQ 0 exit 1
goto download

:win32
echo on
if [%Platform%] NEQ [Win32] exit 1
set TARGET_ARCH=i686
set TARGET_PROGRAM_FILES=%ProgramFiles(x86)%
call %VCVARSALL% amd64_x86
if %ERRORLEVEL% NEQ 0 exit 1
goto download

:download
REM vcvarsall turns echo off
echo on

REM Install Rust
set RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi
echo Downloading %RUST_URL%...
mkdir build
powershell -Command "(New-Object Net.WebClient).DownloadFile('%RUST_URL%', 'build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi')"
if %ERRORLEVEL% NEQ 0 (
  echo ...downloading failed.
  exit 1
)

start /wait msiexec /i build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi INSTALLDIR="%TARGET_PROGRAM_FILES%\Rust %RUST%" /quiet /qn /norestart
if %ERRORLEVEL% NEQ 0 exit 1

set PATH="%PYTHON%";"%PYTHON%\Scripts";"%TARGET_PROGRAM_FILES%\Rust %RUST%\bin";%PATH%

link /?
cl /?
rustc --version
cargo --version

python -m pip install -U setuptools pip wheel
if %ERRORLEVEL% NEQ 0 exit 1

python -m pip install -r test_requirements.txt
if %ERRORLEVEL% NEQ 0 exit 1

appveyor\build.cmd "python -m pip install ."
if %ERRORLEVEL% NEQ 0 exit 1

py.test test/
if %ERRORLEVEL% NEQ 0 exit 1

appveyor\build.cmd "python setup.py bdist_wheel"

REM Copyright 2015 Brian Smith.
REM Copyright 2016 Cory Benfield.
REM
REM Permission to use, copy, modify, and/or distribute this software for any
REM purpose with or without fee is hereby granted, provided that the above
REM copyright notice and this permission notice appear in all copies.
REM
REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF

echo on
SetLocal EnableDelayedExpansion

REM This is the recommended way to choose the toolchain version, according to
REM Appveyor's documentation.
SET PATH=C:\Program Files (x86)\MSBuild\%TOOLCHAIN_VERSION%\Bin;%PATH%

set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%\VC\vcvarsall.bat"

if [%Platform%] NEQ [x64] goto win32
set TARGET_ARCH=x86_64
set TARGET_PROGRAM_FILES=%ProgramFiles%
call %VCVARSALL% amd64
if %ERRORLEVEL% NEQ 0 exit 1
goto download

:win32
echo on
if [%Platform%] NEQ [Win32] exit 1
set TARGET_ARCH=i686
set TARGET_PROGRAM_FILES=%ProgramFiles(x86)%
call %VCVARSALL% amd64_x86
if %ERRORLEVEL% NEQ 0 exit 1
goto download

:download
REM vcvarsall turns echo off
echo on

REM Install Rust
set RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi
echo Downloading %RUST_URL%...
mkdir build
powershell -Command "(New-Object Net.WebClient).DownloadFile('%RUST_URL%', 'build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi')"
if %ERRORLEVEL% NEQ 0 (
  echo ...downloading failed.
  exit 1
)

start /wait msiexec /i build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi INSTALLDIR="%TARGET_PROGRAM_FILES%\Rust %RUST%" /quiet /qn /norestart
if %ERRORLEVEL% NEQ 0 exit 1

set PATH="%PYTHON%";"%PYTHON%\Scripts";"%TARGET_PROGRAM_FILES%\Rust %RUST%\bin";%PATH%

link /?
cl /?
rustc --version
cargo --version

python -m pip install -U setuptools pip wheel
if %ERRORLEVEL% NEQ 0 exit 1

python -m pip install -r test_requirements.txt
if %ERRORLEVEL% NEQ 0 exit 1

appveyor\build.cmd python -m pip install .
if %ERRORLEVEL% NEQ 0 exit 1

py.test test/
if %ERRORLEVEL% NEQ 0 exit 1

appveyor\build.cmd python setup.py bdist_wheel

Remove the quotes.

Remove the quotes.


@echo off

chcp 65001>nul

prompt [%USERNAME%@%COMPUTERNAME% $p]$_$$$s

rem Fake a UNIX environment

doskey clear=cls
doskey ls=dir /d $*
doskey cp=copy $*
doskey mv=move $*
doskey rm=del $*
doskey cat=type $*
doskey touch=type nul$G$G$*

rem Easier navigation

doskey cd=cd /D $*
doskey cd..=cd ..
doskey ..=cd ..
doskey ...=cd ../..
doskey ....=cd ../../..

rem List files properly

doskey l=dir /b $*
doskey ll=dir /b $*

rem Edit functionality

IF NOT EXIST "C:\Program Files\Sublime Text 3" GOTO NOSUBLIME
    doskey edit="C:\Program Files\Sublime Text 3\sublime_text" $*
:NOSUBLIME

rem Open functionality

doskey open=start $*

@echo on

@echo off

chcp 65001>nul

prompt [%USERNAME%@%COMPUTERNAME% $p]$_$$$s

rem Fake a UNIX environment

doskey clear=cls
doskey ls=dir /d $*
doskey cp=copy $*
doskey mv=move $*
doskey rm=del $*
doskey cat=type $*
doskey touch=type nul$G$G$*

rem Easier navigation

doskey cd=cd /D $*
doskey cd..=cd ..
doskey ..=cd ..
doskey ...=cd ../..
doskey ....=cd ../../..

rem List files properly

doskey l=dir /b $*
doskey ll=dir /b $*

rem Edit functionality

IF NOT EXIST "C:\Program Files (x86)\Microsoft VS Code" GOTO NOVSCODE
    doskey edit="C:\Program Files (x86)\Microsoft VS Code\bin\code.cmd" $*
    GOTO NOSUBLIME
:NOVSCODE

IF NOT EXIST "C:\Program Files\Sublime Text 3" GOTO NOSUBLIME
    doskey edit="C:\Program Files\Sublime Text 3\sublime_text" $*
:NOSUBLIME

rem Open functionality

doskey open=start $*

@echo on

Use vscode as editor in windows

Use vscode as editor in windows


@echo off

if [%appveyor_repo_branch%]==[release] (
	set build_options=--configuration Release
) else if defined appveyor_build_number (
	set build_options=--configuration Release --version-suffix ci%appveyor_build_number%
) else (
	set build_options=--configuration Release --version-suffix yolo
)

Purge tabs

Purge tabs


:: use call so if a program fails, the bat continues to run
:: move to the working directory
cd C:\vagrant\
:: install the package dependencies
call C:\nodejsx64\npm.cmd i
:: run mocha
call C:\Users\vagrant\AppData\Roaming\npm\mocha.cmd test\index.js
call C:\Users\vagrant\AppData\Roaming\npm\mocha.cmd test\sp-scquery.js

:: use call so if a program fails, the bat continues to run
:: move to the working directory
cd C:\vagrant\
:: install the package dependencies
call C:\nodejsx64\npm.cmd i
:: run mocha
call C:\Users\vagrant\AppData\Roaming\npm\mocha.cmd test\index.js
call C:\Users\vagrant\AppData\Roaming\npm\mocha.cmd test\funct.js
call C:\Users\vagrant\AppData\Roaming\npm\mocha.cmd test\sp-scquery.js

add functional tests

add functional tests


for %%x in (*.nupkg) do dotnet nuget push "%%x" %1 -Source https://nuget.org

for %%x in (src\DelegateDecompiler\bin\Release\*.nupkg) do dotnet nuget push "%%x" -s https://nuget.org -k %1

Fix push script

Fix push script


@echo off
rem
rem deblocus build script for windows.
rem

set "project=%~dp0.."
call :Resolve %project% project
echo deblocus build script
echo working path: %project%
pushd %project%

set goExe=""
call :RunEx "where go",goExe 2> nul

if "%goExe%" == "" (
    echo Need golang/bin in env.PATH.
    goto Exit
)

if "%~1" == "clean" (
    echo go clean
    go clean
    goto Exit
)

set osext_path="%project%\src\bitbucket.org\kardianos\osext"

set hgExe=
call :RunEx "where hg",hgExe 2> nul
if "%hgExe%" == "" call :InstallOsext
if "%osext_err%" NEQ "0" goto Exit

set "GOPATH=%project%"
echo.
echo building (may download dependencies) ...

go get deblocus
if "%errorlevel%" == "0" (
    echo deblocus build done: %project%/bin
)
goto Exit

:InstallOsext

if exist %osext_path%\osext.go (
    set osext_err=0
    goto EOF
)

pushd %project%\script

if not exist osext.zip (
    set wget=
    set curl=
    call :RunEx "where wget",wget 2> nul
    call :RunEx "where curl",curl 2> nul

    if "%wget%" == "" if "%curl%" == "" (
        echo Need wget or curl in env.PATH.
        goto Exit
    )

    set osext_url="https://bitbucket.org/kardianos/osext/get/default.zip"
    if "%wget%" NEQ "" (
        %wget% -O osext.zip %osext_url%
    ) else (
        %curl% -o osext.zip %osext_url%
    )
)

mkdir %osext_path% 2> nul

set unzipExe=
call :RunEx "where unzip",unzipExe 2> nul

if "%unzipExe%" == "" (
    echo Need unzip in env.PATH.
    goto Exit
)
%unzipExe% -jo osext.zip -d %osext_path%

set osext_err=%errorlevel%
goto Exit

:RunEx
for /f "tokens=*" %%a in ('%~1') do set "%~2=%%a"
goto EOF

:Resolve
set %2=%~f1
goto EOF

:Exit
popd
goto EOF

:EOF

@echo off
rem
rem deblocus build script for windows.
rem

set "project=%~dp0.."
call :Resolve %project% project
echo deblocus build script
echo working path: %project%
pushd %project%

set goExe=""
call :RunEx "where go",goExe 2> nul

if "%goExe%" == "" (
    echo Need golang/bin in env.PATH.
    goto Exit
)

if "%~1" == "clean" (
    echo go clean
    go clean
    goto Exit
)

set osext_path="%project%\src\bitbucket.org\kardianos\osext"

set hgExe=
call :RunEx "where hg",hgExe 2> nul
if "%hgExe%" == "" call :InstallOsext
if "%osext_err%" NEQ "0" goto Exit

set "GOPATH=%project%"
echo.
echo building (may download dependencies) ...

go get deblocus
if "%errorlevel%" == "0" (
    echo deblocus build done: %project%/bin
)
goto Exit

:InstallOsext

if exist %osext_path%\osext.go (
    set osext_err=0
    goto EOF
)

pushd %project%\script

if not exist osext.zip (
    set wget=
    set curl=
    call :RunEx "where wget",wget 2> nul
    call :RunEx "where curl",curl 2> nul

    if "%wget%" == "" if "%curl%" == "" (
        echo Need wget or curl in env.PATH.
        goto Exit
    )

    set osext_url="https://bitbucket.org/kardianos/osext/get/default.zip"
    if "%wget%" NEQ "" (
        wget -O osext.zip %osext_url%
    ) else (
        curl -o osext.zip %osext_url%
    )
)

mkdir %osext_path% 2> nul

set unzipExe=
call :RunEx "where unzip",unzipExe 2> nul

if "%unzipExe%" == "" (
    echo Need unzip in env.PATH.
    goto Exit
)
unzip -jo osext.zip -d %osext_path%

set osext_err=%errorlevel%
goto Exit

:RunEx
for /f "tokens=*" %%a in ('%~1') do set "%~2=%%a"
goto EOF

:Resolve
set %2=%~f1
goto EOF

:Exit
popd
goto EOF

:EOF

fix bat abspath

fix bat abspath


Set Book=%BookName%%1
Call Generate %Book% name SongTi FontSize48
Call Generate %Book% name QuanZiKuFont FontSize48

:: The following fonts generated unreadable characters.
:: Call Generate %Book% name FangSong FontSize48
:: Call Generate %Book% name KaiTi FontSize48

:: The following fonts generated incomplete text.
:: Call Generate %Book% name BeiShiDaFont FontSize48
:: Call Generate %Book% name JinWen FontSize48
:: Call Generate %Book% name LiShu FontSize48
:: Call Generate %Book% name JiaGuWen FontSize48
Set Destinaton=%OutputFolder%\%1
RmDir %Destinaton% /s /q
MkDir %Destinaton%
Move /Y %Book%*.pdf %Destinaton%

Set Book=%BookName%%1
Call Generate %Book% name SongTi FontSize48
Call Generate %Book% name QuanZiKuFont FontSize48

:: The following fonts generated unreadable characters.
:: Call Generate %Book% name FangSong FontSize48
:: Call Generate %Book% name KaiTi FontSize48

:: The following fonts generated incomplete text.
REM Call Generate %Book% name BeiShiDaFont FontSize48
REM Call Generate %Book% name JinWen FontSize48
REM Call Generate %Book% name LiShu FontSize48
REM Call Generate %Book% name JiaGuWen FontSize48

Set Destinaton=%OutputFolder%\%1
RmDir %Destinaton% /s /q
MkDir %Destinaton%
Move /Y %Book%*.pdf %Destinaton%

Create more books for other font families


:: create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin

:: Fetch cygwin
set URL=http://cygwin.com/setup-x86_64.exe
cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal %URL% %SystemDrive%\cygwin\cygwin-setup-x86_64.exe

:: goto a temp directory and install
cd /D %SystemDrive%\windows\temp

:: packages -- comma separated
set PACKAGES=cygrunsrv,openssh,rsync

%SystemDrive%\cygwin\cygwin-setup-x86_64.exe -a x86_64 -q -R %SystemDrive%\cygwin -P %PACKAGES% -s http://cygwin.mirrors.pair.com

:: Firewall Rules
cmd /c netsh advfirewall firewall add rule name="sshd" dir=in action=allow program="%SystemDrive%\cygwin\usr\sbin\sshd.exe" enable=yes
cmd /c netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22

:: Stop the service
%SystemDrive%\cygwin\bin\bash -l -c 'cygrunsrv -E sshd'

:: Configure ssh
%SystemDrive%\cygwin\bin\bash -l -c '/bin/ssh-host-config -y --cygwin "ntsecbinmode mintty" --pwd "acb&&123!!"'

:: /bin/ash is the right shell for this command
:: Is this needed?
:: cmd /c %SystemDrive%\cygwin\bin\ash -l -c /bin/rebaseall

:: Rebuild group and passwd
cmd /c %SystemDrive%\cygwin\bin\bash -l -c 'mkgroup -l'>%SystemDrive%\cygwin\etc\group
cmd /c %SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd

%SystemDrive%\cygwin\bin\bash -l -c 'ln -s "$(dirname $(cygpath -D))" /home/$USERNAME'

:: Put local users home directories in the Windows Profiles directory
%SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l -p "$(cygpath -H)"'>%SystemDrive%\cygwin\etc\passwd

:: Start at last -- server is powered off by packer when ssh is avail.
net start sshd

:: create the cygwin directory
mkdir %SystemDrive%\cygwin

:: Fetch cygwin
set URL=http://cygwin.com/setup-x86_64.exe
bitsadmin /transfer CygwinSetupExe /download /priority normal %URL% %SystemDrive%\cygwin\cygwin-setup-x86_64.exe

:: goto a temp directory and install
cd /D %SystemDrive%\windows\temp

:: packages -- comma separated
set PACKAGES=cygrunsrv,openssh,rsync

%SystemDrive%\cygwin\cygwin-setup-x86_64.exe -a x86_64 -q -R %SystemDrive%\cygwin -P %PACKAGES% -s http://cygwin.mirrors.pair.com

:: Firewall Rules
netsh advfirewall firewall add rule name="sshd" dir=in action=allow program="%SystemDrive%\cygwin\usr\sbin\sshd.exe" enable=yes
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22

:: Stop the service
%SystemDrive%\cygwin\bin\bash -l -c 'cygrunsrv -E sshd'

:: Configure ssh
%SystemDrive%\cygwin\bin\bash -l -c '/bin/ssh-host-config -y --cygwin "ntsecbinmode mintty" --pwd "acb&&123!!"'

:: /bin/ash is the right shell for this command
:: Is this needed?
:: %SystemDrive%\cygwin\bin\ash -l -c /bin/rebaseall

:: Rebuild group and passwd
%SystemDrive%\cygwin\bin\bash -l -c 'mkgroup -l'>%SystemDrive%\cygwin\etc\group
%SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd

%SystemDrive%\cygwin\bin\bash -l -c 'ln -s "$(dirname $(cygpath -D))" /home/$USERNAME'

:: Put local users home directories in the Windows Profiles directory
%SystemDrive%\cygwin\bin\bash -l -c 'mkpasswd -l -p "$(cygpath -H)"'>%SystemDrive%\cygwin\etc\passwd

:: Start at last -- server is powered off by packer when ssh is avail.
net start sshd

Remove superfluous use of cmd /c in bat script


setlocal
call settings.bat
echo "Downloading and unpacking Boost:"
call fetch.bat "http://downloads.sourceforge.net/project/boost/boost/1.63.0/boost_1_63_0.7z" boost_1_63_0 > nul
echo "OK"

set src=%CD%

cd boost_1_63_0

set "TOOLSET=msvc-%MSC_VER%.0"
if NOT EXIST bjam.exe call bootstrap.bat

if NOT EXIST "%BOOST_ROOT%/include/boost-1_63/boost" (
  mkdir "%BOOST_ROOT%/include/boost-1_63/boost"
  xcopy /y /e /q boost "%BOOST_ROOT%/include/boost-1_63/boost"
)

bjam toolset=%TOOLSET% address-model=64 threading=multi link=shared runtime-link=shared ^
   variant=debug,release --prefix=%BOOST_ROOT% ^
   -sBZIP2_SOURCE="%src%\bzip2-1.0.6" -sZLIB_SOURCE="%src%\zlib-1.2.11" ^
   --with-python ^
   install
cd ..

add boost python-only build

add boost python-only build


rem small helper for me to build the developer version on a windows host
set ORIG_PATH=%PATH%
set PATH=%PATH%;c:\hashicorp\vagrant\embedded\bin
gem build vagrant-vcloud.gemspec
set PATH=%ORIG_PATH%

Add gem-build.bat helper

Add gem-build.bat helper


@echo off
setlocal

rem Copyright (c) 1999, 2010 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper command based script.

rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.4 of the Wrapper.

rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper

rem The name and location of the Wrapper configuration file.
rem  (Do not remove quotes.)
set _WRAPPER_CONF_DEFAULT="../conf/neo4j-wrapper.conf"

rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem Find the application home.
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
goto search
:amd64
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
goto search
:ia64
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
goto search
:search
set _WRAPPER_EXE=%_WRAPPER_L_EXE%
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto validate
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF=""
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
goto validate

:validate
rem
rem Find the requested command.
rem
for /F %%v in ('echo %1^|findstr "^help$ ^console$ ^start$ ^pause$ ^resume$ ^stop$ ^restart$ ^install$ ^remove$"') do call :exec set COMMAND=%%v

if "%COMMAND%" == "" (
    set COMMAND=console
)

rem
rem Run the application.
rem At runtime, the current directory will be that of wrapper.exe
rem
call :%COMMAND%
if errorlevel 1 goto callerror
goto :eof

:callerror
echo An error occurred in the process.
pause
goto :eof

:help
echo Usage: %0 { console : start : stop : restart : install : remove } [command]
pause
goto :eof

:console
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
goto :eof

:start
"%_WRAPPER_EXE%" -t %_WRAPPER_CONF%
goto :eof

:pause
"%_WRAPPER_EXE%" -a %_WRAPPER_CONF%
goto :eof

:resume
"%_WRAPPER_EXE%" -e %_WRAPPER_CONF%
goto :eof

:stop
"%_WRAPPER_EXE%" -p %_WRAPPER_CONF%
goto :eof

:install
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
goto :eof

:remove
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
goto :eof

:restart
call :stop
call :start
goto :eof

:exec
%*
goto :eof

@echo off
setlocal

rem Copyright (c) 1999, 2010 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper command based script.

rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.4 of the Wrapper.

rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper

rem The name and location of the Wrapper configuration file.
rem  (Do not remove quotes.)
set _WRAPPER_CONF_DEFAULT="../conf/neo4j-wrapper.conf"

rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof

:nt
rem Find the application home.
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
rem Note: user is responsible for only keeping one
rem wrapper in place.
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
goto :eof

rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF=""
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
goto validate

:validate
rem
rem Find the requested command.
rem
for /F %%v in ('echo %1^|findstr "^help$ ^console$ ^start$ ^pause$ ^resume$ ^stop$ ^restart$ ^install$ ^remove$"') do call :exec set COMMAND=%%v

if "%COMMAND%" == "" (
    set COMMAND=console
)

rem
rem Run the application.
rem At runtime, the current directory will be that of wrapper.exe
rem
call :%COMMAND%
if errorlevel 1 goto callerror
goto :eof

:callerror
echo An error occurred in the process.
pause
goto :eof

:help
echo Usage: %0 { console : start : stop : restart : install : remove } [command]
pause
goto :eof

:console
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
goto :eof

:start
"%_WRAPPER_EXE%" -t %_WRAPPER_CONF%
goto :eof

:pause
"%_WRAPPER_EXE%" -a %_WRAPPER_CONF%
goto :eof

:resume
"%_WRAPPER_EXE%" -e %_WRAPPER_CONF%
goto :eof

:stop
"%_WRAPPER_EXE%" -p %_WRAPPER_CONF%
goto :eof

:install
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
goto :eof

:remove
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
goto :eof

:restart
call :stop
call :start
goto :eof

:exec
%*
goto :eof

Make scripts look for any windows wrapper, not assuming anyting based on guessing.

git-svn-id: d3b6981a72c34c2e21b7d6429dd2b836e77ced17@7105 0b971d98-bb2f-0410-8247-b05b2b5feb2a


"%sdkverpath%" -q -version:"%sdkver%"
call setenv /x64

rem install python packages
pip install --cache-dir C:/egg_cache nose
pip install --cache-dir C:/egg_cache coverage
pip install --cache-dir C:/egg_cache numpy
pip install --cache-dir C:/egg_cache cython
pip install --cache-dir C:/egg_cache babel==1.3
pip install --cache-dir C:/egg_cache Sphinx

rem install traits
python setup.py develop

"%sdkverpath%" -q -version:"%sdkver%"
call setenv /x64

rem install python packages
pip install --cache-dir C:/egg_cache nose
pip install --cache-dir C:/egg_cache coverage
pip install --cache-dir C:/egg_cache numpy
pip install --cache-dir C:/egg_cache cython
rem Work around bug in babel 2.0: see mitsuhiko/babel#174
pip install --cache-dir C:/egg_cache babel==1.3
pip install --cache-dir C:/egg_cache Sphinx

rem install traits
python setup.py develop

Add comment explaining why we're forcing babel 1.3


call "%RECIPE_DIR%\set_bld_opts.bat"
if errorlevel 1 exit 1

cd swig\csharp
if errorlevel 1 exit 1

copy /B "%LIBRARY_PREFIX%\lib\gdal_i.lib" ..\..
if errorlevel 1 exit 1

nmake /f makefile.vc interface
if errorlevel 1 exit 1

nmake /f makefile.vc %BLD_OPTS%
if errorlevel 1 exit 1

call "%RECIPE_DIR%\move_output.bat"
if errorlevel 1 exit 1

call "%RECIPE_DIR%\set_bld_opts.bat"
if errorlevel 1 exit 1

cd swig\csharp
if errorlevel 1 exit 1

copy /B "%LIBRARY_PREFIX%\lib\gdal_i.lib" ..\..
if errorlevel 1 exit 1

nmake /f makefile.vc interface
if errorlevel 1 exit 1

nmake /f makefile.vc %BLD_OPTS%
if errorlevel 1 exit 1

nmake /f makefile.vc test
if errorlevel 1 exit 1

call "%RECIPE_DIR%\move_output.bat"
if errorlevel 1 exit 1

add windows test

add windows test


mkdir build
cd build

cmake -G Ninja ^
      -DCHEMICALFUN_PYTHON_INSTALL_PREFIX="%PREFIX%" ^
      -DCMAKE_BUILD_TYPE=Release ^
      -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
      -DCMAKE_INCLUDE_PATH:PATH="%LIBRARY_INC%" ^
      ..
if errorlevel 1 exit 1
ninja install
if errorlevel 1 exit 1

mkdir build
cd build

cmake -G Ninja ^
      -DCHEMICALFUN_PYTHON_INSTALL_PREFIX:PATH="%PREFIX%" ^
      -DCMAKE_BUILD_TYPE=Release ^
      ..
if errorlevel 1 exit 1
ninja install
if errorlevel 1 exit 1

Update bld.bat

Update bld.bat


@echo on
call "%VS120COMNTOOLS%vsvars32.bat"

msbuild.exe /ToolsVersion:4.0 "MahApps.Metro.SimpleChildWindow.sln" /p:configuration=Debug /t:Clean,Rebuild
msbuild.exe /ToolsVersion:4.0 "MahApps.Metro.SimpleChildWindow.sln" /p:configuration=Release /t:Clean,Rebuild

.nuget\NuGet.exe pack %~dp0MahApps.Metro.SimpleChildWindow.nuspec -OutputDirectory %~dp0

add Build.cmd

add Build.cmd


copy dotfiles\vim\.vimrc %UserProfile%\_vimrc
xcopy /S /Y dotfiles\vim\.vim %UserProfile%\.vim
pause

Add missing install script

Add missing install script


@echo off

NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
    ECHO Not an admin, exiting.
    EXIT /B 1
)

setlocal EnableDelayedExpansion

:: ############################
:: # Create symlinks from the home directory to any desired dotfiles directory.
:: ############################

:: dotfiles directory
set dotfilesdir=%USERPROFILE%\.dotfiles

:: backup directory
set backupdir=%USERPROFILE%\dotfiles_backup

:: list of files/folders to symlink in homedir
set dotfiles=bashrc bash_profile bash dir_colors inputrc minttyrc gitconfig

for %%A in (%dotfiles%) DO (
  set target=%dotfilesdir%\%%A
  set link=%USERPROFILE%\.%%A
  set linkExists="0"

  if exist "!link!" (
    set Z=&& for %%B in ("!link!") do set Z=%%~aB
    if "!Z:~8,1!" == "l" (
      set linkExists="1"
    ) else (
      if not exist "%backupdir%" (
        mkdir "%backupdir%""
      )
      echo Moving existing !link! to %backupdir%
      move "!link!" "%backupdir%"
    )
  )

  if !linkExists! == "0" (
    if exist "!target!\" (
      mklink /d "!link!" "!target!"
    ) else (
      mklink "!link!" "!target!"
    )
  )
)

@echo off

NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
    ECHO Not an admin, exiting.
    EXIT /B 1
)

setlocal EnableDelayedExpansion

:: ############################
:: # Create symlinks from the home directory to any desired dotfiles directory.
:: ############################

:: dotfiles directory
set dotfilesdir=%USERPROFILE%\.dotfiles

:: backup directory
set backupdir=%USERPROFILE%\dotfiles_backup

:: list of files/folders to symlink in homedir
set dotfiles=bashrc bash_profile bash dir_colors inputrc minttyrc gitconfig

for %%A in (%dotfiles%) DO (
  set target=%dotfilesdir%\%%A
  set link=%USERPROFILE%\.%%A
  set linkExists="0"

  if exist "!link!" (
    set Z=&& for %%B in ("!link!") do set Z=%%~aB
    if "!Z:~8,1!" == "l" (
      set linkExists="1"
    ) else (
      if not exist "%backupdir%" (
        mkdir "%backupdir%""
      )
      echo Moving existing !link! to %backupdir%
      move "!link!" "%backupdir%"
    )
  )

  if !linkExists! == "0" (
    if exist "!target!\" (
      mklink /d "!link!" "!target!"
    ) else (
      mklink "!link!" "!target!"
    )
    attrib /L "!link!" +h
  )
)

Set hidden attribute of links

Set hidden attribute of links


mkdir build
cd build

cmake ^
    -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
    -DBUILD_TESTING=ON ^
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ^
    -DCMAKE_CXX_FLAGS="/permissive- /D_USE_MATH_DEFINES" ^
    %SRC_DIR%
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1

:: Test
ctest --output-on-failure -C Release -E "check_|INTEGRATION_ExamplesBuild_TEST|UNIT_Collisions_TEST|UNIT_EntityManagement_TEST"
if errorlevel 1 exit 1

Create bld_cxx.bat

Create bld_cxx.bat


Add rendering script

Add rendering script


@echo off
set PYTHONPATH=%CD%
C:\Python27\python.exe reader_archive\reader_archive.py %*

@echo off
set PYTHONPATH=%CD%
python reader_archive\reader_archive.py %*

Replace absolute path of python

Replace absolute path of python


SETLOCAL

call call_vcvars.cmd

set "_=%CD%"
cd ..
for /F %%1 in ('dir *.exe /B /S /A:-D') do (mt.exe -manifest "%%1.manifest" -outputresource:"%%1";1)
for /F %%1 in ('dir *.dll /B /S /A:-D') do (mt.exe -manifest "%%1.manifest" -outputresource:"%%1";2)
cd %_%

ENDLOCAL

pause

@echo off
SETLOCAL

call call_vcvars.cmd

set "_=%CD%"
cd ..
for /F "delims=" %%1 in ('dir *.exe /B /S /A:-D') do (echo "%%1" && mt.exe -nologo -manifest "%%1.manifest" -outputresource:"%%1";1)
for /F "delims=" %%1 in ('dir *.dll /B /S /A:-D') do (echo "%%1" && mt.exe -nologo -manifest "%%1.manifest" -outputresource:"%%1";2)
cd %_%

ENDLOCAL

Embed manifests in all files

Embed manifests in all files


@echo off
REM Extract subcatchment simulation results from SWMM report (by default *.rpt) file and save into shapefile with subcatchment geometries from SWMM input (*.inp) file.

REM Activate conda environment (with necessary packages installed)
call activate

REM Run rpt2gis
REM Change the paths and the coordinate reference system code (EPSG:XXXX) as necessary
python "../utils/rpt2gis.py" "../demo_catchment/out/SWMM_in/demo_catchment_adap.inp" "../demo_catchment/out/SWMM_out/demo_catchment_adap.rpt" "EPSG:3879"

REM Deactivate conda environment
call deactivate

REM Wait for user input before closing terminal
pause

@echo off
REM Extract subcatchment simulation results from SWMM report (by default *.rpt) file
REM and save into shapefile with subcatchment geometries from SWMM input (*.inp) file.
REM Syntax:
REM 	python rpt2gis.py [PATH TO *.inp FILE] [PATH TO *.rpt FILE] 'EPSG:[XXXX]'

REM Activate conda environment (with necessary packages installed)
call activate

REM Example of running rpt2gis.py
REM '^' is used only to split long lines here
python "../utils/rpt2gis.py" ^
"../demo_catchment/out/SWMM_in/demo_catchment_rect.inp" ^
"../demo_catchment/out/SWMM_out/demo_catchment_rect.rpt" ^
"EPSG:3879"

REM Deactivate conda environment
call deactivate

REM Wait for user input before closing terminal
pause

Replace run_rpt2gis.bat

Replace run_rpt2gis.bat


@ECHO OFF
CLS

REM ----------------------------------------------------------------------
REM DirectoryCleaner v1.0 (https://github.com/earthperson/DirectoryCleaner)
REM
REM Copyright (c) 2009 Dmitry Ponomarev (e-mail: ponomarev.dev@gmail.com)
REM Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
REM ----------------------------------------------------------------------

TITLE DirectoryCleaner v1.0. Copyright (c) 2009 Dmitry Ponomarev (e-mail: ponomarev.dev@gmail.com)

SET DIRECTORY=%temp%

ECHO Opening directory %DIRECTORY%...
CD /D %DIRECTORY% || GOTO FAILOPENDIR

:AMOUNT
SET NUMBER_OF_ENTITIES=0
FOR /D %%i IN (*) DO SET /A NUMBER_OF_ENTITIES=NUMBER_OF_ENTITIES+1
FOR %%i IN (*) DO SET /A NUMBER_OF_ENTITIES=NUMBER_OF_ENTITIES+1
IF %NUMBER_OF_ENTITIES% GTR 0 (
	GOTO LIST
) ELSE (
	ECHO Directory empty
	GOTO END
)

:LIST
ECHO Directory contents:
ECHO.
DIR /B /O:N
ECHO.

:ACTION
ECHO Do you really want to remove %NUMBER_OF_ENTITIES% entities [Y/n]%?
SET /P CONFIRMATION=
IF /I "%CONFIRMATION%"=="y" (
	GOTO PROCESS
) ELSE (
	GOTO IMMEDIATE_END
)

:PROCESS
CLS
ECHO Do...
SET REMOVED_DIRS=0
SET REMOVED_FILES=0
FOR /D %%i IN (*) DO (
	IF "%~nx0" NEQ "%%i" (
		RD /S /Q "%%i" && SET /A REMOVED_DIRS=REMOVED_DIRS+1
	)
)
FOR %%i IN (*) DO (
	IF "%~nx0" NEQ "%%i" (
		DEL /F /Q "%%i" && SET /A REMOVED_FILES=REMOVED_FILES+1
	)
)
SET /A TOTAL_REMOVED=REMOVED_DIRS+REMOVED_FILES
CLS
ECHO Done.
ECHO Removed directories: %REMOVED_DIRS%; removed files: %REMOVED_FILES%; total removed: %TOTAL_REMOVED%.
GOTO AMOUNT

:FAILOPENDIR
CLS
ECHO ERROR: Failed to open directory %DIRECTORY%
GOTO END

:END
PAUSE

:IMMEDIATE_END
EXIT /B

@ECHO OFF
CLS

REM ----------------------------------------------------------------------
REM DirectoryCleaner v1.0.1 (https://github.com/earthperson/DirectoryCleaner)
REM
REM Copyright (c) 2009 Dmitry Ponomarev (e-mail: ponomarev.dev@gmail.com)
REM Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
REM ----------------------------------------------------------------------

TITLE DirectoryCleaner v1.0.1. Copyright (c) 2009 Dmitry Ponomarev (e-mail: ponomarev.dev@gmail.com)

SET DIRECTORY=%temp%

ECHO Opening directory %DIRECTORY%...
CD /D %DIRECTORY% || GOTO FAILOPENDIR

:AMOUNT
SET NUMBER_OF_ENTITIES=0
FOR /D %%i IN (*) DO SET /A NUMBER_OF_ENTITIES=NUMBER_OF_ENTITIES+1
FOR %%i IN (*) DO SET /A NUMBER_OF_ENTITIES=NUMBER_OF_ENTITIES+1
IF %NUMBER_OF_ENTITIES% GTR 0 (
	GOTO LIST
) ELSE (
	ECHO Directory empty
	GOTO END
)

:LIST
ECHO Directory contents:
ECHO.
DIR /B /O:N
ECHO.

:ACTION
ECHO Do you really want to remove %NUMBER_OF_ENTITIES% entities [Y/n]%?
SET /P CONFIRMATION=
IF /I "%CONFIRMATION%"=="y" (
	GOTO PROCESS
) ELSE (
	GOTO IMMEDIATE_END
)

:PROCESS
CLS
ECHO Do...
SET REMOVED_DIRS=0
SET REMOVED_FILES=0
FOR /D %%i IN (*) DO (
	IF "%~nx0" NEQ "%%i" (
		RD /S /Q "%%i" && SET /A REMOVED_DIRS=REMOVED_DIRS+1
	)
)
FOR %%i IN (*) DO (
	IF "%~nx0" NEQ "%%i" (
		DEL /F /Q "%%i" && SET /A REMOVED_FILES=REMOVED_FILES+1
	)
)
SET /A TOTAL_REMOVED=REMOVED_DIRS+REMOVED_FILES
CLS
ECHO Done.
ECHO Removed directories: %REMOVED_DIRS%; removed files: %REMOVED_FILES%; total removed: %TOTAL_REMOVED%.
GOTO AMOUNT

:FAILOPENDIR
CLS
ECHO ERROR: Failed to open directory %DIRECTORY%
GOTO END

:END
PAUSE

:IMMEDIATE_END
EXIT /B

Update for semantic versioning

Update for semantic versioning


@rem make sure node-gyp is on PATH
call npm install node-gyp -g
set BASE=%cd%
@ rem - NODE_PATH only seems to work with forward slashs
set NODE_PATH=%BASE%\lib
@rem put local copy of node-pre-gyp on PATH
set PATH=%BASE%\bin;%PATH%
call node-pre-gyp -C test/app1 clean
call node-pre-gyp -C test/app1 unpublish build package testpackage publish info
call node-pre-gyp -C test/app1 clean install
cd test/app1
call npm test
cd %BASE%
@rem node bin/node-pre-gyp -C test/app1 unpublish build package testpackage publish info --target_arch=x64
node node-pre-gyp -C test/app2 unpublish build package testpackage publish info --custom_include_path=%BASE%\test\app2\include
cd test/app2
call npm test
cd %BASE%
call node-pre-gyp -C test/app3 unpublish build package testpackage publish info
cd test/app3
call npm test
cd %BASE%
call node-pre-gyp -C test/app4 unpublish build package testpackage publish info
cd test/app4
call npm test
cd %BASE%

@rem make sure node-gyp is on PATH
call npm install node-gyp -g
set BASE=%cd%
@ rem - NODE_PATH only seems to work with forward slashs
set NODE_PATH=%BASE%\lib
@rem put local copy of node-pre-gyp on PATH
set PATH=%BASE%\bin;%PATH%
call node-pre-gyp -C test/app1 clean
call node-pre-gyp -C test/app1 unpublish build package testpackage publish info
call node-pre-gyp -C test/app1 clean install
cd test/app1
call npm test
cd %BASE%
call node-pre-gyp -C test/app2 unpublish build package testpackage publish info --custom_include_path=%BASE%\test\app2\include
cd test/app2
call npm test
cd %BASE%
call node-pre-gyp -C test/app3 unpublish build package testpackage publish info
cd test/app3
call npm test
cd %BASE%
call node-pre-gyp -C test/app4 unpublish build package testpackage publish info
cd test/app4
call npm test
cd %BASE%

fix test.bat typo

fix test.bat typo


set CFG=%USERPROFILE%\pydistutils.cfg
echo [config] > "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build_ext] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"

"%PYTHON%" setup.py install --single-version-externally-managed
if errorlevel 1 exit 1

set CFG=%USERPROFILE%\pydistutils.cfg
echo [config] > "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build_ext] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"

"%PYTHON%" -m pip install . --no-deps -vv
if errorlevel 1 exit 1

Replace setup.py by pip install.

Replace setup.py by pip install.


@echo off
cd ext\cpputest
del /Q cpputest_build\*.*
cd cpputest_build
cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DCOVERAGE=OFF -DMEMORY_LEAK_DETECTION=ON ..
mingw32-make
mingw32-make install
cd ..\..\..

add script building cpputest for win

add script building cpputest for win


@echo off

set CURDIR=%CD%

cd /d %~dp0

rem Create Makefile by MakeItSo =======================================

..\3rdparty\makeitso\output\MakeItSo.exe -file=makefile.sln -config=MakeItSo.config

rem Copy Makefie ======================================================
xcopy /Y /D ..\vs2015\*.makefile .\

cd /d %CURDIR%

exit /b 0

:error
cd /d %CURDIR%
echo "Error====="
pause
exit /b 1

@echo off

set CURDIR=%CD%

cd /d %~dp0

rem Create Makefile by MakeItSo =======================================

..\3rdparty\makeitso\output\MakeItSo.exe -file=makefile.sln -config=MakeItSo.config -nl=crlf

rem Copy Makefie ======================================================
xcopy /Y /D ..\vs2015\*.makefile .\

cd /d %CURDIR%

exit /b 0

:error
cd /d %CURDIR%
echo "Error====="
pause
exit /b 1

Add option to specify line feed type.

Add option to specify line feed type.


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

set VSIX_ID=a10cf7af-5f0a-4502-b44b-51ff1b7c8a87
set VSIX_FILENAME=VsChromium.vsix

REM ---------------------------------------------------
REM Detect location of VSIXInstaller.exe
set VSIX_INSTALLER_PATH_2010=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
set VSIX_INSTALLER_PATH_2012=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
set VSIX_INSTALLER_PATH_2013=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
set VSIX_INSTALLER_PATH_2015=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
set VSIX_INSTALLER_PATH_2017=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE
set VSIX_INSTALLER_NAME=VSIXInstaller.exe

REM Order is important: Last (i.e. newer) one wins
if exist "%VSIX_INSTALLER_PATH_2010%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2010%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2012%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2012%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2013%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2013%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2015%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2015%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2017%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2017%\%VSIX_INSTALLER_NAME%

if "%VSIX_INSTALLER%"=="" goto installer_not_found

REM ---------------------------------------------------
REM Analyse command line arguments

if "%1"=="-u" goto uninstall

if "%1"x==x goto noconfig
set CONFIG_NAME=%1

if "%2"x==x goto nosku
if "%3"x==x goto nosku
set SKU_NAME=%2
set SKU_VERSION=%3
goto install

REM ---------------------------------------------------
REM End of program
goto end

REM ---------------------------------------------------
REM Uninstall
:uninstall
"%VSIX_INSTALLER%" /u:%VSIX_ID%
goto end

REM ---------------------------------------------------
REM Install
:install
REM ---------------------------------------------------
REM Detect location of VSIX file
set PROJECT_LOCATION=%~dp0
if exist "%PROJECT_LOCATION%Binaries\%CONFIG_NAME%\VsChromium.vsix" set VSIX_FILE="%PROJECT_LOCATION%Binaries\%CONFIG_NAME%\%VSIX_FILENAME%"
if "%VSIX_FILE%"=="" goto vsix_file_not_found

"%VSIX_INSTALLER%" /skuName:%SKU_NAME% /skuVersion:%SKU_VERSION% /u:%VSIX_ID%
"%VSIX_INSTALLER%" /skuName:%SKU_NAME% /skuVersion:%SKU_VERSION% %VSIX_FILE%
goto end

:noconfig
echo "You must specify Debug or Release as the config name."
goto end

:nosku
echo "You must specify Visual Studio SKU name and version (10.0 for VS 2010, 11.0 for VS 2012, 12.0 for VS 2013)."
goto end

:installer_not_found
echo "VSIXInstaller.exe not found in regular Visual Studio 2010 and 2012 installation path."
goto end

:vsix_file_not_found
echo "VSIX file not found in output directories."
goto end

:end

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

set VSIX_ID=a10cf7af-5f0a-4502-b44b-51ff1b7c8a87
set VSIX_FILENAME=VsChromium.vsix

REM ---------------------------------------------------
REM Detect location of VSIXInstaller.exe
set VSIX_INSTALLER_PATH_2010=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
set VSIX_INSTALLER_PATH_2012=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
set VSIX_INSTALLER_PATH_2013=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
set VSIX_INSTALLER_PATH_2015=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
set VSIX_INSTALLER_PATH_2017=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE
set VSIX_INSTALLER_NAME=VSIXInstaller.exe

REM Order is important: Last (i.e. newer) one wins
if exist "%VSIX_INSTALLER_PATH_2010%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2010%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2012%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2012%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2013%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2013%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2015%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2015%\%VSIX_INSTALLER_NAME%
if exist "%VSIX_INSTALLER_PATH_2017%\%VSIX_INSTALLER_NAME%" set VSIX_INSTALLER=%VSIX_INSTALLER_PATH_2017%\%VSIX_INSTALLER_NAME%

if "%VSIX_INSTALLER%"=="" goto installer_not_found

REM ---------------------------------------------------
REM Analyse command line arguments

if "%1"=="-u" goto uninstall

if "%1"x==x goto noconfig
set CONFIG_NAME=%1

if "%2"x==x goto nosku
if "%3"x==x goto nosku
set SKU_NAME=%2
set SKU_VERSION=%3
goto install

REM ---------------------------------------------------
REM End of program
goto end

REM ---------------------------------------------------
REM Uninstall
:uninstall
"%VSIX_INSTALLER%" /u:%VSIX_ID%
goto end

REM ---------------------------------------------------
REM Install
:install
REM ---------------------------------------------------
REM Detect location of VSIX file
set PROJECT_LOCATION=%~dp0..\
if exist "%PROJECT_LOCATION%Binaries\%CONFIG_NAME%\VsChromium.vsix" set VSIX_FILE="%PROJECT_LOCATION%Binaries\%CONFIG_NAME%\%VSIX_FILENAME%"
if "%VSIX_FILE%"=="" goto vsix_file_not_found

"%VSIX_INSTALLER%" /skuName:%SKU_NAME% /skuVersion:%SKU_VERSION% /u:%VSIX_ID%
"%VSIX_INSTALLER%" /skuName:%SKU_NAME% /skuVersion:%SKU_VERSION% %VSIX_FILE%
goto end

:noconfig
echo "You must specify Debug or Release as the config name."
goto end

:nosku
echo "You must specify Visual Studio SKU name and version (10.0 for VS 2010, 11.0 for VS 2012, 12.0 for VS 2013)."
goto end

:installer_not_found
echo "VSIXInstaller.exe not found in regular Visual Studio 2010 and 2012 installation path."
goto end

:vsix_file_not_found
echo "VSIX file not found in output directories."
goto end

:end

Fix batch file

Fix batch file


# This is for windows users only.
# If you're on a mac or linux, just run `ant build` from this folder in Terminal

set MYDIR=%~dp0
ant build

# This is for windows users only.
# If you're on a mac or linux, just run `ant build` from this folder in Terminal

set MYDIR=%~dp0
set ANT_OPTS=-D"file.encoding=UTF-8"
ant build

build script: set the default file encoding for ant. Closes #729.


@echo off
setlocal
setlocal EnableDelayedExpansion
setlocal EnableExtensions

set NG_TUBE_REPO=https://github.com/angularjs-foundation/video-app.git
set APP_DIR=application
set MODULES_DIR=hands-on-exercises
set MOD_START=1
set MOD_END=7

:CHECK_GIT_PATH
@echo Checking for Git in PATH
git > NUL 2>&1
if errorlevel 9009 if not errorlevel 9010 goto :GIT_NOT_FOUND

:NPM_INSTALL
@echo.
%COMSPEC% /C npm install

:DIR_CHECK
@echo.
@echo Checking for existing directory %MODULES_DIR%
if exist %MODULES_DIR% goto :MODULE_DIR_EXISTS
if exist %APP_DIR% goto :APP_DIR_EXISTS

@echo.
@echo Cloning ng-tube TO %APP_DIR%
git clone !NG_TUBE_REPO! !APP_DIR! -q

:APP_DIR_EXISTS
@echo.
mkdir %MODULES_DIR%

rem use git to get list of branches to cycle through (skips head)
cd %APP_DIR%
for /f "skip=1 tokens=2 delims=/" %%M in ('git branch -r') do @if "%%M" NEQ "master" (
 set CURRENT_MODULE_DIR=%MODULES_DIR%\%%M
 git checkout %%M -q
 mkdir ..\!CURRENT_MODULE_DIR!
 @xcopy *.* ..\!CURRENT_MODULE_DIR!\*.* /s /e /h /y /q
 @echo Downloaded %%M into !CURRENT_MODULE_DIR!
)
cd ..

goto :DONE

:MODULE_DIR_EXISTS
@echo ..The directory %MODULES_DIR% already exists, please remove first before running the installer.
goto :DONE

:GIT_NOT_FOUND
@ECHO ..Git wasn't found. If Git is installed as bash only, run the ./scripts/install.sh from git bash.

:DONE

@echo off
setlocal
setlocal EnableDelayedExpansion
setlocal EnableExtensions

set NG_TUBE_REPO=https://github.com/angularjs-foundation/video-app.git
set APP_DIR=application
set MODULES_DIR=hands-on-exercises
set MOD_START=1
set MOD_END=7

:CHECK_GIT_PATH
@echo Checking for Git in PATH
git > NUL 2>&1
if errorlevel 9009 if not errorlevel 9010 goto :GIT_NOT_FOUND

:NPM_INSTALL
@echo.
%COMSPEC% /C npm install

:DIR_CHECK
@echo.
@echo Checking for existing directory %MODULES_DIR%
if exist %MODULES_DIR% goto :MODULE_DIR_EXISTS
if exist %APP_DIR% goto :APP_DIR_EXISTS

@echo.
@echo Cloning ng-tube TO %APP_DIR%
git clone !NG_TUBE_REPO! !APP_DIR! -q

:APP_DIR_EXISTS
@echo.
mkdir %MODULES_DIR%

rem use git to get list of branches to cycle through (skips head)
if exist scripts\resdep.cmd del scripts\resdep.cmd
cd %APP_DIR%
for /f "skip=1 tokens=2 delims=/" %%M in ('git branch -r') do @if "%%M" NEQ "master" (
 set CURRENT_MODULE_DIR=%MODULES_DIR%\%%M
 git checkout %%M -q
 mkdir ..\!CURRENT_MODULE_DIR!
 @xcopy *.* ..\!CURRENT_MODULE_DIR!\*.* /s /e /h /y /q
 @echo @echo Running npm for module %%M >> ..\scripts\resdep.cmd
 @echo cd !CURRENT_MODULE_DIR! >> ..\scripts\resdep.cmd
 @echo cmd /c npm i --silent >> ..\scripts\resdep.cmd
 @echo cd .. >> ..\scripts\resdep.cmd
 @echo cd .. >> ..\scripts\resdep.cmd
 @echo Downloaded %%M into !CURRENT_MODULE_DIR!
)
@echo.
@echo Resolving dependencies
cd ..

scripts\resdep.cmd
goto :DONE

:MODULE_DIR_EXISTS
@echo ..The directory %MODULES_DIR% already exists, please remove first before running the installer.
goto :DONE

:GIT_NOT_FOUND
@ECHO ..Git wasn't found. If Git is installed as bash only, run the ./scripts/install.sh from git bash.

:DONE

Update install.cmd

Update install.cmd


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

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

CALL ..\svn-config.cmd

IF NOT EXIST "..\deps\" MKDIR "..\deps"

PUSHD ..\deps
ECHO Checking dependencies in %CD%

IF NOT EXIST "imports\" (
    svn co --username guest --password "" http://sharpsvn.open.collab.net/svn/sharpsvn/trunk/imports imports
)
IF NOT EXIST build\imports.done (
    svn up imports
    copy /y imports\dev-default.build default.build
    nant prep-dev %NANTARGS%
    IF ERRORLEVEL 1 (
        EXIT /B 1
    )
    del release\bin\*svn* release\bin\_*.* 2>nul:
    ECHO. > build\imports.done
)

POPD

PUSHD "%TEMP%"
IF NOT ERRORLEVEL 1 (
  rmdir /s /q "%TEMP%" 2> nul:
)
POPD

taskkill /im msbuild.exe /f 2> nul:
taskkill /im svn.exe /f 2> nul:
taskkill /im svnlook.exe /f 2> nul:
taskkill /im svnadmin.exe /f 2> nul:
taskkill /im svnserve.exe /f 2> nul:
taskkill /im svnrdump.exe /f 2> nul:
taskkill /im svnsync.exe /f 2> nul:
taskkill /im httpd.exe /f 2> nul:
taskkill /im client-test.exe /f 2> nul:
taskkill /im fs-test.exe /f 2> nul:
taskkill /im op-depth-test.exe /f 2> nul:
taskkill /im atomic-ra-revprop-change.exe /f 2> nul:
taskkill /im java.exe /f 2> nul:
taskkill /im perl.exe /f 2> nul:
taskkill /im ruby.exe /f 2> nul:
taskkill /im mspdbsrv.exe /f 2> nul:

IF EXIST "%TESTDIR%\swig\" (
    rmdir /s /q "%TESTDIR%\swig"
)

IF EXIST "%TESTDIR%\tests\" (
    PUSHD "%TESTDIR%\tests\"
    rmdir /s /q "%TESTDIR%\tests\" 2> nul:
    POPD
)

exit /B 0

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

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

CALL ..\svn-config.cmd

IF NOT EXIST "..\deps\" MKDIR "..\deps"

PUSHD ..\deps
ECHO Checking dependencies in %CD%

IF NOT EXIST "imports\" (
    svn co --username guest --password "" https://ctf.open.collab.net/svn/repos/sharpsvn/trunk/imports imports
)
IF NOT EXIST build\imports.done (
    svn up imports
    copy /y imports\dev-default.build default.build
    nant prep-dev %NANTARGS%
    IF ERRORLEVEL 1 (
        EXIT /B 1
    )
    del release\bin\*svn* release\bin\_*.* 2>nul:
    ECHO. > build\imports.done
)

POPD

PUSHD "%TEMP%"
IF NOT ERRORLEVEL 1 (
  rmdir /s /q "%TEMP%" 2> nul:
)
POPD

taskkill /im msbuild.exe /f 2> nul:
taskkill /im svn.exe /f 2> nul:
taskkill /im svnlook.exe /f 2> nul:
taskkill /im svnadmin.exe /f 2> nul:
taskkill /im svnserve.exe /f 2> nul:
taskkill /im svnrdump.exe /f 2> nul:
taskkill /im svnsync.exe /f 2> nul:
taskkill /im httpd.exe /f 2> nul:
taskkill /im client-test.exe /f 2> nul:
taskkill /im fs-test.exe /f 2> nul:
taskkill /im op-depth-test.exe /f 2> nul:
taskkill /im atomic-ra-revprop-change.exe /f 2> nul:
taskkill /im java.exe /f 2> nul:
taskkill /im perl.exe /f 2> nul:
taskkill /im ruby.exe /f 2> nul:
taskkill /im mspdbsrv.exe /f 2> nul:

IF EXIST "%TESTDIR%\swig\" (
    rmdir /s /q "%TESTDIR%\swig"
)

IF EXIST "%TESTDIR%\tests\" (
    PUSHD "%TESTDIR%\tests\"
    rmdir /s /q "%TESTDIR%\tests\" 2> nul:
    POPD
)

exit /B 0

Update SharpSvn repository url

Update SharpSvn repository url

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1576161 13f79535-47bb-0310-9956-ffa450edef68


java -jar C:\Softwares\opengrok-0.12.1\lib\opengrok.jar -W C:\Softwares\opengrok-0.12.1\configuration.xml -c C:\Softwares\ctags58\ctags.exe -P -S -v -s D:\Users\qianhao_huang.ASUS\opengrok_projects -d C:\Softwares\opengrok-0.12.1

add opengork.bat for windows

add opengork.bat for windows


rem すべてリビルドした後実行する
SET OUTPUT=..\..\Tools
mkdir %OUTPUT%
copy /y bin\debug\readme.txt %OUTPUT%
copy /y bin\debug\Gochiusearch.exe %OUTPUT%
copy /y bin\debug\index.db %OUTPUT%
copy /y bin\debug\index.txt %OUTPUT%

copy /y ..\CreateIndex\bin\debug\CreateIndex.exe %OUTPUT%
copy /y ..\CreateIndex\Script\avi2jpg.bat %OUTPUT%
copy /y ..\CreateIndex\Script\repeat.bat %OUTPUT%
copy /y ..\CreateIndex\Script\readme-index.txt %OUTPUT%
copy /y ..\CreateDb\bin\debug\CreateDb.exe %OUTPUT%

copy /y ..\ImageSearchEngine\bin\debug\ImageSearchEngine.dll %OUTPUT%

Remove comment and the BOM in file `copytools.bat`


Fix servefiles to work anywhere

Fix servefiles to work anywhere


@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 $Rev$ $Date$
@REM --------------------------------------------------------------------

@REM --------------------------------------------------------------------
@REM Set environment variables relating to the execution of java commands
@REM
@REM This batch file is called by the geronimo.bat file (which is
@REM invoked by the startup.bat, shutdown.bat files).  This file is
@REM also invoked by the deploy.bat file.
@REM
@REM It is preferable (to simplify migration to future Geronimo releases)
@REM to set any environment variables you need in the setenv.bat file
@REM rather than modifying Geronimo's script files.  See the documentation
@REM in the geronimo.bat file for further information.
@REM
@REM (Based upon Apache Tomcat 5.5.12's setclasspath.bat although modified
@REM to be more consistent with the shell script version's support of
@REM JDK_HOME and JRE_HOME)
@REM
@REM --------------------------------------------------------------------

@REM Begin all @REM lines with '@' in case GERONIMO_BATCH_ECHO is 'on'
@if "%GERONIMO_BATCH_ECHO%" == "on"  echo on
@if not "%GERONIMO_BATCH_ECHO%" == "on"  echo off

@REM Handle spaces in provided paths.  Also strips off quotes.
if defined var JAVA_HOME(
set JAVA_HOME=###%JAVA_HOME%###
set JAVA_HOME=%JAVA_HOME:"###=%
set JAVA_HOME=%JAVA_HOME:###"=%
set JAVA_HOME=%JAVA_HOME:###=%
@)
if defined var JRE_HOME(
set JRE_HOME=###%JRE_HOME%###
set JRE_HOME=%JRE_HOME:"###=%
set JRE_HOME=%JRE_HOME:###"=%
set JRE_HOME=%JRE_HOME:###=%
@)

@REM check that either JAVA_HOME or JRE_HOME are set
set jdkOrJreHomeSet=0
if not "%JAVA_HOME%" == "" set jdkOrJreHomeSet=1
if not "%JRE_HOME%" == "" set jdkOrJreHomeSet=1
if "%jdkOrJreHomeSet%" == "1" goto gotJdkOrJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
set ERRORLEVEL=1
goto end

@REM If we get this far we have either JAVA_HOME or JRE_HOME set
@REM now check whether the command requires the JDK and if so
@REM check that JAVA_HOME is really pointing to the JDK files.
:gotJdkOrJreHome
set _REQUIRE_JDK=0
if "%1" == "debug" set _REQUIRE_JDK=1
if "%_REQUIRE_JDK%" == "0" goto okJdkFileCheck

set jdkNotFound=0
if not exist "%JAVA_HOME%\bin\java.exe" set jdkNotFound=1
if not exist "%JAVA_HOME%\bin\javaw.exe" set jdkNotFound=1
if not exist "%JAVA_HOME%\bin\jdb.exe" set jdkNotFound=1
if not exist "%JAVA_HOME%\bin\javac.exe" set jdkNotFound=1
if %jdkNotFound% == 0 goto okJdkFileCheck
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
echo NB: JAVA_HOME should point to a JDK not a JRE
set ERRORLEVEL=1
goto end

:okJdkFileCheck
@REM default JRE_HOME to JAVA_HOME if not set.
if "%JRE_HOME%" == "" set JRE_HOME=%JAVA_HOME%\jre

@REM Set standard command for invoking Java.
@REM Note that NT requires a window name argument when using start.
@REM Also note the quoting as JAVA_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java"
set _RUNJAVAW="%JRE_HOME%\bin\javaw"
set _RUNJDB="%JAVA_HOME%\bin\jdb"

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

@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 $Rev$ $Date$
@REM --------------------------------------------------------------------

@REM --------------------------------------------------------------------
@REM Set environment variables relating to the execution of java commands
@REM
@REM This batch file is called by the geronimo.bat file (which is
@REM invoked by the startup.bat, shutdown.bat files).  This file is
@REM also invoked by the deploy.bat file.
@REM
@REM It is preferable (to simplify migration to future Geronimo releases)
@REM to set any environment variables you need in the setenv.bat file
@REM rather than modifying Geronimo's script files.  See the documentation
@REM in the geronimo.bat file for further information.
@REM
@REM (Based upon Apache Tomcat 5.5.12's setclasspath.bat although modified
@REM to be more consistent with the shell script version's support of
@REM JDK_HOME and JRE_HOME)
@REM
@REM --------------------------------------------------------------------

@REM Begin all @REM lines with '@' in case GERONIMO_BATCH_ECHO is 'on'
@if "%GERONIMO_BATCH_ECHO%" == "on"  echo on
@if not "%GERONIMO_BATCH_ECHO%" == "on"  echo off

@REM Handle spaces in provided paths.  Also strips off quotes.
if defined var JAVA_HOME(
set JAVA_HOME=###%JAVA_HOME%###
set JAVA_HOME=%JAVA_HOME:"###=%
set JAVA_HOME=%JAVA_HOME:###"=%
set JAVA_HOME=%JAVA_HOME:###=%
@)
if defined var JRE_HOME(
set JRE_HOME=###%JRE_HOME%###
set JRE_HOME=%JRE_HOME:"###=%
set JRE_HOME=%JRE_HOME:###"=%
set JRE_HOME=%JRE_HOME:###=%
@)

@REM check that either JAVA_HOME or JRE_HOME are set
set jdkOrJreHomeSet=0
if not "%JAVA_HOME%" == "" set jdkOrJreHomeSet=1
if not "%JRE_HOME%" == "" set jdkOrJreHomeSet=1
if "%jdkOrJreHomeSet%" == "1" goto gotJdkOrJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
set ERRORLEVEL=1
goto end

@REM If we get this far we have either JAVA_HOME or JRE_HOME set
@REM now check whether the command requires the JDK and if so
@REM check that JAVA_HOME is really pointing to the JDK files.
:gotJdkOrJreHome
set _REQUIRE_JDK=0
if "%1" == "debug" set _REQUIRE_JDK=1
if "%_REQUIRE_JDK%" == "0" goto okJdkFileCheck

set jdkNotFound=0
if not exist "%JAVA_HOME%\bin\java.exe" set jdkNotFound=1
if not exist "%JAVA_HOME%\bin\javaw.exe" set jdkNotFound=1
if not exist "%JAVA_HOME%\bin\jdb.exe" set jdkNotFound=1
if not exist "%JAVA_HOME%\bin\javac.exe" set jdkNotFound=1
if %jdkNotFound% == 0 goto okJdkFileCheck
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
echo NB: JAVA_HOME should point to a JDK not a JRE
set ERRORLEVEL=1
goto end

:okJdkFileCheck
@REM default JRE_HOME to JAVA_HOME if not set.
if "%JRE_HOME%" == "" if exist "%JAVA_HOME%\bin\javac.exe" (set JRE_HOME=%JAVA_HOME%\jre) else set JRE_HOME=%JAVA_HOME%

@REM Set standard command for invoking Java.
@REM Note that NT requires a window name argument when using start.
@REM Also note the quoting as JAVA_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java"
set _RUNJAVAW="%JRE_HOME%\bin\javaw"
set _RUNJDB="%JAVA_HOME%\bin\jdb"

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

Allow JAVA_HOME to point to a JRE in Windows OS. Patch from Jack Cai (GERONIMO-4462)

git-svn-id: 0d16bf2c240b8111500ec482b35765e5042f5526@725730 13f79535-47bb-0310-9956-ffa450edef68


:: Copyright by SyneArt <sa@syneart.com>
@echo off&cls&title InstallTheme&color 0F&mode con cols=38 lines=10
setlocal enableextensions enabledelayedexpansion
echo.&echo.&echo.&echo.&echo Install Theme Now , Please Wait ..
set texPath=nul

REM For TeXLive
call tlmgr --version 1>nul 2>&1 && (
	for /f "tokens=1* delims=:" %%a in ('tlmgr --version') do (
		if "%%a"=="tlmgr using installation" (
			set texPath="%%b"&set texPath=!texPath:" =!
			set texPath=!texPath:"=!
		)
	)
	set texPath=!texPath!\texmf-dist\tex\latex\beamer\
	call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
	texhash >nul 2>&1
	if !errorlevel!==1 (call:checkError&goto exit)
)

REM For MiKTeX
call initexmf --version 1>nul 2>&1 && (
	for /f "tokens=1* delims=:" %%a in ('initexmf --report') do (
		if "%%a"=="UserInstall" (
			set texPath="%%b"&set texPath=!texPath:" =!
			set texPath=!texPath:"=!
		)
	)
	set texPath=!texPath!\tex\latex\beamer\base\
	call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
	initexmf --admin --update-fndb >nul 2>&1
	if !errorlevel!==1 (call:checkError&goto exit)
)

if !texPath!==nul (
	cls&echo.&echo.&echo.&echo.&echo Please install LaTeX first.
	color E3&set /p=&goto exit
)

cls&echo.&echo.&echo.&echo.&echo Install Theme Successful ^^! :-P&color 2A&ping 127.0.0.1 -n 3 >nul&goto exit

:checkError
cls&echo.&echo.&echo.&echo.&echo Please stop LaTeX Compile first.
color 4C&set /p=

:copyFile
FOR /R %~1 %%c in (%~2) DO (
	set themesFile=%%c&set themesFile=!themesFile:%~dp0=!
	copy /Y "%%c" "!texPath!!themesFile!" >nul
)

:exit

:: Copyright by SyneArt <sa@syneart.com>
@echo off&cls&title InstallTheme&color 0F&mode con cols=38 lines=10
setlocal enableextensions enabledelayedexpansion
echo.&echo.&echo.&echo.&echo Install Theme Now , Please Wait ..
set texPath=nul

REM For TeXLive
call tlmgr --version 1>nul 2>&1 && (
	for /f "tokens=1* delims=:" %%a in ('tlmgr --version') do (
		if "%%a"=="tlmgr using installation" (
			set texPath="%%b"&set texPath=!texPath:" =!
			set texPath=!texPath:"=!
		)
	)
	set texPath=!texPath!\texmf-dist\tex\latex\beamer\
	call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
	if !errorlevel!==1 (call:checkCopyError&goto exit)
	texhash >nul 2>&1
	if !errorlevel!==1 (call:checkCompileError&goto exit)
)

REM For MiKTeX
call initexmf --version 1>nul 2>&1 && (
	for /f "tokens=1* delims=." %%a in ('findexe initexmf.exe') do (
		echo %%a | FINDSTR "initexmf" 1>nul 2>&1 && set texPath=%%a
	)
	set texPath=!texPath:\miktex\bin\initexmf=!
	set texPath=!texPath!\tex\latex\beamer\base\
	call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
	if !errorlevel!==1 (call:checkCopyError&goto exit)
	initexmf --admin --update-fndb >nul 2>&1
	if !errorlevel!==1 (call:checkCompileError&goto exit)
)

if !texPath!==nul (
	cls&echo.&echo.&echo.&echo.&echo Please install LaTeX first.
	color E3&set /p=&goto exit
)

cls&echo.&echo.&echo.&echo.&echo Install Theme Successful ^^! :-P&color 2A&ping 127.0.0.1 -n 3 >nul&goto exit

:checkCopyError
cls&echo.&echo.&echo.&echo.&echo LaTeX Path Error, please feedback.
color 4C&set /p=&goto exit

:checkCompileError
cls&echo.&echo.&echo.&echo.&echo Please stop LaTeX Compile first.
color 4C&set /p=&goto exit

:copyFile
FOR /R %~1 %%c in (%~2) DO (
	set themesFile=%%c&set themesFile=!themesFile:%~dp0=!
	copy /Y "%%c" "!texPath!!themesFile!" 1>nul 2>&1
)

:exit

Fix MiKTeX path error and show more feedback msg.


修正：windows 下运行命令找不到数据文件的问题

修正：windows 下运行命令找不到数据文件的问题


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

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

call %NuGet% restore Com.Ericmas001.XmTemplating\packages.config -OutputDirectory %cd%\packages -NonInteractive
msbuild XmTemplating.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=diag /nr:false

mkdir Build
mkdir Build\lib
mkdir Build\lib\net40

%nuget% pack "XmTemplating.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

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

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

call %NuGet% restore XmTemplating.sln -NonInteractive
msbuild XmTemplating.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=diag /nr:false

mkdir Build
mkdir Build\lib
mkdir Build\lib\net40

%nuget% pack "XmTemplating.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

Test project not building properly

Test project not building properly


@echo off
SET modulelist=functions
SET release=release\mew
if not exist %modulelist% goto nodir
type nul > %release%
for /f %%a in (tib-list) do (
	if not exist %modulelist%\%%a (
		echo MODULE %%a NOT FOUND
		goto fail
	)

	echo COPYING MODULE %%a TO RELEASE FILE
	type %modulelist%\%%a >> %release%
	;Add end of line
	echo. >> %release%
)
goto success
:success
echo SUCCESS
goto end
:fail
goto end
:nodir
echo NO MODULE DIRECTORY FOUND.
goto end
:end
pause
exit

Rename build.bat

Rename build.bat


@echo off
set FRAMEWORK_PATH=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
set PATH=%PATH%;%FRAMEWORK_PATH%;

:target_config
set TARGET_CONFIG=Release
IF x==%1x goto framework_version
set TARGET_CONFIG=%1

:framework_version
set FRAMEWORK_VERSION=v4.0
set ILMERGE_VERSION=v4,%FRAMEWORK_PATH%
if x==%2x goto build
set FRAMEWORK_VERSION=%2
set ILMERGE_VERSION=%3

:build
if exist output ( rmdir /s /q output )
if exist output ( rmdir /s /q output )

mkdir output
mkdir output\bin

echo === COMPILING ===
echo Compiling / Target: %FRAMEWORK_VERSION% / Config: %TARGET_CONFIG%
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /p:TargetFrameworkVersion=%FRAMEWORK_VERSION%

echo.
echo === TESTS ===
echo Unit Tests
"bin/machine.specifications-bin/.NET 4.0/mspec.exe" src/tests/EventStore.Core.UnitTests/bin/%TARGET_CONFIG%/EventStore.Core.UnitTests.dll
echo Acceptance Tests
"bin/machine.specifications-bin/.NET 4.0/mspec.exe" src/tests/EventStore.Persistence.AcceptanceTests/bin/%TARGET_CONFIG%/EventStore.Persistence.AcceptanceTests.dll
call acceptance-serialization.cmd

echo.
echo === MERGING ===
echo Merging Primary Assembly
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore\bin\%TARGET_CONFIG%\EventStore.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Core\bin\%TARGET_CONFIG%\EventStore.Core.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Serialization\bin\%TARGET_CONFIG%\EventStore.Serialization.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.SqlPersistence\bin\%TARGET_CONFIG%\EventStore.Persistence.SqlPersistence.dll"
(echo.|set /p =EventStore.*)>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.dll %FILES_TO_MERGE%
del exclude.txt

echo Rereferencing Merged Assembly
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /p:ILMerge=true /p:TargetFrameworkVersion=%FRAMEWORK_VERSION%

echo Merging Mongo Persistence
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.MongoPersistence\bin\%TARGET_CONFIG%\EventStore.Persistence.MongoPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.MongoPersistence\bin\%TARGET_CONFIG%\MongoDB*.dll"
echo EventStore.*>exclude.txt
(echo.|set /p =MongoDB.*)>>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.Persistence.MongoPersistence.dll %FILES_TO_MERGE%
del exclude.txt

echo Merging Raven Persistence
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\EventStore.Persistence.RavenPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\MissingBitsFromClientProfile.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\Newtonsoft*.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\Raven*.dll"
echo EventStore.*>exclude.txt
(echo.|set /p =Raven.*)>>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.Persistence.RavenPersistence.dll %FILES_TO_MERGE%
del exclude.txt

echo Merging Json Serialization
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Serialization.Json\bin\%TARGET_CONFIG%\EventStore.Serialization.Json.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Serialization.Json\bin\%TARGET_CONFIG%\Newtonsoft.Json*.dll"
(echo.|set /p =EventStore.*)>>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.Serialization.Json.dll %FILES_TO_MERGE%
del exclude.txt

echo.
echo === FINALIZING ===
echo Copying
mkdir output\doc
copy doc\*.* output\doc
copy "lib\Json.NET\license.txt" "output\doc\Newtonsoft Json.NET license.txt"

echo.
echo === CLEANUP ===
echo Cleaning Build
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean

echo.
echo === DONE ===

@echo off
set FRAMEWORK_PATH=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
set PATH=%PATH%;%FRAMEWORK_PATH%;

:target_config
set TARGET_CONFIG=Release
IF x==%1x goto framework_version
set TARGET_CONFIG=%1

:framework_version
set FRAMEWORK_VERSION=v4.0
set ILMERGE_VERSION=v4,%FRAMEWORK_PATH%
if x==%2x goto build
set FRAMEWORK_VERSION=%2
set ILMERGE_VERSION=%3

:build
if exist output ( rmdir /s /q output )
if exist output ( rmdir /s /q output )
if exist publish ( rmdir /s /q publish )
if exist publish ( rmdir /s /q publish )

mkdir output
mkdir output\bin

echo === COMPILING ===
echo Compiling / Target: %FRAMEWORK_VERSION% / Config: %TARGET_CONFIG%
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /p:TargetFrameworkVersion=%FRAMEWORK_VERSION%

echo.
echo === TESTS ===
echo Unit Tests
"bin/machine.specifications-bin/.NET 4.0/mspec.exe" src/tests/EventStore.Core.UnitTests/bin/%TARGET_CONFIG%/EventStore.Core.UnitTests.dll
echo Acceptance Tests
"bin/machine.specifications-bin/.NET 4.0/mspec.exe" src/tests/EventStore.Persistence.AcceptanceTests/bin/%TARGET_CONFIG%/EventStore.Persistence.AcceptanceTests.dll
call acceptance-serialization.cmd

echo.
echo === MERGING ===
echo Merging Primary Assembly
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore\bin\%TARGET_CONFIG%\EventStore.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Core\bin\%TARGET_CONFIG%\EventStore.Core.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Serialization\bin\%TARGET_CONFIG%\EventStore.Serialization.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.SqlPersistence\bin\%TARGET_CONFIG%\EventStore.Persistence.SqlPersistence.dll"
(echo.|set /p =EventStore.*)>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.dll %FILES_TO_MERGE%
del exclude.txt

echo Rereferencing Merged Assembly
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /p:ILMerge=true /p:TargetFrameworkVersion=%FRAMEWORK_VERSION%

echo Merging Mongo Persistence
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.MongoPersistence\bin\%TARGET_CONFIG%\EventStore.Persistence.MongoPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.MongoPersistence\bin\%TARGET_CONFIG%\MongoDB*.dll"
echo EventStore.*>exclude.txt
(echo.|set /p =MongoDB.*)>>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.Persistence.MongoPersistence.dll %FILES_TO_MERGE%
del exclude.txt

echo Merging Raven Persistence
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\EventStore.Persistence.RavenPersistence.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\MissingBitsFromClientProfile.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\Newtonsoft*.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Persistence.RavenPersistence\bin\%TARGET_CONFIG%\Raven*.dll"
echo EventStore.*>exclude.txt
(echo.|set /p =Raven.*)>>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.Persistence.RavenPersistence.dll %FILES_TO_MERGE%
del exclude.txt

echo Merging Json Serialization
set FILES_TO_MERGE=
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Serialization.Json\bin\%TARGET_CONFIG%\EventStore.Serialization.Json.dll"
set FILES_TO_MERGE=%FILES_TO_MERGE% "src\proj\EventStore.Serialization.Json\bin\%TARGET_CONFIG%\Newtonsoft.Json*.dll"
(echo.|set /p =EventStore.*)>>exclude.txt
bin\ilmerge-bin\ILMerge.exe /keyfile:src/EventStore.snk /internalize:"exclude.txt" /xmldocs /wildcards /targetplatform:%ILMERGE_VERSION% /out:output/bin/EventStore.Serialization.Json.dll %FILES_TO_MERGE%
del exclude.txt

echo.
echo === FINALIZING ===
echo Copying
mkdir output\doc
copy doc\*.* output\doc
copy "lib\Json.NET\license.txt" "output\doc\Newtonsoft Json.NET license.txt"

move output publish

echo.
echo === CLEANUP ===
echo Cleaning Build
msbuild /nologo /verbosity:quiet src/EventStore.sln /p:Configuration=%TARGET_CONFIG% /t:Clean

echo.
echo === DONE ===

Build output placed into 'publish' directory.


@echo off
cls
"build\tools\nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion" "-version" "3.14.9"
"packages\FAKE\tools\Fake.exe" build\build.fsx

@echo off
cls
"build\tools\nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion" "-version" "3.17.0"
"packages\FAKE\tools\Fake.exe" build\build.fsx

update build script

update build script


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

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\Terrarium.Sdk.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=diag /nr:false

mkdir Build
mkdir Build\lib
mkdir Build\lib\net40

%nuget% pack "DynamicProperty.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

build file

build file