:: build Foo.dll

cl -c -DFOO_MAKE_DLL -Zm200 -O2 -DNDEBUG -MT -D_WINDLL  -EHsc -GR -W4 -wd4251 -I"." -I"..\..\include" Foo.cpp
link /NOLOGO /DLL /OUT:"Foo.dll" Foo.obj

:: build SingletonDll.dll

cl -c -DSINGLETONDLL_MAKE_DLL -DFOO_DLL -Zm200 -O2 -DNDEBUG -MT -D_WINDLL  -EHsc -GR -W4 -wd4251 -I"." -I"..\..\include" SingletonDll.cpp
link /NOLOGO /DLL /OUT:"SingletonDll.dll" SingletonDll.obj foo.lib

:: build Client.exe

cl -c -DSINGLETONDLL_DLL -DFOO_DLL -Zm200 -O2 -DNDEBUG -MT -D_WINDLL  -EHsc -GR -W4 -wd4251 -I"." -I"..\..\include" client.cpp
link /NOLOGO /SUBSYSTEM:CONSOLE /OUT:"Client.exe" Client.obj foo.lib SingletonDll.lib

del *.obj
del *.lib
del *.exp

:: build Foo.dll

cl -c -DFOO_MAKE_DLL -Zm200 -O2 -DNDEBUG -MT -D_WINDLL  -EHsc -GR -W4 -wd4251 -I"." -I"..\..\include" Foo.cpp
link /NOLOGO /DLL /OUT:"Foo.dll" Foo.obj

:: build SingletonDll.dll

cl -c -DSINGLETONDLL_MAKE_DLL -DFOO_DLL -Zm200 -O2 -DNDEBUG -MT -D_WINDLL  -EHsc -GR -W4 -wd4251 -I"." -I"..\..\include" SingletonDll.cpp
link /NOLOGO /DLL /OUT:"SingletonDll.dll" SingletonDll.obj foo.lib

:: build Client.exe

cl -c -DSINGLETONDLL_DLL -DFOO_DLL -Zm200 -O2 -DNDEBUG -MT  -EHsc -GR -W4 -wd4251 -I"." -I"..\..\include" client.cpp
link /NOLOGO /SUBSYSTEM:CONSOLE /OUT:"Client.exe" Client.obj foo.lib SingletonDll.lib

del *.obj
del *.lib
del *.exp

remove wrong macro

remove wrong macro

git-svn-id: 2bceadd671bcc8d4f7a34159d1bc3b98592acb3b@588 7ec92016-0320-0410-acc4-a06ded1c099a


@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 %*

@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\bin\drmemory.exe
:: }}}
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 %*

Update Dr. Memory paths to account for the new version of the DrM SFX
TBR=bruening
TEST=DrM FYI bot starts the proper version of DrM
Review URL: http://codereview.chromium.org/6507041

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@75250 0039d316-1c4b-4281-b951-d872f2087c98


@echo off
setlocal

REM Workaround https://github.com/dotnet/coreclr/issues/2153
set ComPlus_ReadyToRun=0

set INIT_TOOLS_LOG=%~dp0init-tools.log
set PACKAGES_DIR=%~dp0packages\
set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://www.myget.org/F/dotnet-buildtools/
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" , "Microsoft.DotNet.BuildTools.Coreclr": "1.0.4-prerelease"}, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

:: Download Nuget.exe
if NOT exist "%PACKAGES_DIR%NuGet.exe" (
  if NOT exist "%PACKAGES_DIR%" mkdir "%PACKAGES_DIR%"
  powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%NuGet.exe')
)

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

@echo off
setlocal

set INIT_TOOLS_LOG=%~dp0init-tools.log
set PACKAGES_DIR=%~dp0packages\
set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://www.myget.org/F/dotnet-buildtools/
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" , "Microsoft.DotNet.BuildTools.Coreclr": "1.0.4-prerelease"}, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

:: Download Nuget.exe
if NOT exist "%PACKAGES_DIR%NuGet.exe" (
  if NOT exist "%PACKAGES_DIR%" mkdir "%PACKAGES_DIR%"
  powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%NuGet.exe')
)

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

Remove ReadyToRun workaround

Remove ReadyToRun workaround


IF NOT EXIST C:\build_sf2cute_x86 (
  IF NOT EXIST C:\sf2cute (
    git clone https://github.com/frabert/sf2cute C:/sf2cute
  )

  mkdir C:\build_sf2cute_x86
  cd C:\build_sf2cute_x86
  cmake -D CMAKE_INSTALL_PREFIX=C:/install_prefix_x86 -D BUILD_TESTING=OFF C:/sf2cute
  cmake --build . --target INSTALL --config Release
  cd C:\projects\libdmusic
)

IF NOT EXIST C:\build_sf2cute_x86-64 (
  IF NOT EXIST C:\sf2cute (
    git clone https://github.com/frabert/sf2cute C:/sf2cute
  )

  mkdir C:\build_sf2cute_x86-64
  cd C:\build_sf2cute_x86-64
  cmake -D CMAKE_INSTALL_PREFIX=C:/install_prefix_x86-64 -D BUILD_TESTING=OFF C:/sf2cute
  cmake --build . --target INSTALL --config Release
  cd C:\projects\libdmusic
)

IF NOT EXIST C:\build_sf2cute_x86 (
  IF NOT EXIST C:\sf2cute (
    git clone https://github.com/frabert/sf2cute C:/sf2cute
  )

  mkdir C:\build_sf2cute_x86
  cd C:\build_sf2cute_x86
  cmake -D CMAKE_INSTALL_PREFIX=C:/install_prefix_x86 -D BUILD_TESTING=OFF C:/sf2cute
  cmake --build . --target INSTALL --config Release
  cd C:\projects\libdmusic
)

IF NOT EXIST C:\build_sf2cute_x86-64 (
  IF NOT EXIST C:\sf2cute (
    git clone https://github.com/frabert/sf2cute C:/sf2cute
  )

  mkdir C:\build_sf2cute_x86-64
  cd C:\build_sf2cute_x86-64
  cmake -G "Visual Studio 15 2017 Win64" -D CMAKE_INSTALL_PREFIX=C:/install_prefix_x86-64 -D BUILD_TESTING=OFF C:/sf2cute
  cmake --build . --target INSTALL --config Release
  cd C:\projects\libdmusic
)

Build 64bit sf2cute

Build 64bit sf2cute


@ECHO OFF
call check.bat
set /p ask=Upload to S3 (y/n)?
if %ask% == y (
	git add .
	set /p msg=Git commit message :
	git commit -m "%msg%"
	echo "%msg%"
)

@ECHO OFF
call check.bat
set /p ask=Upload to S3 (y/n)?
if %ask% == y (
	git add .
	set /p msg=Git commit message :
	git commit -m "%msg%"
	git push
	call doPush.bat
)

Test bat build

Test bat build


