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

set TSAN_PATH=%~dp0..\..\third_party\tsan
set TSAN_SFX=%TSAN_PATH%\tsan-x86-windows-sfx.exe
if EXIST %TSAN_SFX% GOTO BINARY_OK
echo "Can't find ThreadSanitizer executables."
echo "See http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer/threadsanitizer-on-windows"
echo "for the instructions on how to get them."
set %ERRORLEVEL% 1
goto :EOF

:BINARY_OK
%TSAN_SFX% -o%TSAN_PATH%\unpacked -y
set PIN_COMMAND=%TSAN_PATH%\unpacked\tsan-x86-windows\tsan.bat
set PYTHONPATH=%~dp0../python/google
python %~dp0/chrome_tests.py %*

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

set THISDIR=%~dp0
set TOOL_NAME="unknown"

:: Get the tool name and put it into TOOL_NAME {{{1
:: NB: SHIFT command doesn't modify %*
:PARSE_ARGS_LOOP
  if %1 == () GOTO:TOOLNAME_NOT_FOUND
  if %1 == --tool GOTO:TOOLNAME_FOUND
  SHIFT
  goto :PARSE_ARGS_LOOP

:TOOLNAME_NOT_FOUND
echo "Please specify a tool (tsan or drmemory) by using --tool flag"
set %ERRORLEVEL% 1
goto :EOF

:TOOLNAME_FOUND
SHIFT
set TOOL_NAME=%1
:: }}}
if %TOOL_NAME% == drmemory GOTO :SETUP_DRMEMORY
if %TOOL_NAME% == tsan     GOTO :SETUP_TSAN
echo "Unknown tool: %TOOL_NAME%! Only tsan and drmemory are supported right now"
set %ERRORLEVEL% 1
goto :EOF

:SETUP_DRMEMORY
:: Set up DRMEMORY_COMMAND to invoke Dr. Memory {{{1
set DRMEMORY_PATH=%THISDIR%..\..\third_party\drmemory
set DRMEMORY_SFX=%DRMEMORY_PATH%\drmemory-windows-sfx.exe
if EXIST %DRMEMORY_SFX% GOTO DRMEMORY_BINARY_OK
echo "Can't find Dr. Memory executables."
echo "See http://www.chromium.org/developers/how-tos/using-valgrind/dr-memory"
echo "for the instructions on how to get them."
set %ERRORLEVEL% 1
goto :EOF

:DRMEMORY_BINARY_OK
%DRMEMORY_SFX% -o%DRMEMORY_PATH%\unpacked -y
set DRMEMORY_COMMAND=%DRMEMORY_PATH%\unpacked\exports32\bin\drmemory.exe -dr %DRMEMORY_PATH%\unpacked\exports
:: }}}
goto :RUN_TESTS

:SETUP_TSAN
:: Set up PIN_COMMAND to invoke TSan {{{1
set TSAN_PATH=%THISDIR%..\..\third_party\tsan
set TSAN_SFX=%TSAN_PATH%\tsan-x86-windows-sfx.exe
if EXIST %TSAN_SFX% GOTO TSAN_BINARY_OK
echo "Can't find ThreadSanitizer executables."
echo "See http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer/threadsanitizer-on-windows"
echo "for the instructions on how to get them."
set %ERRORLEVEL% 1
goto :EOF

:TSAN_BINARY_OK
%TSAN_SFX% -o%TSAN_PATH%\unpacked -y
set PIN_COMMAND=%TSAN_PATH%\unpacked\tsan-x86-windows\tsan.bat
:: }}}
goto :RUN_TESTS

:RUN_TESTS
set PYTHONPATH=%THISDIR%../python/google
set RUNNING_ON_VALGRIND=yes
python %THISDIR%/chrome_tests.py %*

Modify tools/valgrind/chrome_tests.bat to support Dr. Memory from deps/third_party
Review URL: http://codereview.chromium.org/3119050

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@57518 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


@echo off
@setlocal

set NuGetExe="%~dp0NuGet.exe"

REM If someone passed in a different Roslyn solution, use that.
REM We make use of this when Roslyn is an sub-module for some
REM internal repositories.
set RoslynSolution=%1
if "%RoslynSolution%" == "" set RoslynSolution=%~dp0Roslyn.sln

echo Restoring packages: Toolsets
call %NugetExe% restore -verbosity quiet "%~dp0build\ToolsetPackages\project.json" -configfile "%~dp0nuget.config"

echo Restoring packages: Samples
call %NugetExe% restore -verbosity quiet "%~dp0src\Samples\Samples.sln" -configfile "%~dp0nuget.config"

echo Restoring packages: Roslyn (this may take some time)
call %NugetExe% restore -verbosity quiet "%RoslynSolution%Roslyn.sln" -configfile "%~dp0nuget.config"

@echo off
@setlocal

set NuGetExe="%~dp0NuGet.exe"

REM If someone passed in a different Roslyn solution, use that.
REM We make use of this when Roslyn is an sub-module for some
REM internal repositories.
set RoslynSolution=%1
if "%RoslynSolution%" == "" set RoslynSolution=%~dp0Roslyn.sln

echo Restoring packages: Toolsets
call %NugetExe% restore -verbosity quiet "%~dp0build\ToolsetPackages\project.json" -configfile "%~dp0nuget.config"

echo Restoring packages: Samples
call %NugetExe% restore -verbosity quiet "%~dp0src\Samples\Samples.sln" -configfile "%~dp0nuget.config"

echo Restoring packages: Roslyn (this may take some time)
call %NugetExe% restore -verbosity quiet "%RoslynSolution%" -configfile "%~dp0nuget.config"

Fix break with Restore.cmd

Fix break with Restore.cmd


Add helper to ease syncing TFS.

Add helper to ease syncing TFS.

git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS36]$/ResXResourceManager/Main;C37211


SET bin_dir=%~dp0
SET TOP_DIR=%bin_dir%\..\..\
SET build_type=%1
SET build_dir=%~f2
SET install=%3

CALL %bin_dir%\pre-require.cmd

IF "%build_type%" EQU "" SET build_type=Debug

IF "%build_dir%" EQU "" (
    CALL %bin_dir%\echoc.exe 4 please specify build_dir
    GOTO error
)

IF NOT "%VS120COMNTOOLS%"=="" (
    CALL "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
    SET cmake_target=Visual Studio 12 2013 Win64
    SET boost_lib=lib64-msvc-12.0
    SET boost_package_name=boost_1_57_0_vc12_amd64.7z
    SET boost_dir_name=boost_1_57_0
) ELSE (
    IF NOT "%VS140COMNTOOLS%"=="" (
        CALL "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
        SET cmake_target=Visual Studio 14 2015 Win64
        SET boost_lib=lib64-msvc-14.0
        SET boost_package_name=boost_1_59_0_vc14_amd64.7z
        SET boost_dir_name=boost_1_59_0
    )
)

IF "%cmake_target%"=="" (
    ECHO "error: Visusal studio 2013 or 2015 is not installed, please fix and try later"
    GOTO error
)

IF NOT EXIST "%build_dir%" mkdir %build_dir%

pushd %build_dir%

echo CALL %TOP_DIR%\ext\cmake-3.2.2\bin\cmake.exe .. -DCMAKE_BUILD_TYPE="%build_type%" -DBOOST_INCLUDEDIR="%TOP_DIR%\ext\%boost_dir_name%" -DBOOST_LIBRARYDIR="%TOP_DIR%\ext\%boost_dir_name%\%boost_lib%" -G "%cmake_target%"
CALL %TOP_DIR%\ext\cmake-3.2.2\bin\cmake.exe .. -DCMAKE_BUILD_TYPE="%build_type%" -DBOOST_INCLUDEDIR="%TOP_DIR%\ext\%boost_dir_name%" -DBOOST_LIBRARYDIR="%TOP_DIR%\ext\%boost_dir_name%\%boost_lib%" -G "%cmake_target%"

msbuild dsn.sln /p:Configuration=%build_type%
IF "%install%" NEQ "" (
    msbuild INSTALL.vcxproj /p:Configuration=%build_type%
)

popd
goto exit

:error
    CALL %bin_dir%\echoc.exe 4  "Usage: run.cmd build build_type(Debug|Release|RelWithDebInfo|MinSizeRel) build_dir [install]"

:exit

SET bin_dir=%~dp0
SET TOP_DIR=%bin_dir%\..\..\
SET build_type=%1
SET build_dir=%~f2
SET install=%3

CALL %bin_dir%\pre-require.cmd

IF "%build_type%" EQU "" SET build_type=Debug

IF "%build_dir%" EQU "" (
    CALL %bin_dir%\echoc.exe 4 please specify build_dir
    GOTO error
)

IF NOT "%VS120COMNTOOLS%"=="" (
    SET cmake_target=Visual Studio 12 2013 Win64
    SET boost_lib=lib64-msvc-12.0
    SET boost_package_name=boost_1_57_0_vc12_amd64.7z
    SET boost_dir_name=boost_1_57_0
) ELSE (
    IF NOT "%VS140COMNTOOLS%"=="" (
        SET cmake_target=Visual Studio 14 2015 Win64
        SET boost_lib=lib64-msvc-14.0
        SET boost_package_name=boost_1_59_0_vc14_amd64.7z
        SET boost_dir_name=boost_1_59_0
    )
)

IF "%cmake_target%"=="" (
    ECHO "error: Visusal studio 2013 or 2015 is not installed, please fix and try later"
    GOTO error
)

IF NOT EXIST "%build_dir%" mkdir %build_dir%

pushd %build_dir%

echo CALL %TOP_DIR%\ext\cmake-3.2.2\bin\cmake.exe .. -DCMAKE_BUILD_TYPE="%build_type%" -DBOOST_INCLUDEDIR="%TOP_DIR%\ext\%boost_dir_name%" -DBOOST_LIBRARYDIR="%TOP_DIR%\ext\%boost_dir_name%\%boost_lib%" -G "%cmake_target%"
CALL %TOP_DIR%\ext\cmake-3.2.2\bin\cmake.exe .. -DCMAKE_BUILD_TYPE="%build_type%" -DBOOST_INCLUDEDIR="%TOP_DIR%\ext\%boost_dir_name%" -DBOOST_LIBRARYDIR="%TOP_DIR%\ext\%boost_dir_name%\%boost_lib%" -G "%cmake_target%"

msbuild dsn.sln /p:Configuration=%build_type%
IF "%install%" NEQ "" (
    msbuild INSTALL.vcxproj /p:Configuration=%build_type%
)

popd
goto exit

:error
    CALL %bin_dir%\echoc.exe 4  "Usage: run.cmd build build_type(Debug|Release|RelWithDebInfo|MinSizeRel) build_dir [install]"

:exit

remove redundant cl init in build.cmd

remove redundant cl init in build.cmd


