@echo off

setlocal

set PATH=%CD%\tools;%PATH%

set WGET_ARGS=-c --no-check-certificate
set UNZIP_ARGS=-q

set BASEURL=https://s3.amazonaws.com/rstudio-buildtools/
set GIN_FILE=gin-2.1.2.zip
set JUNIT_FILE=junit-4.9b3.jar
set GNUDIFF_FILE=gnudiff.zip
set GNUGREP_FILE=gnugrep-2.5.4.zip
set MSYS_SSH_FILE=msys-ssh-1000-18.zip
set SUMATRA_PDF_FILE=SumatraPDF-3.1.2-64.zip
set WINUTILS_FILE=winutils-1.0.zip
set WINPTY_FILES=winpty-0.4.3-msys2-2.7.0.zip
set OPENSSL_FILES=openssl-1.1.1d.zip
set BOOST_FILES=boost-1.69.0-win-msvc141.zip

set PANDOC_VERSION=2.9.2.1
set PANDOC_NAME=pandoc-%PANDOC_VERSION%-windows-x86_64
set PANDOC_FILE=%PANDOC_NAME%.zip

set LIBCLANG_VERSION=5.0.2
set LIBCLANG_NAME=libclang-windows-%LIBCLANG_VERSION%
set LIBCLANG_FILE=%LIBCLANG_NAME%.zip

set NODE_VERSION=10.19.0
set NODE_ROOT=node
set NODE_SUBDIR=%NODE_ROOT%\%NODE_VERSION%
set NODE_BASE_URL=https://nodejs.org/dist/v%NODE_VERSION%/
set NODE_ARCHIVE_DIR=node-v%NODE_VERSION%-win-x64
set NODE_ARCHIVE_FILE=%NODE_ARCHIVE_DIR%.zip

if not exist gnudiff (
  wget %WGET_ARGS% "%BASEURL%%GNUDIFF_FILE%"
  mkdir gnudiff
  echo Unzipping %GNUDIFF_FILE%
  unzip %UNZIP_ARGS% "%GNUDIFF_FILE%" -d gnudiff
  del "%GNUDIFF_FILE%"
)

if not exist gnugrep (
  wget %WGET_ARGS% "%BASEURL%%GNUGREP_FILE%"
  mkdir gnugrep
  echo Unzipping %GNUGREP_FILE%
  unzip %UNZIP_ARGS% "%GNUGREP_FILE%" -d gnugrep
  del "%GNUGREP_FILE%"
)

if not exist msys-ssh-1000-18 (
  wget %WGET_ARGS% "%BASEURL%%MSYS_SSH_FILE%"
  mkdir msys-ssh-1000-18
  echo Unzipping %MSYS_SSH_FILE%
  unzip %UNZIP_ARGS% "%MSYS_SSH_FILE%" -d msys-ssh-1000-18
  del "%MSYS_SSH_FILE%"
)

if not exist sumatra\3.1.2 (
  wget %WGET_ARGS% "%BASEURL%sumatrapdf/%SUMATRA_PDF_FILE%"
  mkdir sumatra\3.1.2
  echo Unzipping %SUMATRA_PDF_FILE%
  unzip %UNZIP_ARGS% "%SUMATRA_PDF_FILE%" -d sumatra\3.1.2
  del "%SUMATRA_PDF_FILE%"
)

if not exist winutils\1.0 (
  wget %WGET_ARGS% "%BASEURL%%WINUTILS_FILE%"
  mkdir winutils\1.0
  echo Unzipping %WINUTILS_FILE%
  unzip %UNZIP_ARGS% "%WINUTILS_FILE%" -d winutils\1.0
  del "%WINUTILS_FILE%"
)

if not exist winpty-0.4.3-msys2-2.7.0 (
  wget %WGET_ARGS% "%BASEURL%%WINPTY_FILES%"
  echo Unzipping %WINPTY_FILES%
  unzip %UNZIP_ARGS% "%WINPTY_FILES%"
  del %WINPTY_FILES%
)

if not exist %OPENSSL_FILES:~0,-4% (
  wget %WGET_ARGS% "%BASEURL%%OPENSSL_FILES%"
  echo Unzipping %OPENSSL_FILES%
  unzip %UNZIP_ARGS% "%OPENSSL_FILES%"
  del %OPENSSL_FILES%
)

if not exist %BOOST_FILES:~0,-4%* (
  wget %WGET_ARGS% "%BASEURL%Boost/%BOOST_FILES%"
  echo Unzipping %BOOST_FILES%
  unzip %UNZIP_ARGS% "%BOOST_FILES%"
  del %BOOST_FILES%
)

if not exist sentry-cli.exe (
  echo Installing sentry-cli
  powershell.exe "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; Invoke-WebRequest -Uri https://github.com/getsentry/sentry-cli/releases/download/1.41.2/sentry-cli-Windows-x86_64.exe -OutFile sentry-cli.exe"
)

if not exist breakpad-tools-windows (
  echo Installing breakpad tools for Windows
  wget %WGET_ARGS% "https://s3.amazonaws.com/getsentry-builds/getsentry/breakpad-tools/windows/breakpad-tools-windows.zip"
  echo Unzipping breakpad tools
  unzip %UNZIP_ARGS% breakpad-tools-windows.zip -d breakpad-tools-windows
  del breakpad-tools-windows.zip
)

pushd ..\common
set CORE_DICTIONARIES=core-dictionaries.zip
if not exist "dictionaries\en_US.dic" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-buildtools/dictionaries/%CORE_DICTIONARIES%"
  if exist "%CORE_DICTIONARIES%" (
     mkdir dictionaries
     echo Unzipping %CORE_DICTIONARIES%
     unzip %UNZIP_ARGS% "%CORE_DICTIONARIES%" -d dictionaries
     del "%CORE_DICTIONARIES%"
  )
)

set MATHJAX=mathjax-27.zip
if not exist "mathjax-27" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-buildtools/%MATHJAX%"
  if exist "%MATHJAX%" (
     mkdir mathjax-27
     echo Unzipping %MATHJAX%
     unzip %UNZIP_ARGS% "%MATHJAX%"
     del "%MATHJAX%"
  )
)

if not exist pandoc\%PANDOC_VERSION% (
  wget %WGET_ARGS% "%BASEURL%pandoc/%PANDOC_VERSION%/%PANDOC_FILE%"
  echo Unzipping %PANDOC_FILE%
  unzip %UNZIP_ARGS% "%PANDOC_FILE%"
  mkdir pandoc\%PANDOC_VERSION%
  copy "%PANDOC_NAME%\pandoc*" "pandoc\%PANDOC_VERSION%""
  del %PANDOC_FILE%
  rmdir /s /q %PANDOC_NAME%
)

if not exist libclang\%LIBCLANG_VERSION% (
  wget %WGET_ARGS% "%BASEURL%%LIBCLANG_FILE%"
  echo Unzipping %LIBCLANG_FILE%
  unzip %UNZIP_ARGS% "%LIBCLANG_FILE%"
  del %LIBCLANG_FILE%
)

if not exist %NODE_SUBDIR% (
  wget %WGET_ARGS% %NODE_BASE_URL%%NODE_ARCHIVE_FILE%
  echo Unzipping node %NODE_VERSION%
  mkdir %NODE_ROOT%
  unzip %UNZIP_ARGS% %NODE_ARCHIVE_FILE%
  move %NODE_ARCHIVE_DIR% %NODE_SUBDIR%
  del %NODE_ARCHIVE_FILE%
)

set YARN_DIR=%NODE_SUBDIR%\node_modules\yarn\bin
if not exist %YARN_DIR%\yarn (
  echo "Installing yarn"
  call %NODE_SUBDIR%\npm install --global yarn
)

set PATH=%CD%\%NODE_SUBDIR%;%CD%\%YARN_DIR%;%PATH%
pushd ..\..\src\gwt\panmirror\src\editor
call yarn install
popd

call install-packages.cmd

popd

regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\DIA SDK\bin\msdia140.dll"

call install-crashpad.cmd
call install-soci.cmd

@echo off

setlocal

set PATH=%CD%\tools;%PATH%

set WGET_ARGS=-c --no-check-certificate
set UNZIP_ARGS=-q

set BASEURL=https://s3.amazonaws.com/rstudio-buildtools/
set GIN_FILE=gin-2.1.2.zip
set JUNIT_FILE=junit-4.9b3.jar
set GNUDIFF_FILE=gnudiff.zip
set GNUGREP_FILE=gnugrep-2.5.4.zip
set MSYS_SSH_FILE=msys-ssh-1000-18.zip
set SUMATRA_PDF_FILE=SumatraPDF-3.1.2-64.zip
set WINUTILS_FILE=winutils-1.0.zip
set WINPTY_FILES=winpty-0.4.3-msys2-2.7.0.zip
set OPENSSL_FILES=openssl-1.1.1d.zip
set BOOST_FILES=boost-1.69.0-win-msvc141.zip

set PANDOC_VERSION=2.9.2.1
set PANDOC_NAME=pandoc-%PANDOC_VERSION%
set PANDOC_FILE=%PANDOC_NAME%-windows-x86_64.zip

set LIBCLANG_VERSION=5.0.2
set LIBCLANG_NAME=libclang-windows-%LIBCLANG_VERSION%
set LIBCLANG_FILE=%LIBCLANG_NAME%.zip

set NODE_VERSION=10.19.0
set NODE_ROOT=node
set NODE_SUBDIR=%NODE_ROOT%\%NODE_VERSION%
set NODE_BASE_URL=https://nodejs.org/dist/v%NODE_VERSION%/
set NODE_ARCHIVE_DIR=node-v%NODE_VERSION%-win-x64
set NODE_ARCHIVE_FILE=%NODE_ARCHIVE_DIR%.zip

if not exist gnudiff (
  wget %WGET_ARGS% "%BASEURL%%GNUDIFF_FILE%"
  mkdir gnudiff
  echo Unzipping %GNUDIFF_FILE%
  unzip %UNZIP_ARGS% "%GNUDIFF_FILE%" -d gnudiff
  del "%GNUDIFF_FILE%"
)

if not exist gnugrep (
  wget %WGET_ARGS% "%BASEURL%%GNUGREP_FILE%"
  mkdir gnugrep
  echo Unzipping %GNUGREP_FILE%
  unzip %UNZIP_ARGS% "%GNUGREP_FILE%" -d gnugrep
  del "%GNUGREP_FILE%"
)

if not exist msys-ssh-1000-18 (
  wget %WGET_ARGS% "%BASEURL%%MSYS_SSH_FILE%"
  mkdir msys-ssh-1000-18
  echo Unzipping %MSYS_SSH_FILE%
  unzip %UNZIP_ARGS% "%MSYS_SSH_FILE%" -d msys-ssh-1000-18
  del "%MSYS_SSH_FILE%"
)

if not exist sumatra\3.1.2 (
  wget %WGET_ARGS% "%BASEURL%sumatrapdf/%SUMATRA_PDF_FILE%"
  mkdir sumatra\3.1.2
  echo Unzipping %SUMATRA_PDF_FILE%
  unzip %UNZIP_ARGS% "%SUMATRA_PDF_FILE%" -d sumatra\3.1.2
  del "%SUMATRA_PDF_FILE%"
)

if not exist winutils\1.0 (
  wget %WGET_ARGS% "%BASEURL%%WINUTILS_FILE%"
  mkdir winutils\1.0
  echo Unzipping %WINUTILS_FILE%
  unzip %UNZIP_ARGS% "%WINUTILS_FILE%" -d winutils\1.0
  del "%WINUTILS_FILE%"
)

if not exist winpty-0.4.3-msys2-2.7.0 (
  wget %WGET_ARGS% "%BASEURL%%WINPTY_FILES%"
  echo Unzipping %WINPTY_FILES%
  unzip %UNZIP_ARGS% "%WINPTY_FILES%"
  del %WINPTY_FILES%
)

if not exist %OPENSSL_FILES:~0,-4% (
  wget %WGET_ARGS% "%BASEURL%%OPENSSL_FILES%"
  echo Unzipping %OPENSSL_FILES%
  unzip %UNZIP_ARGS% "%OPENSSL_FILES%"
  del %OPENSSL_FILES%
)

if not exist %BOOST_FILES:~0,-4%* (
  wget %WGET_ARGS% "%BASEURL%Boost/%BOOST_FILES%"
  echo Unzipping %BOOST_FILES%
  unzip %UNZIP_ARGS% "%BOOST_FILES%"
  del %BOOST_FILES%
)