@echo off
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
setlocal
set NUNIT_CONSOLE_PATH=tools\NUnit.ConsoleRunner.3.5.0\tools\nunit3-console.exe
if exist %NUNIT_CONSOLE_PATH% goto :test-all
for %%i in (NuGet.exe) do set nuget=%%~dpnx$PATH:i
if "%nuget%"=="" goto :nonuget
nuget.exe install NUnit.Console -Version 3.5.0 -OutputDirectory tools || exit /b 1
:test-all
call build ^
  && call :test netcore10 Debug ^
  && call :test netcore10 Release ^
  && call :test net451 Debug ^
  && call :test net451 Release
goto :EOF

:test
setlocal
echo Testing %1 (%2)...
if %1==netcore10 (
    dotnet test -f netcoreapp1.0 -c %2 MoreLinq.Test
) else (
    %NUNIT_CONSOLE_PATH% MoreLinq.Test\bin\%2\%1\win7-x86\MoreLinq.Test.dll
)
goto :EOF

:nonuget
echo>&2 NuGet executable not found in PATH
echo>&2 To download a version, see https://dist.nuget.org/
exit /b 2

@echo off
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
setlocal
set NUNIT_CONSOLE_PATH=tools\NUnit.ConsoleRunner.3.5.0\tools\nunit3-console.exe
if exist %NUNIT_CONSOLE_PATH% goto :test-all
for %%i in (NuGet.exe) do set nuget=%%~dpnx$PATH:i
if "%nuget%"=="" goto :nonuget
nuget.exe install NUnit.Console -Version 3.5.0 -OutputDirectory tools || exit /b 1
:test-all
call build ^
  && call :test netcore10 Debug ^
  && call :test netcore10 Release ^
  && call :test net451 Debug ^
  && call :test net451 Release
goto :EOF

:test
setlocal
echo Testing %1 (%2)...
if %1==netcore10 (
    dotnet test -f netcoreapp1.0 -c %2 MoreLinq.Test
) else (
    for /d %%d in (MoreLinq.Test\bin\%2\%1\win*) do (
        %NUNIT_CONSOLE_PATH% %%d\MoreLinq.Test.dll
    )
)
goto :EOF

:nonuget
echo>&2 NuGet executable not found in PATH
echo>&2 To download a version, see https://dist.nuget.org/
exit /b 2

Fix test script to pick up RID dir dynamically


Fix whitespace and command-output handling of npm.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\javanano
md include\google\protobuf\compiler\python
md include\google\protobuf\compiler\ruby
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\javanano\javanano_generator.h include\google\protobuf\compiler\javanano\javanano_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\compiler\ruby\ruby_generator.h include\google\protobuf\compiler\ruby\ruby_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_enum_util.h include\google\protobuf\generated_enum_util.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_entry_lite.h include\google\protobuf\map_entry_lite.h
copy ..\src\google\protobuf\map_field.h include\google\protobuf\map_field.h
copy ..\src\google\protobuf\map_field_lite.h include\google\protobuf\map_field_lite.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\hash.h include\google\protobuf\stubs\hash.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
copy google\protobuf\stubs\pbconfig.h include\google\protobuf\stubs\pbconfig.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\javanano
md include\google\protobuf\compiler\python
md include\google\protobuf\compiler\ruby
copy ..\src\google\protobuf\any.pb.h include\google\protobuf\any.pb.h
copy ..\src\google\protobuf\api.pb.h include\google\protobuf\api.pb.h
copy ..\src\google\protobuf\any.h include\google\protobuf\any.h
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\csharp\csharp_generator.h include\google\protobuf\compiler\csharp\csharp_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\java\java_names.h include\google\protobuf\compiler\java\java_names.h
copy ..\src\google\protobuf\compiler\javanano\javanano_generator.h include\google\protobuf\compiler\javanano\javanano_generator.h
copy ..\src\google\protobuf\compiler\objectivec\objectivec_generator.h include\google\protobuf\compiler\objectivec\objectivec_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\compiler\ruby\ruby_generator.h include\google\protobuf\compiler\ruby\ruby_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\empty.pb.h include\google\protobuf\empty.pb.h
copy ..\src\google\protobuf\extension_set.h include\google\protobuf\extension_set.h
copy ..\src\google\protobuf\field_mask.pb.h include\google\protobuf\field_mask.pb.h
copy ..\src\google\protobuf\generated_enum_reflection.h include\google\protobuf\generated_enum_reflection.h
copy ..\src\google\protobuf\generated_enum_util.h include\google\protobuf\generated_enum_util.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_entry_lite.h include\google\protobuf\map_entry_lite.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_field_lite.h include\google\protobuf\map_field_lite.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\source_context.pb.h include\google\protobuf\source_context.pb.h
copy ..\src\google\protobuf\struct.pb.h include\google\protobuf\struct.pb.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\hash.h include\google\protobuf\stubs\hash.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\shared_ptr.h include\google\protobuf\stubs\shared_ptr.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\timestamp.pb.h include\google\protobuf\timestamp.pb.h
copy ..\src\google\protobuf\type.pb.h include\google\protobuf\type.pb.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
copy ..\src\google\protobuf\wrappers.pb.h include\google\protobuf\wrappers.pb.h
copy google\protobuf\stubs\pbconfig.h include\google\protobuf\stubs\pbconfig.h

Add new headers to extract_includes.bat

Add new headers to extract_includes.bat


@echo off
setlocal

if "%~1" equ "" goto :wrongSyntax

if not defined CMDER_USER_FLAGS (
  :: in case nothing was passed to %CMDER_USER_FLAGS%
  set "CMDER_USER_FLAGS= "
)

set "feNot=false"
goto :parseArgument

:doShift
  shift

:parseArgument
set "currenArgu=%~1"
if /i "%currenArgu%" equ "/setPath" (
  :: set %flag_exists% shortcut
  endlocal
  set "ccall=call %~dp0cexec.cmd"
  set "cexec=%~dp0cexec.cmd"
) else if /i "%currenArgu%" == "/?" (
  goto :help
) else if /i "%currenArgu%" equ "/help" (
  goto :help
) else if /i "%currenArgu%" equ "/h" (
  goto :help
) else if /i "%currenArgu%" equ "NOT" (
  set "feNot=true"
  goto :doShift
) else (
  if "%~1" equ "" goto :wrongSyntax
  if "%~2" equ "" goto :wrongSyntax
  set "feFlagName=%~1"
  set "feCommand=%~2"
  if not "%~3" equ "" (
    set "feParam=%~3"
  )
  goto :detect
)

:detect
:: to avoid erroneous deteciton like "/do" "/doNOT", which both have a "/do"
:: we added a space after the flag name, like "/do ", which won't match "/doN"
set "feFlagName=%feFlagName% "
:: echo.
:: echo %CMDER_USER_FLAGS%
:: echo %feNOT%
:: echo %feFlagName%
:: echo %feCommand%
:: echo %feParam%
:: echo.
echo %CMDER_USER_FLAGS% | %WINDIR%\System32\find /i "%feFlagName%">nul
if "%ERRORLEVEL%" == "0" (
  if "%feNOT%" == "false" (
    endlocal && call %feCommand% %feParam%
    exit /b 0
  )
) else (
  if "%feNOT%" == "true" (
    endlocal && call %feCommand% %feParam%
    exit /b 0
  )
)
endlocal
exit /b 1

