:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT

:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0.."
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__SourceDir=%__ProjectDir%\src"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
set __SkipTestBuild=
set "__DotNetCliPath=%__ProjectDir%\Tools\dotnetcli"

:Arg_Loop
if "%1" == "" goto ArgsDone

if /i "%1" == "/?"    goto Usage
if /i "%1" == "-?"    goto Usage
if /i "%1" == "/h"    goto Usage
if /i "%1" == "-h"    goto Usage
if /i "%1" == "/help" goto Usage
if /i "%1" == "-help" goto Usage

if /i "%1" == "x64"    (set __BuildArch=x64&&shift&goto Arg_Loop)
if /i "%1" == "x86"    (set __BuildArch=x86&&shift&goto Arg_Loop)
if /i "%1" == "arm"    (set __BuildArch=arm&&shift&goto Arg_Loop)
if /i "%1" == "wasm"    (set __BuildOS=WebAssembly&&set __BuildArch=wasm&&shift&goto Arg_Loop)

if /i "%1" == "debug"    (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release"   (set __BuildType=Release&shift&goto Arg_Loop)

if /i "%1" == "clean"   (set __CleanBuild=1&shift&goto Arg_Loop)

if /i "%1" == "skiptests" (set __SkipTests=1&shift&goto Arg_Loop)
if /i "%1" == "skipvsdev" (set __SkipVsDev=1&shift&goto Arg_Loop)
if /i "%1" == "/dotnetclipath" (set __DotNetCliPath=%2&shift&shift&goto Arg_Loop)

if /i "%1" == "/officialbuildid" (set "__ExtraMsBuildParams=/p:OfficialBuildId=%2"&shift&shift&goto Arg_Loop)

echo Invalid command line argument: %1
exit /b 1
:ArgsDone

:: Set the remaining variables based upon the determined build configuration
set "__BinDir=%__RootBinDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__ObjDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\Native\%__BuildOS%.%__BuildArch%.%__BuildType%\"
set "__NativeBuildLog=%__LogsDir%\Native_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
set "__BuildLog=%__LogsDir%\msbuild_%__BuildOS%__%__BuildArch%__%__BuildType%.log"

:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set "__CMakeBinDir=%__BinDir%"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"

:: Configure environment if we are doing a clean build.
if not defined __CleanBuild goto MakeDirs
echo Doing a clean build
echo.

:: Cleanup the previous output for the selected configuration
if exist "%__BinDir%" rd /s /q "%__BinDir%"
if exist "%__ObjDir%" rd /s /q "%__ObjDir%"
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"

if exist "%__LogsDir%" del /f /q "%__LogsDir%\*_%__BuildOS%__%__BuildArch%__%__BuildType%.*"

:MakeDirs
if not exist "%__BinDir%" md "%__BinDir%"
if not exist "%__ObjDir%" md "%__ObjDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
if not exist "%__LogsDir%" md "%__LogsDir%"

:: Check prerequisites
echo Checking pre-requisites...
echo.

if "%__BuildArch%"=="wasm" (
    goto :CheckPrereqsEmscripten
) else (
    goto :CheckPrereqsVs
)

:CheckPrereqsEmscripten
if not defined EMSCRIPTEN (
    echo Emscripten is a prerequisite to build for WebAssembly.
    echo See: https://github.com/dotnet/corert/blob/master/Documentation/how-to-build-WebAssembly.md
    exit /b 1
)
goto CheckPrereqsVs

:CheckPrereqsVs
:: Validate that PowerShell is accessibile.
for %%X in (powershell.exe) do (set __PSDir=%%~$PATH:X)
if defined __PSDir goto EvaluatePS
echo PowerShell is a prerequisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1

:EvaluatePS
:: Eval the output from probe-win1.ps1
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\Native\probe-win.ps1"""') do %%a

:: Default to highest Visual Studio version available
::
:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
:: is no longer set as a global environment variable and is instead only set if the user
:: has launched the VS2017 Developer Command Prompt.
::
:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
:: is already configured to use that toolset. Otherwise, we will fallback to using the latest
:: VS2017 toolset if it is installed. Finally, we will fail the script if no supported VS instance
:: can be found.

if defined VisualStudioVersion goto :RunVCVars

set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist %_VSWHERE% (
  for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -prerelease -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
)
if not exist "%_VSCOMNTOOLS%" goto :MissingVersion

call "%_VSCOMNTOOLS%\VsDevCmd.bat"

:RunVCVars
if "%VisualStudioVersion%"=="15.0" (
    goto :VS2017
)

:MissingVersion
:: Can't find VS 2017
echo Visual Studio 2017 is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1

:VS2017
:: Setup vars for VS2017
set __VSVersion=vs2017
set __VSProductVersion=150
if not exist "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\Auxiliary\Build\vcvarsall.bat" goto :MissingVisualC
goto :CheckMSBuild

:MissingVisualC
echo Could not find Visual C++ under !VS%__VSProductVersion%COMNTOOLS!. Visual C++ is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1

:CheckMSBuild
rem The MSBuild that is installed in the shared location is not compatible
rem with VS2017 C++ projects. I must use the MSBuild located in
rem C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
set _msbuildexe="%VSINSTALLDIR%\MSBuild\15.0\Bin\MSBuild.exe"

if not exist !_msbuildexe! (echo Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md for build instructions. && exit /b 1)

rem Explicitly set Platform causes conflicts in managed project files. Clear it to allow building from VS x64 Native Tools Command Prompt
set Platform=

:: Set the environment for the native build
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)

set __NugetRuntimeId=win7-x64
if /i "%__BuildArch%" == "x86" (set __NugetRuntimeId=win7-x86)

:Done
set BUILDVARS_DONE=1
exit /b 0

:Usage
echo.
echo Build the CoreRT repo.
echo.
echo Usage:
echo     %__ThisScriptShort% [option1] [option2] ...
echo.
echo All arguments are optional. The options are:
echo.
echo./? -? /h -h /help -help: view this message.
echo Build architecture: one of x64, x86, arm, wasm ^(default: x64^).
echo Build type: one of Debug, Checked, Release ^(default: Debug^).
echo clean: force a clean build ^(default is to perform an incremental build^).
echo skiptests: skip building tests ^(default: tests are built^).
exit /b 1

:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT

:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0.."
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__SourceDir=%__ProjectDir%\src"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
set __SkipTestBuild=
set "__DotNetCliPath=%__ProjectDir%\Tools\dotnetcli"

:Arg_Loop
if "%1" == "" goto ArgsDone

if /i "%1" == "/?"    goto Usage
if /i "%1" == "-?"    goto Usage
if /i "%1" == "/h"    goto Usage
if /i "%1" == "-h"    goto Usage
if /i "%1" == "/help" goto Usage
if /i "%1" == "-help" goto Usage

if /i "%1" == "x64"    (set __BuildArch=x64&&shift&goto Arg_Loop)
if /i "%1" == "x86"    (set __BuildArch=x86&&shift&goto Arg_Loop)
if /i "%1" == "arm"    (set __BuildArch=arm&&shift&goto Arg_Loop)
if /i "%1" == "wasm"    (set __BuildOS=WebAssembly&&set __BuildArch=wasm&&shift&goto Arg_Loop)

if /i "%1" == "debug"    (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release"   (set __BuildType=Release&shift&goto Arg_Loop)

if /i "%1" == "clean"   (set __CleanBuild=1&shift&goto Arg_Loop)

if /i "%1" == "skiptests" (set __SkipTests=1&shift&goto Arg_Loop)
if /i "%1" == "skipvsdev" (set __SkipVsDev=1&shift&goto Arg_Loop)
if /i "%1" == "/dotnetclipath" (set __DotNetCliPath=%2&shift&shift&goto Arg_Loop)

if /i "%1" == "/officialbuildid" (set "__ExtraMsBuildParams=/p:OfficialBuildId=%2"&shift&shift&goto Arg_Loop)

echo Invalid command line argument: %1
exit /b 1
:ArgsDone

:: Set the remaining variables based upon the determined build configuration
set "__BinDir=%__RootBinDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__ObjDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\Native\%__BuildOS%.%__BuildArch%.%__BuildType%\"
set "__NativeBuildLog=%__LogsDir%\Native_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
set "__BuildLog=%__LogsDir%\msbuild_%__BuildOS%__%__BuildArch%__%__BuildType%.log"

:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set "__CMakeBinDir=%__BinDir%"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"

:: Configure environment if we are doing a clean build.
if not defined __CleanBuild goto MakeDirs
echo Doing a clean build
echo.

:: Cleanup the previous output for the selected configuration
if exist "%__BinDir%" rd /s /q "%__BinDir%"
if exist "%__ObjDir%" rd /s /q "%__ObjDir%"
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"

if exist "%__LogsDir%" del /f /q "%__LogsDir%\*_%__BuildOS%__%__BuildArch%__%__BuildType%.*"

:MakeDirs
if not exist "%__BinDir%" md "%__BinDir%"
if not exist "%__ObjDir%" md "%__ObjDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
if not exist "%__LogsDir%" md "%__LogsDir%"

:: Check prerequisites
echo Checking pre-requisites...
echo.

if "%__BuildArch%"=="wasm" (
    goto :CheckPrereqsEmscripten
) else (
    goto :CheckPrereqsVs
)

:CheckPrereqsEmscripten
if not defined EMSCRIPTEN (
    echo Emscripten is a prerequisite to build for WebAssembly.
    echo See: https://github.com/dotnet/corert/blob/master/Documentation/how-to-build-WebAssembly.md
    exit /b 1
)
goto CheckPrereqsVs

:CheckPrereqsVs
:: Validate that PowerShell is accessibile.
for %%X in (powershell.exe) do (set __PSDir=%%~$PATH:X)
if defined __PSDir goto EvaluatePS
echo PowerShell is a prerequisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1

:EvaluatePS
:: Eval the output from probe-win1.ps1
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\Native\probe-win.ps1"""') do %%a

:: Default to highest Visual Studio version available
::
:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
:: is no longer set as a global environment variable and is instead only set if the user
:: has launched the VS2017 Developer Command Prompt.
::
:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
:: is already configured to use that toolset. Otherwise, we will fallback to using the latest
:: VS2017 toolset if it is installed. Finally, we will fail the script if no supported VS instance
:: can be found.

if defined VisualStudioVersion goto :RunVCVars

set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist %_VSWHERE% (
  for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -prerelease -property installationPath -products *`) do set _VSCOMNTOOLS=%%i\Common7\Tools
)
if not exist "%_VSCOMNTOOLS%" goto :MissingVersion

call "%_VSCOMNTOOLS%\VsDevCmd.bat"

:RunVCVars
if "%VisualStudioVersion%"=="15.0" (
    goto :VS2017
)

:MissingVersion
:: Can't find VS 2017
echo Visual Studio 2017 is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1

:VS2017
:: Setup vars for VS2017
set __VSVersion=vs2017
set __VSProductVersion=150
if not exist "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\Auxiliary\Build\vcvarsall.bat" goto :MissingVisualC
goto :CheckMSBuild

:MissingVisualC
echo Could not find Visual C++ under !VS%__VSProductVersion%COMNTOOLS!. Visual C++ is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1

:CheckMSBuild
rem The MSBuild that is installed in the shared location is not compatible
rem with VS2017 C++ projects. I must use the MSBuild located in
rem C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
set _msbuildexe="%VSINSTALLDIR%\MSBuild\15.0\Bin\MSBuild.exe"

if not exist !_msbuildexe! (echo Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md for build instructions. && exit /b 1)

rem Explicitly set Platform causes conflicts in managed project files. Clear it to allow building from VS x64 Native Tools Command Prompt
set Platform=

:: Set the environment for the native build
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)

set __NugetRuntimeId=win7-x64
if /i "%__BuildArch%" == "x86" (set __NugetRuntimeId=win7-x86)

:Done
set BUILDVARS_DONE=1
exit /b 0

:Usage
echo.
echo Build the CoreRT repo.
echo.
echo Usage:
echo     %__ThisScriptShort% [option1] [option2] ...
echo.
echo All arguments are optional. The options are:
echo.
echo./? -? /h -h /help -help: view this message.
echo Build architecture: one of x64, x86, arm, wasm ^(default: x64^).
echo Build type: one of Debug, Checked, Release ^(default: Debug^).
echo clean: force a clean build ^(default is to perform an incremental build^).
echo skiptests: skip building tests ^(default: tests are built^).
exit /b 1

Add ability to build CoreRT with VS BuildTools 2017 (#5243)


@echo off

set BOOST_ROOT=D:/dev/boost_1_65_1
set BOOST_LIBRARYDIR=D:/dev/boost_1_65_1/lib/stage
set INCLUDE=%BOOST_ROOT%;D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
set QL_DIR=%CD%\QuantLib
set QLEXT_DIR=%CD%\QuantLib-Ext
set BUILD_TYPE=Release
set ADDRESS_MODEL=Win64

cd QuantLib

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

if %ADDRESS_MODEL%==Win64 (
  set PLATFORM=x64
) else (
  set PLATFORM=Win32
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLib.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

quantlib-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-Ext

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLibExt.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

quantlibext-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-SWIG\Python

python setup.py wrap
python setup.py build
python setup.py bdist_wheel

if %errorlevel% neq 0 exit /b 1

cd ..\..

@echo on

@echo off

set BOOST_ROOT=D:/dev/boost_1_65_1
set BOOST_LIBRARYDIR=D:/dev/boost_1_65_1/lib/stage
set INCLUDE=%BOOST_ROOT%;D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
set QL_DIR=%CD%\QuantLib
set QLEXT_DIR=%CD%\QuantLib-Ext
set BUILD_TYPE=Release
set ADDRESS_MODEL=Win64

cd QuantLib

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

if %ADDRESS_MODEL%==Win64 (
  set PLATFORM=x64
) else (
  set PLATFORM=Win32
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QL_DIR% --target install ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QL_DIR% --target install ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLib.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

quantlib-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-Ext

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QLEXT_DIR% --target install ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QLEXT_DIR% --target install ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLibExt.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

quantlibext-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-SWIG\Python

python setup.py wrap
python setup.py build
python setup.py bdist_wheel

if %errorlevel% neq 0 exit /b 1

cd ..\..

@echo on

update windows script

update windows script


@echo off
setlocal enableextensions

mkdir ReformatUtils 2> NUL
copy /y ..\src\resharper-reformatutils\bin\Release\* ReformatUtils

@echo off
setlocal enableextensions

mkdir ReformatUtils 2> NUL
copy /y ..\src\ReformatUtils\bin\Release\* ReformatUtils

Fix helper script (update path)

Fix helper script (update path)


CALL .\.venv\Scripts\activate
pip install -r .\requirements.txt
pyinstaller .\rocketleagueminimapgenerator\main.py --onefile

MOVE /Y .\dist\main.exe .\dist\rocketleagueminimapgenerator.exe
COPY /Y .\README.md .\dist\README.txt
DEL /S /Q .\dist\assets
COPY /Y .\assets .\dist\assets

powershell Compress-Archive -Force -Path .\dist\rocketleagueminimapgenerator.exe, .\dist\README.txt, .\dist\assets -DestinationPath .\dist\rocketleagueminimapgenerator.zip

pause

CALL .\.venv\Scripts\activate
pip install -r .\requirements.txt
set PYTHONOPTIMIZE=1 && pyinstaller .\rocketleagueminimapgenerator\main.py --onefile

MOVE /Y .\dist\main.exe .\dist\rocketleagueminimapgenerator.exe
COPY /Y .\README.md .\dist\README.txt
DEL /S /Q .\dist\assets
COPY /Y .\assets .\dist\assets

powershell Compress-Archive -Force -Path .\dist\rocketleagueminimapgenerator.exe, .\dist\README.txt, .\dist\assets -DestinationPath .\dist\rocketleagueminimapgenerator.zip

pause

Optimize build output on windows.

Optimize build output on windows.


@rem Fetches (and builds if necessary) external dependencies

@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|Win32"
)

@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
rd /s/q tcltk
rd /s/q tcl8.4.16
rd /s/q tk8.4.16
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
   cd tcl8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
   cd ..\..
   cd tk8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
   cd ..\..
)

@rem sqlite
if not exist sqlite-source-3.3.4 svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
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 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|Win32"
)

@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
   cd tcl8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 INSTALLDIR=..\..\tcltk install
   cd ..\..
   cd tk8.4.16\win
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16
   nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 TCLDIR=..\..\tcl8.4.16 INSTALLDIR=..\..\tcltk install
   cd ..\..
)

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

Revert previous checkin; Tcl/Tk seems to build fine.


@echo CREATING MICROSOFT IMPORT LIBRARY FOR CSOUND64.DLL FOR X64
dumpbin /exports csound-mingw64/csound64.dll > exports.txt
@echo LIBRARY CSOUND64 >> csound64.def
@echo EXPORTS >> csound64.def
FOR /F "skip=19 tokens=4" %%l in (exports.txt) do @echo %%l >> csound64.def
lib /def:csound64.def /out:csound64.lib /machine:x64

Make a Microsoft import library for the x64 csound64.dll.


# Перед импортом закрой все процессы, в которых задействована база данных orc

@echo off

psql --host=localhost --port=5432 --username=postgres -c "DROP DATABASE IF EXISTS orc;"

psql --host=localhost --port=5432 --username=postgres -c "CREATE DATABASE orc;"

psql --host=localhost --port=5432 --username=postgres -c "GRANT ALL PRIVILEGES ON DATABASE orc to admin;"

echo "Enter password of remote database: "

pg_dump --host=ec2-23-23-225-50.compute-1.amazonaws.com --port=5432 --username=hduspsokjkhsmj --dbname=d8lt1tbga2v27l > output.sql

cat output.sql | sed 's/hduspsokjkhsmj/admin/g' > new.sql

psql -U postgres -d orc -f new.sql

psql -U postgres -d orc

@echo off

echo "Before importing close all processes that involve database orc"

psql --host=localhost --port=5432 --username=postgres -c "DROP DATABASE IF EXISTS orc;"

psql --host=localhost --port=5432 --username=postgres -c "CREATE DATABASE orc;"

psql --host=localhost --port=5432 --username=postgres -c "GRANT ALL PRIVILEGES ON DATABASE orc to admin;"

echo "Enter password of remote database: "

pg_dump --host=<host> --port=<port> --username=<username> --dbname=<dbname> > output.sql

cat output.sql | sed 's/<username>/admin/g' > dump.sql

psql -U postgres -d orc -f dump.sql

psql -U postgres -d orc

fix params

import.bat: fix params


rem cygwin_setup.bat configuration.
set _PACKAGES=cron,diffutils,inetutils,ncurses,netcat,openssh,p7zip,procps,python,rsync,screen,unzip,vim,zip,w3m
set _ROOTDIR=C:\cygwin
set _SITE=http://mirrors.xmission.com/cygwin
set _CONFIG_SYSLOGD=True
set _CONFIG_SSHD=True
set _CONFIG_LSA=True

rem cygwin_setup.bat configuration.
set _PACKAGES=cron,diffutils,inetutils,ncurses,netcat,openssh,p7zip,procps,python,rsync,screen,unzip,vim,zip,w3m
set _ROOTDIR=C:\cygwin
set _SITE=http://mirrors.xmission.com/cygwin

rem Enable logging of sshd and it's ilk to /var/log.
set _CONFIG_SYSLOGD=True

rem Enable OpenSSH server.
set _CONFIG_SSHD=True

rem Enable LSA authentication.
rem See http://cygwin.com/cygwin-ug-net/ntsec.html
set _CONFIG_LSA=True

add comments

cygwin_setup_config.bat: add comments


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

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

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

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%

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

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

:GIT_CHECK
call ver | findstr "XP" 2>nul 1>nul
if errorlevel 0 goto :GIT_XP_CHECK
if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_180_CHECK
goto :GIT_1852_CHECK

:GIT_1852_CHECK
set GIT_VERSION=1.8.5.2.chromium.1
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
goto :GIT_COMMON

:: Our new build of git doesn't work on XP (uses newer APIs).
:GIT_XP_CHECK
:: If the new git was installed, remove all old git packages and reinstall the
:: correct version from scratch.
if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin" (
  rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin"
  if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin" (
    rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin"
  )
)
goto :GIT_180_CHECK

:GIT_180_CHECK
set GIT_VERSION=1.8.0
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=%WIN_TOOLS_ROOT_URL%/third_party/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_COMMON
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :MSYS_PATH_CHECK
if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
goto :SVN_CHECK

:MSYS_PATH_CHECK
call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul
if errorlevel 1 goto :SVN_CHECK
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"

:GIT_INSTALL
echo Installing git %GIT_VERSION% (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\git.zip" del "%ZIP_DIR%\git.zip"
echo Fetching from %GIT_ZIP_URL%
cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_ZIP_URL% "%ZIP_DIR%\git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%ZIP_DIR%\git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK

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

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

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

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

:PYTHON_CHECK
:: Note: while the variable talks about 2.7.5, we are now installing 2.7.6.
:: Sorry for the confusion. :(
if "%DEPOT_TOOLS_PYTHON_275%" == "0" goto :PY26_CHECK
if "%DEPOT_TOOLS_PYTHON_27%" == "0" goto :PY26_CHECK
goto :PY27_CHECK

:PY26_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL
set ERRORLEVEL=0
goto :END

:PY27_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
goto :END

:PY27_INSTALL
echo Installing python 2.7.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip "%ZIP_DIR%\python276_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python276_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python276_bin.zip"
set ERRORLEVEL=0
goto :END

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

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

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

:END
call :returncode %ERRORLEVEL%

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

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

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

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%

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

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

:GIT_CHECK
if "%DEPOT_TOOLS_GIT_1852%" == "1" goto :GIT_1852_CHECK
:: Our new build of git doesn't work on some systems (e.g. uses newer APIs than
:: available in XP), so force systems back to the old git while the failures
:: are investigated, unless the new git was explicitly requested above.
goto :GIT_180_FORCE

:GIT_1852_CHECK
set GIT_VERSION=1.8.5.2.chromium.1
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_180_FORCE
:: If the new git was installed, remove all installed git packages to trigger
:: reinstallation of the old version.
if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin" (
  rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin"
  if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin" (
    rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin"
  )
)
goto :GIT_180_CHECK

:GIT_180_CHECK
set GIT_VERSION=1.8.0
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=%WIN_TOOLS_ROOT_URL%/third_party/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_COMMON
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :MSYS_PATH_CHECK
if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
goto :SVN_CHECK

:MSYS_PATH_CHECK
call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul
if errorlevel 1 goto :SVN_CHECK
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"

:GIT_INSTALL
echo Installing git %GIT_VERSION% (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\git.zip" del "%ZIP_DIR%\git.zip"
echo Fetching from %GIT_ZIP_URL%
cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_ZIP_URL% "%ZIP_DIR%\git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%ZIP_DIR%\git.zip"
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK

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

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

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

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

:PYTHON_CHECK
:: Note: while the variable talks about 2.7.5, we are now installing 2.7.6.
:: Sorry for the confusion. :(
if "%DEPOT_TOOLS_PYTHON_275%" == "0" goto :PY26_CHECK
if "%DEPOT_TOOLS_PYTHON_27%" == "0" goto :PY26_CHECK
goto :PY27_CHECK

:PY26_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL
set ERRORLEVEL=0
goto :END

:PY27_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
goto :END

:PY27_INSTALL
echo Installing python 2.7.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip "%ZIP_DIR%\python276_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python276_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python276_bin.zip"
set ERRORLEVEL=0
goto :END

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

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

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

:END
call :returncode %ERRORLEVEL%

Revert default Windows git to the old version.

There are several bot failures, some understood, some not. This will revert
bots to the old git until all the failures can be investigated.

Users who want the new git can still install it with an explicit:
set DEPOT_TOOLS_GIT_1852=1

R=hinoka@google.com

Review URL: https://codereview.chromium.org/150203005

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


@echo off
setlocal EnableExtensions EnableDelayedExpansion

rem ==========================================
rem            PARSE ARGUMENTS
rem ==========================================

set CSCOPE_EXE=cscope
set CSCOPE_ARGS=
set DB_FILE=cscope.out
set FILE_LIST_CMD=
set LOG_FILE=

:ParseArgs
if [%1]==[] goto :DoneParseArgs
if [%1]==[-e] (
    set CSCOPE_EXE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-f] (
    set DB_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-p] (
    set PROJ_ROOT=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-L] (
    set FILE_LIST_CMD=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-l] (
    set LOG_FILE=%~2
    shift
echo Invalid Argument: %1
goto :Usage

:LoopParseArgs
shift
goto :ParseArgs

:DoneParseArgs

rem ==========================================
rem             GENERATE DATABASE
rem ==========================================

if [%LOG_FILE%]==[] set LOG_FILE=CON

echo Locking db file > %LOG_FILE%
echo locked > "%DB_FILE%.lock"

echo Running cscope >> %LOG_FILE%
if NOT ["%FILE_LIST_CMD%"]==[""] (
    if ["%PROJECT_ROOT%"]==["."] (
        for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo "%%F">%DB_FILE%.files
    ) else (
        rem Potentially useful:
        rem http://stackoverflow.com/questions/9749071/cmd-iterate-stdin-piped-from-another-command
        for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo "%PROJECT_ROOT%\%%F">%DB_FILE%.files
    )
) ELSE (
    for /F "usebackq delims=" %%F in (`dir /S /B /A-D .`) do @echo "%%F">%DB_FILE%.files
)
set CSCOPE_ARGS=%CSCOPE_ARGS% -i %DB_FILE%.files
if ["%BUILD_INVERTED_INDEX%"]==["1"] (
    set CSCOPE_ARGS=%CSCOPE_ARGS% -q
)
"%CSCOPE_EXE%" %CSCOPE_ARGS% -b -k -f "%DB_FILE%"
if ERRORLEVEL 1 (
    echo ERROR: Cscope executable returned non-zero code. >> %LOG_FILE%
)

echo Unlocking db file >> %LOG_FILE%
del /F "%DB_FILE%.files" "%DB_FILE%.lock"
if ERRORLEVEL 1 (
    echo ERROR: Unable to remove file lock. >> %LOG_FILE%
)

echo Done. >> %LOG_FILE%

goto :EOF

rem ==========================================
rem                 USAGE
rem ==========================================

:Usage
echo Usage:
echo    %~n0 ^<options^>
echo.
echo    -e [exe=cscope]:             The cscope executable to run
echo    -f [file=cscope.out]:        The path to the database file to create
echo    -p [dir=]:                   The path to the project root
echo    -L [cmd=]:                   The file list command to run
echo    -l [log=]:                   The log file to output to
echo.

@echo off
setlocal EnableExtensions EnableDelayedExpansion

rem ==========================================
rem            PARSE ARGUMENTS
rem ==========================================

set CSCOPE_EXE=cscope
set CSCOPE_ARGS=
set DB_FILE=cscope.out
set FILE_LIST_CMD=
set LOG_FILE=
set BUILD_INVERTED_INDEX=0

:ParseArgs
if [%1]==[] goto :DoneParseArgs
if [%1]==[-e] (
    set CSCOPE_EXE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-f] (
    set DB_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-p] (
    set PROJ_ROOT=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-L] (
    set FILE_LIST_CMD=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-l] (
    set LOG_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-I] (
    set BUILD_INVERTED_INDEX=1
    goto :LoopParseArgs
)
echo Invalid Argument: %1
goto :Usage

:LoopParseArgs
shift
goto :ParseArgs

:DoneParseArgs

rem ==========================================
rem             GENERATE DATABASE
rem ==========================================

if [%LOG_FILE%]==[] set LOG_FILE=CON

echo Locking db file > %LOG_FILE%
echo locked > "%DB_FILE%.lock"

echo Running cscope >> %LOG_FILE%
if NOT ["%FILE_LIST_CMD%"]==[""] (
    if ["%PROJECT_ROOT%"]==["."] (
        for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo "%%F">%DB_FILE%.files
    ) else (
        rem Potentially useful:
        rem http://stackoverflow.com/questions/9749071/cmd-iterate-stdin-piped-from-another-command
        for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo "%PROJECT_ROOT%\%%F">%DB_FILE%.files
    )
) ELSE (
    for /F "usebackq delims=" %%F in (`dir /S /B /A-D .`) do @echo "%%F">%DB_FILE%.files
)
set CSCOPE_ARGS=%CSCOPE_ARGS% -i %DB_FILE%.files
if ["%BUILD_INVERTED_INDEX%"]==["1"] (
    set CSCOPE_ARGS=%CSCOPE_ARGS% -q
)
"%CSCOPE_EXE%" %CSCOPE_ARGS% -b -k -f "%DB_FILE%"
if ERRORLEVEL 1 (
    echo ERROR: Cscope executable returned non-zero code. >> %LOG_FILE%
)

echo Unlocking db file >> %LOG_FILE%
del /F "%DB_FILE%.files" "%DB_FILE%.lock"
if ERRORLEVEL 1 (
    echo ERROR: Unable to remove file lock. >> %LOG_FILE%
)

echo Done. >> %LOG_FILE%

goto :EOF

rem ==========================================
rem                 USAGE
rem ==========================================

:Usage
echo Usage:
echo    %~n0 ^<options^>
echo.
echo    -e [exe=cscope]:             The cscope executable to run
echo    -f [file=cscope.out]:        The path to the database file to create
echo    -p [dir=]:                   The path to the project root
echo    -L [cmd=]:                   The file list command to run
echo    -l [log=]:                   The log file to output to
echo    -I:                          Builds an inverted index
echo.

Fix bad merge of `update_scopedb.cmd`.

Fix bad merge of `update_scopedb.cmd`.


@echo OFF
SET binCount=0
SET objCount=0
@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin 2^>NUL') DO (RMDIR /S /Q "%%G" & SET /A binCount+=1)
@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj 2^>NUL') DO (RMDIR /S /Q "%%G" & SET /A objCount+=1)

echo Found %binCount% bin folders.
echo Found %objCount% obj folders.

SET remaining=0
echo.

@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin 2^>NUL') DO SET /A remaining+=1
@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj 2^>NUL') DO SET /A remaining+=1

rmdir /s /q artifacts

echo.
IF %remaining% == 0 exit

echo Remaining bin and obj folders: %remaining%
echo.
pause

@echo OFF
SET binCount=0
SET objCount=0
@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin 2^>NUL') DO (RMDIR /S /Q "%%G" & SET /A binCount+=1)
@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj 2^>NUL') DO (RMDIR /S /Q "%%G" & SET /A objCount+=1)

echo Found %binCount% bin folders.
echo Found %objCount% obj folders.

SET remaining=0
echo.

@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin 2^>NUL') DO SET /A remaining+=1
@FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj 2^>NUL') DO SET /A remaining+=1

rmdir /s /q artifacts

@FOR /F "tokens=*" %%G IN ('DIR /B /S *.lock.json 2^>NUL') DO (DEL "%%G")

echo.
IF %remaining% == 0 exit

echo Remaining bin and obj folders: %remaining%
echo.
pause

Delete project.lock.json files

delete-output.bat: Delete project.lock.json files


@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

Echo Clear previulsly defined GalleryUrl
set GalleryURl=

SET Param=%1
if "%Param%" NEQ "" (
ECHO Param is defined. Setting GalleryUrl to %Param%.
SET GalleryUrl=%Param%
)

REM If GalleryUrl is still not defined, the default is to use int.nugettest.org
if "%GalleryUrl%"=="" (
ECHO Setting GalleryUrl to the default - int.nugettest.org
SET GalleryUrl=https://int.nugettest.org
)
ECHO The NuGet gallery tests are running against %GalleryUrl%

If Exist ""%VS120COMNTOOLS%"\..\IDE\mstest.exe" (
   set toolpath=%VS120COMNTOOLS%
   goto Run
)

If Exist ""%VS110COMNTOOLS%"..\IDE\mstest.exe" (
   set toolpath=%VS110COMNTOOLS%
   goto Run
)

:Error
Echo The variable toolpath is not set correctly. check your visual studio install. Exiting without running tests...
goto End

:Run
Echo.
Echo Start running NuGet Gallery Functional tests...
Echo The path to mstest.exe is "%toolpath%..\IDE\mstest.exe"
"%toolpath%..\IDE\mstest.exe"  /testsettings:"..\Local.testsettings" /testmetadata:"..\NuGetGallery.FunctionalTests.vsmdi"
Echo Finished running NuGet Gallery Functional tests...
Echo Exit.

:End
endlocal
exit /b 0

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

Echo Set environment variable RunFuntionalTests to True to enable running the functional tests
set RunFuntionalTests=true

Echo Clear previulsly defined GalleryUrl
set GalleryURl=

SET Param=%1
if "%Param%" NEQ "" (
ECHO Param is defined. Setting GalleryUrl to %Param%.
SET GalleryUrl=%Param%
)

REM If GalleryUrl is still not defined, the default is to use int.nugettest.org
if "%GalleryUrl%"=="" (
ECHO Setting GalleryUrl to the default - int.nugettest.org
SET GalleryUrl=https://int.nugettest.org
)
ECHO The NuGet gallery tests are running against %GalleryUrl%

If Exist ""%VS120COMNTOOLS%"\..\IDE\mstest.exe" (
   set toolpath=%VS120COMNTOOLS%
   goto Run
)

If Exist ""%VS110COMNTOOLS%"..\IDE\mstest.exe" (
   set toolpath=%VS110COMNTOOLS%
   goto Run
)

:Error
Echo The variable toolpath is not set correctly. check your visual studio install. Exiting without running tests...
goto End

:Run
Echo.
Echo Start running NuGet Gallery Functional tests...
Echo The path to mstest.exe is "%toolpath%..\IDE\mstest.exe"
"%toolpath%..\IDE\mstest.exe"  /testsettings:"..\Local.testsettings" /testmetadata:"..\NuGetGallery.FunctionalTests.vsmdi"
Echo Finished running NuGet Gallery Functional tests...
Echo Exit.

:End
endlocal
exit /b 0

set the environmental variable RunFunctionalTests=true


@echo off

@rem The call to setenv.bat can be commented out if necessary.
@call "%~dp0\..\..\bin\setenv.bat"

rem set booclasspath
set bootclasspath=-Xbootclasspath/p:%XML_JARS%

set LOOKUP_GROUPS_PROP=-Dcom.gs.jini_lus.groups=%LOOKUPGROUPS%

if "%LOOKUPLOCATORS%" == ""  (
set LOOKUPLOCATORS=
)
set LOOKUP_LOCATORS_PROP=-Dcom.gs.jini_lus.locators=%LOOKUPLOCATORS%

set LCP=.
for %%i in ("%JSHOMEDIR%\lib\platform\velocity\*.jar") do call %JSHOMEDIR%\bin\lcp %%i
set VELOCITY_JARS=%LCP%

set COMMAND_LINE=%JAVACMD% %JAVA_OPTIONS% %bootclasspath% -Dlb.vmDir="%JSHOMEDIR%/tools/apache" %LOOKUP_LOCATORS_PROP% %LOOKUP_GROUPS_PROP% %RMI_OPTIONS% "-Dcom.gs.home=%JSHOMEDIR%" -Djava.security.policy="%POLICY%" -classpath %PRE_CLASSPATH%;%GS_JARS%;%SPRING_JARS%;%JDBC_JARS%;%VELOCITY_JARS%;%POST_CLASSPATH% org.openspaces.pu.container.jee.lb.apache.ApacheLoadBalancerAgent %*

set TITLE="Apache Load Balancer Agent ["%*"] started on [%computername%]"
@title %TITLE%

echo.
echo.
echo Starting apache-lb-agent with line:
echo %COMMAND_LINE%
echo.

%COMMAND_LINE%
goto end

:end
endlocal
title Command Prompt
set TITLE=
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal
exit /B 0

@echo off

@rem The call to setenv.bat can be commented out if necessary.
@call "%~dp0\..\..\bin\setenv.bat"

rem set booclasspath
set bootclasspath=-Xbootclasspath/p:%XML_JARS%

set LOOKUP_GROUPS_PROP=-Dcom.gs.jini_lus.groups=%LOOKUPGROUPS%

if "%LOOKUPLOCATORS%" == ""  (
set LOOKUPLOCATORS=
)
set LOOKUP_LOCATORS_PROP=-Dcom.gs.jini_lus.locators=%LOOKUPLOCATORS%

set LCP=.
for %%i in ("%JSHOMEDIR%\lib\platform\velocity\*.jar") do call "%JSHOMEDIR%"\bin\lcp "%%i"
set VELOCITY_JARS=%LCP%

set COMMAND_LINE=%JAVACMD% %JAVA_OPTIONS% %bootclasspath% -Dlb.vmDir="%JSHOMEDIR%/tools/apache" %LOOKUP_LOCATORS_PROP% %LOOKUP_GROUPS_PROP% %RMI_OPTIONS% "-Dcom.gs.home=%JSHOMEDIR%" -Djava.security.policy=%POLICY% -classpath %PRE_CLASSPATH%;%GS_JARS%;%SPRING_JARS%;%JDBC_JARS%;%VELOCITY_JARS%;%POST_CLASSPATH% org.openspaces.pu.container.jee.lb.apache.ApacheLoadBalancerAgent %*
echo %COMMAND_LINE%
set TITLE="Apache Load Balancer Agent ["%*"] started on [%computername%]"
@title %TITLE%

echo.
echo.
echo Starting apache-lb-agent with line:
echo %COMMAND_LINE%
echo.

%COMMAND_LINE%
goto end

:end
endlocal
title Command Prompt
set TITLE=
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal
exit /B 0

Fix script for windows

Fix script for windows

svn path=/trunk/openspaces/; revision=54801

Former-commit-id: 5966570cb2c3a9b3fd6440d8d532b30e651e5783


echo project (my_sundials_test)>CMakeLists.txt
echo include_directories ("$ENV{PREFIX}/include") >>CMakeLists.txt
echo add_executable (cvRoberts_dns cvRoberts_dns.c) >>CMakeLists.txt
echo target_link_libraries (cvRoberts_dns LINK_PUBLIC m sundials_cvode openblas sundials_nvecserial) >>CMakeLists.txt
echo enable_testing() >>CMakeLists.txt
echo add_test (test_roberts cvRoberts_dns) >>CMakeLists.txt

cmake -G "NMake Makefiles" .
nmake
ctest

rem This should be uncommented when conda-build supports compiler activation at test time for Windows.

rem echo project (my_sundials_test)>CMakeLists.txt
rem echo include_directories ("$ENV{PREFIX}/include") >>CMakeLists.txt
rem echo add_executable (cvRoberts_dns cvRoberts_dns.c) >>CMakeLists.txt
rem echo target_link_libraries (cvRoberts_dns LINK_PUBLIC m sundials_cvode openblas sundials_nvecserial) >>CMakeLists.txt
rem echo enable_testing() >>CMakeLists.txt
rem echo add_test (test_roberts cvRoberts_dns) >>CMakeLists.txt

rem cmake -G "NMake Makefiles" .
rem nmake
rem ctest

comment out all of run_test.bat (until supported)


swig -c++ -python .\win64\NLPIR.interface
copy .\win64\NLPIR.dll %SYSTEMROOT%\system32\
python setup.py build_ext --inplace
python setup.py install
pause

swig -c++ -python NLPIR.interface
copy .\win64\NLPIR.dll %SYSTEMROOT%\system32\
python setup.py build_ext --inplace
python setup.py install
pause

fix little bug of file path for NLPIR.interface


REM the following works for networked drives with spaces!!!
REM Net use p: "\\myNetwork\HPS Classes$\computer programming 2011\Assignments" /persistent:no

REM dir/x gives the short file names.
REM you need to get these paths correct for nodejs, ARM, spark-cli, dfu files
REM NPM_PATH and SparkCLI_PATH may be the same or different.

set NODE_PATH=c:\progra~1\nodejs
set NPM_PATH=c:\progra~1\APPLIC~1\npm
set SPARKCLI_PATH=c:\progra~1\APPLIC~1\npm
set DFU_FILES_PATH=c:\progra~1\AEE653~1\cp12\spark\dfu
set ARM_PATH= c:\AEE653~1\cp12\spark\df

set PATH=C:\Windows;C:\Windows\System32;%NODE_PATH%;%ARM_PATH%;%SPARKCLI_PATH%;%DFU_FILES_PATH%

REM note the next line overwrites the myoutput using > normally >> adds to the file

echo "*************************************" > myoutput.txt 2>&1
echo "%PATH%" >> myoutput.txt 2>&1
PATH    >> myoutput.txt 2>&1

Create mypath.bat

Create mypath.bat


Add update_externals.bat

Add update_externals.bat


"%PYTHON%" setup.py install
"%PYTHON%" setup.py test
if errorlevel 1 exit 1

Create bld.bat

Create bld.bat


:: Fix for https://github.com/jkriege2/JKQtPlotter/issues/35
set "CXXFLAGS= -MD"

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ..
if errorlevel 1 exit 1
cmake --build . --config Release --target install
if errorlevel 1 exit 1

:: Fix for https://github.com/jkriege2/JKQtPlotter/issues/35
set "CXXFLAGS= -MD"

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% -DJKQtPlotter_BUILD_EXAMPLES=OFF -DJKQtPlotter_BUILD_STATIC_LIBS=OFF ..
if errorlevel 1 exit 1
cmake --build . --config Release --target install
if errorlevel 1 exit 1

Disable examples and static libs

Disable examples and static libs


start fgautopilot-0.0.3/fgautopilot.exe

curl -fsS -o nircmd.zip http://www.nirsoft.net/utils/nircmd.zip
7z x nircmd.zip
dir
nircmd.exe cmdwait 20000 savescreenshot "shot.png"
dir
taskkill /f /im "fgautopilot.exe"

start fgautopilot-0.0.3/fgautopilot.exe

curl -fsS -o nircmd.zip http://www.nirsoft.net/utils/nircmd.zip
7z x nircmd.zip
dir
nircmd.exe cmdwait 60000 savescreenshot "shot.png"
dir
taskkill /f /im "fgautopilot.exe"

[appveyor] Increase waiting time before screenshot taking.


python bootstrap.py build\scons
if errorlevel 1 exit 1
cd build\scons
if errorlevel 1 exit 1
python setup.py install --standard-lib
if errorlevel 1 exit 1
:: "%PYTHON%" setup.py install --standard-lib
:: if errorlevel 1 exit 1

"%PYTHON%" setup.py install --standard-lib
if errorlevel 1 exit 1

Update bld.bat

Update bld.bat


set /p versionNumber=

del builds\Unquote-%versionNumber%.zip
del builds\Unquote.%versionNumber%.nupkg

REM preparing staging dirs

mkdir builds
mkdir staging
mkdir staging\net45
mkdir staging\portable259
copy LICENSE staging
copy NOTICE staging

REM building for net45 ...
"C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\fsc.exe" -o:staging\net45\Unquote.dll --noframework --define:TRACE --doc:staging\net45\Unquote.xml --optimize+ -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Numerics.dll" --target:library --warn:3 --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --subsystemversion:6.00 --highentropyva+ Unquote\Utils\Prelude.fs Unquote\Utils\Regex.fs Unquote\Utils\Printf.fs Unquote\Utils\List.fs Unquote\Utils\Type.fs Unquote\AssemblyInfo.fs Unquote\Prelude.fs Unquote\DynamicOperators.fs Unquote\EvaluationException.fs Unquote\Evaluation.fs Unquote\OperatorPrecedence.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\AssertionFailedException.fs Unquote\Assertions.fs

REM building for portable259
"C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\fsc.exe" -o:staging\portable259\Unquote.dll --noframework --define:TRACE --define:PORTABLE --doc:staging\portable259\Unquote.xml --optimize+ -r:"C:\Program Files (x86)\MSBuild\..\Reference Assemblies\Microsoft\FSharp\.NETCore\3.259.3.1\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\Microsoft.CSharp.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Collections.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ComponentModel.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ComponentModel.EventBasedAsync.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Diagnostics.Contracts.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Diagnostics.Debug.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Diagnostics.Tools.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Dynamic.Runtime.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Globalization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.IO.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Linq.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Linq.Expressions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Linq.Queryable.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.NetworkInformation.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.Primitives.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.Requests.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ObjectModel.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Reflection.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Reflection.Extensions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Reflection.Primitives.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Resources.ResourceManager.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Extensions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.InteropServices.WindowsRuntime.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.Json.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.Primitives.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Security.Principal.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ServiceModel.Web.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Text.Encoding.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Text.Encoding.Extensions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Text.RegularExpressions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Threading.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Threading.Tasks.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Windows.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.Linq.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.ReaderWriter.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.Serialization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.XDocument.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.XmlSerializer.dll" --target:library --warn:3 --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- --targetprofile:netcore Unquote.Profile259\AssemblyInfo.fs Unquote\Utils\Prelude.fs Unquote\Utils\Regex.fs Unquote\Utils\Printf.fs Unquote\Utils\List.fs Unquote\Utils\Type.fs Unquote\Prelude.fs Unquote\DynamicOperators.fs Unquote\EvaluationException.fs Unquote\Evaluation.fs Unquote\OperatorPrecedence.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\AssertionFailedException.fs Unquote\Assertions.fs

REM zip builds ...
cd staging
..\tools\7z\7za.exe a -tzip ..\builds\Unquote-%versionNumber%.zip *
cd ..

REM preparing nuget dirs

mkdir nuget
mkdir nuget\lib
mkdir nuget\lib\net45
mkdir "nuget\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1"
copy Unquote.nuspec nuget

REM copy staging builds to nuget package...

copy staging\net45\Unquote.dll nuget\lib\net45\Unquote.dll
copy staging\net45\Unquote.xml nuget\lib\net45\Unquote.xml
copy staging\portable259\Unquote.dll "nuget\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Unquote.dll"
copy staging\portable259\Unquote.xml "nuget\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Unquote.xml"

REM create nuget package...

".nuget\nuget.exe" pack nuget\Unquote.nuspec -Version %versionNumber%
copy Unquote.%versionNumber%.nupkg builds
del Unquote.%versionNumber%.nupkg

REM cleanup...

rd /q /s staging
rd /q /s nuget

pause

set /p versionNumber=

del builds\Unquote-%versionNumber%.zip
del builds\Unquote.%versionNumber%.nupkg

REM preparing staging dirs

mkdir builds
mkdir staging
mkdir staging\net45
mkdir staging\profile259
copy LICENSE staging
copy NOTICE staging

REM building for net45 ...
"C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\fsc.exe" -o:staging\net45\Unquote.dll --noframework --define:TRACE --doc:staging\net45\Unquote.xml --optimize+ -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Numerics.dll" --target:library --warn:3 --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --subsystemversion:6.00 --highentropyva+ Unquote\Utils\Prelude.fs Unquote\Utils\Regex.fs Unquote\Utils\Printf.fs Unquote\Utils\List.fs Unquote\Utils\Type.fs Unquote\AssemblyInfo.fs Unquote\Prelude.fs Unquote\DynamicOperators.fs Unquote\EvaluationException.fs Unquote\Evaluation.fs Unquote\OperatorPrecedence.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\AssertionFailedException.fs Unquote\Assertions.fs

REM building for profile259
"C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\fsc.exe" -o:staging\profile259\Unquote.dll --noframework --define:TRACE --define:PORTABLE --doc:staging\profile259\Unquote.xml --optimize+ -r:"C:\Program Files (x86)\MSBuild\..\Reference Assemblies\Microsoft\FSharp\.NETCore\3.259.3.1\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\Microsoft.CSharp.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Collections.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ComponentModel.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ComponentModel.EventBasedAsync.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Diagnostics.Contracts.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Diagnostics.Debug.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Diagnostics.Tools.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Dynamic.Runtime.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Globalization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.IO.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Linq.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Linq.Expressions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Linq.Queryable.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.NetworkInformation.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.Primitives.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Net.Requests.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ObjectModel.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Reflection.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Reflection.Extensions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Reflection.Primitives.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Resources.ResourceManager.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Extensions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.InteropServices.WindowsRuntime.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.Json.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.Primitives.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Runtime.Serialization.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Security.Principal.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.ServiceModel.Web.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Text.Encoding.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Text.Encoding.Extensions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Text.RegularExpressions.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Threading.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Threading.Tasks.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Windows.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.Linq.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.ReaderWriter.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.Serialization.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.XDocument.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\System.Xml.XmlSerializer.dll" --target:library --warn:3 --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- --targetprofile:netcore Unquote.Profile259\AssemblyInfo.fs Unquote\Utils\Prelude.fs Unquote\Utils\Regex.fs Unquote\Utils\Printf.fs Unquote\Utils\List.fs Unquote\Utils\Type.fs Unquote\Prelude.fs Unquote\DynamicOperators.fs Unquote\EvaluationException.fs Unquote\Evaluation.fs Unquote\OperatorPrecedence.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\AssertionFailedException.fs Unquote\Assertions.fs

REM zip builds ...
cd staging
..\tools\7z\7za.exe a -tzip ..\builds\Unquote-%versionNumber%.zip *
cd ..

REM preparing nuget dirs

mkdir nuget
mkdir nuget\lib
mkdir nuget\lib\net45
mkdir "nuget\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1"
copy Unquote.nuspec nuget

REM copy staging builds to nuget package...

copy staging\net45\Unquote.dll nuget\lib\net45\Unquote.dll
copy staging\net45\Unquote.xml nuget\lib\net45\Unquote.xml
copy staging\profile259\Unquote.dll "nuget\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Unquote.dll"
copy staging\profile259\Unquote.xml "nuget\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Unquote.xml"

REM create nuget package...

".nuget\nuget.exe" pack nuget\Unquote.nuspec -Version %versionNumber%
copy Unquote.%versionNumber%.nupkg builds
del Unquote.%versionNumber%.nupkg

REM cleanup...

rd /q /s staging
rd /q /s nuget

pause

change path

change path


echo off
tools\Fake\FAKE.exe tools\Core.fsx "target=Default" "tools=tools" "solution=src\FifteenBelow.Json.sln"

build batch file

build batch file


@echo off

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
set release_mode=0
set compiler_flags= -nologo -Oi -TP -fp:fast -fp:except- -Gm- -MP -FC -GS- -EHsc- -GR-

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
	rem -DDISPLAY_TIMING
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4189 ^
	-wd4201 -wd4204 -wd4244 ^
	-wd4306 ^
	-wd4456 -wd4457 -wd4480 ^
	-wd4505 -wd4512 -wd4550

set compiler_includes=
set libs= ^
	kernel32.lib
	rem "src\dyncall\lib\*.lib"

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

cl %compiler_settings% "src\main.cpp" ^
	/link %linker_settings% -OUT:%exe_name% ^
	&& odin run examples/old_demos/demo006.odin -opt=0
	rem && odin docs core/fmt.odin

del *.obj > NUL 2> NUL

:end_of_build

@echo off

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
set release_mode=0
set compiler_flags= -nologo -Oi -TP -fp:fast -fp:except- -Gm- -MP -FC -GS- -EHsc- -GR-

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
	rem -DDISPLAY_TIMING
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4189 ^
	-wd4201 -wd4204 -wd4244 ^
	-wd4306 ^
	-wd4456 -wd4457 -wd4480 ^
	-wd4505 -wd4512 -wd4550

set compiler_includes=
set libs= ^
	kernel32.lib
	rem "src\dyncall\lib\*.lib"

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

cl %compiler_settings% "src\main.cpp" ^
	/link %linker_settings% -OUT:%exe_name% ^
	&& odin run examples/demo.odin -opt=0
	rem && odin docs core/fmt.odin

del *.obj > NUL 2> NUL

:end_of_build

Revert to demo.odin

Revert to demo.odin


@echo off
setlocal EnableExtensions

if (%FrameworkDir%)==() set FrameworkDir=%WINDIR%\Microsoft.NET\Framework64\
if (%FrameworkVersion%)==() set FrameworkVersion=v4.0.30319

set MSBUILD=%FrameworkDir%%FrameworkVersion%\msbuild.exe

if not exist %MSBUILD% goto Error_NoMsBuild

set TARGET=%1
if (%TARGET%)==() set TARGET=Default

for /F "tokens=1* delims= " %%a in ("%*") do set BUILDARGS=%%b
if "%BUILDARGS%"=="" set BUILDARGS=/verbosity:minimal

%MSBUILD% /nologo /m /t:%TARGET% %BUILDARGS% %~dp0build/build.proj

if errorlevel 1 goto Error_BuildFailed

echo.
echo *** BUILD SUCCESSFUL ***
echo.
goto :EOF

:Error_BuildFailed
echo.
echo *** BUILD FAILED ***
echo.
exit /b 1

:Error_NoMsBuild
echo.
echo. ERROR: Unable to locate MSBuild.exe (expected location: %MSBUILD%)
echo.
exit /b 1

@echo off
setlocal EnableExtensions

if (%FrameworkDir%)==() set FrameworkDir=%WINDIR%\Microsoft.NET\Framework64\
if (%FrameworkVersion%)==() set FrameworkVersion=v4.0.30319

rem If Framework64 doesn't exist, try to fallback to Framework
if not exist %FrameworkDir% set FrameworkDir=%WINDIR%\Microsoft.NET\Framework\

set MSBUILD=%FrameworkDir%%FrameworkVersion%\msbuild.exe

if not exist %MSBUILD% goto Error_NoMsBuild

set TARGET=%1
if (%TARGET%)==() set TARGET=Default

for /F "tokens=1* delims= " %%a in ("%*") do set BUILDARGS=%%b
if "%BUILDARGS%"=="" set BUILDARGS=/verbosity:minimal

%MSBUILD% /nologo /m /t:%TARGET% %BUILDARGS% %~dp0build/build.proj

if errorlevel 1 goto Error_BuildFailed

echo.
echo *** BUILD SUCCESSFUL ***
echo.
goto :EOF

:Error_BuildFailed
echo.
echo *** BUILD FAILED ***
echo.
exit /b 1

:Error_NoMsBuild
echo.
echo. ERROR: Unable to locate MSBuild.exe (expected location: %MSBUILD%)
echo.
exit /b 1

Add support for building on 32-bit windows.


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

Change SKIP_DOTNET_INSTALL to SKIP_KRE_INSTALL


@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\KoreBuild goto run
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 -Out packages

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
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\KoreBuild goto run
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 -Out packages

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -alias default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

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

Update 'build.cmd' alias parameter to use full name.


set PWD=%~dp0

start /MIN %PWD%\dbserver\bin\openmole-dbserver.bat

mkdir "%UserProfile%\.openmole\.tmp"

set ran="%UserProfile%\.openmole\.tmp\%random%"

java -d64 -version >nul 2>&1
if errorlevel 1 goto is32bit
set FLAG="-XX:+UseCompressedOops"
:is32bit

java -Dosgi.locking=none -Dopenmole.location="%PWD%\" -Dosgi.classloader.singleThreadLoads=true -Dosgi.configuration.area=%ran% -splash:splashscreen.png -XX:MaxPermSize=128M -XX:+UseG1GC -Xmx1G  -XX:MaxPermSize=128M %FLAG% -jar ./plugins/org.eclipse.equinox.launcher.jar -cp ./openmole-plugins -gp ./openmole-plugins-gui %*

rmdir /s /q %ran%

set PWD=%~dp0
start /MIN %PWD%dbserver\bin\openmole-dbserver.bat
mkdir "%UserProfile%\.openmole\.tmp"
set ran="%UserProfile%\.openmole\.tmp\%random%"
java -d64 -version >nul 2>&1
if errorlevel 1 goto is32bit
set FLAG="-XX:+UseCompressedOops"
:is32bit
java -Dosgi.locking=none -Dopenmole.location="%PWD%\" -Dosgi.classloader.singleThreadLoads=true -Dosgi.configuration.area=%ran% -splash:splashscreen.png -XX:MaxPermSize=128M -XX:+UseG1GC -Xmx1G  -XX:MaxPermSize=128M %FLAG% -jar %PWD%/plugins/org.eclipse.equinox.launcher.jar -cp %PWD%/openmole-plugins -gp %PWD%/openmole-plugins-gui %*
rmdir /s /q %ran%

Fix windows launching script.

Fix windows launching script.


@echo off

set LEIN_VERSION=1.4.0-SNAPSHOT

setLocal EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" (
    set LEIN_DIR=%~dp0
    set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
)

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if not exist "%LEIN_JAR%" goto NO_LEIN_JAR

rem ##################################################
rem count number of command line arguments
rem
set ARGCOUNT=0
for %%a in (%*) do set /a ARGCOUNT+=1
rem ##################################################

if "x%LEIN_HOME%" == "x" (
    set LEIN_HOME=%HOMEDRIVE%%HOMEPATH%/.lein
)

call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (.\lib\dev\*.jar) do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in (%LEIN_HOME%\plugins\*.jar) do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH="%LEIN_JAR%";%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;src;"%CLASSPATH%"

if "x%DEBUG%" == "x" goto RUN
echo CLASSPATH=%CLASSPATH%
rem ##################################################

:RUN
if "x%1" == "xrepl" goto RUN_REPL
if "%ARGCOUNT%" == "2" goto RUN_ARG2
if "%ARGCOUNT%" == "3" goto RUN_ARG3
java -client -cp %CLASSPATH% clojure.main -e "(use 'leiningen.core) (-main \"%1\")"
goto EOF

:RUN_ARG2
java -client -cp %CLASSPATH% clojure.main -e "(use 'leiningen.core) (-main \"%1\" \"%2\")"
goto EOF

:RUN_ARG3
java -client -cp %CLASSPATH% clojure.main -e "(use 'leiningen.core) (-main \"%1\" \"%2\" \"%3\")"
goto EOF

:RUN_REPL
%RLWRAP% java -client %JAVA_OPTS% -cp src;classes;%CLASSPATH% clojure.main %2 %3 %4
goto EOF

:NO_LEIN_JAR
echo.
echo "%LEIN_JAR%" can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:SELF_INSTALL
if exist "%LEIN_JAR%" (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl -f -L -o
)
set LEIN_JAR_URL=http://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del "%LEIN_JAR%">nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:EOF

@echo off

set LEIN_VERSION=1.4.0-SNAPSHOT

setLocal EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" (
    set LEIN_DIR=%~dp0
    set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
)

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if not exist "%LEIN_JAR%" goto NO_LEIN_JAR

if "x%LEIN_HOME%" == "x" (
    set LEIN_HOME=%HOMEDRIVE%%HOMEPATH%/.lein
)

call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (.\lib\dev\*.jar) do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in (%LEIN_HOME%\plugins\*.jar) do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH="%LEIN_JAR%";%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;src;"%CLASSPATH%"

if "x%DEBUG%" == "x" goto RUN
echo CLASSPATH=%CLASSPATH%
rem ##################################################

:RUN
if "x%1" == "xrepl" goto RUN_REPL
java -client -cp %CLASSPATH% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:RUN_REPL
%RLWRAP% java -client %JAVA_OPTS% -cp src;classes;%CLASSPATH% clojure.main %2 %3 %4
goto EOF

:NO_LEIN_JAR
echo.
echo "%LEIN_JAR%" can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:SELF_INSTALL
if exist "%LEIN_JAR%" (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl -f -L -o
)
set LEIN_JAR_URL=http://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del "%LEIN_JAR%">nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:EOF

Simplify argument handling with the %* special variable.