if not exist sentry-cli.exe (
  echo Installing sentry-cli
  powershell.exe "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; Invoke-WebRequest -Uri https://github.com/getsentry/sentry-cli/releases/download/1.41.2/sentry-cli-Windows-x86_64.exe -OutFile sentry-cli.exe"
)

if not exist breakpad-tools-windows (
  echo Installing breakpad tools for Windows
  wget %WGET_ARGS% "https://s3.amazonaws.com/getsentry-builds/getsentry/breakpad-tools/windows/breakpad-tools-windows.zip"
  echo Unzipping breakpad tools
  unzip %UNZIP_ARGS% breakpad-tools-windows.zip -d breakpad-tools-windows
  del breakpad-tools-windows.zip
)

pushd ..\common
set CORE_DICTIONARIES=core-dictionaries.zip
if not exist "dictionaries\en_US.dic" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-buildtools/dictionaries/%CORE_DICTIONARIES%"
  if exist "%CORE_DICTIONARIES%" (
     mkdir dictionaries
     echo Unzipping %CORE_DICTIONARIES%
     unzip %UNZIP_ARGS% "%CORE_DICTIONARIES%" -d dictionaries
     del "%CORE_DICTIONARIES%"
  )
)

set MATHJAX=mathjax-27.zip
if not exist "mathjax-27" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-buildtools/%MATHJAX%"
  if exist "%MATHJAX%" (
     mkdir mathjax-27
     echo Unzipping %MATHJAX%
     unzip %UNZIP_ARGS% "%MATHJAX%"
     del "%MATHJAX%"
  )
)

if not exist pandoc\%PANDOC_VERSION% (
  wget %WGET_ARGS% "%BASEURL%pandoc/%PANDOC_VERSION%/%PANDOC_FILE%"
  echo Unzipping %PANDOC_FILE%
  unzip %UNZIP_ARGS% "%PANDOC_FILE%"
  mkdir pandoc\%PANDOC_VERSION%
  copy "%PANDOC_NAME%\pandoc*" "pandoc\%PANDOC_VERSION%""
  del %PANDOC_FILE%
  rmdir /s /q %PANDOC_NAME%
)

if not exist libclang\%LIBCLANG_VERSION% (
  wget %WGET_ARGS% "%BASEURL%%LIBCLANG_FILE%"
  echo Unzipping %LIBCLANG_FILE%
  unzip %UNZIP_ARGS% "%LIBCLANG_FILE%"
  del %LIBCLANG_FILE%
)

if not exist %NODE_SUBDIR% (
  wget %WGET_ARGS% %NODE_BASE_URL%%NODE_ARCHIVE_FILE%
  echo Unzipping node %NODE_VERSION%
  mkdir %NODE_ROOT%
  unzip %UNZIP_ARGS% %NODE_ARCHIVE_FILE%
  move %NODE_ARCHIVE_DIR% %NODE_SUBDIR%
  del %NODE_ARCHIVE_FILE%
)

set YARN_DIR=%NODE_SUBDIR%\node_modules\yarn\bin
if not exist %YARN_DIR%\yarn (
  echo "Installing yarn"
  call %NODE_SUBDIR%\npm install --global yarn
)

set PATH=%CD%\%NODE_SUBDIR%;%CD%\%YARN_DIR%;%PATH%
pushd ..\..\src\gwt\panmirror\src\editor
call yarn install
popd

call install-packages.cmd

popd

regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\DIA SDK\bin\msdia140.dll"

call install-crashpad.cmd
call install-soci.cmd

update pandoc folder paths

update pandoc folder paths

Pandoc has once again changed the way they name folders; adapt to
this change.

Fixes #6808.


if "%APPVEYOR_BUILD_NUMBER%"=="" (
	set APPVEYOR_BUILD_NUMBER=10001
)

set version=31.0.0.%APPVEYOR_BUILD_NUMBER%-CI
REM set platform=x86

if "%platform%"=="x64" (
	set DotPlatform=.x64
	set CPlatform=x64
) else (
	set Platform=x86
	set DotPlatform=.x86
	set CPlatform=Win32
)

NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version% -Properties DotPlatform=%DotPlatform%;Platform=%Platform%;CPlatform=%CPlatform%
NuGet pack CefSharp.WpfOrWinForms.nuspec -NoPackageAnalysis -Version %version% -Properties ControlType=Wpf;DotPlatform=%DotPlatform%;Platform=%Platform%
NuGet pack CefSharp.WpfOrWinForms.nuspec -NoPackageAnalysis -Version %version% -Properties ControlType=WinForms;DotPlatform=%DotPlatform%;Platform=%Platform%

if "%APPVEYOR_BUILD_NUMBER%"=="" (
	set APPVEYOR_BUILD_NUMBER=10000
)

set version=31.0.0-JSWIP-PRE-%APPVEYOR_BUILD_NUMBER%
REM set platform=x86

if "%platform%"=="x64" (
	set DotPlatform=.x64
	set CPlatform=x64
) else (
	set Platform=x86
	set DotPlatform=.x86
	set CPlatform=Win32
)

NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version% -Properties DotPlatform=%DotPlatform%;Platform=%Platform%;CPlatform=%CPlatform%
NuGet pack CefSharp.WpfOrWinForms.nuspec -NoPackageAnalysis -Version %version% -Properties ControlType=Wpf;DotPlatform=%DotPlatform%;Platform=%Platform%
NuGet pack CefSharp.WpfOrWinForms.nuspec -NoPackageAnalysis -Version %version% -Properties ControlType=WinForms;DotPlatform=%DotPlatform%;Platform=%Platform%

Update version number in pack

Update version number in pack


@echo off
if not "%~1" == "--help" if not "%~1" == "-h" if not "%~1" == "/?" goto START
echo.
echo Usage: %~n0 [^<path^> [^<port^>] ]
echo.
echo Start a local web server and open the default browser.
echo.
echo Options:
echo.
echo   ^<path^>                  URL path to open in the browser.
echo.
echo   ^<port^>                  Port to use. (default: 8000)
echo.
echo   -h, --help
echo.
exit /b 0

:START
setlocal
set OPEN_PATH="%~1"
set PORT=%~2
if "%PORT%" == "" set PORT=8000

set DIR=%~dp0
path %DIR%;%PATH%

where /q npm && (
    where /q http-server || (
        call npm install http-server --prefix %DIR% || goto FALLBACK1
    )
    call http-server . -p %PORT% -c-1 --cors --no-dotfiles -o %OPEN_PATH%
    exit /b 0
)
:FALLBACK1

set OPEN_URL="http://127.0.0.1:%PORT%/"%OPEN_PATH%
set OPEN_URL=%OPEN_URL:""=%

where /q ruby && (
    start "" %OPEN_URL%
    ruby -run -e httpd . -p %PORT%
    exit /b 0
)

where /q python && (
    start "" %OPEN_URL%
    python -m SimpleHTTPServer %PORT% || python -m http.server %PORT%
    exit /b 0
)

echo Please install Node.js or Ruby or Python and rerun this script, or use your favorite HTTP server.
exit /b 1

@echo off
if not "%~1" == "--help" if not "%~1" == "-h" if not "%~1" == "/?" goto START
echo.
echo Usage: %~n0 [^<path^> [^<port^>] ]
echo.
echo Start a local web server and open the default browser.
echo.
echo Options:
echo.
echo   ^<path^>                  URL path to open in the browser.
echo.
echo   ^<port^>                  Port to use. (default: 8000)
echo.
echo   -h, --help
echo.
exit /b 0

:START
setlocal
set OPEN_PATH="%~1"
set PORT=%~2
if "%PORT%" == "" set PORT=8000

set DIR=%~dp0
path %DIR%;%PATH%
if "%DIR:~-1%" == "\" set DIR=%DIR:~0,-1%

where /q npm && (
    where /q http-server || (
        call npm install http-server --prefix "%DIR%" || goto FALLBACK1
    )
    call http-server . -p %PORT% -c-1 --cors --no-dotfiles -o %OPEN_PATH%
    exit /b 0
)
:FALLBACK1

set OPEN_URL="http://127.0.0.1:%PORT%/"%OPEN_PATH%
set OPEN_URL=%OPEN_URL:""=%

where /q ruby && (
    start "" %OPEN_URL%
    ruby -run -e httpd . -p %PORT%
    exit /b 0
)

where /q python && (
    start "" %OPEN_URL%
    python -m SimpleHTTPServer %PORT% || python -m http.server %PORT%
    exit /b 0
)

echo Please install Node.js or Ruby or Python and rerun this script, or use your favorite HTTP server.
exit /b 1

chore: fix start-webserver.bat error when directory name has space


"%sdkver%" -q -version:v7.0
call setenv /x64

rem install python packages
pip install --cache-dir c:/temp nose
pip install --cache-dir c:/temp Sphinx
pip install --cache-dir c:/temp coverage
pip install --cache-dir c:/temp numpy
pip install --cache-dir c:/temp pyside
pip install --cache-dir c:/temp git+http://github.com/enthought/traits.git#egg=traits
pip install --cache-dir c:/temp git+http://github.com/enthought/traitsui.git#egg=traitsui
pip install --cache-dir c:/temp git+http://github.com/enthought/apptools.git#egg=apptools
pip install --cache-dir c:/temp git+http://github.com/enthought/pyface.git#egg=pyface
pip install --cache-dir c:/temp git+http://github.com/enthought/envisage.git#egg=envisage

rem install mayavi
python setup.py develop

"%sdkver%" -q -version:v7.0
call setenv /x64

rem install python packages
pip install --cache-dir c:/temp nose
pip install --cache-dir c:/temp Sphinx
pip install --cache-dir c:/temp coverage
pip install --cache-dir c:/temp numpy
pip install --cache-dir c:/temp pyside
pip install --cache-dir c:/temp psutil
pip install --cache-dir c:/temp git+http://github.com/enthought/traits.git#egg=traits
pip install --cache-dir c:/temp git+http://github.com/enthought/traitsui.git#egg=traitsui
pip install --cache-dir c:/temp git+http://github.com/enthought/apptools.git#egg=apptools
pip install --cache-dir c:/temp git+http://github.com/enthought/pyface.git#egg=pyface
pip install --cache-dir c:/temp git+http://github.com/enthought/envisage.git#egg=envisage

rem install mayavi
python setup.py develop

Add missing psutil dependency for appveyor


@echo off

set CATE_BIN=%~dp0

rem Make CATE_HOME=%CATE_BIN%\.. an absolute path:
pushd .
cd %CATE_BIN%\..
set CATE_HOME=%CD%
popd

call "%CATE_BIN%\activate.bat" "%CATE_HOME%"
if errorlevel 1 exit 1

if "%*" == "" (
  prompt $G$S

  echo.
  @echo ESA CCI Toolbox (CLI) command-line interface. Type "cate -h" to get help.
  echo.

  cmd /K ""
) else (
  %*
)

@echo off

set CATE_BIN=%~dp0

rem Make CATE_HOME=%CATE_BIN%\.. an absolute path:
pushd .
cd %CATE_BIN%\..
set CATE_HOME=%CD%
popd

call "%CATE_BIN%\activate.bat" "%CATE_HOME%"
if errorlevel 1 exit 1

if "%*" == "" (
  goto INTERACTIVE
) else (
  goto DELEGATE
)

:INTERACTIVE
prompt $G$S
echo.
@echo ESA CCI Toolbox (CLI) command-line interface. Type "cate -h" to get help.
echo.

cmd /K ""
exit 0

:DELEGATE
%*
exit 0

fix windows cli bat

fix windows cli bat


@echo off

REM DBSteward
REM Database SQL compiler and differencing via XML definition
REM
REM @package DBSteward
REM @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD License
REM @author Nicholas J Kiraly <kiraly.nicholas@gmail.com>

php %~dp0\dbsteward %*

@echo off

REM DBSteward
REM Database SQL compiler and differencing via XML definition
REM
REM @package DBSteward
REM @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD License
REM @author Nicholas J Kiraly <kiraly.nicholas@gmail.com>
REM
REM This batch file is to streamline runnign dbsteward from a repository checkout on windows.
REM Note that #126 describes how composer does this for package installations automatically
REM https://getcomposer.org/doc/articles/vendor-binaries.md#what-about-windows-and-bat-files-