:wrongSyntax
echo The syntax of the command is incorrect.
echo.
echo use /? for help
echo.
endlocal
exit /b

:help
echo.
echo CExec - Conditional Exec
echo.
echo Handles with custom arguments for cmder's init.bat.
echo   written by xiazeyu, inspired DRSDavidSoft.
echo.
echo Usage:
echo.
echo cexec /setPath [NOT] flagName command/program [parameters]
echo.
echo   /setPath         Generate a global varibles %%ccall%% and  %%cexec%% for
echo                    quicker use. Following arguments will be ignored.
echo.
echo   NOT              Specifies that cexec should carry out
echo                    the command only if the flag is missing.
echo.
echo   /[flagName]      Specifies which flag name is to detect. It's recommand
echo                    to use a pair of double quotation marks to wrap
echo                    your flag name to avoid exceed expectation.
echo.
echo   command/program  Specifies the command to carry out if the
echo                    argument name is detected. It's recommand to
echo                    use a pair of double quotation marks to
echo                    wrap your command to avoid exceed expectation.
echo.
echo   parameters       These are the parameters passed to the command/program.
echo                    It's recommand to use a pair of double quotation marks
echo                    to wrap your flag name to avoid exceed expectation.
echo.
echo Examples:
echo.
echo   These examples are expected to be written in %cmder_root%/config/user-profile.cmd
echo   CExec evaluates the environment varible "CMDER_USER_FLAGS" and conditionally
echo   caries out actions based on flags that are passed.
echo.
echo   Case 1:
echo.
echo   The following command in `user_profile.cmd` would execute "notepad.exe" and continue running the `user_profile.cmd`
echo.
echo     "%ccall%" "/startNotepad" "start" "notepad.exe"
echo.
echo   If you pass parameter to init.bat like:
echo.
echo     init.bat /startNotepad
echo.
echo   Case 2:
echo.
echo   The following command in `user_profile.cmd` would execute "notepad.exe" and stop running the `user_profile.cmd`
echo.
echo     "%cexec%" NOT "/dontStartNotepad" "start" "notepad.exe"
echo.
echo   UNLESS you pass parameter to init.bat like:
echo.
echo     init.bat /dontStartNotepad
echo.
endlocal
exit /b

@echo off
setlocal

if "%~1" equ "" goto :wrongSyntax

if not defined CMDER_USER_FLAGS (
  :: in case nothing was passed to %CMDER_USER_FLAGS%
  set "CMDER_USER_FLAGS= "
)

set "feNot=false"
goto :parseArgument

:doShift
  shift

:parseArgument
set "currenArgu=%~1"
if /i "%currenArgu%" equ "/setPath" (
  :: set %flag_exists% shortcut
  endlocal
  set "ccall=call ^"%~dp0cexec.cmd^""
  set "cexec=^"%~dp0cexec.cmd^""
) else if /i "%currenArgu%" == "/?" (
  goto :help
) else if /i "%currenArgu%" equ "/help" (
  goto :help
) else if /i "%currenArgu%" equ "/h" (
  goto :help
) else if /i "%currenArgu%" equ "NOT" (
  set "feNot=true"
  goto :doShift
) else (
  if "%~1" equ "" goto :wrongSyntax
  if "%~2" equ "" goto :wrongSyntax
  set "feFlagName=%~1"
  set "feCommand=%~2"
  if not "%~3" equ "" (
    set "feParam=%~3"
  )
  goto :detect
)

:detect
:: to avoid erroneous deteciton like "/do" "/doNOT", which both have a "/do"
:: we added a space after the flag name, like "/do ", which won't match "/doN"
set "feFlagName=%feFlagName% "
:: echo.
:: echo %CMDER_USER_FLAGS%
:: echo %feNOT%
:: echo %feFlagName%
:: echo %feCommand%
:: echo %feParam%
:: echo.
echo %CMDER_USER_FLAGS% | %WINDIR%\System32\find /i "%feFlagName%">nul
if "%ERRORLEVEL%" == "0" (
  if "%feNOT%" == "false" (
    endlocal && call %feCommand% %feParam%
    exit /b 0
  )
) else (
  if "%feNOT%" == "true" (
    endlocal && call %feCommand% %feParam%
    exit /b 0
  )
)
endlocal
exit /b 1

:wrongSyntax
echo The syntax of the command is incorrect.
echo.
echo use /? for help
echo.
endlocal
exit /b

:help
echo.
echo CExec - Conditional Exec
echo.
echo Handles with custom arguments for cmder's init.bat.
echo   written by xiazeyu, inspired DRSDavidSoft.
echo.
echo Usage:
echo.
echo cexec /setPath [NOT] flagName command/program [parameters]
echo.
echo   /setPath         Generate a global varibles %%ccall%% and  %%cexec%% for
echo                    quicker use. Following arguments will be ignored.
echo.
echo   NOT              Specifies that cexec should carry out
echo                    the command only if the flag is missing.
echo.
echo   /[flagName]      Specifies which flag name is to detect. It's recommand
echo                    to use a pair of double quotation marks to wrap
echo                    your flag name to avoid exceed expectation.
echo.
echo   command/program  Specifies the command to carry out if the
echo                    argument name is detected. It's recommand to
echo                    use a pair of double quotation marks to
echo                    wrap your command to avoid exceed expectation.
echo.
echo   parameters       These are the parameters passed to the command/program.
echo                    It's recommand to use a pair of double quotation marks
echo                    to wrap your flag name to avoid exceed expectation.
echo.
echo Examples:
echo.
echo   These examples are expected to be written in %cmder_root%/config/user-profile.cmd
echo   CExec evaluates the environment varible "CMDER_USER_FLAGS" and conditionally
echo   caries out actions based on flags that are passed.
echo.
echo   Case 1:
echo.
echo   The following command in `user_profile.cmd` would execute "notepad.exe" and continue running the `user_profile.cmd`
echo.
echo     "%ccall%" "/startNotepad" "start" "notepad.exe"
echo.
echo   If you pass parameter to init.bat like:
echo.
echo     init.bat /startNotepad
echo.
echo   Case 2:
echo.
echo   The following command in `user_profile.cmd` would execute "notepad.exe" and stop running the `user_profile.cmd`
echo.
echo     "%cexec%" NOT "/dontStartNotepad" "start" "notepad.exe"
echo.
echo   UNLESS you pass parameter to init.bat like:
echo.
echo     init.bat /dontStartNotepad
echo.
endlocal
exit /b

fix cexec.cmd

fix cexec.cmd


@echo off
@pushd %~dp0

ECHO Remember to build the solution first!

pause

"%~dp0\TestHarness\packages\NUnit.Runners.2.6.4\tools\nunit-console.exe" "%~dp0\TestHarness\nunit\bin\Debug\nunitHarness.dll" /result="%~dp0\results-example-nunit.xml"

"%~dp0\TestHarness\packages\NUnit.Console.3.0.0\tools\nunit3-console.exe" "%~dp0\TestHarness\nunit3\bin\Debug\nunit3Harness.dll" /result="%~dp0\results-example-nunit3.xml"