md include
md include\google
md include\google\protobuf
md include\google\protobuf\stubs
md include\google\protobuf\io
md include\google\protobuf\compiler
md include\google\protobuf\compiler\cpp
md include\google\protobuf\compiler\java
md include\google\protobuf\compiler\python
copy ..\google\protobuf\arena.h include\google\protobuf\arena.h
copy ..\google\protobuf\arenastring.h include\google\protobuf\arenastring.h
copy ..\google\protobuf\compiler\code_generator.h include\google\protobuf\compiler\code_generator.h
copy ..\google\protobuf\compiler\command_line_interface.h include\google\protobuf\compiler\command_line_interface.h
copy ..\google\protobuf\compiler\cpp\cpp_generator.h include\google\protobuf\compiler\cpp\cpp_generator.h
copy ..\google\protobuf\compiler\importer.h include\google\protobuf\compiler\importer.h
copy ..\google\protobuf\compiler\java\java_generator.h include\google\protobuf\compiler\java\java_generator.h
copy ..\google\protobuf\compiler\parser.h include\google\protobuf\compiler\parser.h
copy ..\google\protobuf\compiler\plugin.h include\google\protobuf\compiler\plugin.h
copy ..\google\protobuf\compiler\plugin.pb.h include\google\protobuf\compiler\plugin.pb.h
copy ..\google\protobuf\compiler\python\python_generator.h include\google\protobuf\compiler\python\python_generator.h
copy ..\google\protobuf\descriptor_database.h include\google\protobuf\descriptor_database.h
copy ..\google\protobuf\descriptor.h include\google\protobuf\descriptor.h
copy ..\google\protobuf\descriptor.pb.h include\google\protobuf\descriptor.pb.h
copy ..\google\protobuf\dynamic_message.h include\google\protobuf\dynamic_message.h
copy ..\google\protobuf\extension_set.h include\google\protobuf\extension_set.h
copy ..\google\protobuf\generated_enum_reflection.h include\google\protobuf\generated_enum_reflection.h
copy ..\google\protobuf\generated_message_reflection.h include\google\protobuf\generated_message_reflection.h
copy ..\google\protobuf\generated_message_util.h include\google\protobuf\generated_message_util.h
copy ..\google\protobuf\io\coded_stream.h include\google\protobuf\io\coded_stream.h
copy ..\google\protobuf\io\gzip_stream.h include\google\protobuf\io\gzip_stream.h
copy ..\google\protobuf\io\printer.h include\google\protobuf\io\printer.h
copy ..\google\protobuf\io\strtod.h include\google\protobuf\io\strtod.h
copy ..\google\protobuf\io\tokenizer.h include\google\protobuf\io\tokenizer.h
copy ..\google\protobuf\io\zero_copy_stream.h include\google\protobuf\io\zero_copy_stream.h
copy ..\google\protobuf\io\zero_copy_stream_impl.h include\google\protobuf\io\zero_copy_stream_impl.h
copy ..\google\protobuf\io\zero_copy_stream_impl_lite.h include\google\protobuf\io\zero_copy_stream_impl_lite.h
copy ..\google\protobuf\map_entry.h include\google\protobuf\map_entry.h
copy ..\google\protobuf\map_field.h include\google\protobuf\map_field.h
copy ..\google\protobuf\map_field_inl.h include\google\protobuf\map_field_inl.h
copy ..\google\protobuf\map.h include\google\protobuf\map.h
copy ..\google\protobuf\map_type_handler.h include\google\protobuf\map_type_handler.h
copy ..\google\protobuf\message.h include\google\protobuf\message.h
copy ..\google\protobuf\message_lite.h include\google\protobuf\message_lite.h
copy ..\google\protobuf\metadata.h include\google\protobuf\metadata.h
copy ..\google\protobuf\reflection.h include\google\protobuf\reflection.h
copy ..\google\protobuf\reflection_ops.h include\google\protobuf\reflection_ops.h
copy ..\google\protobuf\repeated_field.h include\google\protobuf\repeated_field.h
copy ..\google\protobuf\repeated_field_reflection.h include\google\protobuf\repeated_field_reflection.h
copy ..\google\protobuf\service.h include\google\protobuf\service.h
copy ..\google\protobuf\stubs\atomicops.h include\google\protobuf\stubs\atomicops.h
copy ..\google\protobuf\stubs\atomicops_internals_aix.h include\google\protobuf\stubs\atomicops_internals_aix.h
copy ..\google\protobuf\stubs\atomicops_internals_arm64_gcc.h include\google\protobuf\stubs\atomicops_internals_arm64_gcc.h
copy ..\google\protobuf\stubs\atomicops_internals_arm_gcc.h include\google\protobuf\stubs\atomicops_internals_arm_gcc.h
copy ..\google\protobuf\stubs\atomicops_internals_arm_qnx.h include\google\protobuf\stubs\atomicops_internals_arm_qnx.h
copy ..\google\protobuf\stubs\atomicops_internals_atomicword_compat.h include\google\protobuf\stubs\atomicops_internals_atomicword_compat.h
copy ..\google\protobuf\stubs\atomicops_internals_generic_gcc.h include\google\protobuf\stubs\atomicops_internals_generic_gcc.h
copy ..\google\protobuf\stubs\atomicops_internals_macosx.h include\google\protobuf\stubs\atomicops_internals_macosx.h
copy ..\google\protobuf\stubs\atomicops_internals_mips_gcc.h include\google\protobuf\stubs\atomicops_internals_mips_gcc.h
copy ..\google\protobuf\stubs\atomicops_internals_pnacl.h include\google\protobuf\stubs\atomicops_internals_pnacl.h
copy ..\google\protobuf\stubs\atomicops_internals_solaris.h include\google\protobuf\stubs\atomicops_internals_solaris.h
copy ..\google\protobuf\stubs\atomicops_internals_tsan.h include\google\protobuf\stubs\atomicops_internals_tsan.h
copy ..\google\protobuf\stubs\atomicops_internals_x86_gcc.h include\google\protobuf\stubs\atomicops_internals_x86_gcc.h
copy ..\google\protobuf\stubs\atomicops_internals_x86_msvc.h include\google\protobuf\stubs\atomicops_internals_x86_msvc.h
copy ..\google\protobuf\stubs\atomic_sequence_num.h include\google\protobuf\stubs\atomic_sequence_num.h
copy ..\google\protobuf\stubs\casts.h include\google\protobuf\stubs\casts.h
copy ..\google\protobuf\stubs\common.h include\google\protobuf\stubs\common.h
copy ..\google\protobuf\stubs\fastmem.h include\google\protobuf\stubs\fastmem.h
copy ..\google\protobuf\stubs\once.h include\google\protobuf\stubs\once.h
copy ..\google\protobuf\stubs\platform_macros.h include\google\protobuf\stubs\platform_macros.h
copy ..\google\protobuf\stubs\singleton.h include\google\protobuf\stubs\singleton.h
copy ..\google\protobuf\stubs\stl_util.h include\google\protobuf\stubs\stl_util.h
copy ..\google\protobuf\stubs\template_util.h include\google\protobuf\stubs\template_util.h
copy ..\google\protobuf\stubs\type_traits.h include\google\protobuf\stubs\type_traits.h
copy ..\google\protobuf\text_format.h include\google\protobuf\text_format.h
copy ..\google\protobuf\unknown_field_set.h include\google\protobuf\unknown_field_set.h
copy ..\google\protobuf\wire_format.h include\google\protobuf\wire_format.h
copy ..\google\protobuf\wire_format_lite.h include\google\protobuf\wire_format_lite.h
copy ..\google\protobuf\wire_format_lite_inl.h include\google\protobuf\wire_format_lite_inl.h

md include
md include\google
md include\google\protobuf
md include\google\protobuf\stubs
md include\google\protobuf\io
md include\google\protobuf\compiler
md include\google\protobuf\compiler\cpp
md include\google\protobuf\compiler\java
md include\google\protobuf\compiler\python
copy ..\src\google\protobuf\arena.h include\google\protobuf\arena.h
copy ..\src\google\protobuf\arenastring.h include\google\protobuf\arenastring.h
copy ..\src\google\protobuf\compiler\code_generator.h include\google\protobuf\compiler\code_generator.h
copy ..\src\google\protobuf\compiler\command_line_interface.h include\google\protobuf\compiler\command_line_interface.h
copy ..\src\google\protobuf\compiler\cpp\cpp_generator.h include\google\protobuf\compiler\cpp\cpp_generator.h
copy ..\src\google\protobuf\compiler\importer.h include\google\protobuf\compiler\importer.h
copy ..\src\google\protobuf\compiler\java\java_generator.h include\google\protobuf\compiler\java\java_generator.h
copy ..\src\google\protobuf\compiler\parser.h include\google\protobuf\compiler\parser.h
copy ..\src\google\protobuf\compiler\plugin.h include\google\protobuf\compiler\plugin.h
copy ..\src\google\protobuf\compiler\plugin.pb.h include\google\protobuf\compiler\plugin.pb.h
copy ..\src\google\protobuf\compiler\python\python_generator.h include\google\protobuf\compiler\python\python_generator.h
copy ..\src\google\protobuf\descriptor_database.h include\google\protobuf\descriptor_database.h
copy ..\src\google\protobuf\descriptor.h include\google\protobuf\descriptor.h
copy ..\src\google\protobuf\descriptor.pb.h include\google\protobuf\descriptor.pb.h
copy ..\src\google\protobuf\dynamic_message.h include\google\protobuf\dynamic_message.h
copy ..\src\google\protobuf\extension_set.h include\google\protobuf\extension_set.h
copy ..\src\google\protobuf\generated_enum_reflection.h include\google\protobuf\generated_enum_reflection.h
copy ..\src\google\protobuf\generated_message_reflection.h include\google\protobuf\generated_message_reflection.h
copy ..\src\google\protobuf\generated_message_util.h include\google\protobuf\generated_message_util.h
copy ..\src\google\protobuf\io\coded_stream.h include\google\protobuf\io\coded_stream.h
copy ..\src\google\protobuf\io\gzip_stream.h include\google\protobuf\io\gzip_stream.h
copy ..\src\google\protobuf\io\printer.h include\google\protobuf\io\printer.h
copy ..\src\google\protobuf\io\strtod.h include\google\protobuf\io\strtod.h
copy ..\src\google\protobuf\io\tokenizer.h include\google\protobuf\io\tokenizer.h
copy ..\src\google\protobuf\io\zero_copy_stream.h include\google\protobuf\io\zero_copy_stream.h
copy ..\src\google\protobuf\io\zero_copy_stream_impl.h include\google\protobuf\io\zero_copy_stream_impl.h
copy ..\src\google\protobuf\io\zero_copy_stream_impl_lite.h include\google\protobuf\io\zero_copy_stream_impl_lite.h
copy ..\src\google\protobuf\map_entry.h include\google\protobuf\map_entry.h
copy ..\src\google\protobuf\map_field.h include\google\protobuf\map_field.h
copy ..\src\google\protobuf\map_field_inl.h include\google\protobuf\map_field_inl.h
copy ..\src\google\protobuf\map.h include\google\protobuf\map.h
copy ..\src\google\protobuf\map_type_handler.h include\google\protobuf\map_type_handler.h
copy ..\src\google\protobuf\message.h include\google\protobuf\message.h
copy ..\src\google\protobuf\message_lite.h include\google\protobuf\message_lite.h
copy ..\src\google\protobuf\metadata.h include\google\protobuf\metadata.h
copy ..\src\google\protobuf\reflection.h include\google\protobuf\reflection.h
copy ..\src\google\protobuf\reflection_ops.h include\google\protobuf\reflection_ops.h
copy ..\src\google\protobuf\repeated_field.h include\google\protobuf\repeated_field.h
copy ..\src\google\protobuf\repeated_field_reflection.h include\google\protobuf\repeated_field_reflection.h
copy ..\src\google\protobuf\service.h include\google\protobuf\service.h
copy ..\src\google\protobuf\stubs\atomicops.h include\google\protobuf\stubs\atomicops.h
copy ..\src\google\protobuf\stubs\atomicops_internals_aix.h include\google\protobuf\stubs\atomicops_internals_aix.h
copy ..\src\google\protobuf\stubs\atomicops_internals_arm64_gcc.h include\google\protobuf\stubs\atomicops_internals_arm64_gcc.h
copy ..\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h include\google\protobuf\stubs\atomicops_internals_arm_gcc.h
copy ..\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h include\google\protobuf\stubs\atomicops_internals_arm_qnx.h
copy ..\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h include\google\protobuf\stubs\atomicops_internals_atomicword_compat.h
copy ..\src\google\protobuf\stubs\atomicops_internals_generic_gcc.h include\google\protobuf\stubs\atomicops_internals_generic_gcc.h
copy ..\src\google\protobuf\stubs\atomicops_internals_macosx.h include\google\protobuf\stubs\atomicops_internals_macosx.h
copy ..\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h include\google\protobuf\stubs\atomicops_internals_mips_gcc.h
copy ..\src\google\protobuf\stubs\atomicops_internals_pnacl.h include\google\protobuf\stubs\atomicops_internals_pnacl.h
copy ..\src\google\protobuf\stubs\atomicops_internals_solaris.h include\google\protobuf\stubs\atomicops_internals_solaris.h
copy ..\src\google\protobuf\stubs\atomicops_internals_tsan.h include\google\protobuf\stubs\atomicops_internals_tsan.h
copy ..\src\google\protobuf\stubs\atomicops_internals_x86_gcc.h include\google\protobuf\stubs\atomicops_internals_x86_gcc.h
copy ..\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h include\google\protobuf\stubs\atomicops_internals_x86_msvc.h
copy ..\src\google\protobuf\stubs\atomic_sequence_num.h include\google\protobuf\stubs\atomic_sequence_num.h
copy ..\src\google\protobuf\stubs\casts.h include\google\protobuf\stubs\casts.h
copy ..\src\google\protobuf\stubs\common.h include\google\protobuf\stubs\common.h
copy ..\src\google\protobuf\stubs\fastmem.h include\google\protobuf\stubs\fastmem.h
copy ..\src\google\protobuf\stubs\once.h include\google\protobuf\stubs\once.h
copy ..\src\google\protobuf\stubs\platform_macros.h include\google\protobuf\stubs\platform_macros.h
copy ..\src\google\protobuf\stubs\singleton.h include\google\protobuf\stubs\singleton.h
copy ..\src\google\protobuf\stubs\stl_util.h include\google\protobuf\stubs\stl_util.h
copy ..\src\google\protobuf\stubs\template_util.h include\google\protobuf\stubs\template_util.h
copy ..\src\google\protobuf\stubs\type_traits.h include\google\protobuf\stubs\type_traits.h
copy ..\src\google\protobuf\text_format.h include\google\protobuf\text_format.h
copy ..\src\google\protobuf\unknown_field_set.h include\google\protobuf\unknown_field_set.h
copy ..\src\google\protobuf\wire_format.h include\google\protobuf\wire_format.h
copy ..\src\google\protobuf\wire_format_lite.h include\google\protobuf\wire_format_lite.h
copy ..\src\google\protobuf\wire_format_lite_inl.h include\google\protobuf\wire_format_lite_inl.h