php %~dp0\dbsteward %*

update dbsteward.bat intended use case and notes from #126 regarding composer package automatic generation of similar


@echo off
:: Microsoft Azure CLI - Windows Installer - Author file components script
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::
:: This re-builds partial WiX files for use in cloning the repo after install.
:: heat.exe from the WiX toolset is used for this.
::

:: to avoid https://github.com/npm/npm/issues/6438
chcp 850

set NODE_VERSION=0.12.7
set NPM_VERSION=1.3.17

:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;"

pushd %~dp0..\

set NODE_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/node.exe
set NPM_DOWNLOAD_URL=http://nodejs.org/dist/npm/npm-%NPM_VERSION%.zip

echo Cleaning previous build artifacts...

set OUTPUT_FOLDER=.\out
if exist %OUTPUT_FOLDER% rmdir /s /q %OUTPUT_FOLDER%
mkdir %OUTPUT_FOLDER%

set TEMP_REPO_FOLDER=azure-cli
set TEMP_REPO=%temp%\%TEMP_REPO_FOLDER%
if not exist %TEMP_REPO% goto CLONE_REPO

echo Temporary clone of the repo already exists. Removing it...
pushd %TEMP_REPO%\..\
if exist %TEMP_REPO_FOLDER% rmdir /s /q %TEMP_REPO_FOLDER%
::rmdir always returns 0, so check folder's existence
if exist %TEMP_REPO_FOLDER% (
    echo Failed to delete %TEMP_REPO_FOLDER%.
    goto ERROR
)
popd

:CLONE_REPO
mkdir %TEMP_REPO%
echo Cloning the repo elsewhere on disk...
pushd ..\..\
robocopy . %TEMP_REPO% /MIR /XD .git tools features scripts test node_modules /NFL /NDL /NJH /NJS
::robocopy emits error code greater or equal than 8(most other commands use any non-zero values)
if %errorlevel% geq 8 (
    echo Robocopy failed to copy xplat sources to the %TEMP_REPO%.
    goto ERROR
)
popd

echo Downloading node and npm...
pushd %TEMP_REPO%\bin
curl -o node.exe %NODE_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
curl -o npm.zip %NPM_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
unzip -q npm.zip
if %errorlevel% neq 0 goto ERROR
del npm.zip
popd

echo Running npm install...
pushd %TEMP_REPO%
call bin/npm.cmd install --production
echo.
echo if YOU SEE A FAILURE AT THE BOTTOM OF THE NPM OUTPUT:
echo If you do not have Node.js installed on this local machine, the Azure
echo postinstall command run by npm will fail.
echo.
echo This is fine as long as only the Azure module had this issue. Onward!
echo.
popd

echo Compiling streamline files...
pushd %TEMP_REPO%
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c lib
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline\lib\streams
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline-streams\lib
if %errorlevel% neq 0 goto ERROR
popd

echo Generating streamline files...
pushd %TEMP_REPO%
.\bin\node.exe bin\azure --gen
popd

echo Removing unncessary files from the enlistment for the CLI to function...
:: This is cleaner than using /EXCLUDE:... commands and easier to see line-by-line...
pushd %TEMP_REPO%

for %%i in (
    .idea
    __temp
    bin\node_modules
) do (
    if exist %%i (
        echo Deleting %%i...
        rmdir /s /q %%i
    )
)

for %%i in (
    *.md
    *.git*
    *.npm*
    *.njsproj
    *.sln
    azure_error
    azure.err
    checkstyle-result.xml
    test-result.xml
    .travis.yml
    .jshintrc
    .gitattributes
    .gitignore
    ChangeLog.txt
    bin\npm.cmd
    LICENSE.txt
) do (
    if exist %%i (
        echo Deleting %%i...
        del /q %%i
    )
)

echo.
popd

echo Creating the wbin (Windows binaries) folder that will be added to the path...
mkdir %TEMP_REPO%\wbin
copy .\scripts\azure.cmd %TEMP_REPO%\wbin\
if %errorlevel% neq 0 goto ERROR
echo Adding license documents...
copy ..\resources\*.rtf %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR
copy ..\resources\ThirdPartyNotices.txt %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR

echo.

:SUCCESS
echo Looks good.

goto END

:ERROR
echo Error occurred, please check the output for details.
exit /b 1

:END
exit /b 0
popd

@echo off
:: Microsoft Azure CLI - Windows Installer - Author file components script
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::
:: This re-builds partial WiX files for use in cloning the repo after install.
:: heat.exe from the WiX toolset is used for this.
::

:: to avoid https://github.com/npm/npm/issues/6438
chcp 850

set NODE_VERSION=0.12.7
set NPM_VERSION=1.3.17

:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;"

pushd %~dp0..\

set NODE_DOWNLOAD_URL=https://nodejs.org/dist/v%NODE_VERSION%/node.exe
set NPM_DOWNLOAD_URL=https://nodejs.org/dist/npm/npm-%NPM_VERSION%.zip

echo Cleaning previous build artifacts...

set OUTPUT_FOLDER=.\out
if exist %OUTPUT_FOLDER% rmdir /s /q %OUTPUT_FOLDER%
mkdir %OUTPUT_FOLDER%

set TEMP_REPO_FOLDER=azure-cli
set TEMP_REPO=%temp%\%TEMP_REPO_FOLDER%
if not exist %TEMP_REPO% goto CLONE_REPO

echo Temporary clone of the repo already exists. Removing it...
pushd %TEMP_REPO%\..\
if exist %TEMP_REPO_FOLDER% rmdir /s /q %TEMP_REPO_FOLDER%
::rmdir always returns 0, so check folder's existence
if exist %TEMP_REPO_FOLDER% (
    echo Failed to delete %TEMP_REPO_FOLDER%.
    goto ERROR
)
popd

:CLONE_REPO
mkdir %TEMP_REPO%
echo Cloning the repo elsewhere on disk...
pushd ..\..\
robocopy . %TEMP_REPO% /MIR /XD .git tools features scripts test node_modules /NFL /NDL /NJH /NJS
::robocopy emits error code greater or equal than 8(most other commands use any non-zero values)
if %errorlevel% geq 8 (
    echo Robocopy failed to copy xplat sources to the %TEMP_REPO%.
    goto ERROR
)
popd

echo Downloading node and npm...
pushd %TEMP_REPO%\bin
curl -o node.exe %NODE_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
curl -o npm.zip %NPM_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
unzip -q npm.zip
if %errorlevel% neq 0 goto ERROR
del npm.zip
popd

echo Running npm install...
pushd %TEMP_REPO%
call bin/npm.cmd install --production
echo.
echo if YOU SEE A FAILURE AT THE BOTTOM OF THE NPM OUTPUT:
echo If you do not have Node.js installed on this local machine, the Azure
echo postinstall command run by npm will fail.
echo.
echo This is fine as long as only the Azure module had this issue. Onward!
echo.
popd

echo Compiling streamline files...
pushd %TEMP_REPO%
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c lib
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline\lib\streams
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline-streams\lib
if %errorlevel% neq 0 goto ERROR
popd

echo Generating streamline files...
pushd %TEMP_REPO%
.\bin\node.exe bin\azure --gen
popd

echo Removing unncessary files from the enlistment for the CLI to function...
:: This is cleaner than using /EXCLUDE:... commands and easier to see line-by-line...
pushd %TEMP_REPO%

for %%i in (
    .idea
    __temp
    bin\node_modules
) do (
    if exist %%i (
        echo Deleting %%i...
        rmdir /s /q %%i
    )
)

for %%i in (
    *.md
    *.git*
    *.npm*
    *.njsproj
    *.sln
    azure_error
    azure.err
    checkstyle-result.xml
    test-result.xml
    .travis.yml
    .jshintrc
    .gitattributes
    .gitignore
    ChangeLog.txt
    bin\npm.cmd
    LICENSE.txt
) do (
    if exist %%i (
        echo Deleting %%i...
        del /q %%i
    )
)

echo.
popd

echo Creating the wbin (Windows binaries) folder that will be added to the path...
mkdir %TEMP_REPO%\wbin
copy .\scripts\azure.cmd %TEMP_REPO%\wbin\
if %errorlevel% neq 0 goto ERROR
echo Adding license documents...
copy ..\resources\*.rtf %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR
copy ..\resources\ThirdPartyNotices.txt %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR

echo.

:SUCCESS
echo Looks good.

goto END

:ERROR
echo Error occurred, please check the output for details.
exit /b 1

:END
exit /b 0
popd

Modify the build script to target the new address of npm.zip


@echo off
REM ---------------------------------------------------------------------
REM Temporary system path at cmd startup
REM ---------------------------------------------------------------------
set PATH=%PATH%;"C:\Program Files\Sublime Text 3\"

REM ---------------------------------------------------------------------
REM Commands
REM ---------------------------------------------------------------------
REM navigation
DOSKEY ..=cd ..
DOSKEY ....=cd ../..

REM tools
DOSKEY chrome="C:\Program Files\Google\Chrome\Application\chrome.exe"
DOSKEY canary="C:\Users\Marco\AppData\Local\Google\Chrome SxS\Application\chrome.exe"
DOSKEY st=sublime_text $*
DOSKEY sublime=sublime_text $*

REM shortcuts
DOSKEY g=git $*
DOSKEY ls=dir /B

REM alias file handling
DOSKEY alias=sublime_text d:\dev\tools\alias.cmd
DOSKEY alias_copy=copy d:\dev\tools\alias.cmd %USERPROFILE%\Dropbox\dev\env

REM ---------------------------------------------------------------------
REM Common directories
REM ---------------------------------------------------------------------
REM development directories
DOSKEY s=cd "D:\dev\git\server"
DOSKEY c=cd "D:\dev\git\web"
DOSKEY t=cd "D:\dev\git\web\test"

REM standard directories
DOSKEY h=cd "%USERPROFILE%\$*"
DOSKEY db=cd "%USERPROFILE%\Dropbox\$*"

@echo off
REM ---------------------------------------------------------------------
REM Temporary system path at cmd startup
REM ---------------------------------------------------------------------
set PATH=%PATH%;"C:\Program Files\Sublime Text 3\"

REM ---------------------------------------------------------------------
REM Commands
REM ---------------------------------------------------------------------
REM navigation
DOSKEY ..=cd ..
DOSKEY ....=cd ../..

REM tools
DOSKEY chrome="C:\Program Files\Google\Chrome\Application\chrome.exe"
DOSKEY canary="C:\Users\<your username>\AppData\Local\Google\Chrome SxS\Application\chrome.exe"
DOSKEY st=sublime_text $*
DOSKEY sublime=sublime_text $*

REM shortcuts
DOSKEY g=git $*
DOSKEY ls=dir /B

REM alias file handling
DOSKEY alias=sublime_text c:\alias.cmd
DOSKEY alias_copy=copy c:\alias.cmd %USERPROFILE%\Dropbox\dev\env

REM ---------------------------------------------------------------------
REM Common directories
REM ---------------------------------------------------------------------
REM development directories
DOSKEY s=cd "c:\src\server"
DOSKEY c=cd "c:\src\web"
DOSKEY t=cd "c:\src\web\test"

REM standard directories
DOSKEY h=cd "%USERPROFILE%\$*"
DOSKEY db=cd "%USERPROFILE%\Dropbox\$*"

change some paths

change some paths


@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

@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%
msbuild INSTALL.vcxproj /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%
msbuild INSTALL.vcxproj /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 quantlib build script

update quantlib build script


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

@echo off
cls
msbuild /t:DownloadNuGet
".nuget\NuGet.exe" "Install" "FAKE" "-OutputDirectory" "packages" "-ExcludeVersion"
"packages\FAKE\tools\Fake.exe" build.fsx
pause

Put fetch-nuget into the build script.

Put fetch-nuget into the build script.


@echo Off
dotnet restore
dotnet build
dotnet pack "src\Discord.Net" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Core" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Commands" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Rest" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.WebSocket" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Rpc" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build

REM dotnet pack "src\Discord.Net\Discord.Net.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
REM dotnet pack "src\Discord.Net.Core\Discord.Net.Core.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
REM dotnet pack "src\Discord.Net.Commands\Discord.Net.Commands.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
REM dotnet pack "src\Discord.Net.Rest\Discord.Net.Rest.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
REM dotnet pack "src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
REM dotnet pack "src\Discord.Net.Rpc\Discord.Net.Rpc.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build