"%~dp0\TestHarness\packages\SpecRun.Runner.1.2.0\tools\specrun.exe" run default.srprofile "/baseFolder:%~dp0\TestHarness\SpecRun\bin\Debug" /log:specrun.log /report:"%~dp0\results-example-specrun.html"

"%~dp0\TestHarness\packagesNonNuget\xunit.runner\xunit.console.clr4.exe" "%~dp0\TestHarness\xunit\bin\Debug\xunitHarness.dll" /xml "%~dp0\results-example-xunit.xml"

"%~dp0\TestHarness\packages\xunit.runner.console.2.1.0\tools\xunit.console.exe" "%~dp0\TestHarness\xunit2\bin\Debug\xunit2Harness.dll" -xml "%~dp0\results-example-xunit2.xml" -parallel none

del "%~dp0\results-example-mstest.trx"
"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:"%~dp0\TestHarness\mstest\bin\Debug\mstestHarness.dll" /resultsfile:"%~dp0\results-example-mstest.trx" /testsettings:"%~dp0\TestHarness\TestSettings.testsettings"

pause

@popd

@echo off
@pushd %~dp0

ECHO Remember to build the solution first!

pause

"%~dp0\TestHarness\packages\NUnit.Runners.2.6.4\tools\nunit-console.exe" "%~dp0\TestHarness\nunit\bin\Debug\nunitHarness.dll" /result="%~dp0\results-example-nunit.xml"

"%~dp0\TestHarness\packages\NUnit.Console.3.0.0\tools\nunit3-console.exe" "%~dp0\TestHarness\nunit3\bin\Debug\nunit3Harness.dll" /result="%~dp0\results-example-nunit3.xml"

"%~dp0\TestHarness\packages\SpecRun.Runner.1.2.0\tools\specrun.exe" run default.srprofile "/baseFolder:%~dp0\TestHarness\SpecRun\bin\Debug" /log:specrun.log /report:"%~dp0\results-example-specrun.html"

"%~dp0\TestHarness\packagesNonNuget\xunit.runner\xunit.console.clr4.exe" "%~dp0\TestHarness\xunit\bin\Debug\xunitHarness.dll" /xml "%~dp0\results-example-xunit.xml"

"%~dp0\TestHarness\packages\xunit.runner.console.2.1.0\tools\xunit.console.exe" "%~dp0\TestHarness\xunit2\bin\Debug\xunit2Harness.dll" -xml "%~dp0\results-example-xunit2.xml" -parallel none

del "%~dp0\results-example-mstest.trx"
"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:"%~dp0\TestHarness\mstest\bin\Debug\mstestHarness.dll" /resultsfile:"%~dp0\results-example-mstest.trx" /testsettings:"%~dp0\TestHarness\TestSettings.testsettings"

cd "%~dp0\TestHarness\Cucumber"
cucumber --format json_pretty --out "%~dp0\results-example.json.json"
cd "%~dp0"

@popd

Add ruby run to the script

Add ruby run to the script


REM Salt bootstrap4win (64 bit)

set shome=c:\salt
set logfile=%shome%\log\bootstrap.log

set dist_url=http://csa-net.dk/salt/dist/win-amd64
set python=python-2.7.3.amd64.msi
set vcredist=vcredist_x64.exe
set openssl=Win64OpenSSL_Light-1_0_0e.exe
set pyzmq=pyzmq-2.1.10.win-amd64-py2.7.msi
set m2crypto=M2Crypto-0.21.1.win-amd64-py2.7.exe
set pycrypto=pycrypto-2.3.win-amd64-py2.7.exe
set pyyaml=PyYAML-3.10.win-amd64-py2.7.msi
set pywin32=pywin32-216.win-amd64-py2.7.exe
set cython=Cython-0.15.1.win-amd64-py2.7.exe
set msgpack=msgpack-python-0.1.12.win-amd64-py2.7.exe
set distsetup=distribute_setup.py
set salt=salt-0.16.3
set unzip=unzip.py
set nssm=nssm.exe

md %shome%\log
call:log Bootstrap initializing
call:logexec md %shome%\download
call:logexec md %shome%\sys
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%python%','%shome%\download\%python%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%vcredist%','%shome%\download\%vcredist%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%openssl%','%shome%\download\%openssl%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%pyzmq%','%shome%\download\%pyzmq%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%m2crypto%','%shome%\download\%m2crypto%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%pycrypto%','%shome%\download\%pycrypto%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%pyyaml%','%shome%\download\%pyyaml%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%pywin32%','%shome%\download\%pywin32%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%cython%','%shome%\download\%cython%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%msgpack%','%shome%\download\%msgpack%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%distsetup%','%shome%\download\%distsetup%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%salt%.zip','%shome%\download\%salt%.zip');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%unzip%','%shome%\download\%unzip%');
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/%nssm%','%shome%\sys\%nssm%');
call:logexec msiexec /i %shome%\download\%python% /quiet /norestart /log %shome%\log\python_install.log TARGETDIR=%shome%\python27 ALLUSERS=0
call:log Setting PATH=%PATH%;%shome%\python27;%shome%\python27\scripts
set PATH=%PATH%;%shome%\python27;%shome%\python27\scripts
call:logexec cmd.exe /c %shome%\download\%vcredist% /q
call:logexec cmd.exe /c %shome%\download\%openssl% /silent /verysilent /sp- /suppressmsgboxes
call:logexec msiexec /i %shome%\download\%pyzmq% /quiet /norestart /log %shome%\log\pyzmq_install.log ALLUSERS=0
call:logexec msiexec /i %shome%\download\%pyyaml% /quiet /norestart /log %shome%\log\pyyaml_install.log ALLUSERS=0
call:logexec cmd.exe /c python %shome%\download\%distsetup%
call:logexec cmd.exe /c %shome%\python27\scripts\easy_install jinja2
call:logexec cmd.exe /c %shome%\python27\scripts\easy_install m2crypto
call:logexec cmd.exe /c %shome%\python27\scripts\easy_install %shome%\download\%pycrypto%
call:logexec cmd.exe /c %shome%\python27\scripts\easy_install %shome%\download\%pywin32%
call:logexec cmd.exe /c %shome%\python27\scripts\easy_install %shome%\download\%cython%
call:logexec cmd.exe /c %shome%\python27\scripts\easy_install %shome%\download\%msgpack%
call:logexec cmd.exe /c python %shome%\download\%unzip% %shome%\download\%salt%.zip -d %shome%
call:log Changing directory to %shome%\%salt%
cd %shome%\%salt%
call:logexec cmd.exe /c python setup.py install
call:logexec cmd.exe /c md %shome%\conf\pki
call:logexec cmd.exe /c PowerShell (New-Object System.Net.WebClient).DownloadFile('%dist_url%/minion.conf','%shome%\conf\minion');
call:logexec cmd.exe /c %shome%\sys\%nssm% install salt-minion %shome%\python27\python %shome%\python27\scripts\salt-minion -c %shome%\conf
call:logexec cmd.exe /c net start salt-minion

