@ECHO OFF
CLS

REM All praise BAT files
REM
REM Kalabox Uninstaller Script.
REM
REM Copyright (C) 2014 Kalamuna LLC
REM
REM This file also contains a modified VirtualBox uninstallers.
REM
REM

ECHO.
ECHO Welcome to the Kalabox uninstaller script.
ECHO.
ECHO This script will destroy your current Kalabox build. If you want
ECHO to save your current build for later please either vagrant package
ECHO your existing build or export the relevant VirtualBox appliance.
ECHO.
ECHO MAKE SURE THAT YOU'VE EXITED THE KALABOX APP OR THIS WILL BLOW UP!!!
ECHO.
ECHO ALSO MAKE SURE YOU VISIT 127.0.0.1:60008 AND SHUTDOWN SYNCTHING
ECHO.
ECHO WHAT YOU WANT TO DO?
ECHO.
ECHO 1. Remove all the things.
ECHO 2. Forget this ever happened.
ECHO.
SET /p id=Choose your destiny:

IF %id% == 1 (
  ECHO Stopping and removing Kalabox2
  boot2docker --vm="Kalabox2" destroy
  ECHO DESTROYED!
  ECHO.
  IF EXIST "%HOMEPATH%\.kalabox" (
    ECHO Removing Kalabox directories
    RMDIR %HOMEPATH%\.kalabox /S /Q
    ECHO REMOVED!
    ECHO.
  )
  IF EXIST "C:\Program Files (x86)\Git\unins000.exe" (
    "C:\Program Files (x86)\Git\unins000.exe" /SILENT /SUPRESSMSGBOXES /NORESTART
    ECHO UNINSTALLED MYSYS GIT!
    ECHO.
  )
  IF EXIST "C:\Program Files\Boot2Docker for Windows\unins000.exe" (
    "C:\Program Files\Boot2Docker for Windows\unins000.exe" /SILENT /SUPRESSMSGBOXES /NORESTART
    ECHO UNINSTALLED MYSYS GIT!
    ECHO.
  )
  ECHO "YOU WILL NEED TO UNINSTALL VIRTUALBOX MANUALLY TO COMPLETE THE UNINSTALL"
)

IF %id% == 2 (
  ECHO SO BE IT.... JEDI
)

PAUSE

@ECHO OFF
CLS

REM All praise BAT files
REM
REM Kalabox Uninstaller Script.
REM
REM Copyright (C) 2014 Kalamuna LLC
REM
REM This file also contains a modified VirtualBox uninstallers.
REM
REM

ECHO.
ECHO Welcome to the Kalabox uninstaller script.
ECHO.
ECHO This script will destroy your current Kalabox build. If you want
ECHO to save your current build for later please either vagrant package
ECHO your existing build or export the relevant VirtualBox appliance.
ECHO.
ECHO MAKE SURE THAT YOU'VE EXITED THE KALABOX APP OR THIS WILL BLOW UP!!!
ECHO.
ECHO ALSO MAKE SURE YOU VISIT 127.0.0.1:60008 AND SHUTDOWN SYNCTHING
ECHO.
ECHO WHAT YOU WANT TO DO?
ECHO.
ECHO 1. Remove all the things.
ECHO 2. Forget this ever happened.
ECHO.
SET /p id=Choose your destiny:

IF %id% == 1 (
  ECHO Stopping and removing Kalabox2
  boot2docker --vm="Kalabox2" destroy
  ECHO DESTROYED!
  ECHO.
  IF EXIST "%HOMEPATH%\.kalabox" (
    ECHO Removing Kalabox directories
    RMDIR %HOMEPATH%\.kalabox /S /Q
    RMDIR "%HOMEPATH%\VirtualBox VMs\Kalabox2" /S /Q
    ECHO REMOVED!
    ECHO.
  )
  IF EXIST "C:\Program Files (x86)\Git\unins000.exe" (
    "C:\Program Files (x86)\Git\unins000.exe" /SILENT /SUPRESSMSGBOXES /NORESTART
    ECHO UNINSTALLED MYSYS GIT!
    ECHO.
  )
  IF EXIST "C:\Program Files\Boot2Docker for Windows\unins000.exe" (
    "C:\Program Files\Boot2Docker for Windows\unins000.exe" /SILENT /SUPRESSMSGBOXES /NORESTART
    ECHO UNINSTALLED MYSYS GIT!
    ECHO.
  )
  ECHO "YOU WILL NEED TO UNINSTALL VIRTUALBOX MANUALLY TO COMPLETE THE UNINSTALL"
)

IF %id% == 2 (
  ECHO SO BE IT.... JEDI
)

PAUSE

Update uninstall for Doze

Update uninstall for Doze


mkdir build
cd build

cmake ^
    -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DBUILD_TESTING=ON ^
    %SRC_DIR%
if errorlevel 1 exit 1

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

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

:: Test.
ctest --output-on-failure -C Release
if errorlevel 1 exit 1

Create bld.bat

Create bld.bat


@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

REM This Windows batch file mounts a virtual hard drive, creates a file in it, removes the file, and then unmounts the hard drive.
REM
REM Setup:
REM   1.  Open _Disk Management_ through the Start menu
REM   2.  Navigate to _Action_ and select _Create VHD_
REM   3.  Select the location for the virtual hard drive file and set the size to 10MB or greater
REM   4.  Right click the new disk, select _Initialize Disk_, and click _OK_
REM   5.  Right-click on the unallocated space in the new disk and select _New Simple Volume_
REM   6.  Follow the wizard; in the screen _Assign Drive Letter or Path_, choose not to assign them
REM   7.  Open a new command line window and type MOUNTVOL
REM   8.  From the output, copy the volume name of your newly created hard drive (e.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}) into the configuration variable VOLUME below
REM   9.  Assign the volume an unused drive letter in the configuration variable DRIVE below
REM   10. Execute this script

ECHO [Script executed at %DATE%-%TIME%]

REM Volume: Configuration variable
REM Volume: Unique identifier for the volume; open command prompt and type MOUNTVOL to find the volume name
REM Volume: E.g. \\?\Volume{2f823551-0df2-11e6-96ba-806e6f6e6963}\
SET VOLUME=

REM Drive: Configuration variable
REM Drive: Letter to denote the mount point
REM Drive: E.g. D
SET DRIVE=

REM Flesh out configuration variables
SET DRIVE=%DRIVE%:

REM Check for empty drive
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Drive %DRIVE% is already in use.
  EXIT /B %RETVAL%
)