@echo Off
dotnet restore
dotnet build
dotnet pack "src\Discord.Net" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
dotnet pack "src\Discord.Net.Core" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
dotnet pack "src\Discord.Net.Commands" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
dotnet pack "src\Discord.Net.Rest" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
dotnet pack "src\Discord.Net.WebSocket" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
dotnet pack "src\Discord.Net.Rpc" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build

REM dotnet pack "src\Discord.Net\Discord.Net.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
REM dotnet pack "src\Discord.Net.Core\Discord.Net.Core.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
REM dotnet pack "src\Discord.Net.Commands\Discord.Net.Commands.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
REM dotnet pack "src\Discord.Net.Rest\Discord.Net.Rest.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
REM dotnet pack "src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build
REM dotnet pack "src\Discord.Net.Rpc\Discord.Net.Rpc.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%BuildCounter%" --no-build

Use BuildCounter suffix in build script

Use BuildCounter suffix in build script


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.2 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.2 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.2
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.4 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.4
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Update BuildLib 0.3.4

Update BuildLib 0.3.4


@echo Off
pushd %~dp0
setlocal

:Build
call npm install
call npm run check
call npm run build
call npm run validate

if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildFail
echo.
echo *** BUILD FAILED ***
goto End

:BuildSuccess
echo.
echo *** BUILD SUCCEEDED ***
goto End

:End
echo.
popd
exit /B %ERRORLEVEL%

Add build.cmd

Add build.cmd


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

msbuild .\.build\Build.proj /p:Configuration="%config%" /t:RunAll /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Diagnostic /nr:false

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

msbuild .\.build\Build.proj /p:Configuration="%config%" /t:RunAll /v:d /fl /flp:LogFile=msbuild.log;Verbosity=Diagnostic /nr:false

Update build.cmd in order to raise msbuild verbosity (to ease CI troubleshooting sessions).


@ECHO OFF
PUSHD %~dp0

SETLOCAL

IF NOT DEFINED VisualStudioVersion (
    IF DEFINED VS140COMNTOOLS (
        CALL "%VS140COMNTOOLS%\VsDevCmd.bat"
        GOTO :EnvSet
    )

    ECHO Error: build.cmd requires Visual Studio 2015.
    SET ERRORLEVEL=1
    GOTO :Exit
)

:EnvSet
SET DnuExe=dnu
SET BuildProj=%~dp0All.sln

:: Check if DNU exists globally
WHERE %DnuExe%

IF NOT '%ERRORLEVEL%'=='0' (
    ECHO ERROR: build.cmd requires dnu installed gloablly.
    GOTO :Exit
)

:: Restore packages for .csproj projects

CALL :RestorePackage

:: Log build command line
SET BuildLog=%~dp0msbuild.log
SET BuildPrefix=echo
SET BuildPostfix=^> "%BuildLog%"
CALL :Build %*

:: Build
SET BuildPrefix=
SET BuildPostfix=
CALL :Build %*

GOTO :AfterBuild

:AfterBuild

:: Pull the build summary from the log file
ECHO.
ECHO === BUILD RESULT ===
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%BuildLog%"

:: Pull xunit test result from the log file
ECHO.
ECHO === TEST EXECUTION SUMMARY ===
findstr /ir /c:"Total:.*Failed.*Skipped.*Time.*" "%BuildLog%"

GOTO :Exit

:Build
%BuildPrefix% msbuild "%BuildProj%" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%BuildLog%";Append %* %BuildPostfix%

:RestorePackage
:: Restore inside each subfolder
FOR /D %%x IN ("src","docs","test") DO (
PUSHD %%x
CMD /C %DnuExe% restore --parallel
POPD
)

SET CachedNuget=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CachedNuget% 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 '%CachedNuget%'"

:COPYNUGET
IF EXIST .NuGet\NuGet.exe GOTO RESTORE
MD .NuGet
COPY %CachedNuget% .NuGet\NuGet.exe

:RESTORE
:: Currently has corpnet dependency
.NuGet\NuGet.exe restore "%BuildProj%"

:Exit
POPD
ECHO.
ECHO Exit Code = %ERRORLEVEL%
EXIT /B %ERRORLEVEL%

@ECHO OFF
PUSHD %~dp0

SETLOCAL

IF NOT DEFINED VisualStudioVersion (
    IF DEFINED VS140COMNTOOLS (
        CALL "%VS140COMNTOOLS%\VsDevCmd.bat"
        GOTO :EnvSet
    )

    ECHO Error: build.cmd requires Visual Studio 2015.
    SET ERRORLEVEL=1
    GOTO :Exit
)

:EnvSet
SET DnuExe=dnu
SET BuildProj=%~dp0All.sln

:: Check if DNU exists globally
WHERE %DnuExe%

IF NOT '%ERRORLEVEL%'=='0' (
    ECHO ERROR: build.cmd requires dnu installed gloablly.
    GOTO :Exit
)

:: Restore packages for .csproj projects

CALL :RestorePackage

:: Log build command line
SET BuildLog=%~dp0msbuild.log
SET BuildPrefix=echo
SET BuildPostfix=^> "%BuildLog%"
CALL :Build %*

:: Build
SET BuildPrefix=
SET BuildPostfix=
CALL :Build %*

GOTO :AfterBuild

:AfterBuild

:: Pull the build summary from the log file
ECHO.
ECHO === BUILD RESULT ===
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%BuildLog%"

:: Pull xunit test result from the log file
ECHO.
ECHO === TEST EXECUTION SUMMARY ===
findstr /ir /c:"Total:.*Failed.*Skipped.*Time.*" "%BuildLog%"

GOTO :Exit

:Build
%BuildPrefix% msbuild "%BuildProj%" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%BuildLog%";Append %* %BuildPostfix%

GOTO :Exit

:RestorePackage
:: Restore inside each subfolder
FOR /D %%x IN ("src","docs","test") DO (
PUSHD %%x
CMD /C %DnuExe% restore --parallel
POPD
)

SET CachedNuget=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CachedNuget% GOTO RESTORE
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 '%CachedNuget%'"

:RESTORE
:: Currently has corpnet dependency
%CachedNuget% restore "%BuildProj%"

:Exit
POPD
ECHO.
ECHO Exit Code = %ERRORLEVEL%
EXIT /B %ERRORLEVEL%

Resolve comments

Resolve comments


REM NOTE: must set encoding else "unmappable character for encoding utf-8"; https://stackoverflow.com/questions/21147974/set-a-system-property-with-ant
SET ANT_OPTS="-Dfile.encoding=UTF8"
ant -buildfile build.xml