goto :EOF

:logexec
SET _pcmd=%*
echo %date% %time% - Executing: %_pcmd% >> %logfile%
%_pcmd% >> %logfile% 2>&1
echo %date% %time% - ReturnCode: %ErrorLevel% >> %logfile%
goto :EOF

:log
echo %date% %time% - Status: %* >> %logfile%
goto: EOF

:EOF

Create windows7-dev-bootstrap.bat

Create windows7-dev-bootstrap.bat

snatch it from salt.


@echo off
::Silakan rubah lokasi executable BIN sesuai instalasi MySQL pada sistem komputer Anda
set lokasi_mysql=C:\xampp\mysql\bin

::Silakan rubah lokasi file *.INI sesuai instalasi MySQL pada sistem komputer Anda
set lokasi_ini=C:\xampp\mysql\bin\my.ini

::Silakan rubah menjadi nama Anda atau nama komputer Anda (opsional)
set pembuat_script=MRHPx aka Rizal / mrhpx at yahoo dot com

echo #################################################################
echo #                                                               #
echo # %pembuat_script%                      #
echo # Mulai menjalankan MySQL, silakan tunggu                       #
echo # Lokasi file *.INI MySQL terletak di %lokasi_ini% #
echo # Mohon jangan tutup jendela ini                                #
echo #                                                               #
echo #################################################################

%lokasi_mysql%\mysqld.exe --defaults-file=%lokasi_ini% --standalone --console

if errorlevel 1 goto error
goto keluar

:error
echo #################################################################
echo #                                                               #
echo # Terjadi kesalahan! MySQL tidak dapat dijalankan               #
echo #                                                               #
echo #################################################################
pause

:keluar

Create Menjalankan_MySQL.bat

Create Menjalankan_MySQL.bat


@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
freetype2, ^
fontconfig, ^
fribidi, ^
harfbuzz, ^
libiconv ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF %ERRORLEVEL% NEQ 0 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR=%CD%
cd %~dp0

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd %CURRDIR% >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF %ERRORLEVEL% NEQ 0 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO SET LIBNAME=%%F
SET LIBNAME=%LIBNAME:*name=%
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME:~1%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd %CURRDIR%
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
freetype2, ^
fontconfig, ^
fribidi, ^
harfbuzz, ^
libiconv ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF ERRORLEVEL 1 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR="%CD%"
cd "%~dp0"

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd "%CURRDIR%" >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF ERRORLEVEL 1 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF ERRORLEVEL 1 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO SET LIBNAME=%%F
SET LIBNAME=%LIBNAME:*name=%
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME:~1%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF ERRORLEVEL 1 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF ERRORLEVEL 1 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd "%CURRDIR%"
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

project: Correct handling of directories with spaces and error codes in dependency bat file.


::$Id$
@echo off
:: Batch script for extracting subversion revision number and writing to specified header define file in specified folder.
:: If folder is missing no file is written
:: Author: Peter Nordin peter.nordin@liu.se
:: Date:   2011-10-26
:: For use in Hopsan, requires TortoiseSVN installed

setlocal
:: TODO: Add more potential paths here
set PATH=%PATH%;"C:\Program Files\TortoiseSVN\bin"
set filename="svnrevnum.h"
set foldername="include"

:: -------------------------------------------
set version=""
set versionS=""
:: Find the revison number, the fith token from the line
for /f "tokens=5" %%i in ('SubWCRev .^|find "Last committed at revision"') do set version=%%i
:: Remove trailing space
for /f "tokens=1 delims=/ " %%a in ("%version%") do set versionS=%%a

:: If the include folder exists write the svnrevnum.h file to that folder
if exist %foldername% (
  call :writeFile "%foldername%/%filename%" %versionS%
)

:: Determine what to report and what exit code to give
:: Exit with code 0 (sucess) or 1 (failed)
if %versionS%=="" (
  echo "Revision information not found"
  exit /b 1
) else (
  echo %versionS%
  exit /b 0
)

:writeFile
  echo //This file has been automatically generated by getSvnRevision.bat > %~1
  echo #ifndef SVNREVNUM_H >> %~1
  echo #define SVNREVNUM_H >> %~1
  if not "%~2"=="" (
    echo #define SVNREVNUM "%~2" >> %~1
  ) else (
    echo //Revision information not found >> %~1
  )
  echo #endif >> %~1
goto:eof

::$Id$
@echo off
:: Batch script for extracting subversion revision number and writing to specified header define file in specified folder.
:: If folder is missing no file is written
:: Author: Peter Nordin peter.nordin@liu.se
:: Date:   2011-10-26
:: For use in Hopsan, requires TortoiseSVN installed

setlocal
:: TODO: Add more potential paths here
set PATH=%PATH%;"C:\Program Files\TortoiseSVN\bin"
set filename="svnrevnum.h"
set foldername="include"

:: -------------------------------------------
set version=""
set versionS=""
:: Find the revison number, the fith token from the line
for /f "tokens=5" %%i in ('SubWCRev .^|find "Last committed at revision"') do set version=%%i
:: Remove trailing space
for /f "tokens=1 delims=/ " %%a in ("%version%") do set versionS=%%a

:: If the include folder exists write the svnrevnum.h file to that folder
if exist %foldername% (
  call :writeFile "%foldername%/%filename%" %versionS%
)

:: Determine what to report and what exit code to give
:: Exit with code 0 (sucess) or 1 (failed)
if %versionS%=="" (
  echo "RevisionInformationNotFound"
  exit /b 1
) else (
  echo %versionS%
  exit /b 0
)

:writeFile
  echo //This file has been automatically generated by getSvnRevision.bat > %~1
  echo #ifndef SVNREVNUM_H >> %~1
  echo #define SVNREVNUM_H >> %~1
  if not "%~2"=="" (
    echo #define SVNREVNUM "%~2" >> %~1
  ) else (
    echo //Revision information not found >> %~1
  )
  echo #endif >> %~1
goto:eof

Make sure we dont have spaces in the error info, As that could be a problem with define, if return code not accepted in qmake


@ECHO OFF
IF "%1"=="" (SET TARGET_DOTNET=35) ELSE (SET TARGET_DOTNET=%1)

IF NOT EXIST gen MKDIR gen
IF NOT EXIST bin MKDIR bin
DEL /Q gen\*.*
DEL /Q bin\*.*

ECHO Generating resources...

tools\ResGen.exe resources/Help.resx gen\HFMCmd.Resource.Help.resources /str:cs,HFMCmd.Resource,Help,gen\HelpResource.cs
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%

IF %TARGET_DOTNET%==35 GOTO DOTNET35
IF %TARGET_DOTNET%==40 GOTO DOTNET40

ECHO Usage: build.bat *Version*, where *Version* is one of: 35 or 40 (default is 35)
EXIT /B 99

:DOTNET35
ECHO Targeting .NET Framework 3.5...
IF NOT EXIST gen\3.5 MKDIR gen\3.5
IF NOT EXIST bin\3.5 MKDIR bin\3.5