REM Mount and check volume
MOUNTVOL %DRIVE% %VOLUME%
CALL :CheckMounted %DRIVE% RETVAl
IF %RETVAL% neq 0 (
  ECHO Error: Failed to mount volume on drive %DRIVE%. Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

REM Add and remove file
ECHO This file can be deleted.> %DRIVE%\tmp.txt
DEL %DRIVE%\tmp.txt

REM Unmount volume and check empty drive
MOUNTVOL %DRIVE% /P
CALL :CheckUnmounted %DRIVE% RETVAL
IF %RETVAL% neq 0 (
  ECHO Error: Failed to unmount volume from drive %DRIVE% . Errorlevel %RETVAL%.
  EXIT /B %RETVAL%
)

ECHO [Script finished at %DATE%-%TIME%]
EXIT /B 0

REM This function checks that a certain drive is mounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2. Return value
REM     Equals 0 if the drive is mounted
REM     Equals Non-zero in any other case
:CheckMounted
SET DRIVE=%~1
MOUNTVOL %DRIVE% /L > NUL 2>&1
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

REM This function checks that a certain drive is unmounted.
REM
REM Parameters:
REM   1: Drive letter with trailing colon (e.g. C:)
REM   2. Return value
REM     Equals 0 if the drive is not mounted
REM     Equals 1 in any other case
:CheckUnmounted
SET DRIVE=%~1
SET EXITCODE=1
MOUNTVOL %DRIVE% /L > NUL 2>&1
IF %ERRORLEVEL% EQU 1 (  REM Must be immediately after MOUNTVOL
  SET EXITCODE=0
)
SET %~2=%EXITCODE%
EXIT /B %EXITCODE%

Add RemountDrive batch file

[Misc] Add RemountDrive batch file


@echo off
rem -*- Mode: bat -*-
rem setenv.bat --- set environment variables
rem Copyright (C) 2019  Dan Harms (Dan.Harms)
rem Author: Dan Harms <dan.harms@xrtrading.com>
rem Created: Thursday, December  5, 2019
rem Version: 1.0
rem Modified Time-stamp: <2019-12-06 11:32:09 Dan.Harms>
rem Modified by: Dan.Harms
rem Keywords:

rem user variables

echo "Setting environment variables..."

setx NAME Dan.Harms
setx EMACS_ROOT "C:\Program Files\emacs-26.3"
setx EMACS_BIN "%EMACS_ROOT%\bin"
setx EDITOR "%EMACS_BIN%\runemacs.exe"
setx MSYS_DIR "C:\Program Files (x86)\GnuWin32\bin"
setx GIT_DIR "C:\Program Files\Git"
setx FIND_EXE "%GIT_DIR%\usr\bin\find"
setx GREP_EXE "%GIT_DIR%\usr\bin\grep"
setx TAR_EXE "%GIT_DIR%\usr\bin\tar"
setx PUTTY_DIR "%ChocolateyInstall%\bin"

echo "...done."

rem code ends here

@echo off
rem -*- Mode: bat -*-
rem setenv.bat --- set environment variables
rem Copyright (C) 2019  Dan Harms (Dan.Harms)
rem Author: Dan Harms <dan.harms@xrtrading.com>
rem Created: Thursday, December  5, 2019
rem Version: 1.0
rem Modified Time-stamp: <2019-12-06 16:16:48 Dan.Harms>
rem Modified by: Dan.Harms
rem Keywords:

rem user variables

echo "Setting environment variables..."

setx NAME Dan.Harms
setx EMACS_ROOT "C:\Program Files\emacs-26.3"
setx EMACS_BIN "%EMACS_ROOT%\bin"
setx EDITOR "%EMACS_BIN%\runemacs.exe"
setx MSYS_DIR "C:\Program Files (x86)\GnuWin32\bin"
setx GIT_DIR "C:\Program Files\Git"
setx FIND_EXE "%GIT_DIR%\usr\bin\find"
setx GREP_EXE "%GIT_DIR%\usr\bin\grep"
setx HOSTNAME_EXE "%MSYS_DIR%\hostname"
setx TAR_EXE "%GIT_DIR%\usr\bin\tar"
setx PUTTY_DIR "%ChocolateyInstall%\bin"

echo "...done."

rem code ends here

update windows install due to hostname (part 2)


echo on
SetLocal EnableDelayedExpansion

REM This is the recommended way to choose the toolchain version, according to
REM Appveyor's documentation.
SET PATH=C:\Program Files (x86)\MSBuild\%TOOLCHAIN_VERSION%\Bin;%PATH%

set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%\VC\vcvarsall.bat"
set MSVCYEAR=vs2015
set MSVCVERSION=v140

if [%Platform%] NEQ [x64] goto win32
set TARGET_ARCH=x86_64
set TARGET_PROGRAM_FILES=%ProgramFiles%
rem call %VCVARSALL% amd64
rem if %ERRORLEVEL% NEQ 0 exit 1
goto download

:win32
echo on
if [%Platform%] NEQ [Win32] exit 1
set TARGET_ARCH=i686
set TARGET_PROGRAM_FILES=%ProgramFiles(x86)%
rem call %VCVARSALL% amd64_x86
rem if %ERRORLEVEL% NEQ 0 exit 1
goto download

:download
REM vcvarsall turns echo off
echo on

cd %ORIGINAL_PATH%

git clone https://github.com/Microsoft/vcpkg packages
cd packages
powershell -exec bypass scripts\bootstrap.ps1
vcpkg install zlib
vcpkg integrate install

cd %ORIGINAL_PATH%

set RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi
echo Downloading %RUST_URL%...
mkdir build
powershell -Command "(New-Object Net.WebClient).DownloadFile('%RUST_URL%', 'build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi')"
if %ERRORLEVEL% NEQ 0 (
  echo ...downloading Rust failed.
  exit 1
)

start /wait msiexec /i build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi INSTALLDIR="%TARGET_PROGRAM_FILES%\Rust %RUST%" /quiet /qn /norestart
if %ERRORLEVEL% NEQ 0 exit 1

set PATH="%TARGET_PROGRAM_FILES%\Rust %RUST%\bin";%PATH%

if [%Configuration%] == [Release] set CARGO_MODE=--release

link /?
cl /?
rustc --version
cargo --version

set RUST_BACKTRACE=1

cargo build -vv %CARGO_MODE%
if %ERRORLEVEL% NEQ 0 exit 1

cargo test -vv %CARGO_MODE%
if %ERRORLEVEL% NEQ 0 exit 1

echo on
SetLocal EnableDelayedExpansion

REM This is the recommended way to choose the toolchain version, according to
REM Appveyor's documentation.
SET PATH=C:\Program Files (x86)\MSBuild\%TOOLCHAIN_VERSION%\Bin;%PATH%

set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%\VC\vcvarsall.bat"
set MSVCYEAR=vs2015
set MSVCVERSION=v140

if [%Platform%] NEQ [x64] goto win32
set TARGET_ARCH=x86_64
set TARGET_PROGRAM_FILES=%ProgramFiles%
rem call %VCVARSALL% amd64
rem if %ERRORLEVEL% NEQ 0 exit 1
goto download

:win32
echo on
if [%Platform%] NEQ [Win32] exit 1
set TARGET_ARCH=i686
set TARGET_PROGRAM_FILES=%ProgramFiles(x86)%
rem call %VCVARSALL% amd64_x86
rem if %ERRORLEVEL% NEQ 0 exit 1
goto download

:download
REM vcvarsall turns echo off
echo on

cd %ORIGINAL_PATH%

git clone https://github.com/Microsoft/vcpkg packages
cd packages
powershell -exec bypass scripts\bootstrap.ps1
vcpkg install zlib
vcpkg integrate install

cd %ORIGINAL_PATH%

set RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi
echo Downloading %RUST_URL%...
mkdir build
powershell -Command "(New-Object Net.WebClient).DownloadFile('%RUST_URL%', 'build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi')"
if %ERRORLEVEL% NEQ 0 (
  echo ...downloading Rust failed.
  exit 1
)

start /wait msiexec /i build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi INSTALLDIR="%TARGET_PROGRAM_FILES%\Rust %RUST%" /quiet /qn /norestart
if %ERRORLEVEL% NEQ 0 exit 1

set PATH="%TARGET_PROGRAM_FILES%\Rust %RUST%\bin";%PATH%

if [%Configuration%] == [Release] set CARGO_MODE=--release

link /?
cl /?
rustc --version
cargo --version

set RUST_BACKTRACE=1

REM cargo build -vv %CARGO_MODE%
REM if %ERRORLEVEL% NEQ 0 exit 1

REM cargo test -vv %CARGO_MODE%
REM if %ERRORLEVEL% NEQ 0 exit 1

remove cargo calls

remove cargo calls


@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

:retry
set /a counter+=1
echo Attempt %counter% out of %attempts%

cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/f3c79f08ae9bcd38ec49255641928ec480de8874
IF %ERRORLEVEL% NEQ 0 goto error

goto end

:error
if %counter% GEQ %attempts% goto :lastError
goto retry

:lastError
popd
echo An error has occured during npm install.
exit /b 1

:end
popd
echo Finished successfully.
exit /b 0

@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

:retry
set /a counter+=1
echo Attempt %counter% out of %attempts%

cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/f5cb76e89e9b71b09b22a7c9f974506e8256b90f
IF %ERRORLEVEL% NEQ 0 goto error

goto end

:error
if %counter% GEQ %attempts% goto :lastError
goto retry

:lastError
popd
echo An error has occured during npm install.
exit /b 1

:end
popd
echo Finished successfully.
exit /b 0

Update Kuduscript version

Update Kuduscript version


setlocal
cd %~dp0
set path=%path;%C:\Users\marco\OneDrive\Documents\PROJECTS\ThirdParties\vtk_installRelease\bin
call "C:\Users\marco\OneDrive\Documents\PROJECTS\polytriagnulation\out\Unittests\Release\unittests.exe"
pause

Test run via bat file.

Test run via bat file.


@echo off
cls
SET SRCDIR=./src/
dotnet test %SRCDIR%OwinRequestScopeContext.Tests/OwinRequestScopeContext.Tests.csproj --verbosity detailed
pause

@echo off
cls
SET SRCDIR=./src/
dotnet test %SRCDIR%OwinRequestScopeContext.Tests/OwinRequestScopeContext.Tests.csproj --framework net461
dotnet test %SRCDIR%OwinRequestScopeContext.Tests/OwinRequestScopeContext.Tests.csproj --framework netcoreapp2.2
pause

Make test.cmd run tests for all supported target frameworks, and bring verbosity down.


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.3
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 4. webpack
IF EXIST "%DEPLOYMENT_TARGET%\webpack.config.js" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! run webpack
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.3
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 4. Build static files
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! run deploy:prod
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Update deployment command

Update deployment command


@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

:retry
set /a counter+=1
echo Attempt %counter% out of %attempts%

cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/f1f26085d54438c5a3eb951baba56fc0db8f90eb
IF %ERRORLEVEL% NEQ 0 goto error

goto end

:error
if %counter% GEQ %attempts% goto :lastError
goto retry

:lastError
popd
echo An error has occured during npm install.
exit /b 1

:end
popd
echo Finished successfully.
exit /b 0

@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

:retry
set /a counter+=1
echo Attempt %counter% out of %attempts%

cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/93edfcb6e9c75d395e805825f5051e707bd50bb8
IF %ERRORLEVEL% NEQ 0 goto error

goto end

:error
if %counter% GEQ %attempts% goto :lastError
goto retry

:lastError
popd
echo An error has occured during npm install.
exit /b 1

:end
popd
echo Finished successfully.
exit /b 0

Update to use KuduScript 1.0.4

Update to use KuduScript 1.0.4


REM Add other things if could be automated, RUN THIS AS ADMIN
@echo off
echo Check for Admn
net sessions
if %errorlevel%==0 (
echo Success
) else (
echo No admin
pause
exit
)
REM Windows Defender scan
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
REM Listing possible penetrations
cd C:\
echo Staring to output active processes to dir C:\!
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts

Update Main.bat

Update Main.bat


@echo off
M:\f03_assets\include\Python27\python.exe -m pyblish_qml

revert changes to qml.bat

revert changes to qml.bat


call "c:\Program Files (x86)\nodejs\nodevars.bat"
call npm.cmd install -g grunt-cli

set APPBUILDER_SKIP_POSTINSTALL_TASKS=1
call npm.cmd install
set APPBUILDER_SKIP_POSTINSTALL_TASKS=

call grunt.cmd pack --no-color

call npm.cmd cache rm appbuilder
rem dedupe command flattens node_modules folder and fixes problems coming from paths being too long
call npm.cmd dedupe

call "c:\Program Files (x86)\nodejs\nodevars.bat"
call npm.cmd install -g grunt-cli

set APPBUILDER_SKIP_POSTINSTALL_TASKS=1
call npm.cmd install
set APPBUILDER_SKIP_POSTINSTALL_TASKS=

call grunt.cmd pack --no-color

call npm.cmd cache rm appbuilder
cmd /C "rmdir /S /Q node_modules"

fix build

fix build


@echo off

goto entry

:usage
  echo usage: bolt init  [-c^|--config CONFIG_DIR]
  echo.
  echo options:
  echo   -c^|--config CONFIG_DIR          override bolt configuration directory
  echo                                    default: config/bolt
  echo.
  echo example:
  echo   Initialise a project after checkout.
  echo.
  echo     bolt init

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:entry

if "%help_mode%"=="true" call :usage && exit /b 0

:parse_flags
  set flag=%~1
  if not "%flag:~0,1%"=="-" goto done_parse_flags
  shift

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

  :parse_config
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set config_dir=%~1
    shift
  goto parse_flags

:done_parse_flags

if "%config_dir%"=="" set config_dir=config\bolt

for %%i in ("%config_dir%") do if not exist %%~si\NUL mkdir %config_dir%

rem FIX discuss the merits of cherry picking these two vs generating all.

if exist "%config_dir%\prod.js" call %base%jsc.bat dev -c "%config_dir%\prod.js" "%config_dir%\bootstrap-prod.js" && exit /b %errorlevel%
if exist "%config_dir%\demo.js" call %base%jsc.bat dev -c "%config_dir%\demo.js" "%config_dir%\bootstrap-demo.js" && exit /b %errorlevel%

exit /b 0

@echo off

goto entry

:usage
  echo usage: bolt init  [-c^|--config CONFIG_DIR]
  echo.
  echo options:
  echo   -c^|--config CONFIG_DIR          override bolt configuration directory
  echo                                    default: config/bolt
  echo.
  echo example:
  echo   Initialise a project after checkout.
  echo.
  echo     bolt init

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:is_dir
  setlocal
  set olddir=%CD%
  cd "%~1" 2>NUL
  set err=%errorlevel%
  cd "%olddir%"
  exit /b %err%

:entry

if "%help_mode%"=="true" call :usage && exit /b 0

:parse_flags
  set flag=%~1
  if not "%flag:~0,1%"=="-" goto done_parse_flags
  shift

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

  :parse_config
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set config_dir=%~1
    shift
  goto parse_flags

:done_parse_flags

if "%config_dir%"=="" set config_dir=config\bolt

call :is_dir "%config_dir%"
if %errorlevel%==1 mkdir "%config_dir%"

rem FIX discuss the merits of cherry picking these two vs generating all.

if exist "%config_dir%\prod.js" call %base%jsc.bat dev -c "%config_dir%\prod.js" "%config_dir%\bootstrap-prod.js" && exit /b %errorlevel%
if exist "%config_dir%\demo.js" call %base%jsc.bat dev -c "%config_dir%\demo.js" "%config_dir%\bootstrap-demo.js" && exit /b %errorlevel%

exit /b 0

Change bolt init to use a better method of checking if a specified path is a directory


@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

REM ***** JAVA options *****

set JAVA_OPTS=^
 -Xms256m^
 -Xmx1G^
 -Djline.enabled=false^
 -XX:+AggressiveOpts^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:+HeapDumpOnOutOfMemoryError

set ES_CLASSPATH=$CLASSPATH;"%ES_HOME%/lib/elasticsearch-@ES_VERSION@.jar";"%ES_HOME%/lib/*";"%ES_HOME%/lib/sigar/*"
set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%"

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Bootstrap"
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

REM ***** JAVA options *****

set JAVA_OPTS=^
 -Xms256m^
 -Xmx1G^
 -Djline.enabled=false^
 -XX:+AggressiveOpts^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:+HeapDumpOnOutOfMemoryError

set ES_CLASSPATH=$CLASSPATH;%ES_HOME%/lib/elasticsearch-@ES_VERSION@.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%"

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Bootstrap"
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

fix windows script to not double quote

fix windows script to not double quote


@echo off
set RUNDIR=%~p0
set CLASSPATH=%CLASSPATH%";"%RUNDIR%..\*";"%RUNDIR%..\lib\*
set TNT4JOPTS=-Dtnt4j.config="%RUNDIR%..\config\tnt4j.properties"
set LOG4JOPTS=-Dlog4j.configuration="file:%RUNDIR%..\config\log4j.properties"
REM set LOGBACKOPTS=-Dlogback.configurationFile="file:%RUNDIR%..\config\logback.xml"
set STREAMSOPTS=%STREAMSOPTS% %LOG4JOPTS% %TNT4JOPTS%

if "%MAINCLASS%" == "" goto set_default
goto run_stream

:set_default_main
set MAINCLASS=com.jkoolcloud.tnt4j.streams.StreamsAgent

:run_stream
java %STREAMSOPTS% -classpath %CLASSPATH% %MAINCLASS% %*

@echo off
set RUNDIR=%~p0
set CLASSPATH=%CLASSPATH%";"%RUNDIR%..\*";"%RUNDIR%..\lib\*
set TNT4JOPTS=-Dtnt4j.config="%RUNDIR%..\config\tnt4j.properties"
set LOG4JOPTS=-Dlog4j.configuration="file:%RUNDIR%..\config\log4j.properties"
REM set LOGBACKOPTS=-Dlogback.configurationFile="file:%RUNDIR%..\config\logback.xml"
set STREAMSOPTS=%STREAMSOPTS% %LOG4JOPTS% %TNT4JOPTS%

if "%MAINCLASS%" == "" goto set_default_main
goto run_stream

:set_default_main
set MAINCLASS=com.jkoolcloud.tnt4j.streams.StreamsAgent

:run_stream
java %STREAMSOPTS% -classpath %CLASSPATH% %MAINCLASS% %*

revert pull request #13

revert pull request #13


remove useless codes from cmd.env.bat

remove useless codes from cmd.env.bat


@echo off

set CURDIR=%CD%

cd /d %~dp0

set MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"

set TARGET=Build
set CONFIG=%1
set PLATFORM=%2

if not defined CONFIG (
    set CONFIG=Debug
)

if not defined PLATFORM (
    set PLATFORM=x64
)

rem glfw =============================

set BUILD_DIR=glfw\%PLATFORM%
set ROOT=..\..

if not exist %BUILD_DIR% (
    mkdir %BUILD_DIR%
)

if not exist %BUILD_DIR%\GLFW.sln (
    cd %BUILD_DIR%
    if %PLATFORM% == Win32 (
        %ROOT%\cmake\bin\cmake.exe -G "Visual Studio 14 2015" ..\
    ) else (
        %ROOT%\cmake\bin\cmake.exe -G "Visual Studio 14 2015 Win64" ..\
    )
    cd %ROOT%
)

%MSBUILD% %BUILD_DIR%\GLFW.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem glew =============================

set BUILD_DIR=glew\build\vc14

%MSBUILD% %BUILD_DIR%\glew.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem makeitso =========================

set BUILD_DIR=makeitso

%MSBUILD% %BUILD_DIR%\MakeItSoLib\MakeItSoLib.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error
%MSBUILD% %BUILD_DIR%\SolutionParser_VS2015\SolutionParser_VS2015.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error
%MSBUILD% %BUILD_DIR%\MakeItSo\MakeItSo.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error

rem end ==============================

rem Copy files for Profile configuration ==============================
if %CONFIG% == Release (
   cd /d %~dp0
   xcopy /Y /D glfw\%PLATFORM%\src\Release glfw\%PLATFORM%\src\Profile\
   xcopy /Y /D glew\lib\Release\%PLATFORM% glew\lib\Profile\%PLATFORM%\
)

cd /d %CURDIR%

exit /b 0

:error
cd /d %CURDIR%
echo "Error====="
pause
exit /b 1

@echo off

set CURDIR=%CD%

set BASEDIR=%~dp0

cd /d %BASEDIR%

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsMSBuildCmd.bat"

set TARGET=Build
set CONFIG=%1

if not defined CONFIG (
    set CONFIG=Debug
)

set PLATFORM=x64

set VS="Visual Studio 16 2019"

rem glfw =============================

set BUILD_DIR=glfw\x64

if not exist %BUILD_DIR% (
    mkdir %BUILD_DIR%
)

if not exist %BUILD_DIR%\GLFW.sln (
    cd %BUILD_DIR%
    cmake -G %VS% ..\
    cd %BASEDIR%
)

MSBuild %BUILD_DIR%\GLFW.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error

rem glew =============================

set BUILD_DIR=glew\build\vc16

if not exist %BUILD_DIR% (
    mkdir %BUILD_DIR%
)

if not exist %BUILD_DIR%\glew.sln (
    cd %BUILD_DIR%
    cmake -G %VS% ..\cmake
    cd %BASEDIR%
)

MSBuild %BUILD_DIR%\glew.sln /t:%TARGET% /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% || goto error
xcopy /Y /D %BUILD_DIR%\lib\%CONFIG% glew\lib\%CONFIG%\%PLATFORM%\
xcopy /Y /D %BUILD_DIR%\bin\%CONFIG% glew\bin\%CONFIG%\%PLATFORM%\

rem makeitso =========================

rem set BUILD_DIR=makeitso

rem %MSBUILD% %BUILD_DIR%\MakeItSoLib\MakeItSoLib.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error
rem %MSBUILD% %BUILD_DIR%\SolutionParser_VS2015\SolutionParser_VS2015.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error
rem %MSBUILD% %BUILD_DIR%\MakeItSo\MakeItSo.csproj /t:%TARGET% /p:Configuration=Release /p:Platform=x86 || goto error

rem end ==============================

rem Copy files for Profile configuration ==============================
if %CONFIG% == Release (
   cd /d %BASEDIR%
   xcopy /Y /D /E glfw\%PLATFORM%\src\Release glfw\%PLATFORM%\src\Profile\
   xcopy /Y /D /E glew\lib\Release\%PLATFORM% glew\lib\Profile\%PLATFORM%\
   xcopy /Y /D /E glew\bin\Release\%PLATFORM% glew\bin\Profile\%PLATFORM%\
)

cd /d %CURDIR%

exit /b 0

:error
cd /d %CURDIR%
echo "Error====="
pause
exit /b 1

Apply for vs2019

Apply for vs2019


@echo off

REM !/bin/bash
REM
REM Copyright 2019 Google LLC
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM Builds and packs firebase unity meant to be used on a Windows environment.

SETLOCAL

SET status=0
SET CPP_DIR=

SET PATH=%PROTOBUF_SRC_ROOT_FOLDER%\vsprojects\x64\Release;%PATH%

set UNITY_ROOT_DIR=%UNITY_ROOT_DIR:\=/%
set PROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER:\=/%

IF EXIST ..\firebase-cpp-sdk (
  SET CPP_DIR=-DFIREBASE_CPP_SDK_DIR^=../../firebase-cpp-sdk
)

IF EXIST "C:\Program Files\Mono\bin" (
  SET MONO_DIR="C:/Program Files/Mono/bin"
) ELSE (
  ECHO ERROR: Cant find mono in program files
  EXIT /B -1
)

IF EXIST "C:\Program Files\OpenSSL-Win64" (
  SET OPENSSL_x64="C:/Program Files/OpenSSL-Win64"
) ELSE (
  ECHO ERROR: Cant find open ssl x64
  EXIT /B -1
)

CALL :BUILD unity, "-DFIREBASE_INCLUDE_UNITY=ON"
if %errorlevel% neq 0 (SET status=%errorlevel%)

:: TODO: Fix mono build to not need unity deps
:: CALL :BUILD mono, "-DFIREBASE_INCLUDE_MONO=ON"
:: if %errorlevel% neq 0 (SET status=%errorlevel%)

CALL :BUILD unity_separate, "-DFIREBASE_INCLUDE_UNITY=ON -DFIREBASE_UNI_LIBRARY=OFF"
if %errorlevel% neq 0 (SET status=%errorlevel%)

:: TODO: Fix mono build to not need unity deps
:: CALL :BUILD mono_separate, "-DFIREBASE_INCLUDE_MONO=ON -DFIREBASE_UNI_LIBRARY=OFF"
:: if %errorlevel% neq 0 (SET status=%errorlevel%)

EXIT /B %status%

:BUILD
  ECHO #################################################################
  DATE /T
  TIME /T
  ECHO Building config '%~1' with option '%~2'.
  ECHO #################################################################

  @echo on

  mkdir windows_%~1
  pushd windows_%~1

  SET CMAKE_ARGS=-DPROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER%
  SET CMAKE_ARGS=%CMAKE_ARGS% %CPP_DIR% -DMONO_DIR=%MONO_DIR%
  SET CMAKE_ARGS=%CMAKE_ARGS% -DUNITY_ROOT_DIR=%UNITY_ROOT_DIR%
  SET CMAKE_ARGS=%CMAKE_ARGS% -DOPENSSL_ROOT_DIR=%OPENSSL_x64%
  SET CMAKE_ARGS=%CMAKE_ARGS% -DFIREBASE_UNITY_BUILD_TESTS=ON
  SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo

  cmake .. -A x64 %CMAKE_ARGS% %~2

  :: Check for errors, and return if there were any
  if %errorlevel% neq 0 (
    popd
    @echo off
    exit /b %errorlevel%
  )

  cmake --build . --config RelWithDebInfo

  :: Again, check for errors, and return if there were any
  if %errorlevel% neq 0 (
    popd
    @echo off
    exit /b %errorlevel%
  )

  cpack .

  popd
  @echo off
EXIT /B %errorlevel%

@echo off

REM !/bin/bash
REM
REM Copyright 2019 Google LLC
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM Builds and packs firebase unity meant to be used on a Windows environment.

SETLOCAL

SET status=0
SET CPP_DIR=

SET PATH=%PROTOBUF_SRC_ROOT_FOLDER%\vsprojects\x64\Release;%PATH%

set UNITY_ROOT_DIR=%UNITY_ROOT_DIR:\=/%
set PROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER:\=/%

IF EXIST ..\firebase-cpp-sdk (
  SET CPP_DIR=-DFIREBASE_CPP_SDK_DIR^=../../firebase-cpp-sdk
)

IF EXIST "C:\Program Files\Mono\bin" (
  SET MONO_DIR="C:/Program Files/Mono/bin"
) ELSE (
  ECHO ERROR: Cant find mono in program files
  EXIT /B -1
)

IF EXIST "C:\Program Files\OpenSSL-Win64" (
  SET OPENSSL_x64="C:/Program Files/OpenSSL-Win64"
) ELSE (
  ECHO ERROR: Cant find open ssl x64
  EXIT /B -1
)

CALL :BUILD unity, "-DFIREBASE_INCLUDE_UNITY=ON"
if %errorlevel% neq 0 (SET status=%errorlevel%)

:: TODO: Fix mono build to not need unity deps
:: CALL :BUILD mono, "-DFIREBASE_INCLUDE_MONO=ON"
:: if %errorlevel% neq 0 (SET status=%errorlevel%)

CALL :BUILD unity_separate, "-DFIREBASE_INCLUDE_UNITY=ON -DFIREBASE_UNI_LIBRARY=OFF"
if %errorlevel% neq 0 (SET status=%errorlevel%)

:: TODO: Fix mono build to not need unity deps
:: CALL :BUILD mono_separate, "-DFIREBASE_INCLUDE_MONO=ON -DFIREBASE_UNI_LIBRARY=OFF"
:: if %errorlevel% neq 0 (SET status=%errorlevel%)

EXIT /B %status%

:BUILD
  ECHO #################################################################
  DATE /T
  TIME /T
  ECHO Building config '%~1' with option '%~2'.
  ECHO #################################################################

  @echo on

  mkdir windows_%~1
  pushd windows_%~1

  SET CMAKE_ARGS=-DPROTOBUF_SRC_ROOT_FOLDER=%PROTOBUF_SRC_ROOT_FOLDER%
  SET CMAKE_ARGS=%CMAKE_ARGS% %CPP_DIR% -DMONO_DIR=%MONO_DIR%
  SET CMAKE_ARGS=%CMAKE_ARGS% -DUNITY_ROOT_DIR=%UNITY_ROOT_DIR%
  SET CMAKE_ARGS=%CMAKE_ARGS% -DOPENSSL_ROOT_DIR=%OPENSSL_x64%
  SET CMAKE_ARGS=%CMAKE_ARGS% -DFIREBASE_UNITY_BUILD_TESTS=ON
  SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo

  cmake .. -G "Visual Studio 16 2019" -A x64 %CMAKE_ARGS% %~2

  :: Check for errors, and return if there were any
  if %errorlevel% neq 0 (
    popd
    @echo off
    exit /b %errorlevel%
  )

  cmake --build . --config RelWithDebInfo

  :: Again, check for errors, and return if there were any
  if %errorlevel% neq 0 (
    popd
    @echo off
    exit /b %errorlevel%
  )

  cpack .

  popd
  @echo off
EXIT /B %errorlevel%

test windows visual studio

test windows visual studio


@echo off
REM Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

REM Script for running JIT mode VM with Dart 2 pipeline: using Fasta in DFE
REM isolate and strong mode semantics.

set SCRIPTPATH=%~dp0

REM Does the path have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%

set OUT_DIR=%SCRIPTPATH%/../../../out/

REM Remove trailing spaces
set DART_CONFIGURATION=%DART_CONFIGURATION: =%

if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
if "%DART_USE_SDK%"=="" set DART_USE_SDK=0
set BUILD_DIR=%OUT_DIR%%DART_CONFIGURATION%

if not "_%DART_VM_OPTIONS%_" == "__" (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
)

if "%DART_USE_SDK%"=="1" (
  set DART_BINARY=%BUILD_DIR%/dart-sdk/bin/dart
  set KERNEL_BINARIES_DIR=%BUILD_DIR%/dart-sdk/lib/_internal
) else (
  set DART_BINARY=%BUILD_DIR%/dart
  set KERNEL_BINARIES_DIR=%BUILD_DIR%
)
set KERNEL_SERVICE_SNAPSHOT=%BUILD_DIR%/gen/kernel-service.dart.snapshot

"%DART_BINARY%" --strong --reify-generic-functions --limit-ints-to-64-bits --dfe="%KERNEL_SERVICE_SNAPSHOT%" --kernel-binaries="%KERNEL_BINARIES_DIR%" %*

@echo off
REM Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

REM Script for running JIT mode VM with Dart 2 pipeline: using Fasta in DFE
REM isolate and strong mode semantics.

set SCRIPTPATH=%~dp0

REM Does the path have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%

set OUT_DIR=%SCRIPTPATH%/../../../out/

REM Remove trailing spaces if line is not empty
if not "%DART_CONFIGURATION%" == "" (
  set DART_CONFIGURATION=%DART_CONFIGURATION: =%
)
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64

if "%DART_USE_SDK%"=="" set DART_USE_SDK=0
set BUILD_DIR=%OUT_DIR%%DART_CONFIGURATION%

if not "_%DART_VM_OPTIONS%_" == "__" (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
)

if "%DART_USE_SDK%"=="1" (
  set DART_BINARY=%BUILD_DIR%/dart-sdk/bin/dart
  set KERNEL_BINARIES_DIR=%BUILD_DIR%/dart-sdk/lib/_internal
) else (
  set DART_BINARY=%BUILD_DIR%/dart
  set KERNEL_BINARIES_DIR=%BUILD_DIR%
)
set KERNEL_SERVICE_SNAPSHOT=%BUILD_DIR%/gen/kernel-service.dart.snapshot

"%DART_BINARY%" --strong --reify-generic-functions --limit-ints-to-64-bits --dfe="%KERNEL_SERVICE_SNAPSHOT%" --kernel-binaries="%KERNEL_BINARIES_DIR%" %*

Remove trailing space only if string is not empty

Bug: dartbug.com/32003
Change-Id: Ia4160e438ac7f98ae607098761618623f6fd0501
Reviewed-on: https://dart-review.googlesource.com/37841
Reviewed-by: Vyacheslav Egorov <72c81f38df725d8f1832acb9b5bb99563fc2f1b9@google.com>
Commit-Queue: Alexander Aprelev <dfb74c35a357c2059971a4bf7fe26b6a7c18085d@google.com>


ghc --make site.hs -O3
upx site.exe --best
pause

ghc --make site.hs -O3 -threaded
upx site.exe --best
pause

Update build script

Update build script


:: Start with bootstrap
:: cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
IF errorlevel 1 exit 1
::
:: ECHO cd %SRCDIR%
:: cd %SRCDIR%
:: set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
:: ECHO b2 toolset=gcc --build-type=complete stage ^
::      --build-dir=buildboost ^
::      --prefix=%LIBRARY_PREFIX% ^
::      address-model=%ARCH% ^
::      variant=release ^
::      threading=multi ^
::      link=shared ^
::      -j%CPU_COUNT% ^
::      -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::      -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::      --with-python
:: CALL b2 toolset=gcc --build-type=complete stage ^
::      --build-dir=buildboost ^
::      --prefix=%LIBRARY_PREFIX% ^
::      address-model=%ARCH% ^
::      variant=release ^
::      threading=multi ^
::      link=shared ^
::      -j%CPU_COUNT% ^
::      -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::      -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::      --with-python

:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%
::
:: Build step
:: CALL b2 install ^
::     --build-dir=buildboost ^
::     --prefix=%LIBRARY_PREFIX% ^
::     toolset=gcc ^
::     address-model=%ARCH% ^
::     variant=release ^
::     threading=multi ^
::     link=shared ^
::     -j%CPU_COUNT% ^
::     -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::     -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::     --with-python
:: IF errorlevel 1 exit 1
::
:: :: Install fix-up for a non version-specific boost include
:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1
::
:: Move dll's to LIBRARY_BIN
:: move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
:: IF errorlevel 1 exit 1
:: Status API Training Shop Blog About

:: Start with bootstrap
:: cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
IF errorlevel 1 exit 1
ECHO cd %SRCDIR%
cd %SRCDIR%
IF errorlevel 1 exit 1
set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
IF errorlevel 1 exit 1
ECHO b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
CALL b2 toolset=gcc --build-type=complete stage ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
        -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
        --with-python
IF errorlevel 1 exit 1
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


:: Start with bootstrap
cd tools\build
dir .
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
dir .
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
dir .
CALL .\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
cd ..\..
dir .
set PATH=%PATH%;%LIBRARY_BIN%

:: Build step
CALL b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=gcc ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=shared ^
    -j%CPU_COUNT% ^
    -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
    -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
    --with-python
IF errorlevel 1 exit 1

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1
Status API Training Shop Blog About

:: Start with bootstrap
cd tools\build
dir .
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
dir .
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
cd ..\..
dir .
CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
dir .
set PATH=%PATH%;%LIBRARY_BIN%

:: Build step
CALL b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=gcc ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=shared ^
    -j%CPU_COUNT% ^
    -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
    -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
    --with-python
IF errorlevel 1 exit 1

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1
Status API Training Shop Blog About

Update bld.bat

Update bld.bat


rem cea-workflow.bat
rem run a (complete) cea workflow for a given scenario

rem configure variables used for the simulation
if not defined CEA-SCENARIO (
    echo please set CEA-SCENARIO first
    exit /b 1
)

rem run each script, break on error

rem copy-default-databases
echo %date% %time% copy-default-databases begin >> %CEA-SCENARIO%\cea-workflow.log
cea copy-default-databases --scenario %CEA-SCENARIO%
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% copy-default-databases end >> %CEA-SCENARIO%\cea-workflow.log

rem data-helper
echo %date% %time% data-helper begin >> %CEA-SCENARIO%\cea-workflow.log
cea data-helper
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% data-helper end >> %CEA-SCENARIO%\cea-workflow.log

rem radiation-daysim
echo %date% %time% radiation-daysim begin >> %CEA-SCENARIO%\cea-workflow.log
cea radiation-daysim
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% radiation-daysim end >> %CEA-SCENARIO%\cea-workflow.log

rem demand
echo %date% %time% demand begin >> %CEA-SCENARIO%\cea-workflow.log
cea demand --multiprocessing on
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% demand end >> %CEA-SCENARIO%\cea-workflow.log

rem emissions
echo %date% %time% emissions begin >> %CEA-SCENARIO%\cea-workflow.log
cea emissions
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% emissions end >> %CEA-SCENARIO%\cea-workflow.log

rem network-layout
echo %date% %time% network-layout begin >> %CEA-SCENARIO%\cea-workflow.log
cea network-layout
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% network-layout end >> %CEA-SCENARIO%\cea-workflow.log

rem operation-costs
echo %date% %time% operation-costs begin >> %CEA-SCENARIO%\cea-workflow.log
cea operation-costs
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% operation-costs end >> %CEA-SCENARIO%\cea-workflow.log

rem photovoltaic
echo %date% %time% photovoltaic begin >> %CEA-SCENARIO%\cea-workflow.log
cea photovoltaic
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% photovoltaic end >> %CEA-SCENARIO%\cea-workflow.log

rem solar-collector
echo %date% %time% solar-collector FP begin >> %CEA-SCENARIO%\cea-workflow.log
cea solar-collector --type-scpanel FP
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% solar-collector FP end >> %CEA-SCENARIO%\cea-workflow.log

rem solar-collector
echo %date% %time% solar-collector ET begin >> %CEA-SCENARIO%\cea-workflow.log
cea solar-collector --type-scpanel ET
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% solar-collector ET end >> %CEA-SCENARIO%\cea-workflow.log

rem photovoltaic-thermal
echo %date% %time% photovoltaic-thermal begin >> %CEA-SCENARIO%\cea-workflow.log
cea photovoltaic-thermal
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% photovoltaic-thermal end >> %CEA-SCENARIO%\cea-workflow.log

rem sewage-potential
echo %date% %time% sewage-potential begin >> %CEA-SCENARIO%\cea-workflow.log
cea sewage-potential
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% sewage-potential end >> %CEA-SCENARIO%\cea-workflow.log

rem lake-potential
echo %date% %time% lake-potential begin >> %CEA-SCENARIO%\cea-workflow.log
cea lake-potential
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% lake-potential end >> %CEA-SCENARIO%\cea-workflow.log

rem thermal-network-matrix
echo %date% %time% thermal-network-matrix begin >> %CEA-SCENARIO%\cea-workflow.log
cea thermal-network-matrix
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% thermal-network-matrix end >> %CEA-SCENARIO%\cea-workflow.log

rem decentralized
echo %date% %time% decentralized begin >> %CEA-SCENARIO%\cea-workflow.log
cea decentralized
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% decentralized end >> %CEA-SCENARIO%\cea-workflow.log

rem optimization
echo %date% %time% optimization begin >> %CEA-SCENARIO%\cea-workflow.log
cea optimization --individualind 2 --ngen 2
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% optimization end >> %CEA-SCENARIO%\cea-workflow.log

rem plots
echo %date% %time% plots begin >> %CEA-SCENARIO%\cea-workflow.log
cea plots
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% plots end >> %CEA-SCENARIO%\cea-workflow.log

rem cea-workflow.bat
rem run a (complete) cea workflow for a given scenario

rem configure variables used for the simulation
if not defined CEA-SCENARIO (
    echo please set CEA-SCENARIO first
    exit /b 1
)

rem run each script, break on error

rem copy-default-databases
echo %date% %time% copy-default-databases begin >> %CEA-SCENARIO%\cea-workflow.log
cea copy-default-databases --scenario %CEA-SCENARIO%
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% copy-default-databases end >> %CEA-SCENARIO%\cea-workflow.log

rem data-helper
echo %date% %time% data-helper begin >> %CEA-SCENARIO%\cea-workflow.log
cea data-helper
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% data-helper end >> %CEA-SCENARIO%\cea-workflow.log

rem radiation-daysim
echo %date% %time% radiation-daysim begin >> %CEA-SCENARIO%\cea-workflow.log
rem cea radiation-daysim
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% radiation-daysim end >> %CEA-SCENARIO%\cea-workflow.log

rem demand
echo %date% %time% demand begin >> %CEA-SCENARIO%\cea-workflow.log
cea demand --multiprocessing on
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% demand end >> %CEA-SCENARIO%\cea-workflow.log

rem emissions
echo %date% %time% emissions begin >> %CEA-SCENARIO%\cea-workflow.log
cea emissions
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% emissions end >> %CEA-SCENARIO%\cea-workflow.log

rem network-layout
echo %date% %time% network-layout begin >> %CEA-SCENARIO%\cea-workflow.log
cea network-layout
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% network-layout end >> %CEA-SCENARIO%\cea-workflow.log

rem operation-costs
echo %date% %time% operation-costs begin >> %CEA-SCENARIO%\cea-workflow.log
cea operation-costs
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% operation-costs end >> %CEA-SCENARIO%\cea-workflow.log

rem photovoltaic
echo %date% %time% photovoltaic begin >> %CEA-SCENARIO%\cea-workflow.log
cea photovoltaic
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% photovoltaic end >> %CEA-SCENARIO%\cea-workflow.log

rem solar-collector
echo %date% %time% solar-collector FP begin >> %CEA-SCENARIO%\cea-workflow.log
cea solar-collector --type-scpanel FP
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% solar-collector FP end >> %CEA-SCENARIO%\cea-workflow.log

rem solar-collector
echo %date% %time% solar-collector ET begin >> %CEA-SCENARIO%\cea-workflow.log
cea solar-collector --type-scpanel ET
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% solar-collector ET end >> %CEA-SCENARIO%\cea-workflow.log

rem photovoltaic-thermal
echo %date% %time% photovoltaic-thermal begin >> %CEA-SCENARIO%\cea-workflow.log
cea photovoltaic-thermal
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% photovoltaic-thermal end >> %CEA-SCENARIO%\cea-workflow.log

rem sewage-potential
echo %date% %time% sewage-potential begin >> %CEA-SCENARIO%\cea-workflow.log
cea sewage-potential
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% sewage-potential end >> %CEA-SCENARIO%\cea-workflow.log

rem lake-potential
echo %date% %time% lake-potential begin >> %CEA-SCENARIO%\cea-workflow.log
cea lake-potential
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% lake-potential end >> %CEA-SCENARIO%\cea-workflow.log

rem thermal-network-matrix
echo %date% %time% thermal-network-matrix begin >> %CEA-SCENARIO%\cea-workflow.log
cea thermal-network-matrix
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% thermal-network-matrix end >> %CEA-SCENARIO%\cea-workflow.log

rem decentralized
echo %date% %time% decentralized begin >> %CEA-SCENARIO%\cea-workflow.log
cea decentralized
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% decentralized end >> %CEA-SCENARIO%\cea-workflow.log

rem optimization
echo %date% %time% optimization begin >> %CEA-SCENARIO%\cea-workflow.log
cea optimization --individualind 2 --ngen 2
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% optimization end >> %CEA-SCENARIO%\cea-workflow.log

rem plots
echo %date% %time% plots begin >> %CEA-SCENARIO%\cea-workflow.log
cea plots
if %errorlevel% neq 0 exit /b %errorlevel%
echo %date% %time% plots end >> %CEA-SCENARIO%\cea-workflow.log

exclude radiation daysim from cea-workflow for now. too costly.


@echo off
rem
rem Install or update Cygwin.
rem
rem Features of this batch file:
rem   * Mostly hands-free, except for stopping of running Cygwin
rem     processes and configuration of newly installed services.
rem   * Stops and starts Cygwin services.
rem   * Lists running Cygwin processes (setup.exe informs you that
rem     they are running, but does not list them).
rem   * Fetches latest setup.exe from cygwin.com.
rem   * Installs standard set of packages.
rem   * Updates all installed packages.
rem   * Runs rebaseall.
rem   * Installs standard services (syslogd, sshd).
rem   * Installs cyglsa.
rem
rem Copyright (c) 2012 Tom Schutter
rem All rights reserved.
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem    - Redistributions of source code must retain the above copyright
rem      notice, this list of conditions and the following disclaimer.
rem    - Redistributions in binary form must reproduce the above
rem      copyright notice, this list of conditions and the following
rem      disclaimer in the documentation and/or other materials provided
rem      with the distribution.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
rem LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
rem CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
rem POSSIBILITY OF SUCH DAMAGE.
rem

setlocal
goto :main

:load_config
    set _CONFFILE=%~dp0\cygwin_setup_config.bat
    if exist "%_CONFFILE%" goto :endif_check_conffile
        echo %_PREFIX% ERROR: Configuration file "%_CONFFILE%" not found.
        exit /b 1
    :endif_check_conffile
    set _PACKAGES=
    set _ROOTDIR=
    set _SITE=
    set _CONFIG_SYSLOGD=
    set _CONFIG_SSHD=
    set _CONFIG_LSA=
    call "%_CONFFILE%"
    if "%_PACKAGES%" == "" (
        echo %_PREFIX% ERROR: _PACKAGES not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_ROOTDIR%" == "" (
        echo %_PREFIX% ERROR: _ROOTDIR not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_SITE%" == "" (
        echo %_PREFIX% ERROR: _SITE not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_CONFIG_SYSLOGD%" == "" (
        echo %_PREFIX% ERROR: _CONFIG_SYSLOGD not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_CONFIG_SSHD%" == "" (
        echo %_PREFIX% ERROR: _CONFIG_SSHD not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_CONFIG_LSA%" == "" (
        echo %_PREFIX% ERROR: _CONFIG_LSA not defined in "%_CONFFILE%"
        exit /b 1
    )
exit /b 0

:check_admin
    rem Check for ADMIN privileges
    rem https://sites.google.com/site/eneerge/home/BatchGotAdmin

    "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" >nul 2>&1
    if not ERRORLEVEL 1 goto :endif_check_admin
        echo %_PREFIX% ERROR: You do not have Administrator privileges
        echo %_PREFIX% Rerun from a "Run as Administrator" command prompt
        exit /b 1
    :endif_check_admin
exit /b 0

:check_for_wget_exe
    rem wget.exe is used to fetch setup.exe
    for /f %%i in ("wget.exe") do if not "%%~$PATH:i" == "" exit /b 0
    echo %_PREFIX% ERROR: wget.exe not found in PATH
    echo %_PREFIX% One source is http://users.ugent.be/~bpuype/wget/
exit /b 1

:stop_services
    rem Stop all Cygwin services.
    if not exist "%_ROOTDIR%\bin\cygrunsrv.exe" goto :eof
    for /f "usebackq" %%s in (`"%_ROOTDIR%\bin\cygrunsrv.exe" --list`) do (
        echo %_PREFIX% Stopping %%s
        "%_ROOTDIR%\bin\cygrunsrv.exe" --stop %%s
    )
goto :eof

:start_service
    rem Start a single Cygwin service.
    echo %_PREFIX% Starting %1
    "%_ROOTDIR%\bin\cygrunsrv.exe" --start %1
goto :eof

:start_services
    rem Start all Cygwin services.

    rem Start syslogd first.
    for /f "usebackq" %%s in (`"%_ROOTDIR%\bin\cygrunsrv.exe" --list`) do (
        if "%%s" == "syslogd" call :start_service %%s
    )
    rem Start rest of services.
    for /f "usebackq" %%s in (`"%_ROOTDIR%\bin\cygrunsrv.exe" --list`) do (
        if not "%%s" == "syslogd" call :start_service %%s
    )
goto :eof

:check_for_cygwin_proc
    rem Check for any Cygwin processes.
    echo %_PREFIX% Checking for running Cygwin processes
    if not exist "%_ROOTDIR%\bin\ps.exe" exit /b 0
    set _TEMPFILE=%TEMP%\cygwin_setup.txt
    :retry
        "%_ROOTDIR%\bin\ps.exe" -l | findstr /v /c:"/usr/bin/ps" > "%_TEMPFILE%"
        findstr /v /r /c:"PID.*COMMAND" "%_TEMPFILE%" | findstr /r /c:"^..*" > NUL:
        if ERRORLEVEL 1 goto :ignore
        echo %_PREFIX% Found running Cygwin processes
        type "%_TEMPFILE%"
        del "%_TEMPFILE%"
        :ask_abort_retry_ignore
            set /p _ANSWER=Abort, Retry, or Ignore?
            set _ANSWER=%_ANSWER:~0,1%
            if "%_ANSWER%" == "a" exit /b 1
            if "%_ANSWER%" == "A" exit /b 1
            if "%_ANSWER%" == "r" goto :retry
            if "%_ANSWER%" == "R" goto :retry
            if "%_ANSWER%" == "i" goto :ignore
            if "%_ANSWER%" == "I" goto :ignore
        goto :ask_abort_retry_ignore
    :ignore
exit /b 0

:get_setup_exe
    rem Download latest setup.exe.
    if not exist %_ROOTDIR% (
        echo %_PREFIX% Creating %_ROOTDIR%
        mkdir "%_ROOTDIR%"
    )
    echo %_PREFIX% Fetching latest setup.exe from cygwin.com
    wget --quiet -O "%_ROOTDIR%\setup.exe" http://cygwin.com/setup.exe
goto :eof

:setup
    rem Run setup.exe.
    echo %_PREFIX% Running setup.exe for updates
    "%_ROOTDIR%\setup.exe" --site %_SITE% --quiet-mode --no-shortcuts --root "%_ROOTDIR%" --local-package-dir "%_ROOTDIR%\LocalPackageDir"
    echo %_PREFIX% Running setup.exe to install standard package set
    "%_ROOTDIR%\setup.exe" --site %_SITE% --quiet-mode --no-shortcuts --root "%_ROOTDIR%" --local-package-dir "%_ROOTDIR%\LocalPackageDir" --packages %_PACKAGES%
goto :eof

:rebaseall
    rem Run rebaseall.
    rem This should be handled by setup.exe, but at this time
    rem setup.exe does not handle all cases.  And running rebaseall
    rem unnecessarily should cause no harm.
    rem See http://cygwin.com/ml/cygwin/2012-08/msg00320.html
    echo %_PREFIX% Running rebaseall
    "%_ROOTDIR%\bin\dash.exe" -c 'cd /usr/bin; PATH=. ; rebaseall'
goto :eof

:create_passwd
    rem Create local passwd and group files.
    if not exist "%_ROOTDIR%\etc\passwd" (
        echo %_PREFIX% Creating /etc/passwd
        "%_ROOTDIR%\bin\bash.exe" --login -i -c '/usr/bin/mkpasswd --local > /etc/passwd'
    )
    if not exist "%_ROOTDIR%\etc\group" (
        echo %_PREFIX% Creating /etc/group
        "%_ROOTDIR%\bin\bash.exe" --login -i -c '/usr/bin/mkgroup --local > /etc/group'
    )
goto :eof

:config_syslogd
    sc query syslogd | findstr "service does not exist" > NUL:
    if ERRORLEVEL 1 goto :eof

    echo %_PREFIX% Configuring syslogd
    if not exist "%_ROOTDIR%\bin\syslogd-config" (
        echo %_PREFIX% ERROR: inetutils not installed
        goto :eof
    )
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/syslogd-config"
goto :eof

:config_sshd
    sc query sshd | findstr "service does not exist" > NUL:
    if ERRORLEVEL 1 goto :eof

    echo %_PREFIX% Configuring sshd
    if not exist "%_ROOTDIR%\bin\ssh-host-config" (
        echo %_PREFIX% ERROR: opensshd not installed
        goto :eof
    )
    findstr /r "^sshd:" "%_ROOTDIR%\etc\passwd"
    if not ERRORLEVEL 1 (
        echo %_PREFIX% ERROR: sshd account found in /etc/passwd
        goto :eof
    )
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/ssh-host-config"
    echo %_PREFIX% Disabling reverse DNS lookup by sshd
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/sed -i -e 's/#UseDNS yes/UseDNS no/' /etc/sshd_config"
goto :eof

:config_lsa
    reg query HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v "Authentication Packages" | findstr cyglsa > NUL:
    if not ERRORLEVEL 1 goto :eof

    echo %_PREFIX% Configuring cyglsa
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/cyglsa-config"
goto :eof

:main
    rem Global constants.
    set _PREFIX=CYGWIN_SETUP:

    call :load_config ||exit /b 1
    call :check_admin ||exit /b 1
    call :check_for_wget_exe ||exit /b 1
    call :stop_services
    call :check_for_cygwin_proc ||exit /b 1
    call :get_setup_exe
    call :setup
    call :rebaseall
    call :create_passwd
    if "%_CONFIG_SYSLOGD%" == "True" call :config_syslogd
    if "%_CONFIG_SSHD%" == "True" call :config_sshd
    call :start_services
    rem Do config_lsa last so that reboot message is last
    if "%_CONFIG_LSA%" == "True" call :config_lsa
:exit

@echo off
rem
rem Install or update Cygwin.
rem
rem Features of this batch file:
rem   * Mostly hands-free, except for stopping of running Cygwin
rem     processes and configuration of newly installed services.
rem   * Stops and starts Cygwin services.
rem   * Lists running Cygwin processes (setup.exe informs you that
rem     they are running, but does not list them).
rem   * Fetches latest setup.exe from cygwin.com.
rem   * Installs standard set of packages.
rem   * Updates all installed packages.
rem   * Runs rebaseall.
rem   * Installs standard services (syslogd, sshd).
rem   * Installs cyglsa.
rem
rem Copyright (c) 2012 Tom Schutter
rem All rights reserved.
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem    - Redistributions of source code must retain the above copyright
rem      notice, this list of conditions and the following disclaimer.
rem    - Redistributions in binary form must reproduce the above
rem      copyright notice, this list of conditions and the following
rem      disclaimer in the documentation and/or other materials provided
rem      with the distribution.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
rem LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
rem CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
rem POSSIBILITY OF SUCH DAMAGE.
rem

setlocal
goto :main

:load_config
    set _CONFFILE=%~dp0\cygwin_setup_config.bat
    if exist "%_CONFFILE%" goto :endif_check_conffile
        echo %_PREFIX% ERROR: Configuration file "%_CONFFILE%" not found.
        exit /b 1
    :endif_check_conffile
    set _PACKAGES=
    set _ROOTDIR=
    set _SITE=
    set _CONFIG_SYSLOGD=
    set _CONFIG_SSHD=
    set _CONFIG_LSA=
    call "%_CONFFILE%"
    if "%_PACKAGES%" == "" (
        echo %_PREFIX% ERROR: _PACKAGES not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_ROOTDIR%" == "" (
        echo %_PREFIX% ERROR: _ROOTDIR not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_SITE%" == "" (
        echo %_PREFIX% ERROR: _SITE not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_CONFIG_SYSLOGD%" == "" (
        echo %_PREFIX% ERROR: _CONFIG_SYSLOGD not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_CONFIG_SSHD%" == "" (
        echo %_PREFIX% ERROR: _CONFIG_SSHD not defined in "%_CONFFILE%"
        exit /b 1
    )
    if "%_CONFIG_LSA%" == "" (
        echo %_PREFIX% ERROR: _CONFIG_LSA not defined in "%_CONFFILE%"
        exit /b 1
    )
exit /b 0

:check_admin
    rem Check for ADMIN privileges
    rem https://sites.google.com/site/eneerge/home/BatchGotAdmin

    "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" >nul 2>&1
    if not ERRORLEVEL 1 goto :endif_check_admin
        echo %_PREFIX% ERROR: You do not have Administrator privileges
        echo %_PREFIX% Rerun from a "Run as Administrator" command prompt
        exit /b 1
    :endif_check_admin
exit /b 0

:check_for_wget_exe
    rem wget.exe is used to fetch setup.exe
    if exist wget.exe exit /b 0
    for /f %%i in ("wget.exe") do if not "%%~$PATH:i" == "" exit /b 0
    echo %_PREFIX% ERROR: wget.exe not found in PATH
    echo %_PREFIX% One source is http://users.ugent.be/~bpuype/wget/
exit /b 1

:stop_services
    rem Stop all Cygwin services.
    if not exist "%_ROOTDIR%\bin\cygrunsrv.exe" goto :eof
    for /f "usebackq" %%s in (`"%_ROOTDIR%\bin\cygrunsrv.exe" --list`) do (
        echo %_PREFIX% Stopping %%s
        "%_ROOTDIR%\bin\cygrunsrv.exe" --stop %%s
    )
goto :eof

:start_service
    rem Start a single Cygwin service.
    echo %_PREFIX% Starting %1
    "%_ROOTDIR%\bin\cygrunsrv.exe" --start %1
goto :eof

:start_services
    rem Start all Cygwin services.

    rem Start syslogd first.
    for /f "usebackq" %%s in (`"%_ROOTDIR%\bin\cygrunsrv.exe" --list`) do (
        if "%%s" == "syslogd" call :start_service %%s
    )
    rem Start rest of services.
    for /f "usebackq" %%s in (`"%_ROOTDIR%\bin\cygrunsrv.exe" --list`) do (
        if not "%%s" == "syslogd" call :start_service %%s
    )
goto :eof

:check_for_cygwin_proc
    rem Check for any Cygwin processes.
    echo %_PREFIX% Checking for running Cygwin processes
    if not exist "%_ROOTDIR%\bin\ps.exe" exit /b 0
    set _TEMPFILE=%TEMP%\cygwin_setup.txt
    :retry
        "%_ROOTDIR%\bin\ps.exe" -l | findstr /v /c:"/usr/bin/ps" > "%_TEMPFILE%"
        findstr /v /r /c:"PID.*COMMAND" "%_TEMPFILE%" | findstr /r /c:"^..*" > NUL:
        if ERRORLEVEL 1 goto :ignore
        echo %_PREFIX% Found running Cygwin processes
        type "%_TEMPFILE%"
        del "%_TEMPFILE%"
        :ask_abort_retry_ignore
            set /p _ANSWER=Abort, Retry, or Ignore?
            set _ANSWER=%_ANSWER:~0,1%
            if "%_ANSWER%" == "a" exit /b 1
            if "%_ANSWER%" == "A" exit /b 1
            if "%_ANSWER%" == "r" goto :retry
            if "%_ANSWER%" == "R" goto :retry
            if "%_ANSWER%" == "i" goto :ignore
            if "%_ANSWER%" == "I" goto :ignore
        goto :ask_abort_retry_ignore
    :ignore
exit /b 0

:get_setup_exe
    rem Download latest setup.exe.
    if not exist %_ROOTDIR% (
        echo %_PREFIX% Creating %_ROOTDIR%
        mkdir "%_ROOTDIR%"
    )
    echo %_PREFIX% Fetching latest setup.exe from cygwin.com
    wget --quiet -O "%_ROOTDIR%\setup.exe" http://cygwin.com/setup.exe
goto :eof

:setup
    rem Run setup.exe.
    echo %_PREFIX% Running setup.exe for updates
    "%_ROOTDIR%\setup.exe" --site %_SITE% --quiet-mode --no-shortcuts --root "%_ROOTDIR%" --local-package-dir "%_ROOTDIR%\LocalPackageDir"
    echo %_PREFIX% Running setup.exe to install standard package set
    "%_ROOTDIR%\setup.exe" --site %_SITE% --quiet-mode --no-shortcuts --root "%_ROOTDIR%" --local-package-dir "%_ROOTDIR%\LocalPackageDir" --packages %_PACKAGES%
goto :eof

:rebaseall
    rem Run rebaseall.
    rem This should be handled by setup.exe, but at this time
    rem setup.exe does not handle all cases.  And running rebaseall
    rem unnecessarily should cause no harm.
    rem See http://cygwin.com/ml/cygwin/2012-08/msg00320.html
    echo %_PREFIX% Running rebaseall
    "%_ROOTDIR%\bin\dash.exe" -c 'cd /usr/bin; PATH=. ; rebaseall'
goto :eof

:create_passwd
    rem Create local passwd and group files.
    if not exist "%_ROOTDIR%\etc\passwd" (
        echo %_PREFIX% Creating /etc/passwd
        "%_ROOTDIR%\bin\bash.exe" --login -i -c '/usr/bin/mkpasswd --local > /etc/passwd'
    )
    if not exist "%_ROOTDIR%\etc\group" (
        echo %_PREFIX% Creating /etc/group
        "%_ROOTDIR%\bin\bash.exe" --login -i -c '/usr/bin/mkgroup --local > /etc/group'
    )
goto :eof

:config_syslogd
    sc query syslogd | findstr "service does not exist" > NUL:
    if ERRORLEVEL 1 goto :eof

    echo %_PREFIX% Configuring syslogd
    if not exist "%_ROOTDIR%\bin\syslogd-config" (
        echo %_PREFIX% ERROR: inetutils not installed
        goto :eof
    )
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/syslogd-config"
goto :eof

:config_sshd
    sc query sshd | findstr "service does not exist" > NUL:
    if ERRORLEVEL 1 goto :eof

    echo %_PREFIX% Configuring sshd
    if not exist "%_ROOTDIR%\bin\ssh-host-config" (
        echo %_PREFIX% ERROR: opensshd not installed
        goto :eof
    )
    findstr /r "^sshd:" "%_ROOTDIR%\etc\passwd"
    if not ERRORLEVEL 1 (
        echo %_PREFIX% ERROR: sshd account found in /etc/passwd
        goto :eof
    )
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/ssh-host-config"
    echo %_PREFIX% Disabling reverse DNS lookup by sshd
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/sed -i -e 's/#UseDNS yes/UseDNS no/' /etc/sshd_config"
goto :eof

:config_lsa
    reg query HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v "Authentication Packages" | findstr cyglsa > NUL:
    if not ERRORLEVEL 1 goto :eof

    echo %_PREFIX% Configuring cyglsa
    "%_ROOTDIR%\bin\bash.exe" --login -i -c "/usr/bin/cyglsa-config"
goto :eof

:main
    rem Global constants.
    set _PREFIX=CYGWIN_SETUP:

    call :load_config ||exit /b 1
    call :check_admin ||exit /b 1
    call :check_for_wget_exe ||exit /b 1
    call :stop_services
    call :check_for_cygwin_proc ||exit /b 1
    call :get_setup_exe
    call :setup
    call :rebaseall
    call :create_passwd
    if "%_CONFIG_SYSLOGD%" == "True" call :config_syslogd
    if "%_CONFIG_SSHD%" == "True" call :config_sshd
    call :start_services
    rem Do config_lsa last so that reboot message is last
    if "%_CONFIG_LSA%" == "True" call :config_lsa
:exit

cygwin_setup.bat: check for wget.exe in cur dir in addition to PATH


@echo off
setlocal enableextensions

goto entry

:usage
  echo usage: bolt [-h^|--help] [-V^|--version]
  echo     or bolt MODE [^<args^>]
  echo.
  echo modes:
  echo   init
  echo   build
  echo   test
  echo   help
  echo.
  echo For usage/help on a specific module, use:
  echo   bolt help MODE

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:version
  for /F " delims=" %%i in (%base%version) do set v=%%i
  echo bolt %v%
  exit /b 0

:entry

set base=%~dp0

if "%~1"=="" echo error: must specify mode. && goto fail_usage

set mode=%~1
shift

if "%mode%"=="init" goto done_mode_validation
if "%mode%"=="build" goto done_mode_validation
if "%mode%"=="test" goto done_mode_validation
if "%mode%"=="help" goto done_mode_validation
if "%mode%"=="-h" call :usage && exit /b 0
if "%mode%"=="--help" call :usage && exit /b 0
if "%mode%"=="-V" call :version && exit /b 0
if "%mode%"=="--version" call :version && exit /b 0

echo invalid mode [%mode%], must be one of init^|build^|test^|help
goto fail_usage

:done_mode_validation

if not "%mode%"=="help" goto run_mode

set help_mode=true
set mode=%~1

if "%mode%"=="init" goto run_mode
if "%mode%"=="build" goto run_mode
if "%mode%"=="test" goto run_mode

echo help requires argument: bolt help MODE, where MODE is one of init^|build^|test
exit /b 2

:run_mode

call %base%bolt-%mode%.subr.bat
exit /b %errorlevel%

Add implementation of bolt script

Add implementation of bolt script


::  This file is included by the quickstart script file "..\..\bw.bat" so that
::  we may keep this script under version control in the svn repository.

@ECHO off
SETLOCAL

ECHO.
ECHO.
ECHO   Bedework Calendar System
ECHO   ------------------------
ECHO.

SET PRG=%0
SET saveddir=%CD%
SET QUICKSTART_HOME=%saveddir%

:: Default some parameters
SET BWCONFIGS=
SET bwc=default
SET BWCONFIG=
SET offline=
SET quickstart=

:: check for command-line arguments and branch on them
IF "%1noargs" == "noargs" GOTO usage
GOTO branch

:quickstart
  ECHO     Preparing quickstart build ...
  SET quickstart="yes"
  SHIFT
  GOTO branch

:bwchome
  :: Define location of configs
  SHIFT
  SET BWCONFIGS=%1
  SHIFT
  GOTO branch

:bwc
  SHIFT
  SET bwc=%1
  SHIFT
  GOTO branch

:offline
  ECHO     Setting to offline mode; libraries will not be downloaded ...
  SET offline="-Dorg.bedework.offline.build=yes"
  SHIFT
  GOTO branch

:doneWithArgs

IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
SET BWCONFIGS=%HOME%\bwbuild
GOTO doneQB

:checkBwConfig
REM  IF "%BWCONFIGS%empty" == "empty" GOTO doneQB
REM    ECHO *******************************************************
REM    ECHO Error: Cannot specIFy both -quickstart and -bwchome
REM    ECHO *******************************************************
REM    GOTO:EOF

  SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild

:doneQB
  SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
  SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%

  IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
  ECHO *******************************************************
  ECHO Error: Configuration %BEDEWORK_CONFIG%
  ECHO does not exist or is not a Bedework configuration.
  ECHO *******************************************************
  GOTO:EOF
:foundBuildProperties

  IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
  ECHO *******************************************************
  ECHO Error: JAVA_HOME is not defined correctly for Bedework.
  ECHO *******************************************************
  GOTO:EOF
:javaOk

:runBedework
  :: Make available for ant
  SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties

  ECHO.
  ECHO     BWCONFIGS = %BWCONFIGS%
  ECHO     BWCONFIG = %BWCONFIG%
  ECHO.

  SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0

  SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"

  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home=%ANT_HOME% org.apache.tools.ant.launch.Launcher %BWCONFIG% %1

  GOTO:EOF

:: Iterate over the command line arguments;
:: DOS Batch labels can't contain hyphens, so convert them
:: (otherwise, we could just "GOTO %1")
:branch
IF "%1" == "-quickstart" GOTO quickstart
IF "%1" == "-bwchome" GOTO bwchome
IF "%1" == "-bwc" GOTO bwc
IF "%1" == "-offline" GOTO offline
GOTO doneWithArgs

:usage
  ECHO    Usage:
  ECHO.
  ECHO    %0 [ -quickstart OR -bwchome path ] [ -bwc configname ] [ -offline ] [ target ]
  ECHO.
  ECHO      -quickstart  Use the current quickstart configurations.
  ECHO      -bwchome     Specify path to configurations
  ECHO      -bwc         Specify configuration name
  ECHO      -offline     Build without atempting to retrieve library jars
  ECHO      target       Ant target to execute
  ECHO.
  ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
  ECHO    directory which contains one directory per configuration.
  ECHO.
  ECHO    Within each configuration directory we expect a file called
  ECHO    build.properties which should point to the property and options file
  ECHO    needed for the deploy process.
  ECHO.
  ECHO    In general these files will be in the same directory as build.properties.
  ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
  ECHO    configuration directory and can be used to build a path to the other files.
  ECHO.
  ECHO.

::  This file is included by the quickstart script file "..\..\bw.bat" so that
::  we may keep this script under version control in the svn repository.

@ECHO off
SETLOCAL

ECHO.
ECHO.
ECHO   Bedework Calendar System
ECHO   ------------------------
ECHO.

SET PRG=%0
SET saveddir=%CD%
SET QUICKSTART_HOME=%saveddir%

:: Default some parameters
SET BWCONFIGS=
SET bwc=default
SET BWCONFIG=
SET offline=
SET quickstart=

:: check for command-line arguments and branch on them
IF "%1noargs" == "noargs" GOTO usage
GOTO branch

:quickstart
  ECHO     Preparing quickstart build ...
  SET quickstart="yes"
  SHIFT
  GOTO branch

:bwchome
  :: Define location of configs
  SHIFT
  SET BWCONFIGS=%1
  SHIFT
  GOTO branch

:bwc
  SHIFT
  SET bwc=%1
  SHIFT
  GOTO branch

:offline
  ECHO     Setting to offline mode; libraries will not be downloaded ...
  SET offline="-Dorg.bedework.offline.build=yes"
  SHIFT
  GOTO branch

:doneWithArgs

IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
SET BWCONFIGS=%HOME%\bwbuild
GOTO doneQB

:checkBwConfig
REM  IF "%BWCONFIGS%empty" == "empty" GOTO doneQB
REM    ECHO *******************************************************
REM    ECHO Error: Cannot specIFy both -quickstart and -bwchome
REM    ECHO *******************************************************
REM    GOTO:EOF

  SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild

:doneQB
  SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
  SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%

  IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
  ECHO *******************************************************
  ECHO Error: Configuration %BEDEWORK_CONFIG%
  ECHO does not exist or is not a Bedework configuration.
  ECHO *******************************************************
  GOTO:EOF
:foundBuildProperties

  IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
  ECHO *******************************************************
  ECHO Error: JAVA_HOME is not defined correctly for Bedework.
  ECHO *******************************************************
  GOTO:EOF
:javaOk

:runBedework
  :: Make available for ant
  SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties

  ECHO.
  ECHO     BWCONFIGS = %BWCONFIGS%
  ECHO     BWCONFIG = %BWCONFIG%
  ECHO.

  SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0

  SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"

  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %1

  GOTO:EOF

:: Iterate over the command line arguments;
:: DOS Batch labels can't contain hyphens, so convert them
:: (otherwise, we could just "GOTO %1")
:branch
IF "%1" == "-quickstart" GOTO quickstart
IF "%1" == "-bwchome" GOTO bwchome
IF "%1" == "-bwc" GOTO bwc
IF "%1" == "-offline" GOTO offline
GOTO doneWithArgs

:usage
  ECHO    Usage:
  ECHO.
  ECHO    %0 [ -quickstart OR -bwchome path ] [ -bwc configname ] [ -offline ] [ target ]
  ECHO.
  ECHO      -quickstart  Use the current quickstart configurations.
  ECHO      -bwchome     Specify path to configurations
  ECHO      -bwc         Specify configuration name
  ECHO      -offline     Build without atempting to retrieve library jars
  ECHO      target       Ant target to execute
  ECHO.
  ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
  ECHO    directory which contains one directory per configuration.
  ECHO.
  ECHO    Within each configuration directory we expect a file called
  ECHO    build.properties which should point to the property and options file
  ECHO    needed for the deploy process.
  ECHO.
  ECHO    In general these files will be in the same directory as build.properties.
  ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
  ECHO    configuration directory and can be used to build a path to the other files.
  ECHO.
  ECHO.

fix up quoting in windows bat file to account for spaces in directory paths


@echo off
php -f %~dp0..\scripts\arcanist.php -- %*

@echo off
php -f "%~dp0..\scripts\arcanist.php" -- %*

Allow `arc.bat` to work from paths with spaces in them

Summary: If you dump `arcanist/` into "Program Files" or similar, the `.bat` currently breaks. Quote the path so it doesn't. Fixes T1436.

Test Plan: Ran `arc` with `arcanist/` in a path with spaces in it.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1436

Differential Revision: https://secure.phabricator.com/D4375


IF DEFINED _ECHO ECHO ON
SETLOCAL

REM Script to compile Debug or Release for either 32 or 64 bit
REM This also supports performing a cmake generation for developers who want to do compilation
REM themselves from the generated project files.
REM This script can be invoked directly from command line or from Visual Studio via
REM PROJECTNAME_cmake.vcxproj.
REM
REM usage examples:
REM    build32Or64.bat Debug x64 cmakegen
REM or
REM    build32Or64.bat Release Win32 rebuild

REM By default it build mordor, but higher level clients can use it if they specify
REM /project and /root arguments.

SET CONFIG=Release
SET USE_CMAKE=0
SET CMAKEGEN=0
SET CLEAN=0
SET CLEANONLY=0

SET PLATFORM=Win32
SET MSBUILD_TARGET=Build

SET PROJECT=Mordor

REM Determine absolute path of root of the source tree no matter how this script was invoked
SET ROOT=%~dp0%\..
pushd %ROOT%
SET ROOT=%CD%
popd

:ARGSLOOP

IF "%1" EQU "" GOTO DONEARGS

IF /i "%1" EQU "/project" (
  SET PROJECT=%2
  SHIFT /1
  SHIFT /1
  GOTO ARGSLOOP
)

IF /i "%1" EQU "/root" (
  SET ROOT=%2
  SHIFT /1
  SHIFT /1
  GOTO ARGSLOOP
)

IF /i "%1" EQU "debug" SET CONFIG=Debug
IF /i "%1" EQU "coverage" SET CONFIG=Debug
IF /i "%1" EQU "release" SET CONFIG=Release

IF /i "%1" EQU "x64" SET PLATFORM=x64
IF /i "%1" EQU "win32" SET PLATFORM=Win32

IF /i "%1" EQU "clean" (
	SET CLEAN=1
	SET CLEANONLY=1
	SET MSBUILD_TARGET=Clean
)

IF /i "%1" EQU "rebuild" (
	SET CLEAN=1
	SET CLEANONLY=0
	SET MSBUILD_TARGET=Rebuild
)

IF /i "%1" EQU "nocmake" SET USE_CMAKE=0
IF /i "%1" EQU "cmake" SET USE_CMAKE=1

IF /i "%1" EQU "cmakegen" (
	SET CMAKEGEN=1
	SET USE_CMAKE=1
)

SHIFT /1
GOTO ARGSLOOP

:DONEARGS

if "%winclientlib%" == "" (
    REM winclientlib variable is needed to find the third party libs
    REM and tools
    REM Normally it should be set as a global env variable with the path
    REM of the winclientlib git repro on the dev machine.
    REM The convention for windows slaves is in the root
    REM profile directory so that is the default.

    SET winclientlib=%USERPROFILE%\winclientlib
)

REM Cmake is installed to winclientlib
SET CMAKE_FULLPATH=%winclientlib%\tools\cmake-3.7.1-win64-x64\bin\cmake

ECHO %MSBUILD_TARGET%ing %PROJECT% %PLATFORM% %CONFIG%

IF "%CLEAN%" EQU "1" (
    REM For cmake case all the generated output is centralized outside of the
    REM source, include CMakeCache.txt, so it is easy to clean or prepare for a rebuild
    RD /S /Q %PLATFORM%
)

IF "%USE_CMAKE%" EQU "0" GOTO buildsolution

IF "%CLEANONLY%" EQU "1" (
    ECHO Clean complete
    EXIT /B 0
)

REM CMake generation phase
REM We need to generate separately for 32 versus 64 bit so generated files are put into subdirectory based on platform
REM Actual output will go into Debug or Release directory inside the platform directory

IF NOT EXIST %PLATFORM% mkdir %PLATFORM%
pushd %PLATFORM%

IF "%PLATFORM%" EQU "Win32" (
    SET GENERATOR="Visual Studio 12 2013"
) ELSE (
    SET GENERATOR="Visual Studio 12 2013 Win64"
    SET PreferredToolArchitecture=x64
)

REM Generate vcxproj
REM IF EXIST CMakeCache.txt DEL CMakeCache.txt
%CMAKE_FULLPATH% %CMAKE_OPTIONS% -G %GENERATOR% %ROOT%
IF ERRORLEVEL 1 EXIT /B

popd

REM If only generating then skip actual build process
IF "%CMAKEGEN%" EQU "1" GOTO :donebuild

REM Cmake Build phase

%CMAKE_FULLPATH% --build %PLATFORM% --target ALL_BUILD --config %CONFIG%
IF ERRORLEVEL 1 EXIT /B
GOTO donebuild

:buildsolution
REM Old method using handmade sln file

REM VS120 is Visual Studio 2013
SET LaunchVCVars="%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"

IF NOT EXIST %LaunchVCVars% (
  ECHO Visual Studio not found!
  EXIT /B 1
)

IF "%PLATFORM%" EQU "Win32" (
    SET VCVARARG=x86
) ELSE (
    SET VCVARARG=AMD64
)

@CALL %LaunchVCVars% %VCVARARG%
IF DEFINED _ECHO ECHO ON

ECHO Adding winclientlib tools to path
SET PATH=%winclientlib%\tools;%PATH%
SET SOLUTION=%PROJECT%.sln

MSBuild /maxcpucount -P:configuration=%CONFIG% -P:platform=%PLATFORM% %SOLUTION% /t:%MSBUILD_TARGET%
IF ERRORLEVEL 1 EXIT /B

:donebuild

ENDLOCAL

IF DEFINED _ECHO ECHO ON
SETLOCAL

REM Script to compile Debug or Release for either 32 or 64 bit
REM This also supports performing a cmake generation for developers who want to do compilation
REM themselves from the generated project files.
REM This script can be invoked directly from command line or from Visual Studio via
REM PROJECTNAME_cmake.vcxproj.
REM
REM usage examples:
REM    build32Or64.bat Debug x64 cmakegen
REM or
REM    build32Or64.bat Release Win32 rebuild

REM By default it build mordor, but higher level clients can use it if they specify
REM /project and /root arguments.

SET CONFIG=Release
SET USE_CMAKE=0
SET CMAKEGEN=0
SET CLEAN=0
SET CLEANONLY=0

SET PLATFORM=Win32
SET MSBUILD_TARGET=Build

SET PROJECT=Mordor

REM Determine absolute path of root of the source tree no matter how this script was invoked
SET ROOT=%~dp0%\..
pushd %ROOT%
SET ROOT=%CD%
popd

:ARGSLOOP

IF "%1" EQU "" GOTO DONEARGS

IF /i "%1" EQU "/project" (
  SET PROJECT=%2
  SHIFT /1
  SHIFT /1
  GOTO ARGSLOOP
)

IF /i "%1" EQU "/root" (
  SET ROOT=%2
  SHIFT /1
  SHIFT /1
  GOTO ARGSLOOP
)

IF /i "%1" EQU "debug" SET CONFIG=Debug
IF /i "%1" EQU "coverage" SET CONFIG=Debug
IF /i "%1" EQU "release" SET CONFIG=Release

IF /i "%1" EQU "x64" SET PLATFORM=x64
IF /i "%1" EQU "win32" SET PLATFORM=Win32

IF /i "%1" EQU "clean" (
	SET CLEAN=1
	SET CLEANONLY=1
	SET MSBUILD_TARGET=Clean
)

IF /i "%1" EQU "rebuild" (
	SET CLEAN=1
	SET CLEANONLY=0
	SET MSBUILD_TARGET=Rebuild
)

IF /i "%1" EQU "nocmake" SET USE_CMAKE=0
IF /i "%1" EQU "cmake" SET USE_CMAKE=1

IF /i "%1" EQU "cmakegen" (
	SET CMAKEGEN=1
	SET USE_CMAKE=1
)

SHIFT /1
GOTO ARGSLOOP

:DONEARGS

if "%winclientlib%" == "" (
    REM winclientlib variable is needed to find the third party libs
    REM and tools
    REM Normally it should be set as a global env variable with the path
    REM of the winclientlib git repro on the dev machine.
    REM The convention for windows slaves is in the root
    REM profile directory so that is the default.

    SET winclientlib=%USERPROFILE%\winclientlib
)

REM Cmake is installed to winclientlib
SET CMAKE_FULLPATH=%winclientlib%\tools\cmake-3.8.0-win64-x64\bin\cmake

ECHO %MSBUILD_TARGET%ing %PROJECT% %PLATFORM% %CONFIG%

IF "%CLEAN%" EQU "1" (
    REM For cmake case all the generated output is centralized outside of the
    REM source, include CMakeCache.txt, so it is easy to clean or prepare for a rebuild
    RD /S /Q %PLATFORM%
)

IF "%USE_CMAKE%" EQU "0" GOTO buildsolution

IF "%CLEANONLY%" EQU "1" (
    ECHO Clean complete
    EXIT /B 0
)

REM CMake generation phase
REM We need to generate separately for 32 versus 64 bit so generated files are put into subdirectory based on platform
REM Actual output will go into Debug or Release directory inside the platform directory

IF NOT EXIST %PLATFORM% mkdir %PLATFORM%
pushd %PLATFORM%

IF "%PLATFORM%" EQU "Win32" (
    SET GENERATOR="Visual Studio 12 2013"
) ELSE (
    SET GENERATOR="Visual Studio 12 2013 Win64"
    SET PreferredToolArchitecture=x64
)

REM Generate vcxproj
REM IF EXIST CMakeCache.txt DEL CMakeCache.txt
%CMAKE_FULLPATH% %CMAKE_OPTIONS% -G %GENERATOR% %ROOT%
IF ERRORLEVEL 1 EXIT /B

popd

REM If only generating then skip actual build process
IF "%CMAKEGEN%" EQU "1" GOTO :donebuild

REM Cmake Build phase

%CMAKE_FULLPATH% --build %PLATFORM% --target ALL_BUILD --config %CONFIG%
IF ERRORLEVEL 1 EXIT /B
GOTO donebuild

:buildsolution
REM Old method using handmade sln file

REM VS120 is Visual Studio 2013
SET LaunchVCVars="%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"

IF NOT EXIST %LaunchVCVars% (
  ECHO Visual Studio not found!
  EXIT /B 1
)

IF "%PLATFORM%" EQU "Win32" (
    SET VCVARARG=x86
) ELSE (
    SET VCVARARG=AMD64
)

@CALL %LaunchVCVars% %VCVARARG%
IF DEFINED _ECHO ECHO ON

ECHO Adding winclientlib tools to path
SET PATH=%winclientlib%\tools;%PATH%
SET SOLUTION=%PROJECT%.sln

MSBuild /maxcpucount -P:configuration=%CONFIG% -P:platform=%PLATFORM% %SOLUTION% /t:%MSBUILD_TARGET%
IF ERRORLEVEL 1 EXIT /B

:donebuild

ENDLOCAL

Use cmake 3.8 on windows

Use cmake 3.8 on windows

* cmake 3.8 to be consistant with Linux cmake version

Change-Id: I9d3b133eba89c0ef8c5915a7fd8f13650888e885
Signed-off-by: Jason Tang <7bffd3ac92c799ededc488fc8ffb5bbc75b0893d@emc.com>
Reviewed-on: https://gerrit.mozy.lab.emc.com/117710
Reviewed-by: Zhaoding Wu <61420d7370e20bdc7547c2b81077a94cae0ed7e1@emc.com>


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

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

@echo off

setlocal

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

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

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

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

:fail
set GOBUILDFAIL=1
echo Fail.
goto end

:succ
echo All tests passed.

:end

add race.bat

src: add race.bat

R=golang-dev, dave, alex.brainman
CC=golang-dev
https://golang.org/cl/7133064


dnvm upgrade
dnu restore -s https://www.myget.org/F/aspnetvnext/ -f https://www.nuget.org/api/v2/
dnu build ./src/AspNet.Mvc.Formatters.Protobuf/project.json

dnvm upgrade
dnu restore
dnu pack ./src/AspNet.Mvc.Formatters.Protobuf/project.json

Add NugetPacking

Add NugetPacking


@setlocal enableextensions enabledelayedexpansion

mkdir c:\projects\pksav\test-env\build

cd c:\projects\pksav\test-env\build
if not %ERRORLEVEL%==0 goto fail

cmake -G "%CMAKE_DASH_G%" -DCMAKE_BUILD_TYPE=Debug ..\..
if not %ERRORLEVEL%==0 goto fail

msbuild ALL_BUILD.vcxproj
if not %ERRORLEVEL%==0 goto fail

:: Don't run anything when cross-compiling
if "x%CMAKE_DASH_G:ARM=%"=="x%CMAKE_DASH_G%" (
    ctest --output-on-failure
    if not %ERRORLEVEL%==0 goto fail

    set SAVEDIR=c:\projects\pksav\testing\pksav-test-saves
    set PATH=c:\projects\pksav\test-env\build\lib\Debug;%PATH%
    set PATH=c:\projects\pksav\test-env\build\apps\Debug;%PATH%

    pksav-gen1-save-dump --all --input=%SAVEDIR%\red_blue\pokemon_red.sav
    if not %ERRORLEVEL%==0 goto fail

    pksav-gen1-save-dump --all --input=%SAVEDIR%\yellow\pokemon_yellow.sav
    if not %ERRORLEVEL%==0 goto fail

    pksav-gen2-save-dump %SAVEDIR%\gold_silver\pokemon_gold.sav
    if not %ERRORLEVEL%==0 goto fail

    pksav-gen2-save-dump %SAVEDIR%\crystal\pokemon_crystal.sav
    if not %ERRORLEVEL%==0 goto fail
)

goto pass

endlocal

:fail
exit /b 1

:pass
exit /b 0

@setlocal enableextensions enabledelayedexpansion

mkdir c:\projects\pksav\test-env\build

cd c:\projects\pksav\test-env\build
if not %ERRORLEVEL%==0 goto fail

cmake -G "%CMAKE_DASH_G%" ..\..
if not %ERRORLEVEL%==0 goto fail

msbuild ALL_BUILD.vcxproj
if not %ERRORLEVEL%==0 goto fail

:: Don't run anything when cross-compiling
if "x%CMAKE_DASH_G:ARM=%"=="x%CMAKE_DASH_G%" (
    ctest --output-on-failure
    if not %ERRORLEVEL%==0 goto fail

    set SAVEDIR=c:\projects\pksav\testing\pksav-test-saves
    set PATH=c:\projects\pksav\test-env\build\lib\Debug;%PATH%
    set PATH=c:\projects\pksav\test-env\build\apps\Debug;%PATH%

    pksav-gen1-save-dump --all --input=%SAVEDIR%\red_blue\pokemon_red.sav
    if not %ERRORLEVEL%==0 goto fail

    pksav-gen1-save-dump --all --input=%SAVEDIR%\yellow\pokemon_yellow.sav
    if not %ERRORLEVEL%==0 goto fail

    pksav-gen2-save-dump %SAVEDIR%\gold_silver\pokemon_gold.sav
    if not %ERRORLEVEL%==0 goto fail

    pksav-gen2-save-dump %SAVEDIR%\crystal\pokemon_crystal.sav
    if not %ERRORLEVEL%==0 goto fail
)

goto pass

endlocal

:fail
exit /b 1

:pass
exit /b 0

remove debug flag from CMake as well

appveyor: remove debug flag from CMake as well


:: Usage: this.bat FILE [FILE ...]
:: Or copy to %AppData%\Microsoft\Windows\SendTo\
:: Dependences: ffmpeg

@echo off
if (%1)==() goto :NO_PARAMETER

:LOOP
@echo on

ffmpeg -i %1 -bsf:a aac_adtstoasc -c:a copy "%~dpn1_%random%.aac"

@echo off
if not %ERRORLEVEL%==0 (
    echo Error Code %ERRORLEVEL% for %1
    pause
    goto :EOF
)
shift
if (%1)==() goto :EOF
goto :LOOP

:NO_PARAMETER
echo Usage:
echo this.bat FILE [FILE ...]
pause

:: Usage: this.bat FILE [FILE ...]
:: Or copy to %AppData%\Microsoft\Windows\SendTo\
:: Dependences: ffmpeg

@echo off
if (%1)==() goto :NO_PARAMETER

:LOOP
@echo on
ffmpeg -i %1 -bsf:a aac_adtstoasc -vn -c:a copy "%~dpn1_%random%.m4a"
@echo off
if errorlevel 1 goto :ERROR
shift
if (%1)==() goto :EOF
goto :LOOP

:NO_PARAMETER
echo Usage:
echo this.bat FILE [FILE ...]
pause
goto :EOF

:ERROR
pause

fix FFmpeg_ExtractYouTubeAudio.cmd

fix FFmpeg_ExtractYouTubeAudio.cmd


add script to compile multiple files with pandoc