:: This script assumes the standard setup on tensorflow Jenkins windows machines.
:: It is NOT guaranteed to work on any other machine. Use at your own risk!
::
:: REQUIREMENTS:
:: * All installed in standard locations:
::   - JDK8, and JAVA_HOME set.
::   - Microsoft Visual Studio 2015 Community Edition
::   - Msys2
::   - Anaconda3
::   - CMake

:: Record the directory we are in. Script should be invoked from the root of the repository.
SET REPO_ROOT=%cd%

:: Make sure we have a clean directory to build things in.
SET BUILD_DIR=cmake_build
RMDIR %BUILD_DIR% /S /Q
MKDIR %BUILD_DIR%
CD %BUILD_DIR%

:: Set which tests to build
SET BUILD_CC_TESTS=OFF
SET BUILD_PYTHON_TESTS=ON

:: Run the CMAKE build to build the pip package.
CALL %REPO_ROOT%\tensorflow\tools\ci_build\windows\cpu\cmake\run_build.bat

SET PIP_EXE="C:\Program Files\Anaconda3\Scripts\pip.exe"

:: Uninstall tensorflow pip package, which might be a leftover from old runs.
%PIP_EXE% uninstall tensorflow

:: Install the pip package.
%PIP_EXE% install %REPO_ROOT%\%BUILD_DIR%\tf_python\dist\tensorflow-0.11.0rc2_cmake_experimental-py3-none-any.whl

:: Run all python tests
ctest -C Release --output-on-failure

:: This script assumes the standard setup on tensorflow Jenkins windows machines.
:: It is NOT guaranteed to work on any other machine. Use at your own risk!
::
:: REQUIREMENTS:
:: * All installed in standard locations:
::   - JDK8, and JAVA_HOME set.
::   - Microsoft Visual Studio 2015 Community Edition
::   - Msys2
::   - Anaconda3
::   - CMake

:: Record the directory we are in. Script should be invoked from the root of the repository.
SET REPO_ROOT=%cd%

:: Make sure we have a clean directory to build things in.
SET BUILD_DIR=cmake_build
RMDIR %BUILD_DIR% /S /Q
MKDIR %BUILD_DIR%
CD %BUILD_DIR%

:: Set which tests to build
SET BUILD_CC_TESTS=OFF
SET BUILD_PYTHON_TESTS=ON

:: Run the CMAKE build to build the pip package.
CALL %REPO_ROOT%\tensorflow\tools\ci_build\windows\cpu\cmake\run_build.bat

SET PIP_EXE="C:\Program Files\Anaconda3\Scripts\pip.exe"

:: Uninstall tensorflow pip package, which might be a leftover from old runs.
%PIP_EXE% uninstall -y tensorflow

:: Install the pip package.
%PIP_EXE% install --upgrade %REPO_ROOT%\%BUILD_DIR%\tf_python\dist\tensorflow-0.11.0rc2_cmake_experimental-py3-none-any.whl

:: Run all python tests
ctest -C Release --output-on-failure

Make sure to uninstall the old pip package and install the newly built one when running windows tests on TF CI.


%PYTHON% -m pip install --no-deps --ignore-installed -vv .

Add Windows build script

Add Windows build script


@echo off

call config.bat

echo Installing PIP...
%PYTHON% %BINDIR%\get-pip.py

echo Installing KCAA Python server prerequisites...
%PIP% install python-dateutil
%PIP% install requests
%PIP% install selenium

pause

@echo off

call config.bat

echo Creating USERDATADIR: %USERDATADIR%
mkdir %USERDATADIR%

echo Installing PIP...
%PYTHON% %BINDIR%\get-pip.py

echo Installing KCAA Python server prerequisites...
%PIP% install python-dateutil
%PIP% install requests
%PIP% install selenium

pause

Create a user data directory on Windows.


SET SCALA_HOME=F:\hudson\tools\scala-2.9.0.1
SET JRUBY_OPTS=-J-XX:MaxPermSize=312m -J-Xmx1024M
SET JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=312m

IF "X%BUILD_RVM%" == "X1.9.3" SET RUBY_HOME=F:\hudson\tools\Ruby193-p194
IF "X%BUILD_RVM%" == "X1.9.2" SET RUBY_HOME=F:\hudson\tools\Ruby192-p290
IF "X%BUILD_RVM%" == "X1.8.7" SET RUBY_HOME=F:\hudson\tools\Ruby187-p370
IF "X%BUILD_RVM%" == "Xjruby" SET RUBY_HOME=F:\hudson\tools\jruby-1.6.7

IF "X%BUILD_JVM%" == "X1.5" SET JAVA_HOME=F:\hudson\tools\java\jdk1.5.0_22-64
IF "X%BUILD_JVM%" == "X1.6" SET JAVA_HOME=F:\hudson\tools\java\jdk1.6.0_27-64
IF "X%BUILD_JVM%" == "X1.7" SET JAVA_HOME=F:\hudson\tools\java\jdk1.7.0

SET GEM_HOME=%HOMEPATH%\.buildr_gems_%JOB_NAME%
SET PATH=%GEM_HOME%\bin;%JAVA_HOME%\bin;%RUBY_HOME%\bin;%PATH%

CALL gem install bundler
CALL bundle install

SET BUILD_RAKE_TASK=ci
CALL rake clobber %BUILD_RAKE_TASK% --trace

SET SCALA_HOME=F:\hudson\tools\scala-2.9.0.1
SET JRUBY_OPTS=-J-XX:MaxPermSize=312m -J-Xmx1024M
SET JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=312m

IF "X%BUILD_RVM%" == "X1.9.3" SET RUBY_HOME=F:\hudson\tools\Ruby193-p194
IF "X%BUILD_RVM%" == "X1.9.2" SET RUBY_HOME=F:\hudson\tools\Ruby192-p290
IF "X%BUILD_RVM%" == "X1.8.7" SET RUBY_HOME=F:\hudson\tools\Ruby187-p370
IF "X%BUILD_RVM%" == "Xjruby" SET RUBY_HOME=F:\hudson\tools\jruby-1.6.7

IF "X%BUILD_JVM%" == "X1.5" SET JAVA_HOME=F:\hudson\tools\java\jdk1.5.0_22-64
IF "X%BUILD_JVM%" == "X1.6" SET JAVA_HOME=F:\hudson\tools\java\jdk1.6.0_27-64
IF "X%BUILD_JVM%" == "X1.7" SET JAVA_HOME=F:\hudson\tools\java\jdk1.7.0

SET PATH=%JAVA_HOME%\bin;%RUBY_HOME%\bin;%PATH%

CALL gem install bundler
CALL bundle install

SET BUILD_RAKE_TASK=ci
CALL rake clobber %BUILD_RAKE_TASK% --trace

Stop attempting to customize GEM_HOME as I can not seem to get it to work

git-svn-id: d8f3215415546ce936cf3b822120ca56e5ebeaa0@1400354 13f79535-47bb-0310-9956-ffa450edef68


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

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

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

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

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

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

set CMD_LINE_ARGS=%*
goto execute

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

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

change vesion in package.json

change vesion in package.json


xcopy sir.ini src\sir.ini*
xcopy sir.ini src\sir.httpserver\sir.ini*

fix setup.bat

fix setup.bat


Add gradlew.bat

Add gradlew.bat


@ECHO OFF

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
bzip2, ^
fontconfig, ^
freetype2, ^
fribidi, ^
game-music-emu, ^
gmp, ^
gnutls, ^
lame, ^
libass, ^
libbluray, ^
libiconv, ^
libilbc, ^
liblzma, ^
libssh, ^
libvpx, ^
mfx_dispatch, ^
modplug, ^
opus, ^
sdl, ^
soxr, ^
speex, ^
theora, ^
vorbis, ^
zlib ^
)
SET PGOPTIONS=--enable-version3 --enable-avisynth --enable-libmp3lame --enable-libvorbis --enable-libspeex --enable-libopus --enable-libilbc --enable-libtheora --enable-libvpx --enable-libgme --enable-libmodplug --enable-libsoxr --enable-libfreetype --enable-fontconfig --enable-libfribidi --enable-libass --enable-gnutls --disable-schannel --enable-gmp --enable-libssh --enable-libbluray --enable-opengl --enable-libmfx --toolchain=msvc

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

REM Initialise error check value
SET ERROR=0

REM Check if executable can be located
IF NOT EXIST "project_generate.exe" (
    ECHO "Error: FFVS Project Generator executable file not found."
    IF EXIST "../.git" (
        ECHO "Please build the executable using the supplied project before continuing."
    )
    GOTO exitOnError
)

REM Check if FFmpeg directory can be located
SET SEARCHPATHS=(./, ../, ./ffmpeg, ../ffmpeg, ../../ffmpeg/)
SET FFMPEGPATH=
FOR %%I IN %SEARCHPATHS% DO (
    IF EXIST "%%I/ffmpeg.h" (
        SET FFMPEGPATH=%%I
    )
)
IF "%FFMPEGPATH%"=="" (
    ECHO Error: Failed finding FFmpeg source directory
    GOTO exitOnError
) ELSE (
    ECHO Located FFmpeg source directory at "%FFMPEGPATH%"
    ECHO.
)

REM Copy across the batch file used to auto get required dependencies
CALL :makeGetDeps || GOTO exit

REM Get/Update any used dependency libraries
SET USERPROMPT=N
SET /P USERPROMPT=Do you want to download/update the required dependency projects (Y/N)?
IF /I "%USERPROMPT%"=="Y" (
    ECHO.
    CALL :getDeps || GOTO exit
    ECHO Ensure that any dependency projects have been built using the supplied project within the dependencies ./SMP folder before continuing.
    ECHO Warning: Some used dependencies require a manual download. Consult the readme for instructions to install the following needed components:
    ECHO    OpenGL, NVENC
    PAUSE
)