Fix vsprojects/extract_includes.bat

Fix vsprojects/extract_includes.bat


%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe pusher-dotnet-server.sln /t:Clean,Rebuild /p:Configuration=Release /fileLogger

if not exist Download\package\lib\net35 mkdir Download\package\lib\net35\

copy README.md Download\Package\lib\net35\

copy PusherServer\bin\Release\PusherServer.dll Download\Package\lib\net35\

copy PusherServer\bin\Release\PusherServer.xml Download\Package\lib\net35\

tools\nuget.exe update -self
tools\nuget.exe pack pusher-dotnet-server.nuspec -BasePath Download\Package -Output Download

%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe pusher-dotnet-server.sln /t:Clean,Rebuild /p:Configuration=Release /fileLogger

if exist Download\package rm -rf Download\package
if not exist Download\package\lib\net35 mkdir Download\package\lib\net35\s

copy README.md Download\Package\

copy PusherServer\bin\Release\PusherServer.dll Download\Package\lib\net35\

copy PusherServer\bin\Release\PusherServer.xml Download\Package\lib\net35\

tools\nuget.exe update -self
tools\nuget.exe pack pusher-dotnet-server.nuspec -BasePath Download\Package -Output Download

delete old package files

delete old package files


echo off
echo =====================================================================
echo Salt Windows Clean Script
echo =====================================================================
echo.

rem Make sure the script is run as Admin
echo Administrative permissions required. Detecting permissions...
echo ---------------------------------------------------------------------
net session >nul 2>&1
if %errorLevel%==0 (
    echo Success: Administrative permissions confirmed.
) else (
    echo Failure: This script must be run as Administrator
    goto eof
)
echo.

:CheckPython27
if exist "\Python27" goto RemovePython27

goto CheckPython35

:RemovePython27
    rem Uninstall Python 2.7
    echo %0 :: Uninstalling Python 2 ...
    echo ---------------------------------------------------------------------
    echo %0 :: - 2.7.12 (32 bit)
    MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C665} /QN
    echo %0 :: - 2.7.12 (64 bit)
    MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C666} /QN
    echo %0 :: - 2.7.13 (32 bit)
    MsiExec.exe /X {4A656C6C-D24A-473F-9747-3A8D00907A03} /QN
    echo %0 :: - 2.7.13 (64 bit)
    MsiExec.exe /X {4A656C6C-D24A-473F-9747-3A8D00907A04} /QN
    echo %0 :: - 2.7.14 (32 bit)
    MsiExec.exe /X {0398A685-FD8D-46B3-9816-C47319B0CF5E} /QN
    echo %0 :: - 2.7.14 (64 bit)
    MsiExec.exe /X {0398A685-FD8D-46B3-9816-C47319B0CF5F} /QN
    echo %0 :: - 2.7.15 (32 bit)
    MsiExec.exe /X {16CD92A4-0152-4CB7-8FD6-9788D3363616} /QN
    echo %0 :: - 2.7.15 (64 bit)
    MsiExec.exe /X {16CD92A4-0152-4CB7-8FD6-9788D3363617} /QN

    echo.

    rem Wipe the Python directory
    echo %0 :: Removing the C:\Python27 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q C:\Python27
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

:CheckPython35
if exist "\Python35" goto RemovePython35

goto CheckPython37

:RemovePython35
    echo %0 :: Uninstalling Python 3 ...
    echo ---------------------------------------------------------------------
    :: 64 bit
    if exist "%LOCALAPPDATA%\Package Cache\{b94f45d6-8461-440c-aa4d-bf197b2c2499}" (
        echo %0 :: - 3.5.3 64bit
        "%LOCALAPPDATA%\Package Cache\{b94f45d6-8461-440c-aa4d-bf197b2c2499}\python-3.5.3-amd64.exe" /uninstall /quiet
    )
    if exist "%LOCALAPPDATA%\Package Cache\{5d57524f-af24-49a7-b90b-92138880481e}" (
        echo %0 :: - 3.5.4 64bit
        "%LOCALAPPDATA%\Package Cache\{5d57524f-af24-49a7-b90b-92138880481e}\python-3.5.4-amd64.exe" /uninstall /quiet
    )

    :: 32 bit
    if exist "%LOCALAPPDATA%\Package Cache\{a10037e1-4247-47c9-935b-c5ca049d0299}" (
        echo %0 :: - 3.5.3 32bit
        "%LOCALAPPDATA%\Package Cache\{a10037e1-4247-47c9-935b-c5ca049d0299}\python-3.5.3" /uninstall /quiet
    )
    if exist "%LOCALAPPDATA%\Package Cache\{06e841fa-ca3b-4886-a820-cd32c614b0c1}" (
        echo %0 :: - 3.5.4 32bit
        "%LOCALAPPDATA%\Package Cache\{06e841fa-ca3b-4886-a820-cd32c614b0c1}\python-3.5.4" /uninstall /quiet
    )

    rem wipe the Python directory
    echo %0 :: Removing the C:\Python35 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python35"
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

    goto eof

:CheckPython37
if exist "\Python37" goto RemovePython37

goto eof

:RemovePython37
    echo %0 :: Uninstalling Python 3.7 ...
    echo ---------------------------------------------------------------------
    :: 64 bit
    if exist "%LOCALAPPDATA%\Package Cache\{8ae589dd-de2e-42cd-af56-102374115fee}" (
        echo %0 :: - 3.7.4 64bit
        "%LOCALAPPDATA%\Package Cache\{8ae589dd-de2e-42cd-af56-102374115fee}\python-3.7.4-amd64.exe" /uninstall /quiet
    )

    :: 32 bit
    if exist "%LOCALAPPDATA%\Package Cache\{b66087e3-469e-4725-8b9b-f0981244afea}" (
        echo %0 :: - 3.7.4 32bit
        "%LOCALAPPDATA%\Package Cache\{b66087e3-469e-4725-8b9b-f0981244afea}\python-3.7.4" /uninstall /quiet
    )
    :: Python Launcher, seems to be the same for 32 and 64 bit
    echo %0 :: - Python Launcher
    msiexec.exe /x {D722DA3A-92F5-454A-BD5D-A48C94D82300} /quiet /qn

    rem wipe the Python directory
    echo %0 :: Removing the C:\Python37 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python37"
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

    goto eof

:eof
echo.
echo =====================================================================
echo End of %0
echo =====================================================================

echo off
echo =====================================================================
echo Salt Windows Clean Script
echo =====================================================================
echo.

rem Make sure the script is run as Admin
echo Administrative permissions required. Detecting permissions ...
echo ---------------------------------------------------------------------
net session >nul 2>&1
if errorlevel 1 (
    echo Success: Administrative permissions confirmed.
) else (
    echo Failure: This script must be run as Administrator
    goto eof
)
echo.

:: Remove environment variables
    echo %0 :: Removing Environment Variables ...
    echo ---------------------------------------------------------------------
    if defined PyDir (
        reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V "PyDir"
    )

:CheckPython27
if exist "\Python27" goto RemovePython27

goto CheckPython35

:RemovePython27
    rem Uninstall Python 2.7
    echo %0 :: Uninstalling Python 2 ...
    echo ---------------------------------------------------------------------
    echo %0 :: - 2.7.12 (32 bit)
    MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C665} /QN
    echo %0 :: - 2.7.12 (64 bit)
    MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C666} /QN
    echo %0 :: - 2.7.13 (32 bit)
    MsiExec.exe /X {4A656C6C-D24A-473F-9747-3A8D00907A03} /QN
    echo %0 :: - 2.7.13 (64 bit)
    MsiExec.exe /X {4A656C6C-D24A-473F-9747-3A8D00907A04} /QN
    echo %0 :: - 2.7.14 (32 bit)
    MsiExec.exe /X {0398A685-FD8D-46B3-9816-C47319B0CF5E} /QN
    echo %0 :: - 2.7.14 (64 bit)
    MsiExec.exe /X {0398A685-FD8D-46B3-9816-C47319B0CF5F} /QN
    echo %0 :: - 2.7.15 (32 bit)
    MsiExec.exe /X {16CD92A4-0152-4CB7-8FD6-9788D3363616} /QN
    echo %0 :: - 2.7.15 (64 bit)
    MsiExec.exe /X {16CD92A4-0152-4CB7-8FD6-9788D3363617} /QN

    echo.

    rem Wipe the Python directory
    echo %0 :: Removing the C:\Python27 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q C:\Python27
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

:CheckPython35
if exist "\Python35" goto RemovePython35

goto CheckPython37

:RemovePython35
    echo %0 :: Uninstalling Python 3 ...
    echo ---------------------------------------------------------------------
    :: 64 bit
    if exist "%LOCALAPPDATA%\Package Cache\{b94f45d6-8461-440c-aa4d-bf197b2c2499}" (
        echo %0 :: - 3.5.3 64bit
        "%LOCALAPPDATA%\Package Cache\{b94f45d6-8461-440c-aa4d-bf197b2c2499}\python-3.5.3-amd64.exe" /uninstall /quiet
    )
    if exist "%LOCALAPPDATA%\Package Cache\{5d57524f-af24-49a7-b90b-92138880481e}" (
        echo %0 :: - 3.5.4 64bit
        "%LOCALAPPDATA%\Package Cache\{5d57524f-af24-49a7-b90b-92138880481e}\python-3.5.4-amd64.exe" /uninstall /quiet
    )

    :: 32 bit
    if exist "%LOCALAPPDATA%\Package Cache\{a10037e1-4247-47c9-935b-c5ca049d0299}" (
        echo %0 :: - 3.5.3 32bit
        "%LOCALAPPDATA%\Package Cache\{a10037e1-4247-47c9-935b-c5ca049d0299}\python-3.5.3" /uninstall /quiet
    )
    if exist "%LOCALAPPDATA%\Package Cache\{06e841fa-ca3b-4886-a820-cd32c614b0c1}" (
        echo %0 :: - 3.5.4 32bit
        "%LOCALAPPDATA%\Package Cache\{06e841fa-ca3b-4886-a820-cd32c614b0c1}\python-3.5.4" /uninstall /quiet
    )

    rem wipe the Python directory
    echo %0 :: Removing the C:\Python35 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python35"
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

    goto eof