ECHO Compiling HFMCmd...
C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe /nologo /target:exe /main:HFMCmd.Launcher /out:gen\3.5\HFMCmd.exe /debug /optimize+ /lib:lib\log4net-1.2.11\bin\net\3.5\release /reference:log4net.dll /lib:lib/hfm-11.1.2.2 /reference:Interop.HFMCONSTANTSLib.dll /reference:Interop.HFMSLICECOMLib.dll /reference:Interop.HFMWAPPLICATIONSLib.dll /reference:Interop.HFMWDOCUMENTSLib.dll /reference:Interop.HFMWSESSIONLib.dll /reference:Interop.HSVCALCULATELib.dll /reference:Interop.HSVCDATALOADLib.dll /reference:Interop.HSVDATALib.dll /reference:Interop.HSVJOURNALLOADACVLib.dll /reference:Interop.HSVJOURNALSLib.dll /reference:Interop.HSVMETADATALib.dll /reference:Interop.HSVMETADATALOADACVLib.dll /reference:Interop.HSVPROCESSFLOWLib.dll /reference:Interop.HSVRESOURCEMANAGERLib.dll /reference:Interop.HSVRULESLOADACVLib.dll /reference:Interop.HSVSECURITYACCESSLib.dll /reference:Interop.HSVSECURITYLOADACVLib.dll /reference:Interop.HSVSESSIONLib.dll /reference:Interop.HSVSTARSCHEMAACMLib.dll /reference:Interop.HSVSYSTEMINFOLib.dll /reference:Interop.HSXCLIENTLib.dll /reference:Interop.HSXSERVERLib.dll /resource:gen\HFMCmd.Resource.Help.resources src\*.cs src\command\*.cs src\commandline\*.cs src\yaml\*.cs src\hfm\*.cs gen\*.cs
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%

ECHO Bundling HFMCmd and libraries into HFMCmd.exe...
tools\ILMerge\ILMerge.exe  /wildcards /lib:C:\WINDOWS\Microsoft.NET\Framework\v3.5 /out:bin\3.5\HFMCmd.exe gen\3.5\HFMCmd.exe lib/hfm-11.1.2.2\*.dll lib\log4net-1.2.11\bin\net\3.5\release\log4net.dll

GOTO END

:DOTNET40
ECHO Targeting .NET Framework 4.0...
IF NOT EXIST gen\4.0 MKDIR gen\4.0
IF NOT EXIST bin\4.0 MKDIR bin\4.0

ECHO Compiling HFMCmd...
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe /nologo /target:exe /main:HFMCmd.Launcher /out:gen\4.0\HFMCmd.exe /debug /optimize+ /lib:lib\log4net-1.2.11\bin\net\4.0\release /reference:log4net.dll /lib:lib/hfm-11.1.2.2 /link:Interop.HFMCONSTANTSLib.dll /link:Interop.HFMSLICECOMLib.dll /link:Interop.HFMWAPPLICATIONSLib.dll /link:Interop.HFMWDOCUMENTSLib.dll /link:Interop.HFMWSESSIONLib.dll /link:Interop.HSVCALCULATELib.dll /link:Interop.HSVCDATALOADLib.dll /link:Interop.HSVDATALib.dll /link:Interop.HSVJOURNALLOADACVLib.dll /link:Interop.HSVJOURNALSLib.dll /link:Interop.HSVMETADATALib.dll /link:Interop.HSVMETADATALOADACVLib.dll /link:Interop.HSVPROCESSFLOWLib.dll /link:Interop.HSVRESOURCEMANAGERLib.dll /link:Interop.HSVRULESLOADACVLib.dll /link:Interop.HSVSECURITYACCESSLib.dll /link:Interop.HSVSECURITYLOADACVLib.dll /link:Interop.HSVSESSIONLib.dll /link:Interop.HSVSTARSCHEMAACMLib.dll /link:Interop.HSVSYSTEMINFOLib.dll /link:Interop.HSXCLIENTLib.dll /link:Interop.HSXSERVERLib.dll /resource:gen\HFMCmd.Resource.Help.resources src\*.cs src\command\*.cs src\commandline\*.cs src\yaml\*.cs src\hfm\*.cs gen\*.cs
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%

ECHO Bundling HFMCmd and libraries into HFMCmd.exe...
tools\ILMerge\ILMerge.exe /targetplatform:v4,C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /wildcards /lib:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /out:bin\4.0\HFMCmd.exe gen\4.0\HFMCmd.exe  lib\log4net-1.2.11\bin\net\4.0\release\log4net.dll

GOTO END

:END
ECHO Build complete!

@ECHO OFF
IF "%1"=="" (SET TARGET_DOTNET=35) ELSE (SET TARGET_DOTNET=%1)

IF NOT EXIST gen MKDIR gen
IF NOT EXIST bin MKDIR bin
DEL /Q gen\*.*
DEL /Q bin\*.*

ECHO Generating resources...

tools\ResGen.exe resources/Help.resx gen\HFMCmd.Resource.Help.resources /str:cs,HFMCmd.Resource,Help,gen\HelpResource.cs
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%

IF %TARGET_DOTNET%==35 GOTO DOTNET35
IF %TARGET_DOTNET%==40 GOTO DOTNET40

ECHO Usage: build.bat *Version*, where *Version* is one of: 35 or 40 (default is 35)
EXIT /B 99

:DOTNET35
ECHO Targeting .NET Framework 3.5...
IF NOT EXIST gen\3.5 MKDIR gen\3.5
IF NOT EXIST bin\3.5 MKDIR bin\3.5

ECHO Compiling HFMCmd...
C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe /nologo /target:exe /main:HFMCmd.Launcher /out:gen\3.5\HFMCmd.exe /debug /optimize+ /lib:lib\log4net-1.2.11\bin\net\3.5\release /reference:log4net.dll /lib:lib/hfm-11.1.2.2 /reference:Interop.HFMCONSTANTSLib.dll /reference:Interop.HFMSLICECOMLib.dll /reference:Interop.HFMWAPPLICATIONSLib.dll /reference:Interop.HFMWDOCUMENTSLib.dll /reference:Interop.HFMWSESSIONLib.dll /reference:Interop.HSVCALCULATELib.dll /reference:Interop.HSVCDATALOADLib.dll /reference:Interop.HSVDATALib.dll /reference:Interop.HSVJOURNALLOADACVLib.dll /reference:Interop.HSVJOURNALSLib.dll /reference:Interop.HSVMETADATALib.dll /reference:Interop.HSVMETADATALOADACVLib.dll /reference:Interop.HSVPROCESSFLOWLib.dll /reference:Interop.HSVRESOURCEMANAGERLib.dll /reference:Interop.HSVRULESLOADACVLib.dll /reference:Interop.HSVSECURITYACCESSLib.dll /reference:Interop.HSVSECURITYLOADACVLib.dll /reference:Interop.HSVSESSIONLib.dll /reference:Interop.HSVSTARSCHEMAACMLib.dll /reference:Interop.HSVSYSTEMINFOLib.dll /reference:Interop.HSXCLIENTLib.dll /reference:Interop.HSXSERVERLib.dll /resource:gen\HFMCmd.Resource.CommandLine.resources /resource:gen\HFMCmd.Resource.Help.resources src\*.cs src\command\*.cs src\commandline\*.cs src\yaml\*.cs src\hfm\*.cs gen\*.cs
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%