REM Run the executable
ECHO Running project generator...
project_generate.exe %PGOPTIONS%
GOTO exit

:makeGetDeps
ECHO Creating project_get_dependencies.bat...
FOR %%I IN %DEPENDENCIES% DO SET LASTDEP=%%I
MKDIR %FFMPEGPATH%/SMP >NUL 2>&1
(
    ECHO @ECHO OFF
    ECHO SETLOCAL EnableDelayedExpansion
    ECHO.
    ECHO SET UPSTREAMURL=%UPSTREAMURL%
    ECHO SET DEPENDENCIES=( ^^
    FOR %%I IN %DEPENDENCIES% DO (
        IF "%%I"=="%LASTDEP%" (
            ECHO %%I ^^
        ) ELSE (
            ECHO %%I, ^^
        )
    )
    type smp_project_get_dependencies
) > "%FFMPEGPATH%/SMP/project_get_dependencies.bat"
ECHO.
EXIT /B %ERRORLEVEL%

:getDeps
REM Add current repo to list of already passed dependencies
ECHO Getting and updating any required dependency libs...
cd %FFMPEGPATH%/SMP
CALL project_get_dependencies.bat "ffmpeg" || EXIT /B 1
cd %~dp0
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
SET ERROR=1

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

@ECHO OFF

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
bzip2, ^
fontconfig, ^
freetype2, ^
fribidi, ^
game-music-emu, ^
gmp, ^
gnutls, ^
lame, ^
libass, ^
libbluray, ^
libiconv, ^
libilbc, ^
liblzma, ^
libssh, ^
libvpx, ^
mfx_dispatch, ^
modplug, ^
opus, ^
sdl, ^
soxr, ^
speex, ^
theora, ^
vorbis, ^
zlib ^
)
SET PGOPTIONS=--enable-version3 --enable-libmp3lame --enable-libvorbis --enable-libspeex --enable-libopus --enable-libilbc --enable-libtheora --enable-libvpx --enable-libgme --enable-libmodplug --enable-libsoxr --enable-libfreetype --enable-fontconfig --enable-libfribidi --enable-libass --enable-gnutls --disable-schannel --enable-gmp --enable-libssh --enable-libbluray --enable-opengl --enable-libmfx --toolchain=msvc

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

REM Initialise error check value
SET ERROR=0

REM Check if executable can be located
IF NOT EXIST "project_generate.exe" (
    ECHO "Error: FFVS Project Generator executable file not found."
    IF EXIST "../.git" (
        ECHO "Please build the executable using the supplied project before continuing."
    )
    GOTO exitOnError
)

REM Check if FFmpeg directory can be located
SET SEARCHPATHS=(./, ../, ./ffmpeg, ../ffmpeg, ../../ffmpeg/)
SET FFMPEGPATH=
FOR %%I IN %SEARCHPATHS% DO (
    IF EXIST "%%I/ffmpeg.h" (
        SET FFMPEGPATH=%%I
    )
)
IF "%FFMPEGPATH%"=="" (
    ECHO Error: Failed finding FFmpeg source directory
    GOTO exitOnError
) ELSE (
    ECHO Located FFmpeg source directory at "%FFMPEGPATH%"
    ECHO.
)

REM Copy across the batch file used to auto get required dependencies
CALL :makeGetDeps || GOTO exit

REM Get/Update any used dependency libraries
SET USERPROMPT=N
SET /P USERPROMPT=Do you want to download/update the required dependency projects (Y/N)?
IF /I "%USERPROMPT%"=="Y" (
    ECHO.
    CALL :getDeps || GOTO exit
    ECHO Ensure that any dependency projects have been built using the supplied project within the dependencies ./SMP folder before continuing.
    ECHO Warning: Some used dependencies require a manual download. Consult the readme for instructions to install the following needed components:
    ECHO    OpenGL, NVENC
    PAUSE
)

REM Run the executable
ECHO Running project generator...
project_generate.exe %PGOPTIONS%
GOTO exit

:makeGetDeps
ECHO Creating project_get_dependencies.bat...
FOR %%I IN %DEPENDENCIES% DO SET LASTDEP=%%I
MKDIR %FFMPEGPATH%/SMP >NUL 2>&1
(
    ECHO @ECHO OFF
    ECHO SETLOCAL EnableDelayedExpansion
    ECHO.
    ECHO SET UPSTREAMURL=%UPSTREAMURL%
    ECHO SET DEPENDENCIES=( ^^
    FOR %%I IN %DEPENDENCIES% DO (
        IF "%%I"=="%LASTDEP%" (
            ECHO %%I ^^
        ) ELSE (
            ECHO %%I, ^^
        )
    )
    type smp_project_get_dependencies
) > "%FFMPEGPATH%/SMP/project_get_dependencies.bat"
ECHO.
EXIT /B %ERRORLEVEL%

:getDeps
REM Add current repo to list of already passed dependencies
ECHO Getting and updating any required dependency libs...
cd %FFMPEGPATH%/SMP
CALL project_get_dependencies.bat "ffmpeg" || EXIT /B 1
cd %~dp0
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
SET ERROR=1

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

Remove avisynth from lgpl bat script.

Remove avisynth from lgpl bat script.

Fixes #6


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

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

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
)

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

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%)

@REM CALL :BUILD unity_separate, "-DFIREBASE_INCLUDE_UNITY=ON -DFIREBASE_UNI_LIBRARY=OFF"
@REM 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%

disable separate for now

disable separate for now


add this commit for test—Switch Mac Pro;


rem ***********************************************************************************************
rem Download BuildTools from https://www.visualstudio.com/downloads/ and install first.
rem ***********************************************************************************************
rem x86 build command
rem "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" .\Castle.Facilities.IBatisNet.sln /t:Rebuild /p:Configuration=Release /p:WarningLevel=0
rem x64 build command
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\amd64\MSBuild.exe" .\Castle.Facilities.IBatisNet.sln /t:Rebuild /p:Configuration=Release /p:WarningLevel=0
pause

@echo If not install Visual Studio 2017, download BuildTools from https://www.visualstudio.com/downloads/ and install first.
nuget-4.3.0.4406.exe restore
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Visual Studio Community\MSBuild\15.0\Bin;
MSBuild.exe .\Castle.Facilities.IBatisNet.sln /t:Rebuild /p:Configuration=Release /p:WarningLevel=0
pause

modify build scripts

modify build scripts


@REM @file
@REM   This stand-alone program is typically called by the edksetup.bat file,
@REM   however it may be executed directly from the BaseTools project folder
@REM   if the file is not executed within a WORKSPACE\BaseTools folder.
@REM
@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.

@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP

@REM
@REM This program and the accompanying materials are licensed and made available
@REM under the terms and conditions of the BSD License which accompanies this
@REM distribution.  The full text of the license may be found at:
@REM   http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
@REM IMPLIED.
@REM

@echo off
pushd .

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

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

:loop
  if "%1"=="" goto setup_workspace
  if /I "%1"=="--nt32" (
    if /I "%2" == "X64" (
      shift
    )
    @REM Ignore --nt32 flag
    shift
    goto loop
  )
  if /I "%1"=="Reconfig" (
    shift
    set RECONFIG=TRUE
    goto loop
  )
  if /I "%1"=="Rebuild" (
    shift
    set REBUILD=TRUE
    goto loop
  )
  if /I "%1"=="ForceRebuild" (
    shift
    set FORCE_REBUILD=TRUE
    goto loop
  )
  if "%1"=="" goto setup_workspace
  if exist %1 (
    if not defined BASE_TOOLS_PATH (
      if exist %1\Source set BASE_TOOLS_PATH=%1
      shift
      goto loop
    )
    if not defined EDK_TOOLS_PATH (
      if exist %1\Bin\Win32 set EDK_TOOLS_PATH=%1
      shift
      goto loop
    )
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  ) else (
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  )
  goto loop

@REM
@REM Check the required system environment variables
@REM

:setup_workspace
  REM
  REM check the EDK_TOOLS_PATH
  REM
  if not defined EDK_TOOLS_PATH goto no_EDK_TOOLS_PATH
  if exist %EDK_TOOLS_PATH% goto set_PATH

:no_EDK_TOOLS_PATH
  if not defined WORKSPACE (
    if defined BASE_TOOLS_PATH (
      set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! Neither BASE_TOOLS_PATH nor EDK_TOOLS_PATH are set. !!!
      echo.
      goto end
    )
  ) else (
    if exist %WORKSPACE%\BaseTools\Bin (
      set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! No tools path available. Please set EDK_TOOLS_PATH !!!
      echo.
      goto end
    )
  )

:set_PATH
  if defined WORKSPACE_TOOLS_PATH goto check_PATH
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  goto PATH_ok

:check_PATH
  if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this session.

:PATH_ok
REM
REM copy *.template to %CONF_PATH%
REM
if not defined WORKSPACE (
   if defined RECONFIG (
     echo.
     echo !!! WARNING !!! WORKSPACE environment variable was not set, cannot Reconfig !!!
     echo.
   )
   goto skip_reconfig
)

if not defined CONF_PATH (
  set CONF_PATH=%WORKSPACE%\Conf
)

if NOT exist %CONF_PATH% (
  if defined PACKAGES_PATH (
    for %%i IN (%PACKAGES_PATH%) DO (
      if exist %%~fi\Conf (
        set CONF_PATH=%%i\Conf
        goto CopyConf
      )
    )
  )
)

:CopyConf
if NOT exist %CONF_PATH% (
  mkdir %CONF_PATH%
) else (
  if defined RECONFIG (
    echo.
    echo  Over-writing the files in the CONF_PATH directory
    echo  using the default template files
    echo.
  )
)