:CheckPython37
if exist "\Python37" goto RemovePython37

goto CheckPython38

:RemovePython37
    echo %0 :: Uninstalling Python 3.7 ...
    echo ---------------------------------------------------------------------
    :: 64 bit
    if exist "%LOCALAPPDATA%\Package Cache\{8ae589dd-de2e-42cd-af56-102374115fee}" (
        echo %0 :: - 3.7.4 64bit
        "%LOCALAPPDATA%\Package Cache\{8ae589dd-de2e-42cd-af56-102374115fee}\python-3.7.4-amd64.exe" /uninstall /quiet
    )

    :: 32 bit
    if exist "%LOCALAPPDATA%\Package Cache\{b66087e3-469e-4725-8b9b-f0981244afea}" (
        echo %0 :: - 3.7.4 32bit
        "%LOCALAPPDATA%\Package Cache\{b66087e3-469e-4725-8b9b-f0981244afea}\python-3.7.4" /uninstall /quiet
    )
    :: Python Launcher, seems to be the same for 32 and 64 bit
    echo %0 :: - Python Launcher
    msiexec.exe /x {D722DA3A-92F5-454A-BD5D-A48C94D82300} /quiet /qn

    rem wipe the Python directory
    echo %0 :: Removing the C:\Python37 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python37"
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

    goto eof

:CheckPython38
if exist "\Python38" goto RemovePython38

goto eof

:RemovePython38
    echo %0 :: Uninstalling Python 3.8 ...
    echo ---------------------------------------------------------------------
    :: 64 bit
    if exist "%LOCALAPPDATA%\Package Cache\{ef6306ce-2a12-4d59-887e-ebf00b9e4ab5}" (
        echo %0 :: - 3.8.8 64bit
        "%LOCALAPPDATA%\Package Cache\{ef6306ce-2a12-4d59-887e-ebf00b9e4ab5}\python-3.8.8-amd64.exe" /uninstall /quiet
    )

    :: 32 bit
    if exist "%LOCALAPPDATA%\Package Cache\{ac93da86-1536-4b03-aea1-dc354b5e9282}" (
        echo %0 :: - 3.8.8 32bit
        "%LOCALAPPDATA%\Package Cache\{ac93da86-1536-4b03-aea1-dc354b5e9282}\python-3.8.8" /uninstall /quiet
    )
    :: Python Launcher, seems to be the same for 32 and 64 bit
    echo %0 :: - Python Launcher
    msiexec.exe /x {3B53E5B7-CFC4-401C-80E9-FF7591C58741} /quiet /qn

    rem wipe the Python directory
    echo %0 :: Removing the C:\Python37 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python37"
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

    goto eof

:eof
echo.
echo =====================================================================
echo End of %0
echo =====================================================================

Remove PyDir env var

Remove PyDir env var


@echo off
REM Update source for glslang (and eventually LunarGLASS)

setlocal EnableDelayedExpansion
set errorCode=0
set BUILD_DIR=%~dp0
set BASE_DIR=%BUILD_DIR%..
set GLSLANG_DIR=%BASE_DIR%\glslang
set LUNARGLASS_DIR=%BASE_DIR%\LunarGLASS

REM // ======== Parameter parsing ======== //

   if "%1" == "" (
      echo usage: update_external_sources.bat [options]
      echo.
      echo Available options:
      echo   --sync-glslang      just pull glslang_revision
      echo   --sync-LunarGLASS   just pull LunarGLASS_revision
      echo   --build-glslang     pulls glslang_revision, configures CMake, builds Release and Debug
      echo   --build-LunarGLASS  pulls LunarGLASS_revision, configures CMake, builds Release and Debug
      echo   --all               sync and build both glslang and LunarGLASS
      goto:finish
   )

   set sync-glslang=0
   set sync-LunarGLASS=0
   set build-glslang=0
   set build-LunarGLASS=0
   set check-glslang-build-dependencies=0
   set check-LunarGLASS-fetch-dependencies=0
   set check-LunarGLASS-build-dependencies=0

   :parameterLoop

      if "%1"=="" goto:parameterContinue

      if "%1" == "--sync-glslang" (
         set sync-glslang=1
		   shift
		   goto:parameterLoop
      )

      if "%1" == "--sync-LunarGLASS" (
         set sync-LunarGLASS=1
         set check-LunarGLASS-fetch-dependencies=1
         shift
         goto:parameterLoop
      )

      if "%1" == "--build-glslang" (
         set sync-glslang=1
         set check-glslang-build-dependencies=1
         set build-glslang=1
         shift
         goto:parameterLoop
      )

      if "%1" == "--build-LunarGLASS" (
         set sync-LunarGLASS=1
         set check-LunarGLASS-fetch-dependencies=1
         set check-LunarGLASS-build-dependencies=1
         set build-LunarGLASS=1
         shift
         goto:parameterLoop
      )

      if "%1" == "--all" (
         set sync-glslang=1
         set sync-LunarGLASS=1
         set build-glslang=1
         set build-LunarGLASS=1
         set check-LunarGLASS-fetch-dependencies=1
         set check-glslang-build-dependencies=1
         set check-LunarGLASS-build-dependencies=1
         shift
         goto:parameterLoop
      )

      echo Unrecognized options "%1"
      goto:error

   :parameterContinue

REM // ======== end Parameter parsing ======== //

REM // ======== Dependency checking ======== //
   for %%X in (git.exe) do (set FOUND=%%~$PATH:X)
   if not defined FOUND (
      echo Dependency check failed:
      echo   git.exe not found
      echo   Install and ensure git.exe makes it into your PATH

      set errorCode=1
   )

   if %check-LunarGLASS-fetch-dependencies% equ 1 (
      for %%X in (svn.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   svn.exe not found
         echo   Get Subversion for Windows here:  http://sourceforge.net/projects/win32svn/
         echo   Install and ensure svn.exe makes it into your PATH, default is "C:\Program Files (x86)\Subversion\bin"
         set errorCode=1
      )

      for %%X in (wget.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   wget.exe not found
         echo   Get wget for Windows here:  http://gnuwin32.sourceforge.net/packages/wget.htm
         echo   Easiest to select "Complete package, except sources" link which will install and setup PATH
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
         set errorCode=1
      )

      for %%X in (gzip.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   gzip.exe not found
         echo   Get gzip for Windows here:  http://gnuwin32.sourceforge.net/packages/gzip.htm
         echo   Easiest to select "Complete package, except sources" link which will install and setup PATH
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
         set errorCode=1
      )

      for %%X in (tar.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   tar.exe not found
         echo   Get tar for Windows here:  http://gnuwin32.sourceforge.net/packages/gtar.htm
         echo   Easiest to select Binaries/Setup link which will install and setup PATH
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
         set errorCode=1
      )
   )

   if %check-glslang-build-dependencies% equ 1 (
      for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   cmake.exe not found
         echo   Get CNake 2.8 for Windows here:  http://www.cmake.org/cmake/resources/software.html
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin"
         set errorCode=1
      )
   )

   if %check-LunarGLASS-build-dependencies% equ 1 (
      for %%X in (python.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   python.exe not found
         echo   Get python 2.7x for Windows here:  http://www.python.org/download/releases/2.7.6/
         echo   Install and ensure each makes it into your PATH, default is "C:\Python27"
         set errorCode=1
      )

      for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   cmake.exe not found
         echo   Get CNake 2.8 for Windows here:  http://www.cmake.org/cmake/resources/software.html
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin"
         set errorCode=1
      )
   )

   REM goto:main

REM // ======== end Dependency checking ======== //

:main

if %errorCode% neq 0 (goto:error)

REM Read the target versions from external file, which is shared with Linux script
if not exist LunarGLASS_revision (
   echo.
   echo Missing LunarGLASS_revision file!  Place it next to this script with target version in it.
   set errorCode=1
   goto:error
)

if not exist glslang_revision (
   echo.
   echo Missing glslang_revision file!  Place it next to this script with target version in it.
   set errorCode=1
   goto:error
)

set /p LUNARGLASS_REVISION= < LunarGLASS_revision
set /p GLSLANG_REVISION= < glslang_revision
echo LUNARGLASS_REVISION=%LUNARGLASS_REVISION%
echo GLSLANG_REVISION=%GLSLANG_REVISION%

echo Creating and/or updating glslang and LunarGLASS in %BASE_DIR%

if %sync-glslang% equ 1 (
   if not exist %GLSLANG_DIR% (
      call:create_glslang
   )
   if %errorCode% neq 0 (goto:error)
   call:update_glslang
   if %errorCode% neq 0 (goto:error)
)

if %sync-LunarGLASS% equ 1 (
   if not exist %LUNARGLASS_DIR% (
      call:create_LunarGLASS
   )
   if %errorCode% neq 0 (goto:error)
   call:update_LunarGLASS
   if %errorCode% neq 0 (goto:error)
)

if %build-glslang% equ 1 (
   call:build_glslang
   if %errorCode% neq 0 (goto:error)
)

if %build-LunarGLASS% equ 1 (
   call:build_LunarGLASS
   if %errorCode% neq 0 (goto:error)
)

REM If we made it here, we are golden
echo.
echo Success
goto:finish

:error
echo.
echo Halting due to error
goto:finish

:finish
if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
endlocal
goto:eof

REM // ======== Functions ======== //

:create_glslang
   REM Windows complains if it can't find the directory below, no need to call
   REM rd /S /Q %GLSLANG_DIR%
   echo.
   echo Creating local glslang repository %GLSLANG_DIR%)
   mkdir %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git clone https://github.com/KhronosGroup/glslang.git .
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source download failed!
      set errorCode=1
   )
goto:eof

:update_glslang
   echo.
   echo Updating %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git fetch --all
   git checkout %GLSLANG_REVISION%
goto:eof

:create_LunarGLASS
   REM Windows complains if it can't find the directory below, no need to call
   REM rd /S /Q %LUNARGLASS_DIR%
   echo.
   echo Creating local LunarGLASS repository %LUNARGLASS_DIR%)
   mkdir %LUNARGLASS_DIR%\Core\LLVM
   cd %LUNARGLASS_DIR%\Core\LLVM
   echo.
   echo Downloading LLVM archive...
   wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
   REM tar on windows can't filter through gzip, so the below line doesn't work
   REM tar --gzip -xf llvm-3.4.src.tar.gz
   echo.
   echo Unzipping the archive...
   echo gzip --decompress --verbose --keep llvm-3.4.src.tar.gz
   gzip --decompress --verbose --keep llvm-3.4.src.tar.gz
   echo.
   echo Extracting the archive... (this is slow)
   echo tar -xf llvm-3.4.src.tar
   tar -xf llvm-3.4.src.tar
   if not exist %LUNARGLASS_DIR%\Core\LLVM\llvm-3.4\lib (
      echo .
      echo LLVM source download failed!
      echo Delete LunarGLASS directory and try again
      set errorCode=1
      goto:eof
   )
   echo.
   echo Syncing LunarGLASS source...
   cd %LUNARGLASS_DIR%
   svn checkout --force https://lunarglass.googlecode.com/svn/trunk/ .
   svn revert --depth=infinity .
   if not exist %LUNARGLASS_DIR%\Frontends\SPIRV (
      echo.
      echo LunarGLASS source download failed!
      set errorCode=1
   )
goto:eof

:update_LunarGLASS
   echo.
   echo Updating %LUNARGLASS_DIR%
   cd %LUNARGLASS_DIR%
   svn update -r %LUNARGLASS_REVISION%
   REM Just in case we are moving backward, do a revert
   svn revert -R .