Luaj: Fix build warnings about 'unmappable character for encoding utf-8' [gnosygnu/xowa#502]


cd ../libs/cu-events
call gulp

cd ../cu-stores
call gulp

cd ../cu-components
call gulp

cd ../../core-testbed
call gulp
copy src\fake*.js dist\js

Build helper script

Build helper script


DEL /Q "..\projector\gen\paths.h"
C:\Python27\python.exe "path_to_arduino.py" -i "..\..\svgs" -o "..\projector\gen\paths.h"

add bat file for simple paths generation


@echo off
rem based on scalac.bat from the Scala distribution
rem ##########################################################################
rem # Copyright 2002-2011, LAMP/EPFL
rem # Copyright 2011-2017, JetBrains
rem #
rem # This is free software; see the distribution for copying conditions.
rem # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
rem # PARTICULAR PURPOSE.
rem ##########################################################################

setlocal enabledelayedexpansion
call :set_home
call :set_path

set "TOOL_NAME=%1"
shift

if "%_TOOL_CLASS%"=="" set _TOOL_CLASS=org.jetbrains.kotlin.cli.utilities.MainKt

if not "%JAVA_HOME%"=="" (
  if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
)

if "%_JAVACMD%"=="" set _JAVACMD=java

set JAVA_ARGS=
set KONAN_ARGS=

:again
set "ARG=%1"
if not "!ARG!" == "" (
    if "!ARG:~0,2!" == "-D" (
        set "JAVA_ARGS=%JAVA_ARGS% %ARG%"
        goto next
    )
    if "!ARG:~0,2!" == "-J" (
        set "JAVA_ARGS=%JAVA_ARGS% !ARG:~2!"
        goto next
    )
    if "!ARG!" == "--time" (
        set "KONAN_ARGS=%KONAN_ARGS% --time"
        set "JAVA_ARGS=%JAVA_ARGS% -agentlib:hprof=cpu=samples -Dkonan.profile=true"
        goto next
    )

    set "KONAN_ARGS=%KONAN_ARGS% %ARG%"

    :next
    shift
    goto again
)

set "NATIVE_LIB=%_KONAN_HOME%\konan\nativelib"
set "KONAN_LIB=%_KONAN_HOME%\konan\lib"

set "SHARED_JAR=%KONAN_LIB%\shared.jar"
set "INTEROP_INDEXER_JAR=%KONAN_LIB%\Indexer.jar"
set "INTEROP_RUNTIME_JAR=%KONAN_LIB%\Runtime.jar"
set "KLIB_JAR=%KONAN_LIB%\klib.jar"
set "KONAN_JAR=%KONAN_LIB%\backend.native.jar"
set "KOTLIN_JAR=%KONAN_LIB%\kotlin-compiler.jar"
set "KOTLIN_STDLIB_JAR=%KONAN_LIB%\kotlin-stdlib.jar"
set "KOTLIN_REFLECT_JAR=%KONAN_LIB%\kotlin-stdlib.jar"
set "KOTLIN_SCRIPT_RUNTIME_JAR=%KONAN_LIB%\kotlin-script-runtime.jar"
set "STUB_GENERATOR_JAR=%KONAN_LIB%\StubGenerator.jar"
set "UTILITIES_JAR=%KONAN_LIB%\utilities.jar"

set "KONAN_CLASSPATH=%KOTLIN_JAR%;%KOTLIN_STDLIB_JAR%;%KOTLIN_REFLECT_JAR%;%KOTLIN_SCRIPT_RUNTIME_JAR%;%INTEROP_RUNTIME_JAR%;%KONAN_JAR%;%STUB_GENERATOR_JAR%;%INTEROP_INDEXER_JAR%;%SHARED_JAR%;%KLIB_JAR%;%UTILITIES_JAR%"

set JAVA_OPTS=-ea ^
    -Xmx3G ^
    "-Djava.library.path=%NATIVE_LIB%" ^
    "-Dkonan.home=%_KONAN_HOME%" ^
    -Dfile.encoding=UTF-8 ^
    %JAVA_OPTS%

set LIBCLANG_DISABLE_CRASH_RECOVERY=1

"%_JAVACMD%" %JAVA_OPTS% %JAVA_ARGS% -cp "%KONAN_CLASSPATH%" %_TOOL_CLASS% %TOOL_NAME% %KONAN_ARGS%

exit /b %ERRORLEVEL%
goto end

rem ##########################################################################
rem # subroutines

:set_home
  set _BIN_DIR=
  for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
  set _KONAN_HOME=%_BIN_DIR%..
goto :eof

:set_path
  rem libclang.dll is dynamically linked and thus requires correct PATH to be loaded.
  rem TODO: remove this hack.
  if ("%KONAN_DATA_DIR%"=="") (set KONAN_DATA_DIR=%USERPROFILE%\.konan)
  set "PATH=%KONAN_DATA_DIR%\dependencies\msys2-mingw-w64-x86_64-gcc-7.2.0-clang-llvm-5.0.0-windows-x86-64\bin;%PATH%"
goto :eof

:end
endlocal

@echo off
rem based on scalac.bat from the Scala distribution
rem ##########################################################################
rem # Copyright 2002-2011, LAMP/EPFL
rem # Copyright 2011-2017, JetBrains
rem #
rem # This is free software; see the distribution for copying conditions.
rem # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
rem # PARTICULAR PURPOSE.
rem ##########################################################################

setlocal enabledelayedexpansion
call :set_home
call :set_path

set "TOOL_NAME=%1"
shift

if "%_TOOL_CLASS%"=="" set _TOOL_CLASS=org.jetbrains.kotlin.cli.utilities.MainKt

if not "%JAVA_HOME%"=="" (
  if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
)

if "%_JAVACMD%"=="" set _JAVACMD=java

set JAVA_ARGS=
set KONAN_ARGS=

:again
set "ARG=%1"
if not "!ARG!" == "" (
    if "!ARG:~0,2!" == "-D" (
        set "JAVA_ARGS=%JAVA_ARGS% %ARG%"
        goto next
    )
    if "!ARG:~0,2!" == "-J" (
        set "JAVA_ARGS=%JAVA_ARGS% !ARG:~2!"
        goto next
    )
    if "!ARG!" == "--time" (
        set "KONAN_ARGS=%KONAN_ARGS% --time"
        set "JAVA_ARGS=%JAVA_ARGS% -agentlib:hprof=cpu=samples -Dkonan.profile=true"
        goto next
    )

    set "KONAN_ARGS=%KONAN_ARGS% %ARG%"

    :next
    shift
    goto again
)

set "NATIVE_LIB=%_KONAN_HOME%\konan\nativelib"
set "KONAN_LIB=%_KONAN_HOME%\konan\lib"

set "SHARED_JAR=%KONAN_LIB%\shared.jar"
set "INTEROP_INDEXER_JAR=%KONAN_LIB%\Indexer.jar"
set "INTEROP_RUNTIME_JAR=%KONAN_LIB%\Runtime.jar"
set "KLIB_JAR=%KONAN_LIB%\klib.jar"
set "KONAN_JAR=%KONAN_LIB%\backend.native.jar"
set "KOTLIN_JAR=%KONAN_LIB%\kotlin-compiler.jar"
set "KOTLIN_STDLIB_JAR=%KONAN_LIB%\kotlin-stdlib.jar"
set "KOTLIN_REFLECT_JAR=%KONAN_LIB%\kotlin-stdlib.jar"
set "KOTLIN_SCRIPT_RUNTIME_JAR=%KONAN_LIB%\kotlin-script-runtime.jar"
set "STUB_GENERATOR_JAR=%KONAN_LIB%\StubGenerator.jar"
set "UTILITIES_JAR=%KONAN_LIB%\utilities.jar"

set "KONAN_CLASSPATH=%KOTLIN_JAR%;%KOTLIN_STDLIB_JAR%;%KOTLIN_REFLECT_JAR%;%KOTLIN_SCRIPT_RUNTIME_JAR%;%INTEROP_RUNTIME_JAR%;%KONAN_JAR%;%STUB_GENERATOR_JAR%;%INTEROP_INDEXER_JAR%;%SHARED_JAR%;%KLIB_JAR%;%UTILITIES_JAR%"

set JAVA_OPTS=-ea ^
    -Xmx3G ^
    "-Djava.library.path=%NATIVE_LIB%" ^
    "-Dkonan.home=%_KONAN_HOME%" ^
    -Dfile.encoding=UTF-8 ^
    %JAVA_OPTS%

set LIBCLANG_DISABLE_CRASH_RECOVERY=1

"%_JAVACMD%" %JAVA_OPTS% %JAVA_ARGS% -cp "%KONAN_CLASSPATH%" %_TOOL_CLASS% %TOOL_NAME% %KONAN_ARGS%

exit /b %ERRORLEVEL%
goto end

rem ##########################################################################
rem # subroutines

:set_home
  set _BIN_DIR=
  for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
  set _KONAN_HOME=%_BIN_DIR%..
goto :eof

:set_path
  rem libclang.dll is dynamically linked and thus requires correct PATH to be loaded.
  rem TODO: remove this hack.
  if "%KONAN_DATA_DIR%"=="" (set KONAN_DATA_DIR=%USERPROFILE%\.konan)
  set "PATH=%KONAN_DATA_DIR%\dependencies\msys2-mingw-w64-x86_64-gcc-7.2.0-clang-llvm-5.0.0-windows-x86-64\bin;%PATH%"
goto :eof

:end
endlocal

Fix KONAN_DATA_DIR in the Windows command-line runner (#1649)


@echo off

:: Prerequisites:
:: 1. Pull down the brackets repo (be sure to update submodules!)
:: 2. Set BRACKETS_SRC to the root of the brackets repo (with NO trailing slash)
:: 3. Build the Windows build of brackets-shell - see scripts\make_appshell_project.bat
::    (should create a brackets-shell\Release dir)

:: Check that BRACKETS_SRC var is defined and points to a dir that exists
:: (we can't only check the latter since an undefined var is "", which DOES 'exist')
IF NOT DEFINED BRACKETS_SRC GOTO NO_BRACKETS_SRC
IF NOT EXIST %BRACKETS_SRC% GOTO NO_BRACKETS_SRC

:: Folder structure before staging:
::   brackets-shell
::      installer
::         mac
::         win  <-- current directory
::      Release
::         Brackets.exe
::         locales
::         ...
::      ...
::   brackets   <-- BRACKETS_SRC
::      src
::      test

:: Folder structure after staging:
::   brackets-shell
::      installer
::         win
::            staging
::               Brackets.exe
::               locales
::               ...
::               www
::                  <contents of BRACKETS_SRC\src>
::      ...

:: Notes on xcopy usage...
::
:: xcopy uses a very primitive exclusion mechanism. The exclusions have to be stored in a file (can't be
:: passed on command line), and they are matched as literal strings (no wildcards). They can't use spaces
:: (even with quotes), and the path containing the exclude text file also cannot contain spaces. The exclude
:: strings are matched against the absolute path+name of each file AND directory being copied.
::
:: The source path is expected to have NO trailing slash (otherwise "Invalid path"); but the destination path
:: *must* have a trailing slash or else xcopy will prompt to disambiguate dest folder vs. path (unless you pass /i).
::
:: For detailed Windows scripting documentation, see:
:: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

:: Remove any old bits from the staging dir
IF NOT EXIST staging\ GOTO STAGING_CLEARED

echo Clearing old staging folder %CD%\staging ...
rmdir staging\ /s /q

:STAGING_CLEARED

:: Copy Release of brackets-shell to staging
echo Copying brackets-shell build from %CD%\..\..\Release ...

(
    echo .pdb
    echo \obj\
    echo \lib\
    echo avformat-54.dll
    echo avutil-51.dll
    echo avcodec-54.dll
    echo d3dcompiler_43.dll
    echo d3dx9_43.dll
    echo libEGL.dll
    echo libGLESv2.dll
    echo cefclient.exe
    echo debug.log
) > shell_excludes.tmp
xcopy ..\..\Release staging /s /i /exclude:shell_excludes.tmp
del shell_excludes.tmp

:: Copy BRACKETS_SRC\src to staging\www
:: excluding .git*
echo Copying brackets source from %BRACKETS_SRC%\src ...

echo .git > www_excludes.tmp
xcopy %BRACKETS_SRC%\src staging\www /s /i /exclude:www_excludes.tmp
del www_excludes.tmp

echo.
echo Done staging Brackets for Windows! (Run installer generator script next)

GOTO END

:NO_BRACKETS_SRC
echo Error: Unable to locate BRACKETS_SRC. Make sure environment variable is set, and is pointing to the root of your brackets repo (with NO trailing slash).

:END

@echo off

:: Prerequisites:
:: 1. Pull down the brackets repo (be sure to update submodules!)
:: 2. Set BRACKETS_SRC to the root of the brackets repo (with NO trailing slash)
:: 3. Build the Windows build of brackets-shell - see scripts\make_appshell_project.bat
::    (should create a brackets-shell\Release dir)

:: Check that BRACKETS_SRC var is defined and points to a dir that exists
:: (we can't only check the latter since an undefined var is "", which DOES 'exist')
IF NOT DEFINED BRACKETS_SRC GOTO NO_BRACKETS_SRC
IF NOT EXIST %BRACKETS_SRC% GOTO NO_BRACKETS_SRC

:: Folder structure before staging:
::   brackets-shell
::      installer
::         mac
::         win  <-- current directory
::      Release
::         Brackets.exe
::         locales
::         ...
::      ...
::   brackets   <-- BRACKETS_SRC
::      src
::      test

:: Folder structure after staging:
::   brackets-shell
::      installer
::         win
::            staging
::               Brackets.exe
::               locales
::               ...
::               www
::                  <contents of BRACKETS_SRC\src>
::      ...

:: Notes on xcopy usage...
::
:: xcopy uses a very primitive exclusion mechanism. The exclusions have to be stored in a file (can't be
:: passed on command line), and they are matched as literal strings (no wildcards). They can't use spaces
:: (even with quotes), and the path containing the exclude text file also cannot contain spaces. The exclude
:: strings are matched against the absolute path+name of each file AND directory being copied.
::
:: The source path is expected to have NO trailing slash (otherwise "Invalid path"); but the destination path
:: *must* have a trailing slash or else xcopy will prompt to disambiguate dest folder vs. path (unless you pass /i).
::
:: For detailed Windows scripting documentation, see:
:: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

:: Remove any old bits from the staging dir
IF NOT EXIST staging\ GOTO STAGING_CLEARED

echo Clearing old staging folder %CD%\staging ...
rmdir staging\ /s /q

:STAGING_CLEARED

:: Copy Release of brackets-shell to staging
echo Copying brackets-shell build from %CD%\..\..\Release ...

(
    echo .pdb
    echo \obj\
    echo \lib\
    echo avformat-54.dll
    echo avutil-51.dll
    echo avcodec-54.dll
    echo d3dcompiler_43.dll
    echo d3dx9_43.dll
    echo libEGL.dll
    echo libGLESv2.dll
    echo cefclient.exe
    echo debug.log
) > shell_excludes.tmp
xcopy ..\..\Release staging /s /i /exclude:shell_excludes.tmp
del shell_excludes.tmp

:: Copy BRACKETS_SRC\src to staging\www
:: excluding .git*
echo Copying brackets source from %BRACKETS_SRC%\src ...

echo .git > www_excludes.tmp
xcopy %BRACKETS_SRC%\src staging\www /s /i /exclude:www_excludes.tmp
del www_excludes.tmp

:: Copy BRACKETS_SRC\samples to staging\samples
echo Copying sample content from %BRACKETS_SRC%\samples ...

xcopy %BRACKETS_SRC%\samples staging\samples /s /i

echo.
echo Done staging Brackets for Windows! (Run installer generator script next)

GOTO END

:NO_BRACKETS_SRC
echo Error: Unable to locate BRACKETS_SRC. Make sure environment variable is set, and is pointing to the root of your brackets repo (with NO trailing slash).

:END

Update installer staging script to include src/samples folder


@echo off

setlocal enabledelayedexpansion

:: try to retrieve code page
set codepage=
for /f "usebackq tokens=2,3* delims=:" %%a in (`chcp`) do (
    if not defined codepage set codepage=%%a
)

:: chcp to 437
chcp 437>/nul

:: try to find gateway
set begin=
set /a index=0
for /f "usebackq tokens=1,2* delims=:" %%a in (`ipconfig`) do (
    if defined begin (
        echo %%a|findstr /c:"Media State">nul && set state=%%b
        if "x!state!" neq "x Media disconnected" (
            set /a index+=1
            if !index! equ 5 set gateway=%%~b
        ) else (
            set begin=
        )
    )
    echo %%a|findstr /c:"Ethernet adapter VPN - VPN Client">nul && set begin=1
)

:: drop default gateway
if "x!gateway: =!" neq "x" (
    set /p ign=going to delete default route with gateway !gateway! ... <nul
    route delete 0.0.0.0 mask 0.0.0.0 %gateway%>nul 2>&1 && echo done.
    :: flush dns
    set /p ign=going to refresh dns settings ... <nul
    ipconfig /flushdns>nul && echo done.
)

:: change code page to origin
chcp !codepage!>nul

endlocal

@echo off

setlocal enabledelayedexpansion

:: try to retrieve code page
set codepage=
for /f "usebackq tokens=2,3* delims=:" %%a in (`chcp`) do (
    if not defined codepage set codepage=%%a
)

:: chcp to 437
chcp 437>/nul

:: try to find gateway
set begin=
set /a index=0
for /f "usebackq tokens=1,2* delims=:" %%a in (`ipconfig`) do (
    if defined begin (
        echo %%a|findstr /c:"Media State">nul && set state=%%b
        if "x!state!" neq "x Media disconnected" (
            set /a index+=1
            if !index! equ 3 set network=%%~b
            if !index! equ 4 set mask=%%~b
            if !index! equ 5 set gateway=%%~b
        ) else (
            set begin=
        )
    )
    echo %%a|findstr /c:"Ethernet adapter VPN - VPN Client">nul && set begin=1
)

:: drop default gateway
if "x!gateway: =!" neq "x" (
    set /p ign=going to delete default route with gateway !gateway! ... <nul
    route delete 0.0.0.0 mask 0.0.0.0 !gateway!>nul 2>&1 && echo done.
    set /p ign=going to add new route: !network! !mask! !gateway! ... <nul
    route add !network! mask !mask! !gateway!>nul 2>&1 && echo done.
    :: flush dns
    set /p ign=going to refresh dns settings ... <nul
    ipconfig /flushdns>nul && echo done.
)

:: change code page to origin
chcp !codepage!>nul

endlocal

add new route after delete defalt route

add new route after delete defalt route


@echo off

set ALIASES=%CMDER_ROOT%\config\aliases

if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
if ["%1"] == ["/?"] goto:p_help
if ["%1"] == ["/reload"] goto:p_reload

:: if arg is an existing alias, display it
if ["%2"] == [""] (
  doskey /macros | findstr /b %1= && goto:eof
  echo Insufficient parameters. & goto:p_help
)

::validate alias
setlocal
for /f "delims== tokens=1" %%G in ("%*") do set _temp2=%%G

	set _temp=%_temp2: =%

if not ["%_temp%"] == ["%_temp2%"] (
	echo Your alias name can not contain a space
	endlocal
	goto:eof
)

:: replace already defined alias
findstr /b /v /i "%_temp%=" "%ALIASES%" >> "%ALIASES%.tmp"
echo %* >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile="%ALIASES%"
endlocal
goto:eof

:p_del
findstr /b /v /i "%2=" "%ALIASES%" >> "%ALIASES%.tmp"
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile=%ALIASES%
goto:eof

:p_reload
doskey /macrofile="%ALIASES%"
echo Aliases reloaded
goto:eof

:p_show
type "%ALIASES%" || echo No aliases found at "%ALIASES%"
goto :eof

:p_help
echo.Usage:
echo.	alias [/reload] [/d] [name=full command]
echo.     /reload  Reload the aliases file
echo.     /d       Delete an alias (must be followed by the alias name)
echo.
echo.	If alias is called with any parameters, it will display the list of existing aliases.
echo.	In the command, you can use the following notations:
echo.	$* allows the alias to assume all the parameters of the supplied command.
echo.	$1-$9 Allows you to seperate parameter by number, much like %%1 in batch.
echo.	$T is the command seperator, allowing you to string several commands together into one alias.
echo.	For more information, read DOSKEY/?

@echo off

set ALIASES=%CMDER_ROOT%\config\aliases

if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
if ["%1"] == ["/?"] goto:p_help
if ["%1"] == ["/reload"] goto:p_reload
:: /d flag for delete existing alias
if ["%1"] == ["/d"] goto:p_del %*
:: if arg is an existing alias, display it
if ["%2"] == [""] (
  doskey /macros | findstr /b %1= && goto:eof
  echo Insufficient parameters. & goto:p_help
)

::validate alias
setlocal
for /f "delims== tokens=1" %%G in ("%*") do set _temp2=%%G

	set _temp=%_temp2: =%

if not ["%_temp%"] == ["%_temp2%"] (
	echo Your alias name can not contain a space
	endlocal
	goto:eof
)

:: replace already defined alias
findstr /b /v /i "%_temp%=" "%ALIASES%" >> "%ALIASES%.tmp"
echo %* >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile="%ALIASES%"
endlocal
goto:eof

:p_del
findstr /b /v /i "%2=" "%ALIASES%" >> "%ALIASES%.tmp"
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile=%ALIASES%
goto:eof

:p_reload
doskey /macrofile="%ALIASES%"
echo Aliases reloaded
goto:eof

:p_show
type "%ALIASES%" || echo No aliases found at "%ALIASES%"
goto :eof

:p_help
echo.Usage:
echo.	alias [/reload] [/d] [name=full command]
echo.     /reload  Reload the aliases file
echo.     /d       Delete an alias (must be followed by the alias name)
echo.
echo.	If alias is called with any parameters, it will display the list of existing aliases.
echo.	In the command, you can use the following notations:
echo.	$* allows the alias to assume all the parameters of the supplied command.
echo.	$1-$9 Allows you to seperate parameter by number, much like %%1 in batch.
echo.	$T is the command seperator, allowing you to string several commands together into one alias.
echo.	For more information, read DOSKEY/?

Fix the /d flag

Fix the /d flag

Was deleted in last commit.


@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl6 "%~dp0\%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl6 "%~dp0\%~n0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
__END__
:endofperl

Add p6doc runner for windows

Add p6doc runner for windows

Pretty much a straight copy from panda.bat


@echo off
setlocal enableDelayedExpansion

REM Setup initial vars
set "script_name=WatchDog.py"
set "thisDir=%~dp0"
set /a tried=0
set "toask=yes"

goto checkscript

:checkscript
REM Check for our script first
if not exist "!thisDir!\!script_name!" (
    echo Could not find !script_name!.
    echo Please make sure to run this script from the same directory
    echo as !script_name!.
    echo.
    echo Press [enter] to quit.
    pause > nul
    exit /b
)
goto checkpy

:checkpy
python -V > NUL 2>&1
if not "!errorlevel!" == "0" (
    if %tried% lss 1 (
        if /i "!toask!"=="yes" (
            REM Better ask permission first
            goto askinstall
        ) else (
            goto installpy
        )
    ) else (
        cls
        echo   ###     ###
        echo  # Warning #
        echo ###     ###
        REM Couldn't install for whatever reason - give the error message
        echo Python is not installed or not found in your PATH var.
        echo Please install it from https://www.python.org/downloads/windows/
        echo.
        echo Make sure you check the box labeled:
        echo.
        echo "Add Python X.X to PATH"
        echo.
        echo Where X.X is the py version you're installing.
        echo.
        echo Press [enter] to quit.
        pause > nul
        exit /b
    )
)
goto runscript

:askinstall
cls
echo   ###              ###
echo  # Python Not Found #
echo ###              ###
echo.
echo Python was not found on the system or in the PATH var.
echo.
set /p "menu=Would you like to install it now? [y/n]: "
if /i "!menu!"=="y" (
    REM We got the OK - install it
    goto installpy
) else if "!menu!"=="n" (
    REM No OK here...
    set /a tried=%tried%+1
    goto checkpy
)
REM Incorrect answer - go back
goto askinstall

:installpy
REM This will attempt to download and install python
REM First we get the html for the python downloads page for Windows
set /a tried=%tried%+1
cls
echo   ###               ###
echo  # Installing Python #
echo ###               ###
echo.
echo Gathering info from https://www.python.org/downloads/windows/...
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('https://www.python.org/downloads/windows/','%TEMP%\pyurl.txt')"
if not exist "%TEMP%\pyurl.txt" (
    goto checkpy
)

echo Parsing for latest...
pushd "%TEMP%"
:: Version detection code slimmed by LussacZheng (https://github.com/corpnewt/gibMacOS/issues/20)
for /f "tokens=9 delims=< " %%x in ('findstr /i /c:"Latest Python 3 Release" pyurl.txt') do ( set "release=%%x" )
popd

echo Found Python !release! -  Downloading...
REM Let's delete our txt file now - we no longer need it
del "%TEMP%\pyurl.txt"

REM At this point - we should have the version number.
REM We can build the url like so: "https://www.python.org/ftp/python/[version]/python-[version]-amd64.exe"
set "url=https://www.python.org/ftp/python/!release!/python-!release!-amd64.exe"
REM Now we download it with our slick powershell command
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('!url!','%TEMP%\pyinstall.exe')"
REM If it doesn't exist - we bail
if not exist "%TEMP%\pyinstall.exe" (
    goto checkpy
)
REM It should exist at this point - let's run it to install silently
echo Installing...
echo pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
pushd "%TEMP%"
pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
popd
echo Installer finsihed with %ERRORLEVEL% status.
REM Now we should be able to delete the installer and check for py again
del "%TEMP%\pyinstall.exe"
REM If it worked, then we should have python in our PATH
REM this does not get updated right away though - let's try
REM manually updating the local PATH var
set "spath="
set "upath="
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKCU\Environment" /v "Path" 2^> nul') do (
    if NOT "%%j"=="" (
		set "upath=%%j"
	)
)
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" 2^> nul') do (
    if NOT "%%j"=="" (
		set "spath=%%j"
	)
)
if not "!spath!" == "" (
    REM We got something in the system path
    set "PATH=!spath!"
    if not "!upath!" == "" (
        REM We also have something in the user path
        set "PATH=!PATH!;!upath!"
    )
) else if not "!upath!" == "" (
    set "PATH=!upath!"
)
goto checkpy
exit /b

:runscript
REM Python found
cls
echo   ###                ###
echo  # CorpBot - CorpNewt #
echo ###                ###
echo.
set "args=%*"
set "args=!args:"=!"
if "!args!"=="" (
    python "!thisDir!!script_name!"
) else (
    python "!thisDir!!script_name!" %*
)
pause > nul
goto :EOF

@echo off
setlocal enableDelayedExpansion

REM Setup initial vars
set "script_name=WatchDog.py"
set "thisDir=%~dp0"
set /a tried=0
set "toask=yes"
set "py2v="
set "py2path="
set "py3v="
set "py3path="
set "pypath="

REM use_py3:
REM   TRUE  = Use if found, use py2 otherwise
REM   FALSE = Use py2
REM   FORCE = Use py3
set "use_py3=TRUE"

goto checkscript

:checkscript
REM Check for our script first
if not exist "!thisDir!\!script_name!" (
    echo Could not find !script_name!.
    echo Please make sure to run this script from the same directory
    echo as !script_name!.
    echo.
    echo Press [enter] to quit.
    pause > nul
    exit /b
)
goto checkpy

:checkpy
for /f "tokens=1" %%x in ('where python') do ( call :checkpyversion "%%x" "py2v" "py2path" "py3v" "py3path" )
set "targetpy=3"
if /i "!use_py3!" == "FALSE" (
    set "targetpy=2"
    set "pypath=!py2path!"
) else if /i "!use_py3!" == "FORCE" (
    set "pypath=!py3path!"
) else if /i "!use_py3!" == "TRUE" (
    set "pypath=!py3path!"
    if "!pypath!" == "" set "pypath=!py2path!"
)
if not "!pypath!" == "" (
    goto runscript
)

if "!pypath!" == "" (
    if %tried% lss 1 (
        if /i "!toask!"=="yes" (
            REM Better ask permission first
            goto askinstall
        ) else (
            goto installpy
        )
    ) else (
        cls
        echo   ###     ###
        echo  # Warning #
        echo ###     ###
        echo.
        REM Couldn't install for whatever reason - give the error message
        echo Python is not installed or not found in your PATH var.
        echo Please install it from https://www.python.org/downloads/windows/
        echo.
        echo Make sure you check the box labeled:
        echo.
        echo "Add Python X.X to PATH"
        echo.
        echo Where X.X is the py version you're installing.
        echo.
        echo Press [enter] to quit.
        pause > nul
        exit /b
    )
)
goto runscript

:checkpyversion <path> <py2v> <py2path> <py3v> <py3path>
set "version="&for /f "tokens=2* USEBACKQ delims= " %%a in (`"%~1" -V 2^>^&1`) do (
    REM Ensure we have a version number
    call :isnumber "%%a"
    if not "!errorlevel!" == "0" goto :EOF
    set "version=%%a"
)
if not defined version goto :EOF
if "!version:~0,1!" == "2" (
    REM Python 2
    call :comparepyversion "!version!" "!%~2!"
    if "!errorlevel!" == "1" (
        set "%~2=!version!"
        set "%~3=%~1"
    )
) else (
    REM Python 3
    call :comparepyversion "!version!" "!%~4!"
    if "!errorlevel!" == "1" (
        set "%~4=!version!"
        set "%~5=%~1"
    )
)
goto :EOF

:isnumber <check>
set "var="&for /f "delims=0123456789." %%i in ("%~1") do set var=%%i
if defined var (exit /b 1)
exit /b 0

:comparepyversion <version1> <version2> <return>
REM Exits with status 0 if equal, 1 if v1 gtr v2, 2 if v1 lss v2
for /f "tokens=1,2,3 delims=." %%a in ("%~1") do (
    set a1=%%a
    set a2=%%b
    set a3=%%c
)
for /f "tokens=1,2,3 delims=." %%a in ("%~2") do (
    set b1=%%a
    set b2=%%b
    set b3=%%c
)
if not defined a1 set a1=0
if not defined a2 set a2=0
if not defined a3 set a3=0
if not defined b1 set b1=0
if not defined b2 set b2=0
if not defined b3 set b3=0
if %a1% gtr %b1% exit /b 1
if %a1% lss %b1% exit /b 2
if %a2% gtr %b2% exit /b 1
if %a2% lss %b2% exit /b 2
if %a3% gtr %b3% exit /b 1
if %a3% lss %b3% exit /b 2
exit /b 0

:askinstall
cls
echo   ###              ###
echo  # Python Not Found #
echo ###              ###
echo.
echo Python !targetpy! was not found on the system or in the PATH var.
echo.
set /p "menu=Would you like to install it now? [y/n]: "
if /i "!menu!"=="y" (
    REM We got the OK - install it
    goto installpy
) else if "!menu!"=="n" (
    REM No OK here...
    set /a tried=%tried%+1
    goto checkpy
)
REM Incorrect answer - go back
goto askinstall

:installpy
REM This will attempt to download and install python
REM First we get the html for the python downloads page for Windows
set /a tried=%tried%+1
cls
echo   ###               ###
echo  # Installing Python #
echo ###               ###
echo.
echo Gathering info from https://www.python.org/downloads/windows/...
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('https://www.python.org/downloads/windows/','%TEMP%\pyurl.txt')"
if not exist "%TEMP%\pyurl.txt" (
    goto checkpy
)

echo Parsing for latest...
pushd "%TEMP%"
:: Version detection code slimmed by LussacZheng (https://github.com/corpnewt/gibMacOS/issues/20)
for /f "tokens=9 delims=< " %%x in ('findstr /i /c:"Latest Python !targetpy! Release" pyurl.txt') do ( set "release=%%x" )
popd

echo Found Python !release! -  Downloading...
REM Let's delete our txt file now - we no longer need it
del "%TEMP%\pyurl.txt"

REM At this point - we should have the version number.
REM We can build the url like so: "https://www.python.org/ftp/python/[version]/python-[version]-amd64.exe"
set "url=https://www.python.org/ftp/python/!release!/python-!release!-amd64.exe"
set "pytype=exe"
if "!targetpy!" == "2" (
    set "url=https://www.python.org/ftp/python/!release!/python-!release!.amd64.msi"
    set "pytype=msi"
)
REM Now we download it with our slick powershell command
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('!url!','%TEMP%\pyinstall.!pytype!')"
REM If it doesn't exist - we bail
if not exist "%TEMP%\pyinstall.!pytype!" (
    goto checkpy
)
REM It should exist at this point - let's run it to install silently
echo Installing...
pushd "%TEMP%"
if /i "!pytype!" == "exe" (
    echo pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
    pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
) else (
    set "foldername=!release:.=!"
    echo msiexec /i pyinstall.msi /qb ADDLOCAL=ALL TARGETDIR="%LocalAppData%\Programs\Python\Python!foldername:~0,2!"
    msiexec /i pyinstall.msi /qb ADDLOCAL=ALL TARGETDIR="%LocalAppData%\Programs\Python\Python!foldername:~0,2!"
)
popd
echo Installer finished with %ERRORLEVEL% status.
REM Now we should be able to delete the installer and check for py again
del "%TEMP%\pyinstall.!pytype!"
REM If it worked, then we should have python in our PATH
REM this does not get updated right away though - let's try
REM manually updating the local PATH var
set "spath="
set "upath="
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKCU\Environment" /v "Path" 2^> nul') do ( if not "%%j" == "" set "upath=%%j" )
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" 2^> nul') do ( if not "%%j" == "" set "spath=%%j" )
if not "!spath!" == "" (
    REM We got something in the system path
    set "PATH=!spath!"
    if not "!upath!" == "" (
        REM We also have something in the user path
        set "PATH=!PATH!;!upath!"
    )
) else if not "!upath!" == "" (
    set "PATH=!upath!"
)
goto checkpy
exit /b
:runscript
REM Python found
cls
echo   ###                ###
echo  # CorpBot - CorpNewt #
echo ###                ###
echo.
set "args=%*"
set "args=!args:"=!"
if "!args!"=="" (
    "!pypath!" "!thisDir!!script_name!"
) else (
    "!pypath!" "!thisDir!!script_name!" %*
)
pause > nul
goto :EOF

Expand python detection

Expand python detection


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem                                                                         ##
@rem  Griffon JVM Bootstrap for Windowz                                      ##
@rem                                                                         ##
@rem ##########################################################################

@rem
@rem $Revision: 4170 $ $Date: 2006-10-26 12:11:12 +0000 (Thu, 26 Oct 2006) $
@rem

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~1
shift

set CLASS=%~1
shift

if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"

@rem Determine the command interpreter to execute the "CD" later
set COMMAND_COM="cmd.exe"
if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"

@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
set FIND_EXE="find.exe"
if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"

:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME

echo.
echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
if not errorlevel 1 goto check_GRIFFON_HOME

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:check_GRIFFON_HOME
@rem Define GRIFFON_HOME if not set
if "%GRIFFON_HOME%" == "" set GRIFFON_HOME=%DIRNAME%..

@rem remove trailing slash from GRIFFON_HOME
if "%GRIFFON_HOME:~-1%"=="\" SET GRIFFON_HOME=%GRIFFON_HOME:~0,-1%

@rem classpath handling
set _SKIP=2
set CP=
if "x%~1" == "x-cp" set CP=%~2
if "x%~1" == "x-classpath" set CP=%~2
if "x%~1" == "x--classpath" set CP=%~2
if "x" == "x%CP%" goto init
set _SKIP=4
shift
shift

:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%eval[2+2]" == "4" goto 4NT_args

@rem Slurp the command line arguments.
set CMD_LINE_ARGS=

:win9xME_args_slurp
if "x%~1" == "x" goto execute

rem horrible roll your own arg processing inspired by jruby equivalent

rem escape minus (-d), quotes (-q), star (-s).
set _ARGS=%*
if not defined _ARGS goto execute
set _ARGS=%_ARGS:-=-d%
set _ARGS=%_ARGS:"=-q%
rem Windowz will try to match * with files so we escape it here
rem but it is also a meta char for env var string substitution
rem so it can't be first char here, hack just for common cases.
rem If in doubt use a space or bracket before * if using -e.
set _ARGS=%_ARGS: *= -s%
set _ARGS=%_ARGS:)*=)-s%
set _ARGS=%_ARGS:0*=0-s%
set _ARGS=%_ARGS:1*=1-s%
set _ARGS=%_ARGS:2*=2-s%
set _ARGS=%_ARGS:3*=3-s%
set _ARGS=%_ARGS:4*=4-s%
set _ARGS=%_ARGS:5*=5-s%
set _ARGS=%_ARGS:6*=6-s%
set _ARGS=%_ARGS:7*=7-s%
set _ARGS=%_ARGS:8*=8-s%
set _ARGS=%_ARGS:9*=9-s%

rem prequote all args for 'for' statement
set _ARGS="%_ARGS%"

set _ARG=
:win9xME_args_loop
rem split args by spaces into first and rest
for /f "tokens=1,*" %%i in (%_ARGS%) do call :get_arg "%%i" "%%j"
goto process_arg

:get_arg
rem remove quotes around first arg
for %%i in (%1) do set _ARG=%_ARG% %%~i
rem set the remaining args
set _ARGS=%2
rem remove the leading space we'll add the first time
if "x%_ARG:~0,1%" == "x " set _ARG=%_ARG:~1%
rem return
goto :EOF

:process_arg
if "%_ARG%" == "" goto execute

rem collect all parts of a quoted argument containing spaces
if not "%_ARG:~0,2%" == "-q" goto :argIsComplete
if "%_ARG:~-2%" == "-q" goto :argIsComplete
rem _ARG starts with a quote but does not end with one:
rem  add the next part to _ARG until the matching quote is found
goto :win9xME_args_loop

:argIsComplete
if "x4" == "x%_SKIP%" goto skip_4
if "x3" == "x%_SKIP%" goto skip_3
if "x2" == "x%_SKIP%" goto skip_2
if "x1" == "x%_SKIP%" goto skip_1

rem now unescape -q, -s, -d
set _ARG=%_ARG:-s=*%
set _ARG=%_ARG:-q="%
set _ARG=%_ARG:-d=-%

set CMD_LINE_ARGS=%CMD_LINE_ARGS% %_ARG%
set _ARG=
goto win9xME_args_loop

:skip_4
set _ARG=
set _SKIP=3
goto win9xME_args_loop

:skip_3
set _ARG=
set _SKIP=2
goto win9xME_args_loop

:skip_2
set _ARG=
set _SKIP=1
goto win9xME_args_loop

:skip_1
set _ARG=
set _SKIP=0
goto win9xME_args_loop

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=%GRIFFON_HOME%\lib\groovy-all-@groovy.version@.jar;%GRIFFON_HOME%\dist\griffon-cli-@griffon.version@.jar;%GRIFFON_HOME%\dist\griffon-rt-@griffon.version@.jar

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

@rem Setting a classpath using the -cp or -classpath option means not to use
@rem the global classpath. Groovy behaves then the same as the java
@rem interpreter
if "x" == "x%CP%" goto empty_cp
:non_empty_cp
set CP=%CP%;.
goto after_cp
:empty_cp
set CP=.
:after_cp

if "x" == "x%CLASSPATH%" goto after_classpath
set CP=%CP%;%CLASSPATH%
:after_classpath

set STARTER_MAIN_CLASS=org.codehaus.griffon.cli.support.GriffonStarter
set STARTER_CONF=%GRIFFON_HOME%\conf\groovy-starter.conf

set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar

set STACKTRACE_FILTERS="groovy., org.codehaus.groovy., java., javax., sun., gjdk.groovy., gant., org.codehaus.gant."

if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx512m"
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgriffon.home="%GRIFFON_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir="."
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.sanitized.stacktraces="%STACKTRACE_FILTERS%"

if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"

@rem Execute Groovy
CALL "%JAVA_EXE%" %JAVA_OPTS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" "%CMD_LINE_ARGS%"
:end
@rem End local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" endlocal

@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem                                                                         ##
@rem  Griffon JVM Bootstrap for Windowz                                      ##
@rem                                                                         ##
@rem ##########################################################################

@rem
@rem $Revision: 4170 $ $Date: 2006-10-26 12:11:12 +0000 (Thu, 26 Oct 2006) $
@rem

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~1
shift

set CLASS=%~1
shift

if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"

@rem Determine the command interpreter to execute the "CD" later
set COMMAND_COM="cmd.exe"
if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"

@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
set FIND_EXE="find.exe"
if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"

:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME

echo.
echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
if not errorlevel 1 goto check_GRIFFON_HOME

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:check_GRIFFON_HOME
@rem Define GRIFFON_HOME if not set
if "%GRIFFON_HOME%" == "" set GRIFFON_HOME=%DIRNAME%..

@rem remove trailing slash from GRIFFON_HOME
if "%GRIFFON_HOME:~-1%"=="\" SET GRIFFON_HOME=%GRIFFON_HOME:~0,-1%

@rem classpath handling
set _SKIP=2
set CP=
if "x%~1" == "x-cp" set CP=%~2
if "x%~1" == "x-classpath" set CP=%~2
if "x%~1" == "x--classpath" set CP=%~2
if "x" == "x%CP%" goto init
set _SKIP=4
shift
shift

:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%eval[2+2]" == "4" goto 4NT_args

@rem Slurp the command line arguments.
set CMD_LINE_ARGS=

:win9xME_args_slurp
if "x%~1" == "x" goto execute

rem horrible roll your own arg processing inspired by jruby equivalent

rem escape minus (-d), quotes (-q), star (-s).
set _ARGS=%*
if not defined _ARGS goto execute
set _ARGS=%_ARGS:-=-d%
set _ARGS=%_ARGS:"=-q%
rem Windowz will try to match * with files so we escape it here
rem but it is also a meta char for env var string substitution
rem so it can't be first char here, hack just for common cases.
rem If in doubt use a space or bracket before * if using -e.
set _ARGS=%_ARGS: *= -s%
set _ARGS=%_ARGS:)*=)-s%
set _ARGS=%_ARGS:0*=0-s%
set _ARGS=%_ARGS:1*=1-s%
set _ARGS=%_ARGS:2*=2-s%
set _ARGS=%_ARGS:3*=3-s%
set _ARGS=%_ARGS:4*=4-s%
set _ARGS=%_ARGS:5*=5-s%
set _ARGS=%_ARGS:6*=6-s%
set _ARGS=%_ARGS:7*=7-s%
set _ARGS=%_ARGS:8*=8-s%
set _ARGS=%_ARGS:9*=9-s%