ECHO Bundling HFMCmd and libraries into HFMCmd.exe...
tools\ILMerge\ILMerge.exe  /wildcards /lib:C:\WINDOWS\Microsoft.NET\Framework\v3.5 /out:bin\3.5\HFMCmd.exe gen\3.5\HFMCmd.exe lib/hfm-11.1.2.2\*.dll lib\log4net-1.2.11\bin\net\3.5\release\log4net.dll

GOTO END

:DOTNET40
ECHO Targeting .NET Framework 4.0...
IF NOT EXIST gen\4.0 MKDIR gen\4.0
IF NOT EXIST bin\4.0 MKDIR bin\4.0

ECHO Compiling HFMCmd...
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe /nologo /target:exe /main:HFMCmd.Launcher /out:gen\4.0\HFMCmd.exe /debug /optimize+ /lib:lib\log4net-1.2.11\bin\net\4.0\release /reference:log4net.dll /lib:lib/hfm-11.1.2.2 /link:Interop.HFMCONSTANTSLib.dll /link:Interop.HFMSLICECOMLib.dll /link:Interop.HFMWAPPLICATIONSLib.dll /link:Interop.HFMWDOCUMENTSLib.dll /link:Interop.HFMWSESSIONLib.dll /link:Interop.HSVCALCULATELib.dll /link:Interop.HSVCDATALOADLib.dll /link:Interop.HSVDATALib.dll /link:Interop.HSVJOURNALLOADACVLib.dll /link:Interop.HSVJOURNALSLib.dll /link:Interop.HSVMETADATALib.dll /link:Interop.HSVMETADATALOADACVLib.dll /link:Interop.HSVPROCESSFLOWLib.dll /link:Interop.HSVRESOURCEMANAGERLib.dll /link:Interop.HSVRULESLOADACVLib.dll /link:Interop.HSVSECURITYACCESSLib.dll /link:Interop.HSVSECURITYLOADACVLib.dll /link:Interop.HSVSESSIONLib.dll /link:Interop.HSVSTARSCHEMAACMLib.dll /link:Interop.HSVSYSTEMINFOLib.dll /link:Interop.HSXCLIENTLib.dll /link:Interop.HSXSERVERLib.dll /resource:gen\HFMCmd.Resource.CommandLine.resources /resource:gen\HFMCmd.Resource.Help.resources src\*.cs src\command\*.cs src\commandline\*.cs src\yaml\*.cs src\hfm\*.cs gen\*.cs
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%

ECHO Bundling HFMCmd and libraries into HFMCmd.exe...
tools\ILMerge\ILMerge.exe /targetplatform:v4,C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /wildcards /lib:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /out:bin\4.0\HFMCmd.exe gen\4.0\HFMCmd.exe  lib\log4net-1.2.11\bin\net\4.0\release\log4net.dll

GOTO END

:END
ECHO Build complete!

Update build.bat for removed resource

Update build.bat for removed resource


@c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /nologo /debug+ /t:library /define:TRACE /out:bin\ReverseProxy.dll code\ReverseProxy.cs

@c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc /nologo /debug+ /t:library /define:TRACE /out:bin\ReverseProxy.dll code\ReverseProxy.cs

Switch build to .NET Framework 3.5

Switch build to .NET Framework 3.5


@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*"

@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"

Return the error code from build.cmd

Return the error code from build.cmd


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

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

nuget restore src\Resharper.ConfigurationSense.sln

"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild" src\Resharper.ConfigurationSense.sln /t:Rebuild /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

nuget pack resharper.nuspec -NoPackageAnalysis -Version %version% -Properties "Configuration=%config%;ReSharperDep=Wave;ReSharperVer=[6.0]"

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

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

nuget restore src\Resharper.ConfigurationSense.sln

"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild" src\Resharper.ConfigurationSense.sln /t:Rebuild /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

nuget pack resharper.nuspec -NoPackageAnalysis -Version %version% -Properties "Configuration=%config%;ReSharperDep=Wave;ReSharperVer=[6.0]"

Update version.

Update version.


@echo off
setlocal
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
if not exist "%MSBUILDEXE%" (
    echo The .NET Framework 4.0 does not appear to be installed on this
    echo machine, which is required to build the solution.
    exit /b 1
)
if "%1"=="docs" call :docs %2 %3 %4 %5 %6 %7 %8 %9 & goto :EOF
call :base %*
goto :EOF

:base
for %%i in (debug release) do "%MSBUILDEXE%" "MoreLinq.sln" /v:m /p:Configuration=%%i %*
goto :EOF

:docs
call :base %*
"%MSBUILDEXE%" MoreLinq.shfbproj %*
goto :EOF

@echo off
setlocal
cd "%~dp0"
set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
if not exist "%MSBUILDEXE%" (
    echo The .NET Framework 4.0 does not appear to be installed on this
    echo machine, which is required to build the solution.
    exit /b 1
)
if "%1"=="docs" call :docs %2 %3 %4 %5 %6 %7 %8 %9 & goto :EOF

:base
for %%i in (debug release) do "%MSBUILDEXE%" "MoreLinq.sln" /v:m /p:Configuration=%%i %*
goto :EOF

:docs
call :base
"%MSBUILDEXE%" MoreLinq.shfbproj %*
goto :EOF

Build script simplification

Build script simplification


@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

:run
CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

:run
CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Update K_BUILD_VERSION/kre/KRE/.k => DNX_BUILD_VERSION/dnx/DNX/.dnx.


@echo off
cd %~dp0

@ECHO OFF
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "& {Import-Module '.\tools\psake\psake.psm1'; invoke-psake .\build.ps1 %*; if ($lastexitcode -ne 0) {write-host "ERROR: $lastexitcode" -fore RED; exit $lastexitcode} }"

Build Push Nuget

Build Push Nuget


@echo off
rem Only need to run this the first time after clone. Subsequent builds can be just "msbuild".
rem Alternatively, this batch file can be invoked passing msbuild parameters, like: build.cmd /v:detailed /t:Rebuild

cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
.nuget\NuGet.exe install packages.config -OutputDirectory .nuget\packages -ExcludeVersion

:run
msbuild build.proj /v:detailed %1 %2 %3 %4 %5 %6 %7 %8 %9

:: Optional batch file to quickly build with some defaults.
:: Alternatively, this batch file can be invoked passing msbuild parameters, like: build.cmd "/v:detailed" "/t:Rebuild"

@ECHO OFF

:: Ensure MSBuild can be located. Allows for a better error message below.
where msbuild > %TEMP%\msbuild.txt
set /p msb=<%TEMP%\msbuild.txt

IF "%msb%"=="" (
    echo Please run %~n0 from a Visual Studio Developer Command Prompt.
    exit /b -1
)

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
PUSHD "%~dp0" >NUL