goto:eof

:build_glslang
   echo.
   echo Building %GLSLANG_DIR%
   cd  %GLSLANG_DIR%
   mkdir build
   set GLSLANG_BUILD_DIR=%GLSLANG_DIR%\build
   cd %GLSLANG_BUILD_DIR%
   cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
   REM Check for existence of one lib, even though we should check for all results
   if not exist %GLSLANG_BUILD_DIR%\glslang\Release\glslang.lib (
      echo.
      echo glslang Release build failed!
      set errorCode=1
   )
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
   REM Check for existence of one lib, even though we should check for all results
   if not exist %GLSLANG_BUILD_DIR%\glslang\Debug\glslang.lib (
      echo.
      echo glslang Debug build failed!
      set errorCode=1
   )
goto:eof

:build_LunarGLASS
   echo.
   echo Building %LUNARGLASS_DIR%
   set LLVM_DIR=%LUNARGLASS_DIR%\Core\LLVM\llvm-3.4
   cd %LLVM_DIR%
   mkdir build
   set LLVM_BUILD_DIR=%LLVM_DIR%\build
   cd %LLVM_BUILD_DIR%
   cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LLVM_BUILD_DIR%\lib\Release\LLVMCore.lib (
      echo.
      echo LLVM Release build failed!
      set errorCode=1
      goto:eof
   )
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LLVM_BUILD_DIR%\lib\Debug\LLVMCore.lib (
      echo.
      echo LLVM Debug build failed!
      set errorCode=1
      goto:eof
   )
   cd %LUNARGLASS_DIR%
   mkdir build
   set LUNARGLASS_BUILD_DIR=%LUNARGLASS_DIR%\build
   cd %LUNARGLASS_BUILD_DIR%
   cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LUNARGLASS_BUILD_DIR%\Core\Release\core.lib (
      echo.
      echo LunarGLASS build failed!
      set errorCode=1
      goto:eof
   )
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LUNARGLASS_BUILD_DIR%\Core\Debug\core.lib (
      echo.
      echo LunarGLASS build failed!
      set errorCode=1
      goto:eof
   )
goto:eof

@echo off
REM Update source for glslang (and eventually LunarGLASS)

setlocal EnableDelayedExpansion
set errorCode=0
set BUILD_DIR=%~dp0
set BASE_DIR=%BUILD_DIR%..
set GLSLANG_DIR=%BASE_DIR%\glslang
set LUNARGLASS_DIR=%BASE_DIR%\LunarGLASS

REM // ======== Parameter parsing ======== //

   if "%1" == "" (
      echo usage: update_external_sources.bat [options]
      echo.
      echo Available options:
      echo   --sync-glslang      just pull glslang_revision
      echo   --sync-LunarGLASS   just pull LunarGLASS_revision
      echo   --build-glslang     pulls glslang_revision, configures CMake, builds Release and Debug
      echo   --build-LunarGLASS  pulls LunarGLASS_revision, configures CMake, builds Release and Debug
      echo   --all               sync and build both glslang and LunarGLASS
      goto:finish
   )

   set sync-glslang=0
   set sync-LunarGLASS=0
   set build-glslang=0
   set build-LunarGLASS=0
   set check-glslang-build-dependencies=0
   set check-LunarGLASS-fetch-dependencies=0
   set check-LunarGLASS-build-dependencies=0

   :parameterLoop

      if "%1"=="" goto:parameterContinue

      if "%1" == "--sync-glslang" (
         set sync-glslang=1
		   shift
		   goto:parameterLoop
      )

      if "%1" == "--sync-LunarGLASS" (
         set sync-LunarGLASS=1
         set check-LunarGLASS-fetch-dependencies=1
         shift
         goto:parameterLoop
      )

      if "%1" == "--build-glslang" (
         set sync-glslang=1
         set check-glslang-build-dependencies=1
         set build-glslang=1
         shift
         goto:parameterLoop
      )

      if "%1" == "--build-LunarGLASS" (
         set sync-LunarGLASS=1
         set check-LunarGLASS-fetch-dependencies=1
         set check-LunarGLASS-build-dependencies=1
         set build-LunarGLASS=1
         shift
         goto:parameterLoop
      )

      if "%1" == "--all" (
         set sync-glslang=1
         set sync-LunarGLASS=1
         set build-glslang=1
         set build-LunarGLASS=1
         set check-LunarGLASS-fetch-dependencies=1
         set check-glslang-build-dependencies=1
         set check-LunarGLASS-build-dependencies=1
         shift
         goto:parameterLoop
      )

      echo Unrecognized options "%1"
      goto:error

   :parameterContinue

REM // ======== end Parameter parsing ======== //

REM // ======== Dependency checking ======== //
   for %%X in (git.exe) do (set FOUND=%%~$PATH:X)
   if not defined FOUND (
      echo Dependency check failed:
      echo   git.exe not found
      echo   Install and ensure git.exe makes it into your PATH

      set errorCode=1
   )

   if %check-LunarGLASS-fetch-dependencies% equ 1 (
      for %%X in (svn.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   svn.exe not found
         echo   Get Subversion for Windows here:  http://sourceforge.net/projects/win32svn/
         echo   Install and ensure svn.exe makes it into your PATH, default is "C:\Program Files (x86)\Subversion\bin"
         set errorCode=1
      )

      for %%X in (wget.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   wget.exe not found
         echo   Get wget for Windows here:  http://gnuwin32.sourceforge.net/packages/wget.htm
         echo   Easiest to select "Complete package, except sources" link which will install and setup PATH
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
         set errorCode=1
      )

      for %%X in (gzip.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   gzip.exe not found
         echo   Get gzip for Windows here:  http://gnuwin32.sourceforge.net/packages/gzip.htm
         echo   Easiest to select "Complete package, except sources" link which will install and setup PATH
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
         set errorCode=1
      )

      for %%X in (tar.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   tar.exe not found
         echo   Get tar for Windows here:  http://gnuwin32.sourceforge.net/packages/gtar.htm
         echo   Easiest to select Binaries/Setup link which will install and setup PATH
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
         set errorCode=1
      )
   )

   if %check-glslang-build-dependencies% equ 1 (
      for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   cmake.exe not found
         echo   Get CNake 2.8 for Windows here:  http://www.cmake.org/cmake/resources/software.html
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin"
         set errorCode=1
      )
   )

   if %check-LunarGLASS-build-dependencies% equ 1 (
      for %%X in (python.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   python.exe not found
         echo   Get python 2.7x for Windows here:  http://www.python.org/download/releases/2.7.6/
         echo   Install and ensure each makes it into your PATH, default is "C:\Python27"
         set errorCode=1
      )

      for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X)
      if not defined FOUND (
         echo Dependency check failed:
         echo   cmake.exe not found
         echo   Get CNake 2.8 for Windows here:  http://www.cmake.org/cmake/resources/software.html
         echo   Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin"
         set errorCode=1
      )
   )

   REM goto:main

REM // ======== end Dependency checking ======== //

:main

if %errorCode% neq 0 (goto:error)

REM Read the target versions from external file, which is shared with Linux script
if not exist LunarGLASS_revision (
   echo.
   echo Missing LunarGLASS_revision file!  Place it next to this script with target version in it.
   set errorCode=1
   goto:error
)

if not exist glslang_revision (
   echo.
   echo Missing glslang_revision file!  Place it next to this script with target version in it.
   set errorCode=1
   goto:error
)

set /p LUNARGLASS_REVISION= < LunarGLASS_revision
set /p GLSLANG_REVISION= < glslang_revision
echo LUNARGLASS_REVISION=%LUNARGLASS_REVISION%
echo GLSLANG_REVISION=%GLSLANG_REVISION%

set /p LUNARGLASS_REVISION_R32= < LunarGLASS_revision_R32
set /p GLSLANG_REVISION_R32= < glslang_revision_R32
echo LUNARGLASS_REVISION_R32=%LUNARGLASS_REVISION_R32%
echo GLSLANG_REVISION_R32=%GLSLANG_REVISION_R32%

echo Creating and/or updating glslang and LunarGLASS in %BASE_DIR%

if %sync-glslang% equ 1 (
   rd /S /Q %GLSLANG_DIR%
   if not exist %GLSLANG_DIR% (
      call:create_glslang
   )
   if %errorCode% neq 0 (goto:error)
   call:update_glslang
   if %errorCode% neq 0 (goto:error)
)

if %sync-LunarGLASS% equ 1 (
   if not exist %LUNARGLASS_DIR% (
      call:create_LunarGLASS
   )
   if %errorCode% neq 0 (goto:error)
   call:update_LunarGLASS
   if %errorCode% neq 0 (goto:error)
)

if %build-glslang% equ 1 (
   call:build_glslang
   if %errorCode% neq 0 (goto:error)
)

if %build-LunarGLASS% equ 1 (
   call:build_LunarGLASS
   if %errorCode% neq 0 (goto:error)
)

REM If we made it here, we are golden
echo.
echo Success
goto:finish

:error
echo.
echo Halting due to error
goto:finish

:finish
if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
endlocal
goto:eof

REM // ======== Functions ======== //

:create_glslang
   REM Windows complains if it can't find the directory below, no need to call
   REM rd /S /Q %GLSLANG_DIR%
   echo.
   echo Creating local glslang repository %GLSLANG_DIR%)
   mkdir %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git clone https://github.com/KhronosGroup/glslang.git .
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source download failed!
      set errorCode=1
   )
goto:eof

:update_glslang
   echo.
   echo Updating %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   svn.exe checkout --force https://cvs.khronos.org/svn/repos/SPIRV/trunk/glslang/ .
   svn.exe update -r %GLSLANG_REVISION_R32%
   svn.exe revert -R .
goto:eof

:create_LunarGLASS
   REM Windows complains if it can't find the directory below, no need to call
   REM rd /S /Q %LUNARGLASS_DIR%
   echo.
   echo Creating local LunarGLASS repository %LUNARGLASS_DIR%)
   mkdir %LUNARGLASS_DIR%\Core\LLVM
   cd %LUNARGLASS_DIR%\Core\LLVM
   echo.
   echo Downloading LLVM archive...
   wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
   REM tar on windows can't filter through gzip, so the below line doesn't work
   REM tar --gzip -xf llvm-3.4.src.tar.gz
   echo.
   echo Unzipping the archive...
   echo gzip --decompress --verbose --keep llvm-3.4.src.tar.gz
   gzip --decompress --verbose --keep llvm-3.4.src.tar.gz
   echo.
   echo Extracting the archive... (this is slow)
   echo tar -xf llvm-3.4.src.tar
   tar -xf llvm-3.4.src.tar
   if not exist %LUNARGLASS_DIR%\Core\LLVM\llvm-3.4\lib (
      echo .
      echo LLVM source download failed!
      echo Delete LunarGLASS directory and try again
      set errorCode=1
      goto:eof
   )
   echo.
   echo Syncing LunarGLASS source...
   cd %LUNARGLASS_DIR%
   svn checkout --force https://lunarglass.googlecode.com/svn/trunk/ .
   svn revert --depth=infinity .
   if not exist %LUNARGLASS_DIR%\Frontends\SPIRV (
      echo.
      echo LunarGLASS source download failed!
      set errorCode=1
   )
goto:eof

:update_LunarGLASS
   echo.
   echo Updating %LUNARGLASS_DIR%
   cd %LUNARGLASS_DIR%
   svn update -r %LUNARGLASS_REVISION%
   REM Just in case we are moving backward, do a revert
   svn revert -R .
goto:eof