rem prequote all args for 'for' statement
set _ARGS="%_ARGS%"

set _ARG=
:win9xME_args_loop
rem split args by spaces into first and rest
for /f "tokens=1,*" %%i in (%_ARGS%) do call :get_arg "%%i" "%%j"
goto process_arg

:get_arg
rem remove quotes around first arg
for %%i in (%1) do set _ARG=%_ARG% %%~i
rem set the remaining args
set _ARGS=%2
rem remove the leading space we'll add the first time
if "x%_ARG:~0,1%" == "x " set _ARG=%_ARG:~1%
rem return
goto :EOF

:process_arg
if "%_ARG%" == "" goto execute

rem collect all parts of a quoted argument containing spaces
if not "%_ARG:~0,2%" == "-q" goto :argIsComplete
if "%_ARG:~-2%" == "-q" goto :argIsComplete
rem _ARG starts with a quote but does not end with one:
rem  add the next part to _ARG until the matching quote is found
goto :win9xME_args_loop

:argIsComplete
if "x4" == "x%_SKIP%" goto skip_4
if "x3" == "x%_SKIP%" goto skip_3
if "x2" == "x%_SKIP%" goto skip_2
if "x1" == "x%_SKIP%" goto skip_1

rem now unescape -q, -s, -d
set _ARG=%_ARG:-s=*%
set _ARG=%_ARG:-q="%
set _ARG=%_ARG:-d=-%