IF EXIST .nuget\nuget.exe goto restore
IF NOT EXIST .nuget md .nuget
echo Downloading latest version of NuGet.exe...
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile .nuget/nuget.exe"

:restore
:: Build script packages have no version in the path, so we install them to .nuget\packages to avoid conflicts with
:: solution/project packages.
IF NOT EXIST packages.config goto run
.nuget\nuget.exe install packages.config -OutputDirectory .nuget\packages -ExcludeVersion -Verbosity quiet

:run
IF "%Verbosity%"=="" (
    set Verbosity=minimal
)

ECHO ON
"%msb%" build.proj /v:%Verbosity% /nr:true /m %1 %2 %3 %4 %5 %6 %7 %8 %9
@ECHO OFF

POPD >NUL
ENDLOCAL

Improve build script

Improve build script


@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\Sake goto getdnx
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
    .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
    .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

:getdnx
IF "%SKIP_DNX_INSTALL%"=="" (
    IF "%BUILDCMD_DNX_VERSION%"=="" (
        BUILDCMD_DNX_VERSION=latest
    )
    CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
    CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
    CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
)

packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=
SET BUILDCMD_DNX_VERSION=

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\Sake goto getdnx
IF "%BUILDCMD_KOREBUILD_VERSION%"=="" (
    .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
    .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

:getdnx
IF "%BUILDCMD_DNX_VERSION%"=="" (
    SET BUILDCMD_DNX_VERSION=latest
)
IF "%SKIP_DNX_INSTALL%"=="" (
    CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default
    CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default
) ELSE (
    CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
)

packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Fix local build break

Fix local build break


@echo Off
setlocal enableextensions enabledelayedexpansion

if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
	FOR /F "delims=" %%E in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\installer\vswhere.exe" -latest -property installationPath') DO (
		set "MSBUILD_EXE=%%E\MSBuild\15.0\Bin\MSBuild.exe"
		if exist "!MSBUILD_EXE!" goto :build
	)
)

FOR %%E in (Enterprise, Professional, Community) DO (
	set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\%%E\MSBuild\15.0\Bin\MSBuild.exe"
	if exist "!MSBUILD_EXE!" goto :build
)

REM Couldn't be located in the standard locations, expand search
FOR /F "delims=" %%E IN ('dir /b /ad "%ProgramFiles(x86)%\Microsoft Visual Studio\"') DO (
	set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\%%E\MSBuild\15.0\Bin\MSBuild.exe"
	if exist "!MSBUILD_EXE!" goto :build

	FOR /F "delims=" %%F IN ('dir /b /ad "%ProgramFiles(x86)%\Microsoft Visual Studio\%%E"') DO (
		set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\%%E\%%F\MSBuild\15.0\Bin\MSBuild.exe"
		if exist "!MSBUILD_EXE!" goto :build
	)
)

echo Could not find MSBuild 15, it is required to build.
exit /b 1

:build
"%MSBUILD_EXE%" NuGetPackageExplorer.sln /t:Restore
"%MSBUILD_EXE%" NuGetPackageExplorer.sln /m /bl /verbosity:minimal /p:Configuration=Release

test change

test change


@REM create resource group
az group create --name k8-lab --location canadacentral

@REM create aci
<<<<<<< HEAD
az container create --name mycontain0er --image tutum/hello-world --resource-group k8-lab --ip-address public --port 80
=======
az container create --name mycontainer --image tutum/hello-world --resource-group myResourceGroup --ip-address public --port 80
>>>>>>> origin/master

@REM show details and public ip
az container show --name mycontainer --resource-group k8-lab

@REM show logs
@REM az container logs --name mycontainer --resource-group myResourceGroup

@REM delete everything
@REM az container delete --name mycontainer --resource-group myResourceGroup
@REM az group delete -n myResourceGroup --yes

@REM create resource group
az group create --name k8-lab --location canadacentral

@REM create aci
az container create --name mycontainer --image tutum/hello-world --resource-group myResourceGroup --ip-address public --port 80

@REM show details and public ip
az container show --name mycontainer --resource-group k8-lab

@REM show logs
@REM az container logs --name mycontainer --resource-group myResourceGroup

@REM delete everything
@REM az container delete --name mycontainer --resource-group myResourceGroup
@REM az group delete -n myResourceGroup --yes

Update aci.cmd

Update aci.cmd


if not exist deps git clone -b master http://buildserver.urbackup.org/git/urbackup_deps deps
cd deps
git reset --hard
git pull
cd ..

Build with Visual Studio 2015

Build with Visual Studio 2015


@rem Fetches (and builds if necessary) external dependencies

@REM XXX FIXME - building for x64 disabled for now.

@rem Assume we start inside the Python source directory
cd ..
call "%VS90COMNTOOLS%vsvars32.bat"

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
@REM if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
@REM    vcbuild db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static
@REM )

@rem OpenSSL
if not exist openssl-0.9.8g (
  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a
  svn export http://svn.python.org/projects/external/openssl-0.9.8g
)

@rem tcltk
if not exist tcl8.4.16 (
   if exist tcltk rd /s/q tcltk
   if exist tcl8.4.12 rd /s/q tcl8.4.12
   if exist tk8.4.12 rd /s/q tk8.4.12
   svn export http://svn.python.org/projects/external/tcl8.4.16
   svn export http://svn.python.org/projects/external/tk8.4.16
@REM    cd tcl8.4.16\win
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
@REM    cd ..\..
@REM    cd tk8.4.16\win
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
@REM    cd ..\..
)

@rem sqlite
if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
@REM if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild

@rem Fetches (and builds if necessary) external dependencies

@REM XXX FIXME - building for x64 disabled for now.

@rem Assume we start inside the Python source directory
cd ..
call "%VS90COMNTOOLS%vsvars32.bat"

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
@rem Remove VS 2003 builds
if exist db-4.4.20 if not exist db-4.4.20\build_win32\this_is_for_vs9 (
   echo Removing old build
   rd /s/q db-4.4.20
)
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20-vs9 db-4.4.20
if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
   vcbuild db-4.4.20\build_win32\db_static.vcproj "Debug AMD64|x64"
)

@rem OpenSSL
if not exist openssl-0.9.8g (
  if exist openssl-0.9.8a rd /s/q openssl-0.9.8a
  svn export http://svn.python.org/projects/external/openssl-0.9.8g
)

@rem tcltk
if not exist tcl8.4.16 (
   if exist tcltk rd /s/q tcltk
   if exist tcl8.4.12 rd /s/q tcl8.4.12
   if exist tk8.4.12 rd /s/q tk8.4.12
   svn export http://svn.python.org/projects/external/tcl8.4.16
   svn export http://svn.python.org/projects/external/tk8.4.16
@REM    cd tcl8.4.16\win
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
@REM    cd ..\..
@REM    cd tk8.4.16\win
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
@REM    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
@REM    cd ..\..
)

@rem sqlite
if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
@REM if not exist build\PCbuild\sqlite3.dll copy sqlite-source-3.3.4\sqlite3.dll build\PCbuild

Update db-4.4.20 build procedure.

Update db-4.4.20 build procedure.