:build_glslang
   echo.
   echo Building %GLSLANG_DIR%
   cd  %GLSLANG_DIR%
   mkdir build
   set GLSLANG_BUILD_DIR=%GLSLANG_DIR%\build
   cd %GLSLANG_BUILD_DIR%
   cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
   REM Check for existence of one lib, even though we should check for all results
   if not exist %GLSLANG_BUILD_DIR%\glslang\Release\glslang.lib (
      echo.
      echo glslang Release build failed!
      set errorCode=1
   )
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
   REM Check for existence of one lib, even though we should check for all results
   if not exist %GLSLANG_BUILD_DIR%\glslang\Debug\glslang.lib (
      echo.
      echo glslang Debug build failed!
      set errorCode=1
   )
goto:eof

:build_LunarGLASS
   echo.
   echo Building %LUNARGLASS_DIR%
   set LLVM_DIR=%LUNARGLASS_DIR%\Core\LLVM\llvm-3.4
   cd %LLVM_DIR%
   mkdir build
   set LLVM_BUILD_DIR=%LLVM_DIR%\build
   cd %LLVM_BUILD_DIR%
   cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LLVM_BUILD_DIR%\lib\Release\LLVMCore.lib (
      echo.
      echo LLVM Release build failed!
      set errorCode=1
      goto:eof
   )
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LLVM_BUILD_DIR%\lib\Debug\LLVMCore.lib (
      echo.
      echo LLVM Debug build failed!
      set errorCode=1
      goto:eof
   )
   cd %LUNARGLASS_DIR%
   mkdir build
   set LUNARGLASS_BUILD_DIR=%LUNARGLASS_DIR%\build
   cd %LUNARGLASS_BUILD_DIR%
   cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LUNARGLASS_BUILD_DIR%\Core\Release\core.lib (
      echo.
      echo LunarGLASS build failed!
      set errorCode=1
      goto:eof
   )
   msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
   REM Check for existence of one lib, even though we should check for all results
   if not exist %LUNARGLASS_BUILD_DIR%\Core\Debug\core.lib (
      echo.
      echo LunarGLASS build failed!
      set errorCode=1
      goto:eof
   )
goto:eof

build: fix update_external_sources.bat to pick up SPIRV rev32 for glslang


rmdir ..\BuiltNuGet\built /S /Q
md ..\BuiltNuGet\built

IF [%1] EQU [snupkg] (
REM nuget.exe Pack ..\BuiltNuGet\linq2db.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
REM nuget.exe Pack ..\BuiltNuGet\linq2db.AspNet.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
REM nuget.exe Pack ..\BuiltNuGet\linq2db.Tools.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
REM nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Grpc.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
REM nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Wcf.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
) ELSE (
REM Azure Artifacts doesn't support snupkg yet/still
REM https://developercommunity.visualstudio.com/idea/657354/add-snupkg-support-to-azure-devops-artifacts.html
REM nuget.exe Pack ..\BuiltNuGet\linq2db.nuspec -OutputDirectory ..\BuiltNuGet\built
REM nuget.exe Pack ..\BuiltNuGet\linq2db.AspNet.nuspec -OutputDirectory ..\BuiltNuGet\built
REM nuget.exe Pack ..\BuiltNuGet\linq2db.Tools.nuspec -OutputDirectory ..\BuiltNuGet\built
REM nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Grpc.nuspec -OutputDirectory ..\BuiltNuGet\built
REM nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Wcf.nuspec -OutputDirectory ..\BuiltNuGet\built
)

nuget.exe Pack ..\BuiltNuGet\linq2db.cli.nuspec -OutputDirectory ..\BuiltNuGet\built

REM disable new T4 nugets publishing, prepare for their obsoletion and removal
goto eof:
nuget.exe Pack ..\BuiltNuGet\linq2db.Access.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.DB2.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.DB2.Core.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Firebird.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Informix.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Informix.Core.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.MySql.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.MySqlConnector.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Oracle.Managed.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Oracle.Unmanaged.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.PostgreSQL.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SapHana.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SqlCe.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SQLite.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SQLite.MS.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SqlServer.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SqlServer.MS.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Sybase.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Sybase.DataAction.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.t4models.nuspec -OutputDirectory ..\BuiltNuGet\built

rmdir ..\BuiltNuGet\built /S /Q
md ..\BuiltNuGet\built

IF [%1] EQU [snupkg] (
nuget.exe Pack ..\BuiltNuGet\linq2db.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
nuget.exe Pack ..\BuiltNuGet\linq2db.AspNet.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
nuget.exe Pack ..\BuiltNuGet\linq2db.Tools.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Grpc.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Wcf.nuspec -OutputDirectory ..\BuiltNuGet\built -Symbols -SymbolPackageFormat snupkg
) ELSE (
REM Azure Artifacts doesn't support snupkg yet/still
REM https://developercommunity.visualstudio.com/idea/657354/add-snupkg-support-to-azure-devops-artifacts.html
nuget.exe Pack ..\BuiltNuGet\linq2db.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.AspNet.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Tools.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Grpc.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Remote.Wcf.nuspec -OutputDirectory ..\BuiltNuGet\built
)

nuget.exe Pack ..\BuiltNuGet\linq2db.cli.nuspec -OutputDirectory ..\BuiltNuGet\built

REM disable new T4 nugets publishing, prepare for their obsoletion and removal
REM goto eof:
nuget.exe Pack ..\BuiltNuGet\linq2db.Access.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.DB2.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.DB2.Core.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Firebird.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Informix.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Informix.Core.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.MySql.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.MySqlConnector.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Oracle.Managed.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Oracle.Unmanaged.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.PostgreSQL.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SapHana.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SqlCe.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SQLite.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SQLite.MS.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SqlServer.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.SqlServer.MS.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Sybase.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.Sybase.DataAction.nuspec -OutputDirectory ..\BuiltNuGet\built
nuget.exe Pack ..\BuiltNuGet\linq2db.t4models.nuspec -OutputDirectory ..\BuiltNuGet\built

revert nuget pack changes

revert nuget pack changes


:: Save source for C code and remove compiled libraries
ren "%SRC_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SRC_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
md %SP_DIR%\goodvibes\share\
"%CC%" /LD symmetry.c /Fe:"%SP_DIR%\goodvibes\share\symmetry_win.dll"

:: Save source for C code and remove compiled libraries
ren "%SRC_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SRC_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
md %SP_DIR%\goodvibes\share\
"%CC%" /LD symmetry.c /F:"%SP_DIR%\goodvibes\share\symmetry_win.dll"

Update bld.bat

Update bld.bat


@echo off
if not defined Configuration set Configuration=Debug
if not defined Nemerle set Nemerle="%ProgramFiles%\Nemerle\Net-4.0"
set RuntimeDllPath=%~dp0\..\N2\N2.Runtime\bin\%Configuration%
set N2CompilerDllPath=%~dp0\..\N2\N2.Compiler\bin\%Configuration%\Stage2

echo ---- POSITIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Positive
set OutDir=%~dp0\Bin\%Configuration%\Positive
set Tests=%~dp0\!Positive
call :runtests

echo ---- NEGATIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Negative
set OutDir=%~dp0\Bin\%Configuration%\Negative
set Tests=%~dp0\!Negative
call :runtests

pause

goto :eof

:runtests
rmdir %OutDir% /S /Q
mkdir %OutDir%
copy %~dp0\..\Grammars\Bin\%Configuration%\*.* %OutDir% /B /Z 1>nul
pushd .
cd %OutDir%
%Nemerle%\Nemerle.Compiler.Test.exe %Tests%\*.n %Tests%\*.cs %Tests%\*.n2 -output:%OutDir% -ref:System.Core -ref:%RuntimeDllPath%\N2.Runtime.dll -macro:%N2CompilerDllPath%\N2.Compiler.dll %TeamCityArgs%
popd
goto :eof

@echo off
if not defined Configuration set Configuration=Debug
if not defined NemerleBinPathRoot set NemerleBinPathRoot=%ProgramFiles%\Nemerle
if not defined Nemerle set Nemerle=%NemerleBinPathRoot%\Net-4.0
set RuntimeDllPath=%~dp0\..\N2\N2.Runtime\bin\%Configuration%
set N2CompilerDllPath=%~dp0\..\N2\N2.Compiler\bin\%Configuration%\Stage2

echo ---- POSITIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Positive
set OutDir=%~dp0\Bin\%Configuration%\Positive
set Tests=%~dp0\!Positive
call :runtests

echo ---- NEGATIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Negative
set OutDir=%~dp0\Bin\%Configuration%\Negative
set Tests=%~dp0\!Negative
call :runtests

pause

goto :eof

:runtests
rmdir %OutDir% /S /Q
mkdir %OutDir%
copy %~dp0\..\Grammars\Bin\%Configuration%\*.* %OutDir% /B /Z 1>nul
pushd .
cd %OutDir%
%Nemerle%\Nemerle.Compiler.Test.exe %Tests%\*.n %Tests%\*.cs %Tests%\*.n2 -output:%OutDir% -ref:System.Core -ref:%RuntimeDllPath%\N2.Runtime.dll -macro:%N2CompilerDllPath%\N2.Compiler.dll %TeamCityArgs%
popd
goto :eof

Fix test running script.

Fix test running script.


@echo off
rem
rem function install
rem

setlocal ENABLEEXTENSIONS

set serviceName=Neo4j-Server
set serviceDisplayName="Neo4j Graph Database"
set serviceStartType=auto
set classpath="\"-DserverClasspath=lib/*.jar;system/lib/*.jar;plugins/**/*.jar;./conf*\""
set mainclass="\"-DserverMainClass=org.neo4j.server.Bootstrapper\""
set configFile="\"conf\neo4j-wrapper.conf\""
set wrapperJarFilename=windows-service-wrapper-5.jar

if NOT [%2]==[] set serviceName=%2
if NOT [%3]==[] set serviceDisplayName=%3

if NOT %serviceName: =% == %serviceName% goto :usage

rem if NOT "%2" == "" set serviceName=%2
rem if NOT "%3" == "" set serviceDisplayName="%3"

goto :main %1 %2 %3

:getStatus
  set status=""

  rem get the state line from the sc output
  for /F "tokens=1,2 delims=:" %%a in ('sc query %serviceName%^|findstr "STATE"') do set status=%%b

  rem Remove ALL space, concatenating the numerical and the string - no prob
  set status=%status: =%

  rem done, if non existent it will be empty
  rem note that the strings we compare to normally
  rem have two spaces between numerical and
  rem string description. The substitution
  rem above swallowed these, though
  if "%status%" == "4RUNNING" (
    set status="RUNNING"
  ) else if "%status%" == "1STOPPED" (
    set status="STOPPED"
  ) else (
    set status="NOT INSTALLED"
  )
  goto:eof

:status
  call :getStatus
  echo %status%
  goto :eof

:install
  call "%~dps0functions.bat" :findJavaHome
  if not "%javaHomeError%" == "" (
    echo %javaHomeError%
    call:instructions
    goto:eof
  )

  call:verifySupportedJavaVersion
  if not "%javaVersionError%" == "" (
    echo %javaVersionError%
    call:instructions
    goto:eof
  )
  rem Remove quotes from javaPath so that it can have /bin/java appended to it
  rem See http://ss64.com/nt/syntax-esc.html, "Removing quotes"
  set javaPath=###%javaPath%###
  set javaPath=%javaPath:"###=%
  set javaPath=%javaPath:###"=%
  set javaPath=%javaPath:###=%

  set binPath="\"%javaPath%\bin\java.exe\" -DworkingDir=\"%~dps0..\" -DconfigFile=%configFile% %classpath% %mainclass% -Dorg.neo4j.cluster.logdirectory=\"%~dps0..\data\log\" -jar \"%~dps0%wrapperJarFilename%\"  %serviceName%"

  sc create "%serviceName%" binPath= %binPath% DisplayName= "%serviceDisplayName:"=%" start= %serviceStartType%
  sc start %serviceName%
  @echo off
  goto :eof

:remove
  call :stop
  sc delete %serviceName%
  goto :eof

:start
  call :getStatus
  if %status% == "NOT INSTALLED" (
    call:console
  ) else if %status% == "RUNNING" (
    echo Service is already running, no action taken
  ) else (
    sc start %serviceName%
  )
  goto :eof