set CMD_LINE_ARGS=%CMD_LINE_ARGS% %_ARG%
set _ARG=
goto win9xME_args_loop

:skip_4
set _ARG=
set _SKIP=3
goto win9xME_args_loop

:skip_3
set _ARG=
set _SKIP=2
goto win9xME_args_loop

:skip_2
set _ARG=
set _SKIP=1
goto win9xME_args_loop

:skip_1
set _ARG=
set _SKIP=0
goto win9xME_args_loop

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=%GRIFFON_HOME%\lib\groovy-all-@groovy.version@.jar;%GRIFFON_HOME%\dist\griffon-cli-@griffon.version@.jar;%GRIFFON_HOME%\dist\griffon-rt-@griffon.version@.jar

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

@rem Setting a classpath using the -cp or -classpath option means not to use
@rem the global classpath. Groovy behaves then the same as the java
@rem interpreter
if "x" == "x%CP%" goto empty_cp
:non_empty_cp
set CP=%CP%;.
goto after_cp
:empty_cp
set CP=.
:after_cp

if "x" == "x%CLASSPATH%" goto after_classpath
set CP=%CP%;%CLASSPATH%
:after_classpath

set STARTER_MAIN_CLASS=org.codehaus.griffon.cli.support.GriffonStarter
set STARTER_CONF=%GRIFFON_HOME%\conf\groovy-starter.conf