if NOT exist %CONF_PATH%\target.txt (
  echo copying ... target.template to %CONF_PATH%\target.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (
    echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
) else (
  if defined RECONFIG echo over-write ... target.template to %CONF_PATH%\target.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
)

if NOT exist %CONF_PATH%\tools_def.txt (
  echo copying ... tools_def.template to %CONF_PATH%\tools_def.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (
    echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
) else (
  if defined RECONFIG echo over-write ... tools_def.template to %CONF_PATH%\tools_def.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
)

if NOT exist %CONF_PATH%\build_rule.txt (
  echo copying ... build_rule.template to %CONF_PATH%\build_rule.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (
    echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
) else (
  if defined RECONFIG echo over-write ... build_rule.template to %CONF_PATH%\build_rule.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
)

echo           PATH      = %PATH%
echo.
if defined WORKSPACE (
  echo      WORKSPACE      = %WORKSPACE%
)
if defined PACKAGES_PATH (
  echo  PACKAGES_PATH      = %PACKAGES_PATH%
)
echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%
if defined BASE_TOOLS_PATH (
  echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
)
if defined EDK_TOOLS_BIN (
  echo  EDK_TOOLS_BIN      = %EDK_TOOLS_BIN%
)
echo      CONF_PATH      = %CONF_PATH%
echo.

:skip_reconfig

@REM
@REM Test if we are going to have to do a build
@REM
if defined FORCE_REBUILD goto check_build_environment
if defined REBUILD goto check_build_environment
if not exist "%EDK_TOOLS_PATH%" goto check_build_environment

IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_c_tools

goto check_python_tools

:check_c_tools
  echo.
  echo !!! ERROR !!! Binary C tools are missing. They are requried to be built from BaseTools Source.
  echo.
  goto end

:check_python_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" goto check_build_environment

goto end

:check_build_environment
  if defined BASETOOLS_PYTHON_SOURCE goto VisualStudioAvailable

  if not defined BASE_TOOLS_PATH (
     if not exist "Source\C\Makefile" (
       if not exist "%EDK_TOOLS_PATH%\Source\C\Makefile" goto no_source_files
       set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
     ) else (
       set BASE_TOOLS_PATH=%CD%
     )
  )

  if not defined PYTHON_HOME (
    if defined PYTHONHOME (
      set PYTHON_HOME=%PYTHONHOME%
    ) else (
      echo.
      echo  !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set.
      echo PYTHON_HOME is required to build or execute the python tools.
      echo.
      goto end
    )
  )

  @REM We have Python, now test for FreezePython application
  if not defined PYTHON_FREEZER_PATH (
    echo.
    echo !!! WARNING !!! PYTHON_FREEZER_PATH environment variable is not set.
    echo Setup environment to run Python scripts directly.
    echo.
    set "PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike"
  )

  set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python
  set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%

  echo                PATH = %PATH%
  echo         PYTHON_HOME = %PYTHON_HOME%
  echo          PYTHONPATH = %PYTHONPATH%
  if defined PYTHON_FREEZER_PATH (
    echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%
  )
  echo.

:VisualStudioAvailable
  if not defined FORCE_REBUILD (
    if not defined REBUILD (
      goto end
    )
  )
  call "%EDK_TOOLS_PATH%\get_vsvars.bat"
  if not defined VCINSTALLDIR (
    @echo.
    @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!
    @echo.
    goto end
  )
  if not defined FORCE_REBUILD goto IncrementalBuild

:CleanAndBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake cleanall
  del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
  popd
  @REM Let CleanAndBuild fall through to IncrementalBuild

:IncrementalBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake c
  popd

  if defined PYTHON_FREEZER_PATH (
    echo BUILDING PYTHON TOOLS
    pushd .
    cd %BASE_TOOLS_PATH%
    call nmake python
    popd
  ) else (
    echo.
    echo !!! WARNING !!! Cannot make executable from Python code, executing python scripts instead !!!
    echo.
  )
  goto end

:no_source_files
  echo.
  echo !!! ERROR !!! Cannot build BaseTools applications - no source directory located !!!
  echo.
  goto end

:Usage
  @echo.
  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"
  @echo.
  @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path.
  @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.
  @echo         Rebuild           If sources are available perform an Incremental build, only
  @echo                           build those updated tools.
  @echo         ForceRebuild      If sources are available, rebuild all tools regardless of
  @echo                           whether they have been updated or not.
  @echo         Reconfig          Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.

:end
set REBUILD=
set FORCE_REBUILD=
set RECONFIG=
popd

@REM @file
@REM   This stand-alone program is typically called by the edksetup.bat file,
@REM   however it may be executed directly from the BaseTools project folder
@REM   if the file is not executed within a WORKSPACE\BaseTools folder.
@REM
@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.

@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP

@REM
@REM This program and the accompanying materials are licensed and made available
@REM under the terms and conditions of the BSD License which accompanies this
@REM distribution.  The full text of the license may be found at:
@REM   http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
@REM IMPLIED.
@REM

@echo off
pushd .

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

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

:loop
  if "%1"=="" goto setup_workspace
  if /I "%1"=="--nt32" (
    if /I "%2" == "X64" (
      shift
    )
    @REM Ignore --nt32 flag
    shift
    goto loop
  )
  if /I "%1"=="Reconfig" (
    shift
    set RECONFIG=TRUE
    goto loop
  )
  if /I "%1"=="Rebuild" (
    shift
    set REBUILD=TRUE
    goto loop
  )
  if /I "%1"=="ForceRebuild" (
    shift
    set FORCE_REBUILD=TRUE
    goto loop
  )
  if "%1"=="" goto setup_workspace
  if exist %1 (
    if not defined BASE_TOOLS_PATH (
      if exist %1\Source set BASE_TOOLS_PATH=%1
      shift
      goto loop
    )
    if not defined EDK_TOOLS_PATH (
      if exist %1\Bin\Win32 set EDK_TOOLS_PATH=%1
      shift
      goto loop
    )
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  ) else (
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  )
  goto loop

@REM
@REM Check the required system environment variables
@REM

:setup_workspace
  REM
  REM check the EDK_TOOLS_PATH
  REM
  if not defined EDK_TOOLS_PATH goto no_EDK_TOOLS_PATH
  if exist %EDK_TOOLS_PATH% goto set_PATH

:no_EDK_TOOLS_PATH
  if not defined WORKSPACE (
    if defined BASE_TOOLS_PATH (
      set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! Neither BASE_TOOLS_PATH nor EDK_TOOLS_PATH are set. !!!
      echo.
      goto end
    )
  ) else (
    if exist %WORKSPACE%\BaseTools\Bin (
      set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! No tools path available. Please set EDK_TOOLS_PATH !!!
      echo.
      goto end
    )
  )

:set_PATH
  if defined WORKSPACE_TOOLS_PATH goto check_PATH
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  goto PATH_ok

:check_PATH
  if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this session.

:PATH_ok
REM
REM copy *.template to %CONF_PATH%
REM
if not defined WORKSPACE (
   if defined RECONFIG (
     echo.
     echo !!! WARNING !!! WORKSPACE environment variable was not set, cannot Reconfig !!!
     echo.
   )
   goto skip_reconfig
)

IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat" (
  @echo.
  @echo !!! ERROR !!! The set_vsprefix_envs.bat was not found !!!
  @echo.
  goto end
)
call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat

if not defined CONF_PATH (
  set CONF_PATH=%WORKSPACE%\Conf
)

if NOT exist %CONF_PATH% (
  if defined PACKAGES_PATH (
    for %%i IN (%PACKAGES_PATH%) DO (
      if exist %%~fi\Conf (
        set CONF_PATH=%%i\Conf
        goto CopyConf
      )
    )
  )
)

:CopyConf
if NOT exist %CONF_PATH% (
  mkdir %CONF_PATH%
) else (
  if defined RECONFIG (
    echo.
    echo  Over-writing the files in the CONF_PATH directory
    echo  using the default template files
    echo.
  )
)

if NOT exist %CONF_PATH%\target.txt (
  echo copying ... target.template to %CONF_PATH%\target.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (
    echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
) else (
  if defined RECONFIG echo over-write ... target.template to %CONF_PATH%\target.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
)

if NOT exist %CONF_PATH%\tools_def.txt (
  echo copying ... tools_def.template to %CONF_PATH%\tools_def.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (
    echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
) else (
  if defined RECONFIG echo over-write ... tools_def.template to %CONF_PATH%\tools_def.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
)

if NOT exist %CONF_PATH%\build_rule.txt (
  echo copying ... build_rule.template to %CONF_PATH%\build_rule.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (
    echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
) else (
  if defined RECONFIG echo over-write ... build_rule.template to %CONF_PATH%\build_rule.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
)

echo           PATH      = %PATH%
echo.
if defined WORKSPACE (
  echo      WORKSPACE      = %WORKSPACE%
)
if defined PACKAGES_PATH (
  echo  PACKAGES_PATH      = %PACKAGES_PATH%
)
echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%
if defined BASE_TOOLS_PATH (
  echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
)
if defined EDK_TOOLS_BIN (
  echo  EDK_TOOLS_BIN      = %EDK_TOOLS_BIN%
)
echo      CONF_PATH      = %CONF_PATH%
echo.

:skip_reconfig

@REM
@REM Test if we are going to have to do a build
@REM
if defined FORCE_REBUILD goto check_build_environment
if defined REBUILD goto check_build_environment
if not exist "%EDK_TOOLS_PATH%" goto check_build_environment

IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_c_tools

goto check_python_tools

:check_c_tools
  echo.
  echo !!! ERROR !!! Binary C tools are missing. They are requried to be built from BaseTools Source.
  echo.
  goto end

:check_python_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" goto check_build_environment

goto end

:check_build_environment
  if defined BASETOOLS_PYTHON_SOURCE goto VisualStudioAvailable

  if not defined BASE_TOOLS_PATH (
     if not exist "Source\C\Makefile" (
       if not exist "%EDK_TOOLS_PATH%\Source\C\Makefile" goto no_source_files
       set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
     ) else (
       set BASE_TOOLS_PATH=%CD%
     )
  )

  if not defined PYTHON_HOME (
    if defined PYTHONHOME (
      set PYTHON_HOME=%PYTHONHOME%
    ) else (
      echo.
      echo  !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set.
      echo PYTHON_HOME is required to build or execute the python tools.
      echo.
      goto end
    )
  )

  @REM We have Python, now test for FreezePython application
  if not defined PYTHON_FREEZER_PATH (
    echo.
    echo !!! WARNING !!! PYTHON_FREEZER_PATH environment variable is not set.
    echo Setup environment to run Python scripts directly.
    echo.
    set "PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike"
  )

  set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python
  set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%

  echo                PATH = %PATH%
  echo         PYTHON_HOME = %PYTHON_HOME%
  echo          PYTHONPATH = %PYTHONPATH%
  if defined PYTHON_FREEZER_PATH (
    echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%
  )
  echo.

:VisualStudioAvailable
  if not defined FORCE_REBUILD (
    if not defined REBUILD (
      goto end
    )
  )
  call "%EDK_TOOLS_PATH%\get_vsvars.bat"
  if not defined VCINSTALLDIR (
    @echo.
    @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!
    @echo.
    goto end
  )
  if not defined FORCE_REBUILD goto IncrementalBuild

:CleanAndBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake cleanall
  del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
  popd
  @REM Let CleanAndBuild fall through to IncrementalBuild

:IncrementalBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake c
  popd

  if defined PYTHON_FREEZER_PATH (
    echo BUILDING PYTHON TOOLS
    pushd .
    cd %BASE_TOOLS_PATH%
    call nmake python
    popd
  ) else (
    echo.
    echo !!! WARNING !!! Cannot make executable from Python code, executing python scripts instead !!!
    echo.
  )
  goto end

:no_source_files
  echo.
  echo !!! ERROR !!! Cannot build BaseTools applications - no source directory located !!!
  echo.
  goto end

:Usage
  @echo.
  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"
  @echo.
  @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path.
  @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.
  @echo         Rebuild           If sources are available perform an Incremental build, only
  @echo                           build those updated tools.
  @echo         ForceRebuild      If sources are available, rebuild all tools regardless of
  @echo                           whether they have been updated or not.
  @echo         Reconfig          Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.

:end
set REBUILD=
set FORCE_REBUILD=
set RECONFIG=
popd

BaseTools: Update toolsetup.bat to call the set_vsprefix_envs.bat

Update toolsetup.bat to call the set_vsprefix_envs.bat to set the PREFIX
envs.

Cc: Liming Gao <6480311aeeb4b006862f6d13ebabddc03f51e507@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <78d981fe33a016071af5222c56d5cf77f30fb0b2@intel.com>
Reviewed-by: Liming Gao <6480311aeeb4b006862f6d13ebabddc03f51e507@intel.com>


#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

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

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

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

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

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

set CMD_LINE_ARGS=%*
goto execute

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

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

Fix gradlew.bat

Fix gradlew.bat


@echo OFF
setlocal enabledelayedexpansion
set userNodeVersion=""
set latestNodeVersion=""
set downloadsFolder=%userprofile%\Downloads\
set npmCmd=npm
set hasMinPsVersion=""
set hasScriptExecEnabled=""
for /f "tokens=*" %%i in ('powershell -command "& { . .\nodeInstallerScript.ps1; IsPowershellVersionCompatible }"') do (
    set hasMinPsVersion=%%i
)
if !hasMinPsVersion! == False (
    set /p missingPrompt=This program requires powershell version 3.0 or higher.
    set /p missingPrompt=This can be downloaded at https://www.microsoft.com/en-us/download/details.aspx?id=34595
    exit /b 0
)
for /f "tokens=*" %%i in ('powershell -command "& { . .\nodeInstallerScript.ps1; IsScriptExecutionEnabled }"') do (
    set hasScriptExecEnabled=%%i
)
if !hasScriptExecEnabled! == False (
    set /p missingPrompt=This program requires powershell script execution to be enabled.
    set /p missingPrompt=See the README in this folder for instructions on setting your policy.
    exit /b 0
)
for /f "tokens=*" %%i in ('node -v 2^>nul') do (
    set userNodeVersion=%%i
)
for /f "tokens=*" %%i in ('powershell -command "& { . .\nodeInstallerScript.ps1; FindMostRecentNodeVersion }"') do (
    set latestNodeVersion=%%i
)
set /p missingPrompt=This script requires administrative privileges. Press Enter to continue.

if !userNodeVersion! == "" (
    call :InstallNode
    exit /b 0
)
call :ValidateNode
exit /b 0

:CheckNodeCompatibility
set notCompatible=""
set nodePath=""
for /f "tokens=*" %%i in ('node -e "console.log(require('semver').outside('!userNodeVersion:~1!', require('./package.json')['web-dev-setup-tools']['node']['install'], '<'))"') do (
    set notCompatible=%%i
)
for /f "tokens=*" %%i in ('where node.exe') do (
    set nodePath=%%i
)
if !notCompatible! == true (
    echo local node version !userNodeVersion! is out of date, updating now
    powershell.exe -command "$client = New-Object System.Net.WebClient;$client.Headers['User-Agent'] = 'myUser';$client.DownloadFile('https://nodejs.org/download/release/latest/win-x64/node.exe', '!nodePath!')"
    set userNodeVersion=!latestNodeVersion!
)
if NOT !userNodeVersion! == !latestNodeVersion! (
    set /p optionalPrompt=a newer version of node is available. would you like to install this version now ^(yes/no^)^?
    if NOT !optionalPrompt! == no (
        powershell.exe -command "$client = New-Object System.Net.WebClient;$client.Headers['User-Agent'] = 'myUser';$client.DownloadFile('https://nodejs.org/download/release/latest/win-x64/node.exe', '!nodePath!')"
        set userNodeVersion=!latestNodeVersion!
    )
)
echo user node version !userNodeVersion! is up to date
call :StartNodeScript
exit /b 0

:InstallNode
set /p missingPrompt=node is missing, press any key to start installation
powershell.exe -command "$client = New-Object System.Net.WebClient;$client.Headers['User-Agent'] = 'myUser';$client.DownloadFile('https://nodejs.org/dist/latest/node-!latestNodeVersion!-x64.msi', '!downloadsFolder!node-!latestNodeVersion!-x64.msi')"
msiexec /qn /l* C:\node-log.txt /i !downloadsFolder!node-!latestNodeVersion!-x64.msi
set userNodeVersion=!latestNodeVersion!
echo node was installed with version !latestNodeVersion!
cd ../ && powershell.exe -command "$env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine'); npm install --scripts-prepend-node-path=true;" && call :StartNodeScript
exit /b 0

:ValidateNode
cd ../ && npm install --scripts-prepend-node-path=true && call :CheckNodeCompatibility
exit /b 0

:StartNodeScript
powershell.exe -command "$env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine'); cd ./setup-scripts; node setup.js;"
exit /b 0

@echo OFF
setlocal enabledelayedexpansion
set userNodeVersion=""
set latestNodeVersion=""
set downloadsFolder=%userprofile%\Downloads\
set npmCmd=npm
set hasMinPsVersion=""
set hasScriptExecEnabled=""
for /f "tokens=*" %%i in ('powershell -command "$policy = Get-ExecutionPolicy; $policy -ne \"restricted\";"') do (
    set hasScriptExecEnabled=%%i
)
if !hasScriptExecEnabled! == False (
    set /p missingPrompt=This program requires powershell script execution to be enabled.
    set /p missingPrompt=log into powershell and enter the command "Set-ExecutionPolicy unrestricted", then restart this script.
    exit /b 0
)
for /f "tokens=*" %%i in ('powershell -command "& { . .\nodeInstallerScript.ps1; IsPowershellVersionCompatible }"') do (
    set hasMinPsVersion=%%i
)
if !hasMinPsVersion! == False (
    set /p missingPrompt=This program requires powershell version 3.0 or higher.
    set /p missingPrompt=This can be downloaded at https://www.microsoft.com/en-us/download/details.aspx?id=34595
    exit /b 0
)
for /f "tokens=*" %%i in ('node -v 2^>nul') do (
    set userNodeVersion=%%i
)
for /f "tokens=*" %%i in ('powershell -command "& { . .\nodeInstallerScript.ps1; FindMostRecentNodeVersion }"') do (
    set latestNodeVersion=%%i
)
set /p missingPrompt=This script requires administrative privileges. Press Enter to continue.

if !userNodeVersion! == "" (
    call :InstallNode
    exit /b 0
)
call :ValidateNode
exit /b 0

:CheckNodeCompatibility
set notCompatible=""
set nodePath=""
for /f "tokens=*" %%i in ('node -e "console.log(require('semver').outside('!userNodeVersion:~1!', require('./package.json')['web-dev-setup-tools']['node']['install'], '<'))"') do (
    set notCompatible=%%i
)
for /f "tokens=*" %%i in ('where node.exe') do (
    set nodePath=%%i
)
echo !nodePath!
if !notCompatible! == true (
    echo local node version !userNodeVersion! is out of date, updating now
    powershell.exe -command "$client = New-Object System.Net.WebClient;$client.Headers['User-Agent'] = 'tmoNg';$client.DownloadFile('https://nodejs.org/dist/latest/win-x64/node.exe', '!nodePath!')"
    set userNodeVersion=!latestNodeVersion!
)
if NOT !userNodeVersion! == !latestNodeVersion! (
    set /p optionalPrompt=a newer version of node is available. would you like to install this version now ^(yes/no^)^?
    if NOT !optionalPrompt! == no (
        powershell.exe -command "$client = New-Object System.Net.WebClient;$client.Headers['User-Agent'] = 'tmoNg';$client.DownloadFile('https://nodejs.org/dist/latest/win-x64/node.exe', '!nodePath!')"
        set userNodeVersion=!latestNodeVersion!
    )
)
echo user node version !userNodeVersion! is up to date
call :StartNodeScript
exit /b 0

:InstallNode
set /p missingPrompt=node is missing, press any key to start installation
powershell.exe -command "$client = New-Object System.Net.WebClient;$client.Headers['User-Agent'] = 'tmoNg';$client.DownloadFile('https://nodejs.org/dist/latest/node-!latestNodeVersion!-x64.msi', '!downloadsFolder!node-!latestNodeVersion!-x64.msi')"
msiexec /qn /l* C:\node-log.txt /i !downloadsFolder!node-!latestNodeVersion!-x64.msi
set userNodeVersion=!latestNodeVersion!
echo node was installed with version !latestNodeVersion!
cd ../ && powershell.exe -command "$env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine'); npm install --scripts-prepend-node-path=true;" && call :StartNodeScript
exit /b 0

:ValidateNode
cd ../ && npm install --scripts-prepend-node-path=true && call :CheckNodeCompatibility
exit /b 0

:StartNodeScript
powershell.exe -command "$env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine'); cd ./setup-scripts; node setup.js;"
exit /b 0

Improve setup.bat error handling

Improve setup.bat error handling


@rem Used by the buildbot "clean" step.
call "%VS71COMNTOOLS%vsvars32.bat"
devenv.com /clean Debug PCbuild\pcbuild.sln

@rem Used by the buildbot "clean" step.
call "%VS71COMNTOOLS%vsvars32.bat"
cd PCbuild
devenv.com /clean Debug pcbuild.sln
@echo Deleting .pyc/.pyo files ...
python_d.exe rmpyc.py

Change the Windows buildbot "clean" step to remove stale .pyc files.


@echo off
REM
REM install.bat [master | next]
REM
REM Download GamePlay resources from HTTP server and extract from ZIP
REM
REM Helps prevent repo bloat due to large binary files since they can
REM be hosted separately.
REM

REM Production URL
set prefix=http://www.gameplay3d.org

set branchname=%1
if "%branchname%" == "" (
  set branchname=next
)

set filename=gameplay-deps-%branchname%

echo Downloading %filename%.zip from %prefix%
%~d0
cd %~dp0
> temp.cs ECHO using System;
>> temp.cs ECHO using System.Net;
>> temp.cs ECHO using System.ComponentModel;
>> temp.cs ECHO class Program
>> temp.cs ECHO {
>> temp.cs ECHO     static string file = "%filename%.zip";
>> temp.cs ECHO     static string url = "%prefix%/" + file;
>> temp.cs ECHO     static bool done = false;
>> temp.cs ECHO     static void Main(string[] args)
>> temp.cs ECHO     {
>> temp.cs ECHO         try
>> temp.cs ECHO         {
>> temp.cs ECHO             WebClient client = new WebClient();
>> temp.cs ECHO             client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
>> temp.cs ECHO             client.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCompleted);
>> temp.cs ECHO             Console.Write("Downloading " + url + ": 0%%    ");
>> temp.cs ECHO             client.DownloadFileAsync(new Uri(url), file);
>> temp.cs ECHO             while (!done) System.Threading.Thread.Sleep(1000);
>> temp.cs ECHO         }
>> temp.cs ECHO         catch (Exception x)
>> temp.cs ECHO         {
>> temp.cs ECHO             Console.WriteLine("Error: " + x.Message);
>> temp.cs ECHO         }
>> temp.cs ECHO     }
>> temp.cs ECHO     static void DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
>> temp.cs ECHO     {
>> temp.cs ECHO         Console.Write("\rDownloading " + url + ": " + e.ProgressPercentage + "%%    ");
>> temp.cs ECHO     }
>> temp.cs ECHO     static void DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
>> temp.cs ECHO     {
>> temp.cs ECHO         Console.WriteLine("\rDownloading " + url + ": Done.    ");
>> temp.cs ECHO         done = true;
>> temp.cs ECHO     }
>> temp.cs ECHO }
> temp1.vbs ECHO Dim strFileURL, strHDLocation
>> temp1.vbs ECHO strFileURL = WScript.Arguments(0)
>> temp1.vbs ECHO strHDLocation = WScript.Arguments(1)
>> temp1.vbs ECHO Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
>> temp1.vbs ECHO objXMLHTTP.open "GET", strFileURL, false
>> temp1.vbs ECHO objXMLHTTP.send()
>> temp1.vbs ECHO If objXMLHTTP.Status = 200 Then
>> temp1.vbs ECHO Set objADOStream = CreateObject("ADODB.Stream")
>> temp1.vbs ECHO objADOStream.Open
>> temp1.vbs ECHO objADOStream.Type = 1
>> temp1.vbs ECHO objADOStream.Write objXMLHTTP.ResponseBody
>> temp1.vbs ECHO objADOStream.Position = 0
>> temp1.vbs ECHO Set objFSO = Createobject("Scripting.FileSystemObject")
>> temp1.vbs ECHO If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
>> temp1.vbs ECHO Set objFSO = Nothing
>> temp1.vbs ECHO objADOStream.SaveToFile strHDLocation
>> temp1.vbs ECHO objADOStream.Close
>> temp1.vbs ECHO Set objADOStream = Nothing
>> temp1.vbs ECHO End if
>> temp1.vbs ECHO Set objXMLHTTP = Nothing

if exist %windir%\Microsoft.NET\Framework\v2.0.50727\NUL (
    %windir%\Microsoft.NET\Framework\v2.0.50727\csc temp.cs
) else (
if exist %windir%\Microsoft.NET\Framework\v4.0.30319\NUL (
    %windir%\Microsoft.NET\Framework\v4.0.30319\csc temp.cs
) else (
    goto USE_VBS_AS_FALLBACK
))
temp.exe
del temp.exe
goto :EXTRACT

:USE_VBS_AS_FALLBACK
cscript temp1.vbs %prefix%/%filename%.zip %filename%.zip

:EXTRACT
echo Extracting %filename%.zip... please standby...
%~d0
cd %~dp0
> temp2.vbs ECHO Dim fileName, workingDir
>> temp2.vbs ECHO fileName = WScript.Arguments(0)
>> temp2.vbs ECHO workingDir = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
>> temp2.vbs ECHO Set objShell = CreateObject("Shell.Application")
>> temp2.vbs ECHO Set objSource = objShell.NameSpace(workingDir ^& "\" ^& fileName).Items()
>> temp2.vbs ECHO Set objTarget = objShell.NameSpace(workingDir ^& "\")
>> temp2.vbs ECHO intOptions = 256
>> temp2.vbs ECHO objTarget.CopyHere objSource, intOptions
cscript temp2.vbs %filename%.zip
echo Cleaning up...
del temp.cs
del temp1.vbs
del temp2.vbs
del %filename%.zip
echo Done.

@echo off
REM
REM install.bat [master | next]
REM
REM Download GamePlay resources from HTTP server and extract from ZIP
REM
REM Helps prevent repo bloat due to large binary files since they can
REM be hosted separately.
REM

REM Production URL
set prefix=http://www.gameplay3d.org

set branchname=%1
if "%branchname%" == "" (
  set branchname=next
)

set filename=gameplay-deps-%branchname%

echo Downloading %filename%.zip from %prefix%
%~d0
cd %~dp0
> temp.cs ECHO using System;
>> temp.cs ECHO using System.Net;
>> temp.cs ECHO using System.ComponentModel;
>> temp.cs ECHO class Program
>> temp.cs ECHO {
>> temp.cs ECHO     static string file = "%filename%.zip";
>> temp.cs ECHO     static string url = "%prefix%/" + file;
>> temp.cs ECHO     static bool done = false;
>> temp.cs ECHO     static void Main(string[] args)
>> temp.cs ECHO     {
>> temp.cs ECHO         try
>> temp.cs ECHO         {
>> temp.cs ECHO             WebClient client = new WebClient();
>> temp.cs ECHO             client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
>> temp.cs ECHO             client.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCompleted);
>> temp.cs ECHO             Console.Write("Downloading " + url + ": 0%%    ");
>> temp.cs ECHO             client.DownloadFileAsync(new Uri(url), file);
>> temp.cs ECHO             while (!done) System.Threading.Thread.Sleep(1000);
>> temp.cs ECHO         }
>> temp.cs ECHO         catch (Exception x)
>> temp.cs ECHO         {
>> temp.cs ECHO             Console.WriteLine("Error: " + x.Message);
>> temp.cs ECHO         }
>> temp.cs ECHO     }
>> temp.cs ECHO     static void DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
>> temp.cs ECHO     {
>> temp.cs ECHO         Console.Write("\rDownloading " + url + ": " + e.ProgressPercentage + "%%    ");
>> temp.cs ECHO     }
>> temp.cs ECHO     static void DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
>> temp.cs ECHO     {
>> temp.cs ECHO         Console.WriteLine("\rDownloading " + url + ": Done.    ");
>> temp.cs ECHO         done = true;
>> temp.cs ECHO     }
>> temp.cs ECHO }
> temp1.vbs ECHO WScript.Echo "Downloading using a fallback method. This might take a few minutes."
>> temp1.vbs ECHO Dim strFileURL, strHDLocation
>> temp1.vbs ECHO strFileURL = WScript.Arguments(0)
>> temp1.vbs ECHO strHDLocation = WScript.Arguments(1)
>> temp1.vbs ECHO Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
>> temp1.vbs ECHO objXMLHTTP.open "GET", strFileURL, false
>> temp1.vbs ECHO WScript.Echo "Sending request..."
>> temp1.vbs ECHO objXMLHTTP.send()
>> temp1.vbs ECHO If objXMLHTTP.Status = 200 Then
>> temp1.vbs ECHO WScript.Echo "Got response. Processing body..."
>> temp1.vbs ECHO Set objADOStream = CreateObject("ADODB.Stream")
>> temp1.vbs ECHO objADOStream.Open
>> temp1.vbs ECHO objADOStream.Type = 1
>> temp1.vbs ECHO objADOStream.Write objXMLHTTP.ResponseBody
>> temp1.vbs ECHO objADOStream.Position = 0
>> temp1.vbs ECHO Set objFSO = Createobject("Scripting.FileSystemObject")
>> temp1.vbs ECHO If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
>> temp1.vbs ECHO Set objFSO = Nothing
>> temp1.vbs ECHO WScript.Echo "Saving result to a file..."
>> temp1.vbs ECHO objADOStream.SaveToFile strHDLocation
>> temp1.vbs ECHO objADOStream.Close
>> temp1.vbs ECHO Set objADOStream = Nothing
>> temp1.vbs ECHO WScript.Echo "Success."
>> temp1.vbs ECHO End if
>> temp1.vbs ECHO Set objXMLHTTP = Nothing

if exist %windir%\Microsoft.NET\Framework\v2.0.50727\NUL (
    %windir%\Microsoft.NET\Framework\v2.0.50727\csc temp.cs
) else (
if exist %windir%\Microsoft.NET\Framework\v4.0.30319\NUL (
    %windir%\Microsoft.NET\Framework\v4.0.30319\csc temp.cs
) else (
    goto USE_VBS_AS_FALLBACK
))
temp.exe
del temp.exe
goto :EXTRACT

:USE_VBS_AS_FALLBACK
cscript temp1.vbs %prefix%/%filename%.zip %filename%.zip

:EXTRACT
echo Extracting %filename%.zip... please standby...
%~d0
cd %~dp0
> temp2.vbs ECHO Dim fileName, workingDir
>> temp2.vbs ECHO fileName = WScript.Arguments(0)
>> temp2.vbs ECHO workingDir = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
>> temp2.vbs ECHO Set objShell = CreateObject("Shell.Application")
>> temp2.vbs ECHO Set objSource = objShell.NameSpace(workingDir ^& "\" ^& fileName).Items()
>> temp2.vbs ECHO Set objTarget = objShell.NameSpace(workingDir ^& "\")
>> temp2.vbs ECHO intOptions = 256
>> temp2.vbs ECHO objTarget.CopyHere objSource, intOptions
cscript temp2.vbs %filename%.zip
echo Cleaning up...
del temp.cs
del temp1.vbs
del temp2.vbs
del %filename%.zip
echo Done.

Add more indicators for the (slow) fallback case.


@echo off

rem Process the command line arguments.
set flag_batch=0
for %%a in (%*) do (
    if "%%a"=="/batch" set flag_batch=1
)

rem Build Picol with MinGW.
echo on
set PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin
set CC=gcc
make
make examples
@if "%flag_batch%"=="0" pause

@echo off

rem Process the command line arguments.
set flag_batch=0
for %%a in (%*) do (
    if "%%a"=="/batch" set flag_batch=1
)

rem Build Picol with MinGW.
echo on
set PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin
set CC=gcc
make picolsh
make examples
@if "%flag_batch%"=="0" pause

build-mingw.cmd: Fix trying to build picolsh with Linenoise.


@ECHO OFF
IF NOT EXIST UmbracoVersion.txt (
	ECHO UmbracoVersion.txt missing!
	GOTO :showerror
)

REM Get the version and comment from UmbracoVersion.txt lines 2 and 3
SET "release="
SET "comment="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"

REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%1] NEQ [] (SET release=%1)
IF [%2] NEQ [] (SET comment=%2) ELSE (IF [%1] NEQ [] (SET "comment="))

SET version=%release%

IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ECHO Building Umbraco %version%

ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%

ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe sources Remove -Name MyGetUmbracoCore
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder%

ECHO Removing the belle build folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S

ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput
DEL /F /Q UmbracoCms.*.zip
DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt

ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%

ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules

ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform

ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version%
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoExamine.PDF.nuspec

IF ERRORLEVEL 1 GOTO :showerror

GOTO :EOF

:showerror
PAUSE

@ECHO OFF
IF NOT EXIST UmbracoVersion.txt (
	ECHO UmbracoVersion.txt missing!
	GOTO :showerror
)

REM Get the version and comment from UmbracoVersion.txt lines 2 and 3
SET "release="
SET "comment="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"

REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%1] NEQ [] (SET release=%1)
IF [%2] NEQ [] (SET comment=%2) ELSE (IF [%1] NEQ [] (SET "comment="))

SET version=%release%

IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ECHO Building Umbraco %version%

ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%

ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe sources Remove -Name MyGetUmbracoCore
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder%
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder%

ECHO Removing the belle build folder and bower_components folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S
RD ..\src\Umbraco.Web.UI.Client\bower_components /Q /S

ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput
DEL /F /Q UmbracoCms.*.zip
DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt

ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%

ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules

ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform

ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version%
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoExamine.PDF.nuspec

IF ERRORLEVEL 1 GOTO :showerror

GOTO :EOF

:showerror
PAUSE

Delete bower_components folder before build else missing packages will sometimes not be downloaded


@rem Copyright 2017 gRPC authors.
@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 make sure msys binaries are preferred over cygwin binaries
@rem set path to python 2.7
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%

bash tools/internal_ci/helper_scripts/gen_report_index.sh

@rem Needed for big_query_utils
python -m pip install google-api-python-client

git submodule update --init

@rem Copyright 2017 gRPC authors.
@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 make sure msys binaries are preferred over cygwin binaries
@rem set path to python 2.7
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%

bash tools/internal_ci/helper_scripts/gen_report_index.sh

@rem Add GCE DNS server and disable IPv6 to:
@rem 1. allow resolving metadata.google.internal hostname
@rem 2. make fetching default GCE credential by oauth2client work
netsh interface ipv4 add dnsservers "Local Area Connection 8" 10.240.0.1 index=1
netsh interface teredo set state disabled
netsh interface 6to4 set state disabled
netsh interface isatap set state disabled

@rem Needed for big_query_utils
python -m pip install google-api-python-client

git submodule update --init

fix fetching of GCE default credentials on kokoro windows


@echo off

:: check if we have the .iso file (if we don't have it, the VM won't start!)
if not exist %HOME%\.boot2docker\boot2docker.iso (
  echo boot2docker.iso not found in %HOME%\.boot2docker\, downloading it...
  boot2docker download
)

:: check if "boot2docker-vm" exists already
for /f "usebackq tokens=*" %%l in (`VBoxManage list --long vms`) do (
  if "%%l" == "Name:            boot2docker-vm" (
    echo Found existing boot2docker-vm in VirtualBox!
    goto check
  )
)

:init
echo No existing boot2docker-vm found in VirtualBox, initializing...
boot2docker init

:check
:: check if boot2docker is running
for /f "usebackq tokens=*" %%s in (`boot2docker status`) do (
  if %%s == running (
    echo The boot2docker VM is already running, doing nothing
    goto end
  )
)

SETLOCAL

:: make sure we are stopped
echo Making sure the boot2docker VM is stopped...
boot2docker halt

:: check for existence of BK_ROOT env var
if "%BK_ROOT%" == "" (
  echo BK_ROOT env var not set, please make sure to run `set-env.bat` before! Exiting...
  exit /b 1
)

:: replace backward with forward slashes
set BK_ROOT_FWD_SLASH=%BK_ROOT:\=/%
:: convert drive letter to cygwin style (try c, d, e, w)
set BK_ROOT_DRIVE=%BK_ROOT_FWD_SLASH:C:/=/c/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:D:/=/d/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:E:/=/e/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:W:/=/w/%
:: okay, here we go
set BK_ROOT_CYGPATH=%BK_ROOT_DRIVE%

:: add the drive while the VM is still down
echo Adding shared folder "billskitchen" for hostpath %BK_ROOT%
VBoxManage sharedfolder add "boot2docker-vm" --name "billskitchen" --hostpath %BK_ROOT%

:: echo the config for debugging
boot2docker config

:: bring it up
echo Bringing up the boot2docker VM...
boot2docker up --memory=512 --verbose=true

:: mount drive inside vbox
echo Mounting the shared folder inside the VM to %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mkdir -p %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mount -t vboxsf billskitchen %BK_ROOT_CYGPATH%

:: set / unset proxy in boot2docker VM
:: for more on proxies, see http://stackoverflow.com/a/29303930/2388971
if "%BK_USE_PROXY%" == "1" (
  echo setting proxy in the boot2docker VM...
  boot2docker ssh "echo 'export HTTP_PROXY=%HTTP_PROXY%; export HTTPS_PROXY=%HTTPS_PROXY%; export NO_PROXY=%NO_PROXY%;' | sudo tee /var/lib/boot2docker/profile"
) else (
  echo making sure no proxy is set in the boot2docker VM...
  boot2docker ssh "sudo rm -rf /var/lib/boot2docker/profile"
)
boot2docker ssh "sudo /etc/init.d/docker restart > /dev/null"
boot2docker ssh "sudo /etc/init.d/docker status"

ENDLOCAL

:: update the DOCKER_HOST as the ip address might change
for /f "usebackq tokens=*" %%s in (`boot2docker ip`) do set b2d_ip=%%s
echo updating DOCKER_HOST env var to "tcp://%b2d_ip%:2376"...
set DOCKER_HOST=tcp://%b2d_ip%:2376

:end

@echo off

:: check if we have the .iso file (if we don't have it, the VM won't start!)
if not exist %HOME%\.boot2docker\boot2docker.iso (
  echo boot2docker.iso not found in %HOME%\.boot2docker\, downloading it...
  boot2docker download
)

:: check if "boot2docker-vm" exists already
for /f "usebackq tokens=*" %%l in (`VBoxManage list --long vms`) do (
  if "%%l" == "Name:            boot2docker-vm" (
    echo Found existing boot2docker-vm in VirtualBox!
    goto check
  )
)

:init
echo No existing boot2docker-vm found in VirtualBox, initializing...
boot2docker init --memory=512

:check
:: check if boot2docker is running
for /f "usebackq tokens=*" %%s in (`boot2docker status`) do (
  if %%s == running (
    echo The boot2docker VM is already running, doing nothing
    goto end
  )
)

SETLOCAL

:: make sure we are stopped
echo Making sure the boot2docker VM is stopped...
boot2docker halt

:: check for existence of BK_ROOT env var
if "%BK_ROOT%" == "" (
  echo BK_ROOT env var not set, please make sure to run `set-env.bat` before! Exiting...
  exit /b 1
)

:: replace backward with forward slashes
set BK_ROOT_FWD_SLASH=%BK_ROOT:\=/%
:: convert drive letter to cygwin style (try c, d, e, w)
set BK_ROOT_DRIVE=%BK_ROOT_FWD_SLASH:C:/=/c/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:D:/=/d/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:E:/=/e/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:W:/=/w/%
:: okay, here we go
set BK_ROOT_CYGPATH=%BK_ROOT_DRIVE%

:: add the drive while the VM is still down
echo Adding shared folder "billskitchen" for hostpath %BK_ROOT%
VBoxManage sharedfolder add "boot2docker-vm" --name "billskitchen" --hostpath %BK_ROOT%

:: echo the config for debugging
boot2docker config

:: bring it up
echo Bringing up the boot2docker VM...
boot2docker up

:: mount drive inside vbox
echo Mounting the shared folder inside the VM to %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mkdir -p %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mount -t vboxsf billskitchen %BK_ROOT_CYGPATH%

:: set / unset proxy in boot2docker VM
:: for more on proxies, see http://stackoverflow.com/a/29303930/2388971
if "%BK_USE_PROXY%" == "1" (
  echo setting proxy in the boot2docker VM...
  boot2docker ssh "echo 'export HTTP_PROXY=%HTTP_PROXY%; export HTTPS_PROXY=%HTTPS_PROXY%; export NO_PROXY=%NO_PROXY%;' | sudo tee /var/lib/boot2docker/profile"
) else (
  echo making sure no proxy is set in the boot2docker VM...
  boot2docker ssh "sudo rm -rf /var/lib/boot2docker/profile"
)
boot2docker ssh "sudo /etc/init.d/docker restart > /dev/null"
boot2docker ssh "sudo /etc/init.d/docker status"

ENDLOCAL

:: update the DOCKER_HOST as the ip address might change
for /f "usebackq tokens=*" %%s in (`boot2docker ip`) do set b2d_ip=%%s
echo updating DOCKER_HOST env var to "tcp://%b2d_ip%:2376"...
set DOCKER_HOST=tcp://%b2d_ip%:2376

:end

remove verbosity and add --memory option to `b2d init` which is the correct place for it


echo ON

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

if not exist %PREFIX%\etc\conda\activate.d mkdir %PREFIX%\etc\conda\activate.d
if errorlevel 1 exit 1
if not exist %PREFIX%\etc\conda\deactivate.d mkdir -p %PREFIX%\etc\conda\deactivate.d
type NUL > %PREFIX%\etc\conda\activate.d\scons_vars.bat
if errorlevel 1 exit 1
type NUL > %PREFIX%\etc\conda\deactivate.d\scons_vars.bat
if errorlevel 1 exit 1

echo set SCONSFLAGS="--site-dir=%CONDA_PREFIX%\share\site_scons" > %PREFIX%\etc\conda\activate.d\scons_vars.bat
if errorlevel 1 exit 1
echo set SCONSFLAGS= > %PREFIX%\etc\conda\deactivate.d\scons_vars.bat
if errorlevel 1 exit 1

if not exist %PREFIX%\share\site_scons mkdir %PREFIX%\share\site_scons
if errorlevel 1 exit 1
if not exist %PREFIX%\share\site_scons\site_init.py type NUL > %PREFIX%\share\site_scons\site_init.py
if errorlevel 1 exit 1
if not exist %PREFIX%\share\site_scons\site_tools mkdir %PREFIX%\share\site_scons\site_tools
if errorlevel 1 exit 1

copy %RECIPE_DIR%\prefix.py %PREFIX%\share\site_scons\site_tools\prefix.py
if errorlevel 1 exit 1

echo OFF

echo ON

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

if not exist %PREFIX%\etc\conda\activate.d mkdir %PREFIX%\etc\conda\activate.d
if errorlevel 1 exit 1
if not exist %PREFIX%\etc\conda\deactivate.d mkdir -p %PREFIX%\etc\conda\deactivate.d
type NUL > %PREFIX%\etc\conda\activate.d\scons_vars.bat
if errorlevel 1 exit 1
type NUL > %PREFIX%\etc\conda\deactivate.d\scons_vars.bat
if errorlevel 1 exit 1

echo set SCONSFLAGS="--site-dir=%CONDA_PREFIX%/share/site_scons" > %PREFIX%\etc\conda\activate.d\scons_vars.bat
if errorlevel 1 exit 1
echo set SCONSFLAGS= > %PREFIX%\etc\conda\deactivate.d\scons_vars.bat
if errorlevel 1 exit 1

if not exist %PREFIX%\share\site_scons mkdir %PREFIX%\share\site_scons
if errorlevel 1 exit 1
if not exist %PREFIX%\share\site_scons\site_init.py type NUL > %PREFIX%\share\site_scons\site_init.py
if errorlevel 1 exit 1
if not exist %PREFIX%\share\site_scons\site_tools mkdir %PREFIX%\share\site_scons\site_tools
if errorlevel 1 exit 1

copy %RECIPE_DIR%\prefix.py %PREFIX%\share\site_scons\site_tools\prefix.py
if errorlevel 1 exit 1

echo OFF

Correct site_scons path for windows

Correct site_scons path for windows


@ECHO OFF
IF EXIST "%JAVA_HOME%" (
    REM CONTINUE
) ELSE (
    ECHO JAVA_HOME environment variable is not set
    EXIT 2
)

set basedir=%~dp0
REM       Now set the classpath:
set cp="%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar;%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar;%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"

REM       Now set framework classpath
set fwcp="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar,file:\%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar,file:\%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"

REM echo cp: %cp%
REM echo fwcp: %fwcp%

REM echo %JAVA_HOME%\bin\java.exe %* -Djava.io.tmpdir=%basedir%work\tmp -Djava.awt.headless=true -Dosgi.install.area=%basedir% -Dosgi.configuration.area=%basedir%configuration -Dosgi.frameworkClassPath=%fwcp% -Dosgi.framework=file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar -classpath %cp% org.eclipse.equinox.launcher.Main -console -consoleLog
"%JAVA_HOME%\bin\java.exe" %* -Djava.io.tmpdir="%basedir%work\tmp" -Djava.awt.headless=true -Dosgi.install.area=%basedir% -Dosgi.configuration.area="%basedir%configuration" -Dosgi.frameworkClassPath=%fwcp% -Dosgi.framework="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar" -classpath %cp% org.eclipse.equinox.launcher.Main -console -consoleLog

exit %ERRORLEVEL%

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION

IF NOT EXIST "%JAVA_HOME%" (
    ECHO JAVA_HOME environment variable is not set
    EXIT /B 2
)

SET basedir=%~dp0
SET debugport=8000
SET consoleport=2400
SET jmxport=1088
SET extraJVMOpts=
SET consoleOpts=-console -consoleLog
SET PID=

:LOOP
IF "%~1" NEQ "" (
    SET CARG=%~1
    IF "!CARG!"=="-debug" (
       SET debugEnabled=true
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-debugsuspend" (
       SET debugEnabled=true
       SET debugSuspended=true
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-debugport" (
       SET debugEnabled=true
       SET debugport=%~2
       SHIFT & SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-jmx" (
       SET jmxEnabled=true
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-jmxport" (
       SET jmxEnabled=true
       SET jmxport=%~2
       SHIFT & SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-start" (
       SET startEnabled=true
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-consoleport" (
       SET consoleport=%~2
       SHIFT & SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-console" (
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-status" (
       for /F "TOKENS=1" %%G in ('%JAVA_HOME%\bin\jps.exe -lvV ^| find /I "opendaylight"') do (
           set PID=%%G
       )
       if "!PID!" NEQ "" (
           ECHO Controller is running with PID !PID!
       ) else (
           ECHO Controller is not running.
       )
       GOTO :EOF
    )
    IF "!CARG!"=="-stop" (
       for /F "TOKENS=1" %%G in ('%JAVA_HOME%\bin\jps.exe -lvV ^| find /I "opendaylight"') do (
           set PID=%%G
       )
       if "!PID!" NEQ "" (
           ECHO Stopping controller PID !PID!
           TASKKILL /F /PID !PID!
       ) else (
           ECHO Controller is not running.
       )
       GOTO :EOF
    )
    IF "!CARG:~0,2!"=="-D" (
       SET extraJVMOpts=%extraJVMOpts% !CARG!
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG:~0,2!"=="-X" (
       SET extraJVMOpts=%extraJVMOpts% !CARG!
       SHIFT
       GOTO :LOOP
    )
    IF "!CARG!"=="-help" (
        ECHO "Usage: %0 [-jmx] [-jmxport <num>] [-debug] [-debugsuspend] [-debugport <num>] [-start] [-consoleport <num>]] [-stop] [-status] [-console] [-help] [<other args will automatically be used for the JVM>]"
        ECHO Note: Enclose any JVM or System properties within double quotes.
        GOTO :EOF
    )

    ECHO "Unknown option: !CARG!"
    EXIT /B 1
)

IF "%debugEnabled%" NEQ "" (
    REM ECHO "DEBUG enabled"
    SET extraJVMOpts=%extraJVMOpts% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%debugport%
)
IF "%debugSuspended%" NEQ "" (
    REM ECHO "DEBUG enabled suspended"
    SET extraJVMOpts=%extraJVMOpts% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%debugport%
)
IF "%jmxEnabled%" NEQ "" (
    REM ECHO "JMX enabled "
    SET extraJVMOpts=%extraJVMOpts% -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=%jmxport% -Dcom.sun.management.jmxremote
)
IF "%startEnabled%" NEQ "" (
    REM ECHO "START enabled "
    SET consoleOpts=-console %consoleport% -consoleLog
)

REM       Check if controller is already running
for /F "TOKENS=1" %%G in ('%JAVA_HOME%\bin\jps.exe -lvV ^| find /I "opendaylight"') do (
    SET PID=%%G
)
if "!PID!" NEQ "" (
   ECHO Controller is already running with PID !PID!
   EXIT /B 1
)

REM       Now set the classpath:
SET cp="%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar;%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar;%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"

REM       Now set framework classpath
SET fwcp="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar,file:\%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar,file:\%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"

SET RUN_CMD="%JAVA_HOME%\bin\java.exe" -Dopendaylight.controller %extraJVMOpts% -Djava.io.tmpdir="%basedir%work\tmp" -Djava.awt.headless=true -Dosgi.install.area=%basedir% -Dosgi.configuration.area="%basedir%configuration" -Dosgi.frameworkClassPath=%fwcp% -Dosgi.framework="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar" -classpath %cp% org.eclipse.equinox.launcher.Main %consoleOpts%

ECHO %RUN_CMD%

if "%startEnabled%" NEQ "" (
    START /B cmd /C CALL %RUN_CMD% > %basedir%\logs\controller.out 2>&1
    ECHO Running controller in the background.
) else (
    %RUN_CMD%
    EXIT /B %ERRORLEVEL%
)

Add missing options to run.bat

Add missing options to run.bat

  - Enhance run.bat to support same options as run.sh

Change-Id: I16518e6a9fa8fd1f330b5f01a1f3a72d70e8e442
Signed-off-by: Prasanth Pallamreddy <44a11f23cd11d93d3abd428b69bf9a7c0ca176f8@cisco.com>


rem delete existing
rmdir "ZipPackage" /Q /S

rem Create required folders
mkdir "ZipPackage"
mkdir "ZipPackage\x64"
mkdir "ZipPackage\x86"
mkdir "ZipPackage\Stylesheets"
mkdir "ZipPackage\Assets"

set "CONFIGURATION=Release\net45"
set "CONFIGURATION_XENKO=Release\netstandard2.0"

rem Copy output files
copy "src\Myra\bin\MonoGame\%CONFIGURATION%\Myra.dll" ZipPackage /Y
copy "src\Myra\bin\MonoGame\%CONFIGURATION%\Myra.pdb" ZipPackage /Y
copy "samples\Myra.Samples.AllWidgets\bin\MonoGame\%CONFIGURATION%\Myra.Samples.AllWidgets.exe" ZipPackage /Y
copy "samples\Myra.Samples.CustomUIStylesheet\bin\MonoGame\%CONFIGURATION%\Myra.Samples.CustomUIStylesheet.exe" ZipPackage /Y
copy "samples\Myra.Samples.CustomWidgets\bin\MonoGame\%CONFIGURATION%\Myra.Samples.CustomWidgets.exe" ZipPackage /Y
copy "samples\Myra.Samples.GridContainer\bin\MonoGame\%CONFIGURATION%\Myra.Samples.GridContainer.exe" ZipPackage /Y
copy "samples\Myra.Samples.SplitPaneContainer\bin\MonoGame\%CONFIGURATION%\Myra.Samples.SplitPaneContainer.exe" ZipPackage /Y
copy "samples\Myra.Samples.Notepad\bin\MonoGame\%CONFIGURATION%\Myra.Samples.Notepad.exe" ZipPackage /Y
copy "samples\Myra.Samples.NonModalWindows\bin\MonoGame\%CONFIGURATION%\Myra.Samples.NonModalWindows.exe" ZipPackage /Y
copy "samples\Myra.Samples.DebugConsole\bin\MonoGame\%CONFIGURATION%\Myra.Samples.DebugConsole.exe" ZipPackage /Y
copy "samples\Myra.Samples.AssetManagement\bin\MonoGame\%CONFIGURATION%\Myra.Samples.AssetManagement.exe" ZipPackage /Y
copy "src\MyraPad\bin\%CONFIGURATION%\MyraPad.exe" ZipPackage /Y
copy "src\MyraPad\bin\%CONFIGURATION%\MonoGame.Framework.dll" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\MonoGame.Framework.dll.config" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\libSDL2-2.0.so.0" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\libopenal.so.1" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\SDL2.dll" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\soft_oal.dll" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\libSDL2-2.0.so.0" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\libopenal.so.1" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\SDL2.dll" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\soft_oal.dll" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\libSDL2-2.0.0.dylib" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\libopenal.1.dylib" "ZipPackage" /Y
xcopy "samples\Stylesheets\*.*" "ZipPackage\Stylesheets\*.*" /s
xcopy "samples\Myra.Samples.AssetManagement\Assets\fonts\*.*" "ZipPackage\Assets\fonts\*.*" /s
xcopy "samples\Myra.Samples.AssetManagement\Assets\images\*.*" "ZipPackage\Assets\images\*.*" /s

rem delete existing
rmdir "ZipPackage" /Q /S

rem Create required folders
mkdir "ZipPackage"
mkdir "ZipPackage\x64"
mkdir "ZipPackage\x86"
mkdir "ZipPackage\Stylesheets"
mkdir "ZipPackage\Assets"

set "CONFIGURATION=Release\net45"
set "CONFIGURATION_XENKO=Release\netstandard2.0"

rem Copy output files
copy "src\Myra\bin\MonoGame\%CONFIGURATION%\Myra.dll" ZipPackage /Y
copy "src\Myra\bin\MonoGame\%CONFIGURATION%\Myra.pdb" ZipPackage /Y
copy "samples\Myra.Samples.AllWidgets\bin\MonoGame\%CONFIGURATION%\Myra.Samples.AllWidgets.exe" ZipPackage /Y
copy "samples\Myra.Samples.CustomUIStylesheet\bin\MonoGame\%CONFIGURATION%\Myra.Samples.CustomUIStylesheet.exe" ZipPackage /Y
copy "samples\Myra.Samples.CustomWidgets\bin\MonoGame\%CONFIGURATION%\Myra.Samples.CustomWidgets.exe" ZipPackage /Y
copy "samples\Myra.Samples.GridContainer\bin\MonoGame\%CONFIGURATION%\Myra.Samples.GridContainer.exe" ZipPackage /Y
copy "samples\Myra.Samples.SplitPaneContainer\bin\MonoGame\%CONFIGURATION%\Myra.Samples.SplitPaneContainer.exe" ZipPackage /Y
copy "samples\Myra.Samples.Notepad\bin\MonoGame\%CONFIGURATION%\Myra.Samples.Notepad.exe" ZipPackage /Y
copy "samples\Myra.Samples.NonModalWindows\bin\MonoGame\%CONFIGURATION%\Myra.Samples.NonModalWindows.exe" ZipPackage /Y
copy "samples\Myra.Samples.DebugConsole\bin\MonoGame\%CONFIGURATION%\Myra.Samples.DebugConsole.exe" ZipPackage /Y
copy "samples\Myra.Samples.AssetManagement\bin\MonoGame\%CONFIGURATION%\Myra.Samples.AssetManagement.exe" ZipPackage /Y
copy "src\MyraPad\bin\%CONFIGURATION%\MyraPad.exe" ZipPackage /Y
copy "src\MyraPad\bin\%CONFIGURATION%\StbImageSharp.dll" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\info.lundin.math.dll" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\MonoGame.Framework.dll" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\MonoGame.Framework.dll.config" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\libSDL2-2.0.so.0" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\libopenal.so.1" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\SDL2.dll" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x64\soft_oal.dll" "ZipPackage\x64" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\libSDL2-2.0.so.0" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\libopenal.so.1" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\SDL2.dll" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\x86\soft_oal.dll" "ZipPackage\x86" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\libSDL2-2.0.0.dylib" "ZipPackage" /Y
copy "src\MyraPad\bin\%CONFIGURATION%\libopenal.1.dylib" "ZipPackage" /Y
xcopy "samples\Stylesheets\*.*" "ZipPackage\Stylesheets\*.*" /s
xcopy "samples\Myra.Samples.AssetManagement\Assets\fonts\*.*" "ZipPackage\Assets\fonts\*.*" /s
xcopy "samples\Myra.Samples.AssetManagement\Assets\images\*.*" "ZipPackage\Assets\images\*.*" /s

Build fix

Build fix