:stop
  sc stop %serviceName%
  goto:eof

:restart
  call :stop
  call :start
  goto :eof

:usage
  echo Usage: %~0Neo4jInstaller.bat ^<install^|remove^> [service name] [service display name]
  echo        - Service Name - Optional, must NOT contain spaces
  echo        - Service Display Name - Optional, The name displayed in the services window, surround with quotes to use spaces
  goto:eof

:main
  if "%1" == "" goto :usage
  if "%1" == "remove"  goto :remove
  if "%1" == "install" goto :install
  if "%1" == "stop" goto :stop
  if "%1" == "start" goto :start
  if "%1" == "status" goto :status
  call :usage
  goto :eof

rem end function remove

:verifySupportedJavaVersion

  set javaVersionError=
  set javaCommand=%javaPath:"=%\bin\java.exe

  rem Remove leading spaces
  for /f "tokens=* delims= " %%a in ("%javaCommand%") do set javaCommand=%%a

  rem Find version
  for /f "usebackq tokens=3" %%g in (`"%javaCommand%" -version 2^>^&1`) do (
      set JAVAVER=%%g
      goto:breakJavaVersionLoop
  )
  :breakJavaVersionLoop

  set JAVAVER=%JAVAVER:"=%
  set "JAVAVER=%JAVAVER:~0,3%"

  if "%JAVAVER%"=="1.7" goto:eof
  if "%JAVAVER%"=="1.8" (
    echo ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
    goto:eof
  )
  set javaVersionError=ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
  goto:eof

:instructions
  echo * Please use Oracle(R) Java(TM) 7 to run Neo4j Server. Download "Java Platform (JDK) 7" from:
  echo   http://www.oracle.com/technetwork/java/javase/downloads/index.html
  echo * Please see http://neo4j.com/docs/ for Neo4j Server installation instructions.
  goto:eof

@echo off
rem
rem function install
rem

setlocal ENABLEEXTENSIONS

set serviceName=Neo4j-Server
set serviceDisplayName="Neo4j Graph Database"
set serviceStartType=auto
set classpath="\"-DserverClasspath=lib/*.jar;system/lib/*.jar;plugins/**/*.jar;./conf*\""
set mainclass="\"-DserverMainClass=#{neo4j.mainClass}\""
set configFile="\"conf\neo4j-wrapper.conf\""
set wrapperJarFilename=windows-service-wrapper-5.jar

if NOT [%2]==[] set serviceName=%2
if NOT [%3]==[] set serviceDisplayName=%3

if NOT %serviceName: =% == %serviceName% goto :usage

rem if NOT "%2" == "" set serviceName=%2
rem if NOT "%3" == "" set serviceDisplayName="%3"

goto :main %1 %2 %3

:getStatus
  set status=""

  rem get the state line from the sc output
  for /F "tokens=1,2 delims=:" %%a in ('sc query %serviceName%^|findstr "STATE"') do set status=%%b

  rem Remove ALL space, concatenating the numerical and the string - no prob
  set status=%status: =%

  rem done, if non existent it will be empty
  rem note that the strings we compare to normally
  rem have two spaces between numerical and
  rem string description. The substitution
  rem above swallowed these, though
  if "%status%" == "4RUNNING" (
    set status="RUNNING"
  ) else if "%status%" == "1STOPPED" (
    set status="STOPPED"
  ) else (
    set status="NOT INSTALLED"
  )
  goto:eof

:status
  call :getStatus
  echo %status%
  goto :eof

:install
  call "%~dps0functions.bat" :findJavaHome
  if not "%javaHomeError%" == "" (
    echo %javaHomeError%
    call:instructions
    goto:eof
  )

  call:verifySupportedJavaVersion
  if not "%javaVersionError%" == "" (
    echo %javaVersionError%
    call:instructions
    goto:eof
  )
  rem Remove quotes from javaPath so that it can have /bin/java appended to it
  rem See http://ss64.com/nt/syntax-esc.html, "Removing quotes"
  set javaPath=###%javaPath%###
  set javaPath=%javaPath:"###=%
  set javaPath=%javaPath:###"=%
  set javaPath=%javaPath:###=%

  set binPath="\"%javaPath%\bin\java.exe\" -DworkingDir=\"%~dps0..\" -DconfigFile=%configFile% %classpath% %mainclass% -Dorg.neo4j.cluster.logdirectory=\"%~dps0..\data\log\" -jar \"%~dps0%wrapperJarFilename%\"  %serviceName%"

  sc create "%serviceName%" binPath= %binPath% DisplayName= "%serviceDisplayName:"=%" start= %serviceStartType%
  sc start %serviceName%
  @echo off
  goto :eof

:remove
  call :stop
  sc delete %serviceName%
  goto :eof

:start
  call :getStatus
  if %status% == "NOT INSTALLED" (
    call:console
  ) else if %status% == "RUNNING" (
    echo Service is already running, no action taken
  ) else (
    sc start %serviceName%
  )
  goto :eof

:stop
  sc stop %serviceName%
  goto:eof

:restart
  call :stop
  call :start
  goto :eof

:usage
  echo Usage: %~0Neo4jInstaller.bat ^<install^|remove^> [service name] [service display name]
  echo        - Service Name - Optional, must NOT contain spaces
  echo        - Service Display Name - Optional, The name displayed in the services window, surround with quotes to use spaces
  goto:eof

:main
  if "%1" == "" goto :usage
  if "%1" == "remove"  goto :remove
  if "%1" == "install" goto :install
  if "%1" == "stop" goto :stop
  if "%1" == "start" goto :start
  if "%1" == "status" goto :status
  call :usage
  goto :eof

rem end function remove

:verifySupportedJavaVersion

  set javaVersionError=
  set javaCommand=%javaPath:"=%\bin\java.exe

  rem Remove leading spaces
  for /f "tokens=* delims= " %%a in ("%javaCommand%") do set javaCommand=%%a

  rem Find version
  for /f "usebackq tokens=3" %%g in (`"%javaCommand%" -version 2^>^&1`) do (
      set JAVAVER=%%g
      goto:breakJavaVersionLoop
  )
  :breakJavaVersionLoop

  set JAVAVER=%JAVAVER:"=%
  set "JAVAVER=%JAVAVER:~0,3%"

  if "%JAVAVER%"=="1.7" goto:eof
  if "%JAVAVER%"=="1.8" (
    echo ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
    goto:eof
  )
  set javaVersionError=ERROR! You are using an unsupported version of Java, please use Oracle HotSpot 1.7.
  goto:eof

:instructions
  echo * Please use Oracle(R) Java(TM) 7 to run Neo4j Server. Download "Java Platform (JDK) 7" from:
  echo   http://www.oracle.com/technetwork/java/javase/downloads/index.html
  echo * Please see http://neo4j.com/docs/ for Neo4j Server installation instructions.
  goto:eof

Use appropriate main class in Neo4jInstaller

After changing the class that launches the Neo4j database server the change of class name was omitted in the installer for windows.


set /p versionNumber=

REM clean up
del builds\im-only-resting-%versionNumber%.zip
rd /q /s builds\im-only-resting-%versionNumber%
rd /q /s builds\im-only-resting

REM preparing staging dir
mkdir staging
copy LICENSE staging
copy NOTICE staging
copy Ior\bin\Release\im-only-resting.exe staging
copy Ior\bin\Release\libtidy.dll staging
copy Ior\bin\Release\Newtonsoft.Json.dll staging
copy Ior\bin\Release\PropertyGridEx.dll staging
copy Ior\bin\Release\RestSharp.dll staging
copy Ior\bin\Release\TidyManaged.dll staging
copy Ior\bin\Release\Utils.dll staging
copy Ior\bin\Release\NLog.config staging

REM zip staging files
cd staging
"..\tools\7z\7za.exe" a -tzip "..\builds\im-only-resting-%versionNumber%.zip" *
cd ..

REM extract build
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting-%versionNumber%"
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting"

REM clean up
rd /q /s staging

pause

set /p versionNumber=

REM clean up
del builds\im-only-resting-%versionNumber%.zip
rd /q /s builds\im-only-resting-%versionNumber%
rd /q /s builds\im-only-resting

REM preparing staging dir
mkdir staging
copy LICENSE staging
copy NOTICE staging
copy Ior\bin\Release\im-only-resting.exe staging
copy Ior\bin\Release\libtidy.dll staging
copy Ior\bin\Release\Newtonsoft.Json.dll staging
copy Ior\bin\Release\PropertyGridEx.dll staging
copy Ior\bin\Release\RestSharp.dll staging
copy Ior\bin\Release\TidyManaged.dll staging
copy Ior\bin\Release\Utils.dll staging
copy Ior\bin\Release\NLog.config staging
copy Ior\bin\Release\NLog.dll staging

REM zip staging files
cd staging
"..\tools\7z\7za.exe" a -tzip "..\builds\im-only-resting-%versionNumber%.zip" *
cd ..

REM extract build
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting-%versionNumber%"
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting"

REM clean up
rd /q /s staging

pause

include NLog.dll in archiver

include NLog.dll in archiver


@echo off
:: Batch arguments:
:: %~1: Project/Solution to build
:: %~2: Target(Normally should be Debug or Release)
:: %~3: Platform(Normally should be "Any CPU" for sln and AnyCPU for a csproj)
:: if none are passed, defaults to building Sharpmake.sln in Debug|AnyCPU

setlocal enabledelayedexpansion

:: Clear previous run status
COLOR

: set batch file directory as current
pushd "%~dp0"

set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist %VSWHERE% (
    echo ERROR: Cannot determine the location of the vswhere command Common Tools folder.
    goto error
)

set VSMSBUILDCMD=
for /f "usebackq delims=" %%i in (`%VSWHERE% -latest -products * -property installationPath`) do (
  if exist "%%i\Common7\Tools\VsMSBuildCmd.bat" (
    set VSMSBUILDCMD="%%i\Common7\Tools\VsMSBuildCmd.bat"
  )
)

if not defined VSMSBUILDCMD (
    echo ERROR: Cannot determine the location of Common Tools folder.
    goto error
)

echo MSBuild batch path: !VSMSBUILDCMD!
call !VSMSBUILDCMD!
if %errorlevel% NEQ 0 goto error

if "%~1" == "" (
    call :BuildSharpmake "Sharpmake.sln" "Debug" "Any CPU"
) else (
    call :BuildSharpmake %1 %2 %3
)

if %errorlevel% NEQ 0 goto error

goto success

@REM -----------------------------------------------------------------------
:: Build Sharpmake using specified arguments
:BuildSharpmake
echo Compiling %~1 in "%~2|%~3"...

set MSBUILD_CMD=msbuild -t:build -restore "%~1" /nologo /verbosity:m /p:Configuration="%~2" /p:Platform="%~3"
echo %MSBUILD_CMD%
%MSBUILD_CMD%
set ERROR_CODE=%errorlevel%
if %ERROR_CODE% NEQ 0 (
    echo ERROR: Failed to compile %~1 in "%~2|%~3".
    goto end
)
goto success

@REM -----------------------------------------------------------------------
:success
COLOR 2F
set ERROR_CODE=0
goto end

@REM -----------------------------------------------------------------------
:error
COLOR 4F
set ERROR_CODE=1
goto end

@REM -----------------------------------------------------------------------
:end
:: restore caller current directory
popd
exit /b %ERROR_CODE%

@echo off
:: Batch arguments:
:: %~1: Project/Solution to build
:: %~2: Target(Normally should be Debug or Release)
:: %~3: Platform(Normally should be "Any CPU" for sln and AnyCPU for a csproj)
:: if none are passed, defaults to building Sharpmake.sln in Debug|AnyCPU

setlocal enabledelayedexpansion

:: Clear previous run status
COLOR

set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist %VSWHERE% (
    echo ERROR: Cannot determine the location of the vswhere command Common Tools folder.
    goto error
)