set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar

set STACKTRACE_FILTERS="groovy., org.codehaus.groovy., java., javax., sun., gjdk.groovy., gant., org.codehaus.gant."

if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx512m"
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgriffon.home="%GRIFFON_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir="."
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.sanitized.stacktraces=%STACKTRACE_FILTERS%

if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"

@rem Execute Groovy
CALL "%JAVA_EXE%" %JAVA_OPTS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" "%CMD_LINE_ARGS%"
:end
@rem End local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" endlocal

@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause

Fix command invocation on Windows

Fix command invocation on Windows


_bin\ZD.AU.exe /sign http://zydeo.net/downloadinstaller?file=ZydeoSetup-v1.1.exe _install\ZydeoSetup-v1.1.exe _install\ZydeoUpdate-RSA.xml _install\sigs.txt

update signing - sample CMD

update signing - sample CMD


@echo off
Rmdir .\Tools\ /s /q
NuGet.exe install MSBuildTasks -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive
NuGet.exe install NUnit -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive
NuGet.exe install NUnit.Runners -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive
NuGet.exe install Wix.Toolset -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive

@echo off
Rmdir .\Tools\ /s /q
NuGet.exe install MSBuildTasks -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive
NuGet.exe install NUnit -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive
NuGet.exe install NUnit.Runners -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive
NuGet.exe install Wix.Toolset.2015 -OutputDirectory .\Tools\ -ExcludeVersion -NonInteractive

Update wix to 3.10

[wix] Update wix to 3.10


@echo off
rem *********************************************************************************
rem * dev-shell Bootstrap v1.0-beta.2                                                      *
rem *                                                                               *
rem * This command script will bootstrap the checked out git source into a complete *
rem * development system for MinGW / MSYS.                                          *
rem *                                                                               *
rem * Usage : double-click or run from the command line, runs fully automatically.  *
rem *********************************************************************************

rem note that there is limited error checking or idiot-proofing in the file at this time.

echo dev-shell bootstrap v1.0-beta.2 (c) seapagan 2015
echo.
echo Stage 1 : Download and unpack some required packages ...
rem tinyperl ...
if NOT EXIST %~dp0support\packages\tinyperl-2.0-580-win32.zip (
  %~dp0support\bootstrap\wget -q --show-progress -c --trust-server-names --directory-prefix=%~dp0support\packages http://sourceforge.net/projects/tinyperl/files/tinyperl/2.0/tinyperl-2.0-580-win32.zip/download
) ELSE (
	ECHO TinyPerl package already exists, skipping download.
)
rem md5deep ...
if NOT EXIST %~dp0support\packages\md5deep-4.4.zip (
  %~dp0support\bootstrap\wget -q --show-progress -c --directory-prefix=%~dp0support\packages https://github.com/jessek/hashdeep/releases/download/release-4.4/md5deep-4.4.zip
) ELSE (
	ECHO MD5Deep package already exists, skipping download.
)

echo.
rem erase TinyPerl directory first if exists ...
if EXIST "%~dp0support\tinyperl\" (
RD /S /Q %~dp0support\tinyperl
)
%~dp0support\bootstrap\unzip.exe -q %~dp0support\packages\tinyperl-2.0-580-win32.zip -d %~dp0support
move %~dp0support\tinyperl* %~dp0support\tinyperl > NUL
if NOT EXIST "%~dp0support\tinyperl\" (
	echo Failure to unpack the TinyPerl distribution, please report any error messages, thanks.
	pause
	exit /b 254
)

rem unpack the md5deep.exe ...
%~dp0support\bootstrap\unzip.exe -j -q -o %~dp0support\packages\md5deep-4.4.zip "md5deep-4.4\md5deep.exe" -d %~dp0support
if NOT EXIST "%~dp0support\md5deep.exe" (
	echo Failure to unpack the MD5Deep distribution, please report any error messages, thanks.
	pause
	exit /b 253
)

rem now run the perl script to continue...
cd %~dp0support\bootstrap
%~dp0support\tinyperl\tinyperl bootstrap.pl

pause

@echo off
rem *********************************************************************************
rem * dev-shell Bootstrap v1.0-beta.3                                                      *
rem *                                                                               *
rem * This command script will bootstrap the checked out git source into a complete *
rem * development system for MinGW / MSYS.                                          *
rem *                                                                               *
rem * Usage : double-click or run from the command line, runs fully automatically.  *
rem *********************************************************************************

rem note that there is limited error checking or idiot-proofing in the file at this time.

echo dev-shell bootstrap v1.0-beta.3 (c) seapagan 2015
echo.
echo Stage 1 : Download and unpack some required packages ...
rem tinyperl ...
if NOT EXIST %~dp0support\packages\tinyperl-2.0-580-win32.zip (
  %~dp0support\bootstrap\wget -q --show-progress -c --trust-server-names --directory-prefix=%~dp0support\packages http://sourceforge.net/projects/tinyperl/files/tinyperl/2.0/tinyperl-2.0-580-win32.zip/download
) ELSE (
	ECHO TinyPerl package already exists, skipping download.
)
rem md5deep ...
if NOT EXIST %~dp0support\packages\md5deep-4.4.zip (
  %~dp0support\bootstrap\wget -q --show-progress -c --directory-prefix=%~dp0support\packages https://github.com/jessek/hashdeep/releases/download/release-4.4/md5deep-4.4.zip
) ELSE (
	ECHO MD5Deep package already exists, skipping download.
)

echo.
rem erase TinyPerl directory first if exists ...
if EXIST "%~dp0support\tinyperl\" (
RD /S /Q %~dp0support\tinyperl
)
%~dp0support\bootstrap\unzip.exe -q %~dp0support\packages\tinyperl-2.0-580-win32.zip -d %~dp0support
move %~dp0support\tinyperl* %~dp0support\tinyperl > NUL
if NOT EXIST "%~dp0support\tinyperl\" (
	echo Failure to unpack the TinyPerl distribution, please report any error messages, thanks.
	pause
	exit /b 254
)

rem unpack the md5deep.exe ...
%~dp0support\bootstrap\unzip.exe -j -q -o %~dp0support\packages\md5deep-4.4.zip "md5deep-4.4\md5deep.exe" -d %~dp0support
if NOT EXIST "%~dp0support\md5deep.exe" (
	echo Failure to unpack the MD5Deep distribution, please report any error messages, thanks.
	pause
	exit /b 253
)

rem now run the perl script to continue...
cd %~dp0support\bootstrap
%~dp0support\tinyperl\tinyperl bootstrap.pl

pause

update version number

update version number


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.5 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.5 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.5
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.28.0 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.28.0 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.28.0
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.6 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.6 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.6
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Update BuildLib 0.3.6

Update BuildLib 0.3.6


mkdir build && cd build
cmake ^
	-G "%CMAKE_GENERATOR%"                   ^
	-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%  ^
	-DCMAKE_INSTALL_BINDIR=%LIBRARY_BIN%     ^
	-DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB%     ^
	-DCMAKE_INSTALL_INCLUDEDIR=%LIBRARY_INC% ^
	..

cmake --build . --target install

mkdir build && cd build
cmake ^
	-G "%CMAKE_GENERATOR%"                   ^
	-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX%  ^
	-DBIN_INSTALL_DIR=%LIBRARY_BIN%     ^
	-DLIB_INSTALL_DIR=%LIBRARY_LIB%     ^
	-DINCLUDE_INSTALL_DIR=%LIBRARY_INC% ^
	..

cmake --build . --target install

fix cmake for Windows

fix cmake for Windows


@echo off
py -3.4 -m py2exe.build_exe src/gamedevbot.py
pause

@echo off
py -3.4 -m py2exe.build_exe -p twitter src/gamedevbot.py
pause

add python-twitter module

add python-twitter module


set EnableNuGetPackageRestore=true
call .\packages\psake.4.2.0.1\tools\psake.cmd build.ps1 %*

pause

Build script and nuget now automatically grabs missing dependencies


REM optional clean
REM rm -rf artifacts CoreTests/bin CoreTests/obj CoreIntegrationTests/bin CoreIntegrationTests/obj Microsoft.AspNetCore.Identity.MongoDB/bin Microsoft.AspNetCore.Identity.MongoDB/obj

dotnet restore src
dotnet test -c Release src/CoreTests
dotnet test -c Release src/CoreIntegrationTests
dotnet pack -c Release -o artifacts src/Microsoft.AspNetCore.Identity.MongoDB

REM nuget add artifacts\X.nupkg -Source C:\Code\scratch\localnugetfeedtesting
REM nuget publish artifacts\X.nupkg

REM optional clean
REM rm -rf artifacts CoreTests/bin CoreTests/obj CoreIntegrationTests/bin CoreIntegrationTests/obj Microsoft.AspNetCore.Identity.MongoDB/bin Microsoft.AspNetCore.Identity.DocumentDB/obj

dotnet restore src
dotnet test -c Release src/CoreTests
dotnet test -c Release src/CoreIntegrationTests
dotnet pack -c Release -o artifacts src/Microsoft.AspNetCore.Identity.DocumentDB

REM nuget add artifacts\X.nupkg -Source C:\Code\scratch\localnugetfeedtesting
REM nuget publish artifacts\X.nupkg

update build script

update build script


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.3 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.4 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.4
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Update BuildLib 0.3.4

Update BuildLib 0.3.4