set VSMSBUILDCMD=
for /f "usebackq delims=" %%i in (`%VSWHERE% -latest -products * -property installationPath`) do (
  if exist "%%i\Common7\Tools\VsMSBuildCmd.bat" (
    set VSMSBUILDCMD="%%i\Common7\Tools\VsMSBuildCmd.bat"
  )
)

if not defined VSMSBUILDCMD (
    echo ERROR: Cannot determine the location of Common Tools folder.
    goto error
)

echo MSBuild batch path: !VSMSBUILDCMD!
call !VSMSBUILDCMD!
if %errorlevel% NEQ 0 goto error

if "%~1" == "" (
    call :BuildSharpmake "%~dp0Sharpmake.sln" "Debug" "Any CPU"
) else (
    call :BuildSharpmake %1 %2 %3
)

if %errorlevel% NEQ 0 goto error

goto success

@REM -----------------------------------------------------------------------
:: Build Sharpmake using specified arguments
:BuildSharpmake
echo Compiling %~1 in "%~2|%~3"...

set MSBUILD_CMD=msbuild -t:build -restore "%~1" /nologo /verbosity:m /p:Configuration="%~2" /p:Platform="%~3"
echo %MSBUILD_CMD%
%MSBUILD_CMD%
set ERROR_CODE=%errorlevel%
if %ERROR_CODE% NEQ 0 (
    echo ERROR: Failed to compile %~1 in "%~2|%~3".
    goto end
)
goto success

@REM -----------------------------------------------------------------------
:success
COLOR 2F
set ERROR_CODE=0
goto end

@REM -----------------------------------------------------------------------
:error
COLOR 4F
set ERROR_CODE=1
goto end

@REM -----------------------------------------------------------------------
:end
exit /b %ERROR_CODE%

Stop changing the working directory in the CompileSharpmake batch file


@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20160616-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
    SET BRANCH=master
) ELSE (
    SET BRANCH=%1
)

IF "%2"=="" (
    SET JAVA_WEB=http://www.klib.io/_archives/java/1.8
) ELSE (
    ::SET JAVA_WEB=https://s3-eu-west-1.amazonaws.com/klib.io/www/_archives/java/zipped/1.8
    SET JAVA_WEB=http://jazz01.rd.corpintra.net/web/repo/_archives/java/zipped/1.8
)
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip
SET JAVA=%JAVA_ARCHIVE:~13,-4%

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET ECL_INST_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

SET BUILD_SERVER_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph
SET BUILD_SERVER_ROOT=http://www.klib.io/org.eclipse.oomph
SET OOMPH_VERSION=1.4.0

SET CUSTOM=osgi
SET PROD_CAT_FILTER=osgi\.products
SET PROD_FILTER=osgi\.idefix\.mars
SET PROD_VERSION=latest\.bndtools\.bintray

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::  'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::  SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA=%SCRIPT_PATH%\java

:: source archives location
SET JAVA_WEB=http://www.klib.io/_archives/java

:: concrete version names for the Java Archives
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip

:: Java Name (includes version)
SET JAVA_VERSION=%JAVA_ARCHIVE:~16,-9%
SET JAVA_NAME=%JAVA_ARCHIVE:~13,-4%
SET JAVA_WEB_DL=%JAVA_WEB%/%JAVA_VERSION%/%JAVA_ARCHIVE%
SET JAVA_DL=%DL%\%JAVA_ARCHIVE%

:: extract locations
SET JAVA_EXTRACT=%JAVA%\%JAVA_VERSION%

ECHO.
ECHO # setup local JDK %JAVA_VERSION% in version %JAVA_NAME%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%JAVA_DL%' ) { Write-Output '   - skipping download,   cause file exists   - %JAVA_DL%' } else { Write-Output '   - downloading archive %JAVA_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%JAVA_WEB_DL%','%JAVA_DL%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %JAVA_WEB%/%JAVA_ARCHIVE%
    GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%JAVA_EXTRACT%\%JAVA_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %JAVA_EXTRACT%\%JAVA_NAME%' } else { Write-Output '   - extracting %JAVA_DL% archive to %JAVA_EXTRACT%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%JAVA_DL%', '%JAVA_EXTRACT%')}"

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # download and extract into %SCRIPT_PATH%\%ECL_INST_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; $browser = New-Object System.Net.WebClient; $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $browser.DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BUILD_STORE=%BUILD_SERVER_ROOT%/%OOMPH_VERSION%/%BRANCH%/%LATEST%

SET ECLIPSE_INSTALLER_WEB=%BUILD_STORE%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';$browser = New-Object System.Net.WebClient; $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $browser.DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
    GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%ECL_INST_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%ECL_INST_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%ECL_INST_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%ECL_INST_NAME%')}"

ECHO    - copying latest java %JAVA%\jre into %SCRIPT_PATH%\%ECL_INST_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%ECL_INST_NAME%\jre\NUL (
    XCOPY /Y /I /E /H %JAVA8% %SCRIPT_PATH%\%ECL_INST_NAME%\jre 2>&1 > NUL
)

SET ECL_INST_INI=%SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.ini

FINDSTR peterkir.github.io %ECL_INST_INI% 2>&1 > NUL
IF "%ERRORLEVEL%"=="" (
    ECHO    - skipping vmArgs addition, cause already inside
) ELSE (
    ECHO    - adding vmArgs to ini file
    :: allow installation of unsigned bundles
    ECHO -Declipse.p2.unsignedPolicy=allow >> %ECL_INST_INI%

    :: hidden p2 options (configured to default)
    ECHO -Declipse.p2.max.threads=4        >> %ECL_INST_INI%
    ECHO -Declipse.p2.force.threading=true >> %ECL_INST_INI%
    ECHO -Declipse.p2.mirrors=true         >> %ECL_INST_INI%

    :: filtering user displayed catalogs/products/versions
    ECHO -Doomph.setup.product.catalog.filter=%PROD_CAT_FILTER%>> %ECL_INST_INI%
    ECHO -Doomph.setup.product.filter=%PROD_FILTER%>>             %ECL_INST_INI%
    ECHO -Doomph.setup.product.version.filter=%PROD_VERSION%>>    %ECL_INST_INI%

    ECHO -Doomph.setup.jre.choice=false                          >> %ECL_INST_INI%
    ECHO -Doomph.installer.update.url=%BUILD_STORE%/p2/installer >> %ECL_INST_INI%
    ECHO -Doomph.update.url=%BUILD_STORE%/p2/oomph               >> %ECL_INST_INI%
    ECHO -Doomph.setup.installer.mode=advanced                   >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>https://peterkir.github.io/idefix/oomph/%CUSTOM%/productsCatalog.setup >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>https://peterkir.github.io/idefix/oomph/%CUSTOM%/projectsCatalog.setup >> %ECL_INST_INI%
)

ECHO.
ECHO # launching %ECL_INST_NAME%
ECHO.
START /B %SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20160616-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
    SET BRANCH=master
) ELSE (
    SET BRANCH=%1
)

IF "%2"=="" (
    SET JAVA_WEB=http://www.klib.io/_archives/java/1.8
) ELSE (
    ::SET JAVA_WEB=https://s3-eu-west-1.amazonaws.com/klib.io/www/_archives/java/zipped/1.8
    SET JAVA_WEB=http://jazz01.rd.corpintra.net/web/repo/_archives/java/zipped/1.8
)
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip
SET JAVA=%JAVA_ARCHIVE:~13,-4%

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET ECL_INST_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

SET BUILD_SERVER_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph
SET BUILD_SERVER_ROOT=http://www.klib.io/org.eclipse.oomph
SET OOMPH_VERSION=1.4.0

SET CUSTOM=osgi
SET PROD_CAT_FILTER=osgi\\.products
SET PROD_FILTER=osgi\\.idefix\\.neon
SET PROD_VERSION=latest\\.bndtools\\.bintray

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::  'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::  SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA=%SCRIPT_PATH%\java

:: source archives location
SET JAVA_WEB=http://www.klib.io/_archives/java

:: concrete version names for the Java Archives
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip

:: Java Name (includes version)
SET JAVA_VERSION=%JAVA_ARCHIVE:~16,-9%
SET JAVA_NAME=%JAVA_ARCHIVE:~13,-4%
SET JAVA_WEB_DL=%JAVA_WEB%/%JAVA_VERSION%/%JAVA_ARCHIVE%
SET JAVA_DL=%DL%\%JAVA_ARCHIVE%

:: extract locations
SET JAVA_EXTRACT=%JAVA%\%JAVA_VERSION%

ECHO.
ECHO # setup local JDK %JAVA_VERSION% in version %JAVA_NAME%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%JAVA_DL%' ) { Write-Output '   - skipping download,   cause file exists   - %JAVA_DL%' } else { Write-Output '   - downloading archive %JAVA_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%JAVA_WEB_DL%','%JAVA_DL%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %JAVA_WEB%/%JAVA_ARCHIVE%
    GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%JAVA_EXTRACT%\%JAVA_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %JAVA_EXTRACT%\%JAVA_NAME%' } else { Write-Output '   - extracting %JAVA_DL% archive to %JAVA_EXTRACT%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%JAVA_DL%', '%JAVA_EXTRACT%')}"

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # download and extract into %SCRIPT_PATH%\%ECL_INST_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; $browser = New-Object System.Net.WebClient; $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $browser.DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BUILD_STORE=%BUILD_SERVER_ROOT%/%OOMPH_VERSION%/%BRANCH%/%LATEST%

SET ECLIPSE_INSTALLER_WEB=%BUILD_STORE%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';$browser = New-Object System.Net.WebClient; $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $browser.DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
    GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%ECL_INST_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%ECL_INST_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%ECL_INST_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%ECL_INST_NAME%')}"

ECHO    - copying latest java %JAVA%\jre into %SCRIPT_PATH%\%ECL_INST_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%ECL_INST_NAME%\jre\NUL (
    XCOPY /Y /I /E /H %JAVA8% %SCRIPT_PATH%\%ECL_INST_NAME%\jre 2>&1 > NUL
)

SET ECL_INST_INI=%SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.ini

FINDSTR peterkir.github.io %ECL_INST_INI% 2>&1 > NUL
IF "%ERRORLEVEL%"=="" (
    ECHO    - skipping vmArgs addition, cause already inside
) ELSE (
    ECHO    - adding vmArgs to ini file
    :: allow installation of unsigned bundles
    ECHO -Declipse.p2.unsignedPolicy=allow >> %ECL_INST_INI%

    :: hidden p2 options (configured to default)
    ECHO -Declipse.p2.max.threads=4        >> %ECL_INST_INI%
    ECHO -Declipse.p2.force.threading=true >> %ECL_INST_INI%
    ECHO -Declipse.p2.mirrors=true         >> %ECL_INST_INI%

    :: filtering user displayed catalogs/products/versions
    ECHO -Doomph.setup.product.catalog.filter=%PROD_CAT_FILTER%>> %ECL_INST_INI%
    ECHO -Doomph.setup.product.filter=%PROD_FILTER%>>             %ECL_INST_INI%
    ECHO -Doomph.setup.product.version.filter=%PROD_VERSION%>>    %ECL_INST_INI%

    ECHO -Doomph.setup.jre.choice=false                          >> %ECL_INST_INI%
    ECHO -Doomph.installer.update.url=%BUILD_STORE%/p2/installer >> %ECL_INST_INI%
    ECHO -Doomph.update.url=%BUILD_STORE%/p2/oomph               >> %ECL_INST_INI%
    ECHO -Doomph.setup.installer.mode=advanced                   >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>https://peterkir.github.io/idefix/oomph/%CUSTOM%/productsCatalog.setup >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>https://peterkir.github.io/idefix/oomph/%CUSTOM%/projectsCatalog.setup >> %ECL_INST_INI%
)

ECHO.
ECHO # launching %ECL_INST_NAME%
ECHO.
START /B %SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

fix oomph filter selection

fix oomph filter selection