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

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.11
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

:: #region ORCHARD ENVIRONMENTAL VARIABLES
:: ------------
SET SITE_DIR=%~dp0%..
SET DEPLOYMENT_SOURCE=%~dp0%.
SET DEPLOYMENT_TARGET=%SITE_DIR%\wwwroot
SET DEPLOYMENT_TEMP="%DEPLOYMENT_SOURCE%\build\precompiled"
SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
:: ---------------
:: #endregion ORCHARD ENVIRONMENTAL VARIABLES

SET ARTIFACTS=%SITE_DIR%\artifacts

:: #region For local testing, create artifacts dir
:: ------------
IF NOT EXIST ARTIFACTS (
  mkdir ARTIFACTS
)
:: ------------
:: #endregion

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

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

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

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

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

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

:: 1. Restore NuGet packages
IF /I "src\Orchard.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\src\Orchard.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /nologo /verbosity:m /t:Precompiled /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

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

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

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

goto end

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.11
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

:: 1. Restore NuGet packages
IF /I "src\Orchard.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\src\Orchard.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /nologo /verbosity:m /t:Precompiled /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /nologo /verbosity:m /t:Precompiled /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

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

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

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

goto end

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Remove unecessary stuff.

Remove unecessary stuff.


SETLOCAL
SET VERSION=%1
REM CALL Scripts\buildpack %VERSION% || exit /B 1
REM nuget push .\Artifacts\Mapsui.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Forms.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Native.%VERSION%.nupkg -source nuget.org || exit /B 1
git commit -m %VERSION% -a || exit /B 1
git tag %VERSION% || exit /B 1
git push origin %VERSION% || exit /B 1
git push || exit /B 1

SETLOCAL
SET VERSION=%1
CALL Scripts\buildpack %VERSION% || exit /B 1
nuget push .\Artifacts\Mapsui.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Forms.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Native.%VERSION%.nupkg -source nuget.org || exit /B 1
git commit -m %VERSION% -a || exit /B 1
git tag %VERSION% || exit /B 1
git push origin %VERSION% || exit /B 1
git push || exit /B 1

Revert temporary change to buildpackpush.bat


SETLOCAL
SET VERSION=%1
REM CALL Scripts\buildpack %VERSION% || exit /B 1
REM nuget push .\Artifacts\Mapsui.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Forms.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Wpf.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.iOS.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Android.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Uwp.%VERSION%.nupkg -source nuget.org || exit /B 1
git commit -m %VERSION% -a || exit /B 1
git tag %VERSION% || exit /B 1
git push origin %VERSION% || exit /B 1
git push || exit /B 1

SETLOCAL
SET VERSION=%1
CALL Scripts\buildpack %VERSION% || exit /B 1
nuget push .\Artifacts\Mapsui.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Forms.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Wpf.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.iOS.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Android.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Uwp.%VERSION%.nupkg -source nuget.org || exit /B 1
git commit -m %VERSION% -a || exit /B 1
git tag %VERSION% || exit /B 1
git push origin %VERSION% || exit /B 1
git push || exit /B 1

Revert buildpackpush.bat temp version

Revert buildpackpush.bat temp version


CD .\artifacts\bin\King.Azure.Unit.Test\Release\app

dnvm use 1.0.0-rc1-update1 -r clr -a x64
dnu restore -f ../../../King.Azure/Release
./King.Azure.Unit.Test.cmd

CD ../../../../../

CD .\artifacts\bin\King.Azure.Integration.Test\Release\app

dnvm use 1.0.0-rc1-update1 -r clr -a x64
dnu restore -f ../../../King.Azure/Release
./King.Azure.Integration.Test.cmd

CD ../../../../../

test the codez

test the codez


@echo off
setlocal enableextensions

goto entry

:usage
  echo usage: jsc dev      [-c^|--config CONFIG_JS] [BOOTSTRAP_TARGET]
  echo     or jsc compile  [-c^|--config CONFIG_JS] MODULE_FILE ... COMPILE_TARGET
  echo     or jsc identify MODULE_FILE
  echo     or jsc inline   [-c^|--config CONFIG_JS] [-n^|--invoke-main MAIN_MODULE] [-r^|--register] COMPILE_FILE ... LINK_TARGET
  echo     or jsc link     [-c^|--config CONFIG_JS] COMPILE_FILE ... LINK_TARGET
  echo     or jsc help
  echo.
  echo arguments:
  echo   BOOTSTRAP_TARGET file to generate for running in dev mode, this defaults
  echo                    to a file called bootstrap.js in the same directory as
  echo                    the config file
  echo   MODULE_FILE      file containing an uncompiled module
  echo   COMPILE_TARGET   file to generate when compiling, will contain the set of
  echo                    modules and their dependencies
  echo   COMPILE_FILE     file produced by compilation to use as input to linking,
  echo                    COMPILE_FILE must have corresponding 'COMPILE_TARGET.meta'
  echo   LINK_TARGET      file to generate when linking, will contain bootstrap
  echo                    information: bolt, install and configuration
  echo.
  echo options:
  echo   -c^|--config CONFIG_JS          override bolt configuration file
  echo                                    default: config/bolt/prod.js
  echo   -o^|--output OUTPUT_DIR         override compilation output directory
  echo                                    default: scratch/main/js/compile
  echo   -n^|--invoke-main MAIN_MODULE   specify main module of inline scripts
  echo   -r^|--register                  register modules in global namespace
  echo.

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

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

:entry

set base=%~dp0

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

set mode=%~1
shift

if "%mode%"=="dev" goto done_mode_validation
if "%mode%"=="compile" goto done_mode_validation
if "%mode%"=="identify" goto done_mode_validation
if "%mode%"=="inline" goto done_mode_validation
if "%mode%"=="link" goto done_mode_validation
if "%mode%"=="help" call :usage && exit /b 0

echo invalid mode [%mode%], must be one of dev^|compile^|identify^|inline^|link^|help
goto fail_usage

:done_mode_validation

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

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="-o" goto parse_output
  if "%flag%"=="--output" goto parse_output
  if "%flag%"=="-n" goto parse_invoke
  if "%flag%"=="--invoke-main" goto parse_invoke
  if "%flag%"=="-r" goto parse_register
  if "%flag%"=="--register" goto parse_register
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

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

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

  :parse_invoke
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set invoke_main=true
    set main=%~1
    shift
  goto parse_flags

  :parse_register
    set register_modules=true
  goto parse_flags

:done_parse_flags

if "%config_js%"=="" set config_js=config/bolt/prod.js
if "%output_dir%"=="" set output_dir=scratch/main/js/compile
if "%register_modules%"=="" set register_modules=false
if "%invoke_main%"=="" set invoke_main=false

if not exist "%config_js%" echo %config_js% does not exist or is not a file && goto fail
call :is_dir "%config_js%"
if %errorlevel%==0 echo %config_js% does not exist or is not a file && goto fail

for %%i in (node.exe) do set node=%%~$PATH:i
if "%node%"=="" echo error: node.js is not on the system path && goto fail

if "%mode%"=="dev" goto jsc_dev
if "%mode%"=="compile" goto jsc_compile
if "%mode%"=="identify" goto jsc_identify
if "%mode%"=="inline" goto jsc_inline
if "%mode%"=="link" goto jsc_link
exit /b 0

:jsc_dev
  if "%~1"=="" for %%F in ("%config_js%") do (set bootstrap=%%~dpFbootstrap.js) && goto exec_jsc_dev
  if "%~2"=="" set bootstrap=%~1 && goto exec_jsc_dev
  echo invalid number of arguments for jsc %mode%
  goto fail_usage

  :exec_jsc_dev
    "%node%" "%base%jsc.js" "%mode%" "%bootstrap%" "%config_js%"
exit /b 0

:jsc_compile
  goto jsc_x

:jsc_identify
  if "%~1"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  if not "%~2"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  "%node%" "%base%jsc.js" "%mode%" "%~1"
exit /b 0

:jsc_inline
  if "%~1"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  if "%~2"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage

  :jsc_inline_remaining
  if "%~1"=="" goto end_jsc_inline_remaining
  set remaining=%remaining% "%~1"
  shift
  goto jsc_inline_remaining
  :end_jsc_inline_remaining

  "%node%" "%base%jsc.js" "%mode%" "%config_js%" "%invoke_main%" "%main%" "%register_modules%" %remaining%
exit /b 0

:jsc_link
  goto jsc_x

:jsc_x
  if "%~1"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  if "%~2"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage

  :jsc_x_remaining
  if "%~1"=="" goto end_jsc_x_remaining
  set remaining=%remaining% "%~1"
  shift
  goto jsc_x_remaining
  :end_jsc_x_remaining

  "%node%" "%base%jsc.js" "%mode%" "%config_js%" %remaining%
exit /b 0

Change to windows line endings

Change to windows line endings


:: Copyright (c) 2017 Sony Corporation. All Rights Reserved.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

SETLOCAL
:: Options
SET protobuf_tag=v3.4.1
SET libarchive_tag=v3.3.2
SET build_type=Release
IF [%generate_target%] == [] (
  SET generate_target=Visual Studio 14 2015 Win64
)
SET nnabla_root=%~dp0..\..
SET third_party_folder=%nnabla_root%\third_party
IF [%nnabla_build_folder%] == [] (
  SET nnabla_build_folder=%nnabla_root%\build
)
SET nnabla_cmake_cpp_utils=%~dp0\cmake_cpp_utils.bat
SET wd=%cd%

:: Get ZLIB
SET zlib_folder=%third_party_folder%\zlib123dllx64
SET zlib_library=%zlib_folder%\dll_x64\zlibwapi.lib
SET zlib_dll=%zlib_folder%\dll_x64\zlibwapi.dll
SET zlib_include_dir=%zlib_folder%
if not exist %zlib_folder%.zip (
	powershell "iwr %nnabla_iwr_options% -Uri http://www.winimage.com/zLibDll/zlib123dllx64.zip -OutFile %zlib_folder%.zip" || GOTO :error
)
CD %third_party_folder%
SETLOCAL
if not exist %zlib_folder% (
	MD %zlib_folder%
)
CD %zlib_folder%
cmake -E tar xvzf ..\zlib123dllx64.zip || GOTO :error
ENDLOCAL

if not exist %third_party_folder%\zlib123.zip (
	powershell "iwr %nnabla_iwr_options% -Uri http://www.winimage.com/zLibDll/zlib123.zip -OutFile %third_party_folder%\zlib123.zip" || GOTO :error
)
SETLOCAL
if not exist zlib123 (
	MD zlib123
)
CD zlib123
cmake -E tar xvzf ..\zlib123.zip || GOTO :error
COPY zlib.h %zlib_folder% || GOTO :error
COPY zconf.h %zlib_folder% || GOTO :error
CD ..
cmake -E remove_directory zlib123
ENDLOCAL

:: Build LibArchive
SET libarchive_folder=%third_party_folder%\libarchive-%libarchive_tag%
SET libarchive_library=%libarchive_folder%\build-folder\libarchive\%build_type%\archive.lib
SET libarchive_dll=%libarchive_folder%\build-folder\bin\%build_type%\archive.dll
SET libarchive_include_dir=%libarchive_folder%\libarchive
if not exist %libarchive_folder% (
	git clone https://github.com/libarchive/libarchive.git --branch %libarchive_tag% --depth=1 %libarchive_folder% || GOTO :error
)
CD %libarchive_folder%
if not exist build-folder (
	MD build-folder
)
CD build-folder
cmake.exe -G "%generate_target%" .. ^
-DENABLE_NETTLE=FALSE ^
-DENABLE_OPENSSL=FALSE ^
-DENABLE_LZO=FALSE ^
-DENABLE_LZMA=FALSE ^
-DENABLE_BZip2=FALSE ^
-DENABLE_LIBXML2=FALSE ^
-DENABLE_EXPAT=FALSE ^
-DENABLE_PCREPOSIX=FALSE ^
-DENABLE_LibGCC=FALSE ^
-DENABLE_CNG=FALSE ^
-DENABLE_TAR=FALSE ^
-DENABLE_TAR_SHARED=FALSE ^
-DENABLE_CPIO=FALSE ^
-DENABLE_CPIO_SHARED=FALSE ^
-DENABLE_CAT=FALSE ^
-DENABLE_CAT_SHARED=FALSE ^
-DENABLE_XATTR=FALSE ^
-DENABLE_ACL=FALSE ^
-DENABLE_ICONV=FALSE ^
-DENABLE_TEST=FALSE ^
-DZLIB_INCLUDE_DIR=%zlib_include_dir% ^
-DZLIB_LIBRARY_RELEASE=%zlib_library% || GOTO :error
cmake.exe --build . --config Release || GOTO :error

:: Build protobuf libs
SET protobuf_folder=%third_party_folder%\protobuf-%protobuf_tag%
SET protobuf_include_dir=%protobuf_folder%\src
SET protobuf_bin_folder=%protobuf_folder%\build-folder\Release
SET protobuf_library=%protobuf_bin_folder%\libprotobuf.lib
SET protobuf_lite_library=%protobuf_bin_folder%\libprotobuf-lite.lib
SET protobuf_protoc_executable=%protobuf_bin_folder%\protoc.exe
if not exist %protobuf_folder% (
	git clone https://github.com/google/protobuf.git --branch %protobuf_tag% --depth=1 %protobuf_folder% || GOTO :error
)
CD %protobuf_folder%
if not exist build-folder (
	MD build-folder
)
CD build-folder
cmake.exe -G "%generate_target%" -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..\cmake || GOTO :error
cmake.exe --build . --config Release || GOTO :error
: extract_includes.bat

ECHO "--- CMake options for C++ build ---"
SET nnabla_cmake_command=cmake -G "%generate_target%" -DBUILD_CPP_UTILS=ON -DBUILD_PYTHON_PACKAGE=OFF -DLibArchive_LIBRARY=%libarchive_library% -DLibArchive_INCLUDE_DIR=%libarchive_include_dir% -DProtobuf_INCLUDE_DIR=%protobuf_include_dir% -DProtobuf_LIBRARY=%protobuf_library% -DProtobuf_LITE_LIBRARY=%protobuf_lite_library% -DProtobuf_PROTOC_EXECUTABLE=%protobuf_protoc_executable% -DPROTOC_COMMAND=%protobuf_protoc_executable% %nnabla_root%

@ECHO OFF
(
	ECHO SETLOCAL
	ECHO if not exist %nnabla_build_folder% ^(
	ECHO MD %nnabla_build_folder%
	ECHO ^)
	ECHO CD %nnabla_build_folder%
	ECHO %nnabla_cmake_command% ^|^| GOTO :error
	ECHO cmake --build . --config Release ^|^| GOTO :error
	ECHO :error
	ECHO ECHO failed with error code ^%errorlevel^%.
	ECHO exit /b ^%errorlevel^%
	ECHO ENDLOCAL
) > %nnabla_cmake_cpp_utils%
ENDLOCAL

:error
ECHO failed with error code %errorlevel%.
exit /b %errorlevel%

ENDLOCAL

:: Copyright (c) 2017 Sony Corporation. All Rights Reserved.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

:: To build with Debug mode, set environment variable `build_type` as `Debug` as following
:: before running this script.
:: set build_type=Debug

SETLOCAL
:: Options
SET protobuf_tag=v3.4.1
SET libarchive_tag=v3.3.2
IF [%build_type%] == [] (
  SET build_type=Release
)
IF [%generate_target%] == [] (
  SET generate_target=Visual Studio 14 2015 Win64
)
SET nnabla_root=%~dp0..\..
SET third_party_folder=%nnabla_root%\third_party
IF [%nnabla_build_folder%] == [] (
  SET nnabla_build_folder=%nnabla_root%\build
)
SET nnabla_cmake_cpp_utils=%~dp0\cmake_cpp_utils.bat
SET wd=%cd%

:: Get ZLIB
SET zlib_folder=%third_party_folder%\zlib123dllx64
SET zlib_library=%zlib_folder%\dll_x64\zlibwapi.lib
SET zlib_dll=%zlib_folder%\dll_x64\zlibwapi.dll
SET zlib_include_dir=%zlib_folder%
if not exist %zlib_folder%.zip (
	powershell "iwr %nnabla_iwr_options% -Uri http://www.winimage.com/zLibDll/zlib123dllx64.zip -OutFile %zlib_folder%.zip" || GOTO :error
)
CD %third_party_folder%
SETLOCAL
if not exist %zlib_folder% (
	MD %zlib_folder%
)
CD %zlib_folder%
cmake -E tar xvzf ..\zlib123dllx64.zip || GOTO :error
ENDLOCAL

if not exist %third_party_folder%\zlib123.zip (
	powershell "iwr %nnabla_iwr_options% -Uri http://www.winimage.com/zLibDll/zlib123.zip -OutFile %third_party_folder%\zlib123.zip" || GOTO :error
)
SETLOCAL
if not exist zlib123 (
	MD zlib123
)
CD zlib123
cmake -E tar xvzf ..\zlib123.zip || GOTO :error
COPY zlib.h %zlib_folder% || GOTO :error
COPY zconf.h %zlib_folder% || GOTO :error
CD ..
cmake -E remove_directory zlib123
ENDLOCAL

:: Build LibArchive
SET libarchive_folder=%third_party_folder%\libarchive-%libarchive_tag%
SET libarchive_library=%libarchive_folder%\build-folder\libarchive\%build_type%\archive.lib
SET libarchive_dll=%libarchive_folder%\build-folder\bin\%build_type%\archive.dll
SET libarchive_include_dir=%libarchive_folder%\libarchive
if not exist %libarchive_folder% (
	git clone https://github.com/libarchive/libarchive.git --branch %libarchive_tag% --depth=1 %libarchive_folder% || GOTO :error
)
CD %libarchive_folder%
if not exist build-folder (
	MD build-folder
)
CD build-folder
cmake.exe -G "%generate_target%" .. ^
-DENABLE_NETTLE=FALSE ^
-DENABLE_OPENSSL=FALSE ^
-DENABLE_LZO=FALSE ^
-DENABLE_LZMA=FALSE ^
-DENABLE_BZip2=FALSE ^
-DENABLE_LIBXML2=FALSE ^
-DENABLE_EXPAT=FALSE ^
-DENABLE_PCREPOSIX=FALSE ^
-DENABLE_LibGCC=FALSE ^
-DENABLE_CNG=FALSE ^
-DENABLE_TAR=FALSE ^
-DENABLE_TAR_SHARED=FALSE ^
-DENABLE_CPIO=FALSE ^
-DENABLE_CPIO_SHARED=FALSE ^
-DENABLE_CAT=FALSE ^
-DENABLE_CAT_SHARED=FALSE ^
-DENABLE_XATTR=FALSE ^
-DENABLE_ACL=FALSE ^
-DENABLE_ICONV=FALSE ^
-DENABLE_TEST=FALSE ^
-DZLIB_INCLUDE_DIR=%zlib_include_dir% ^
-DZLIB_LIBRARY_RELEASE=%zlib_library% || GOTO :error
cmake.exe --build . --config %build_type% || GOTO :error

:: Build protobuf libs
SET protobuf_folder=%third_party_folder%\protobuf-%protobuf_tag%
SET protobuf_include_dir=%protobuf_folder%\src
SET protobuf_bin_folder=%protobuf_folder%\build-folder\%build_type%
SET protobuf_lib_suffix=.lib
IF [%build_type%] == [Debug] (
  SET protobuf_lib_suffix=.dlib
)
SET protobuf_library=%protobuf_bin_folder%\libprotobuf%protobuf_lib_suffix%
SET protobuf_lite_library=%protobuf_bin_folder%\libprotobuf-lite%protobuf_lib_suffix%
SET protobuf_protoc_executable=%protobuf_bin_folder%\protoc.exe
if not exist %protobuf_folder% (
	git clone https://github.com/google/protobuf.git --branch %protobuf_tag% --depth=1 %protobuf_folder% || GOTO :error
)
CD %protobuf_folder%
if not exist build-folder (
	MD build-folder
)
CD build-folder
cmake.exe -G "%generate_target%" -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..\cmake || GOTO :error
cmake.exe --build . --config %build_type% || GOTO :error
: extract_includes.bat

ECHO "--- CMake options for C++ build ---"
set nnabla_debug_options=
IF [%build_type%] == [Debug] (
  set nnabla_debug_options=-DCMAKE_CXX_FLAGS="/bigobj"
)
SET nnabla_cmake_command=cmake -G "%generate_target%" -DBUILD_CPP_UTILS=ON -DBUILD_PYTHON_PACKAGE=OFF -DLibArchive_LIBRARY=%libarchive_library% -DLibArchive_INCLUDE_DIR=%libarchive_include_dir% -DProtobuf_INCLUDE_DIR=%protobuf_include_dir% -DProtobuf_LIBRARY=%protobuf_library% -DProtobuf_LITE_LIBRARY=%protobuf_lite_library% -DProtobuf_PROTOC_EXECUTABLE=%protobuf_protoc_executable% -DPROTOC_COMMAND=%protobuf_protoc_executable% %nnabla_root% -DZLIB_LIBRARY_RELEASE=%zlib_library% -DZLIB_INCLUDE_DIR=%zlib_include_dir% %nnabla_debug_options%

@ECHO OFF
(
	ECHO SETLOCAL
	ECHO if not exist %nnabla_build_folder% ^(
	ECHO MD %nnabla_build_folder%
	ECHO ^)
	ECHO CD %nnabla_build_folder%
	ECHO %nnabla_cmake_command% ^|^| GOTO :error
	ECHO cmake --build . --config %build_type% ^|^| GOTO :error
	ECHO :error
	ECHO ECHO failed with error code ^%errorlevel^%.
	ECHO exit /b ^%errorlevel^%
	ECHO ENDLOCAL
) > %nnabla_cmake_cpp_utils%
ENDLOCAL

exit /b
:error
ECHO failed with error code %errorlevel%.
exit /b %errorlevel%

ENDLOCAL

Debug build on Windows

[build] Debug build on Windows


@echo off
rem This will download the Kolibri windows installer artifact at the windows-2016 buildkite agent.
rem After the installer successfully sign it will upload the signed installer at the Sign Windows installer pipeline artifact.
rem To sign the Windows installer set the `SIGN_WINDOWS_INSTALLER=true` environment variable.

IF NOT "%SIGN_WINDOWS_INSTALLER%" == "true" (GOTO DONT_SIGN)

set current_path=%cd%
buildkite-agent.exe artifact download "installer/*.exe" . --step "Build kolibri windows installer" --build %BUILDKITE_BUILD_ID% --agent-access-token %BUILDKITE_AGENT_ACCESS_TOKEN%
%WINDOWS_SIGN_SCRIPT_PATH% "%current_path%\installer" && cd "%current_path%\installer\" && buildkite-agent.exe artifact upload "*.exe"
GOTO END

:DONT_SIGN
echo Set the SIGN_WINDOWS_INSTALLER=true environment variable to sign the Windows installer.

:END

@echo off
rem To sign the Windows installer, set the `SIGN_WINDOWS_INSTALLER=true` environment variable.
rem This will download the Kolibri Windows installer artifact at the windows-2016 Buildkite agent.
rem After the installer successfully sign it will upload the installer at the Sign Windows Installer pipeline artifact.

IF NOT "%SIGN_WINDOWS_INSTALLER%" == "true" (GOTO DONT_SIGN)

set current_path=%cd%
buildkite-agent.exe artifact download "installer/*.exe" . --step "Build kolibri windows installer" --build %BUILDKITE_BUILD_ID% --agent-access-token %BUILDKITE_AGENT_ACCESS_TOKEN%
%WINDOWS_SIGN_SCRIPT_PATH% "%current_path%\installer" && cd "%current_path%\installer\" && ren *.exe *-signed.exe && buildkite-agent.exe artifact upload "*.exe"
GOTO END

:DONT_SIGN
echo Set the SIGN_WINDOWS_INSTALLER=true environment variable to sign the Windows installer.

:END

Add a singed name at the filename of the installer, after it was successfully signed.


SET GOPATH=%CD%\gopath
SET PATH=C:\Go\bin;C:\Program Files\Git\cmd\;%GOPATH%\bin;%PATH%

cd %GOPATH%\src\code.cloudfoundry.org\cli

powershell -command set-executionpolicy remotesigned

go version

go get -u github.com/onsi/ginkgo/ginkgo

ginkgo version

ginkgo -r -race -randomizeAllSpecs -randomizeSuites -skipPackage integration -flakeAttempts=2 .

SET GOPATH=%CD%\gopath
SET PATH=C:\Go\bin;C:\Program Files\Git\cmd\;%GOPATH%\bin;%PATH%

cd %GOPATH%\src\code.cloudfoundry.org\cli

powershell -command set-executionpolicy remotesigned

go version

go get -u github.com/onsi/ginkgo/ginkgo

ginkgo version

ginkgo -r -randomizeAllSpecs -randomizeSuites -skipPackage integration -flakeAttempts=2 .

Remove -race from windows units temporarily

Because of https://github.com/golang/go/issues/27089, passing "-race" to
ginkgo causes the windows build to fail. We are simply removing this
flag until the golang issue is resolved. (Units on other operating
systems still check for race conditions.)

[#160911621]

Signed-off-by: Will Murphy <a0e419adf8e2224ae039ba5f1877fb7f62d300e5@pivotal.io>


set ICU=C:\Dev\icu

cd %~dp0

xcopy /Y %ICU%\include\unicode include

xcopy /Y %ICU%\bin\*51.dll lib_x86_release
xcopy /Y %ICU%\bin\*51d.dll lib_x86_debug
xcopy /Y %ICU%\bin\icudt51.dll lib_x86_release
xcopy /Y %ICU%\bin\icudt51.dll lib_x86_debug

xcopy /Y %ICU%\bin64\*51.dll lib_x64_release
xcopy /Y %ICU%\bin64\*51d.dll lib_x64_debug
xcopy /Y %ICU%\bin64\icudt51.dll lib_x64_release
xcopy /Y %ICU%\bin64\icudt51.dll lib_x64_debug

xcopy /Y %ICU%\lib\icuin.* lib_x86_release
xcopy /Y %ICU%\lib\icuind.* lib_x86_debug
xcopy /Y %ICU%\lib\icuuc.* lib_x86_release
xcopy /Y %ICU%\lib\icuucd.* lib_x86_debug
xcopy /Y %ICU%\lib\icudt.* lib_x86_release
xcopy /Y %ICU%\lib\icudt.* lib_x86_debug

xcopy /Y %ICU%\lib64\icuin.* lib_x64_release
xcopy /Y %ICU%\lib64\icuind.* lib_x64_debug
xcopy /Y %ICU%\lib64\icuuc.* lib_x64_release
xcopy /Y %ICU%\lib64\icuucd.* lib_x64_debug
xcopy /Y %ICU%\lib64\icudt.* lib_x64_release
xcopy /Y %ICU%\lib64\icudt.* lib_x64_debug

set ICU=C:\Dev\icu

cd %~dp0

xcopy /Y /I %ICU%\include\unicode include\unicode

xcopy /Y %ICU%\bin\*51.dll lib_x86_release
xcopy /Y %ICU%\bin\*51d.dll lib_x86_debug
xcopy /Y %ICU%\bin\icudt51.dll lib_x86_release
xcopy /Y %ICU%\bin\icudt51.dll lib_x86_debug

xcopy /Y %ICU%\bin64\*51.dll lib_x64_release
xcopy /Y %ICU%\bin64\*51d.dll lib_x64_debug
xcopy /Y %ICU%\bin64\icudt51.dll lib_x64_release
xcopy /Y %ICU%\bin64\icudt51.dll lib_x64_debug

xcopy /Y %ICU%\lib\icuin.* lib_x86_release
xcopy /Y %ICU%\lib\icuind.* lib_x86_debug
xcopy /Y %ICU%\lib\icuuc.* lib_x86_release
xcopy /Y %ICU%\lib\icuucd.* lib_x86_debug
xcopy /Y %ICU%\lib\icudt.* lib_x86_release
xcopy /Y %ICU%\lib\icudt.* lib_x86_debug

xcopy /Y %ICU%\lib64\icuin.* lib_x64_release
xcopy /Y %ICU%\lib64\icuind.* lib_x64_debug
xcopy /Y %ICU%\lib64\icuuc.* lib_x64_release
xcopy /Y %ICU%\lib64\icuucd.* lib_x64_debug
xcopy /Y %ICU%\lib64\icudt.* lib_x64_release
xcopy /Y %ICU%\lib64\icudt.* lib_x64_debug

fix copy-icu.cmd

fix copy-icu.cmd


@echo off
CLS

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
echo.
echo **************************************
echo Installing GitHub CLI as Administrator
echo **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:gotPrivileges

setlocal & cd /d %~dp0

set HUB_BIN_PATH="%LOCALAPPDATA%\GitHubCLI\bin"
IF EXIST %HUB_BIN_PATH% GOTO DIRECTORY_EXISTS
mkdir %HUB_BIN_PATH%
set "path=%PATH%;%HUB_BIN_PATH:"=%"
1>NUL setx PATH "%PATH%" /M
:DIRECTORY_EXISTS

:: Delete any existing programs
2>NUL del /q %HUB_BIN_PATH%\hub*

1>NUL copy .\bin\hub.exe %HUB_BIN_PATH%\hub.exe

echo hub.exe installed successfully. Press any key to exit
pause > NUL

@echo off
CLS
goto checkPrivileges

:: Unfortunately, Windows doesn't have a decent built-in way to append a string to the $PATH.
:: setx is convenient, but it 1) truncates paths longer than 1024 characters, and
:: 2) mucks up the user path with the machine-wide path.
:: This function takes care of these problems by calling Environment.Get/SetEnvironmentVariable
:: via PowerShell, which lacks these issues.
:appendToUserPath
set "RUNPS=powershell -NoProfile -ExecutionPolicy Bypass -Command" :: Command to start PowerShell.
set "OLDPATHPS=[Environment]::GetEnvironmentVariable('PATH', 'User')" :: PowerShell command to run to get the old $PATH for the current user.

:: Capture the output of %RUNPS% "%OLDPATHPS%" and set it to OLDPATH
for /f "delims=" %%i in ('%RUNPS% "%OLDPATHPS%"') do (
    set "OLDPATH=%%i"
)

set "NEWPATH=%OLDPATH%;%1"
:: Set the new $PATH
%RUNPS% "[Environment]::SetEnvironmentVariable('PATH', '%NEWPATH%', 'User')"
goto :eof

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
echo.
echo **************************************
echo Installing GitHub CLI as Administrator
echo **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:gotPrivileges

setlocal & cd /d %~dp0

set HUB_BIN_PATH="%LOCALAPPDATA%\GitHubCLI\bin"
IF EXIST %HUB_BIN_PATH% GOTO DIRECTORY_EXISTS
mkdir %HUB_BIN_PATH%
set "path=%PATH%;%HUB_BIN_PATH:"=%"
call :appendToUserPath "%HUB_BIN_PATH:"=%"
:DIRECTORY_EXISTS

:: Delete any existing programs
2>NUL del /q %HUB_BIN_PATH%\hub*

1>NUL copy .\bin\hub.exe %HUB_BIN_PATH%\hub.exe

echo hub.exe installed successfully. Press any key to exit
pause > NUL

Fix Windows installer for OS usernames with spaces

The Windows installer appends the location of `hub.exe` to user's PATH,
but that would break if the OS username has spaces.


@echo off
setlocal enableextensions

goto entry

:usage
  echo usage: jsc dev      [-c^|--config CONFIG_JS] [BOOTSTRAP_TARGET]
  echo     or jsc compile  [-c^|--config CONFIG_JS] MODULE_FILE ... COMPILE_TARGET
  echo     or jsc identify MODULE_FILE
  echo     or jsc inline   [-c^|--config CONFIG_JS] [-n^|--invoke-main MAIN_MODULE] [-r^|--register] COMPILE_FILE ... LINK_TARGET
  echo     or jsc link     [-c^|--config CONFIG_JS] COMPILE_FILE ... LINK_TARGET
  echo     or jsc help
  echo.
  echo arguments:
  echo   BOOTSTRAP_TARGET file to generate for running in dev mode, this defaults
  echo                    to a file called bootstrap.js in the same directory as
  echo                    the config file
  echo   MODULE_FILE      file containing an uncompiled module
  echo   COMPILE_TARGET   file to generate when compiling, will contain the set of
  echo                    modules and their dependencies
  echo   COMPILE_FILE     file produced by compilation to use as input to linking,
  echo                    COMPILE_FILE must have corresponding 'COMPILE_TARGET.meta'
  echo   LINK_TARGET      file to generate when linking, will contain bootstrap
  echo                    information: bolt, install and configuration
  echo.
  echo options:
  echo   -c^|--config CONFIG_JS          override bolt configuration file
  echo                                    default: config/bolt/prod.js
  echo   -o^|--output OUTPUT_DIR         override compilation output directory
  echo                                    default: scratch/main/js/compile
  echo   -n^|--invoke-main MAIN_MODULE   specify main module of inline scripts
  echo   -r^|--register                  register modules in global namespace
  echo.

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:entry

set base=%~dp0

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

set mode=%~1
shift

if "%mode%"=="dev" goto done_mode_validation
if "%mode%"=="compile" goto done_mode_validation
if "%mode%"=="identify" goto done_mode_validation
if "%mode%"=="inline" goto done_mode_validation
if "%mode%"=="link" goto done_mode_validation
if "%mode%"=="help" goto done_mode_validation

echo invalid mode [%mode%], must be one of dev^|compile^|identify^|inline^|link^|help
goto fail_usage

:done_mode_validation

if "%mode%"=="help" call :usage && exit /b 0

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

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="-o" goto parse_output
  if "%flag%"=="--output" goto parse_output
  if "%flag%"=="-n" goto parse_invoke
  if "%flag%"=="--invoke-main" goto parse_invoke
  if "%flag%"=="-r" goto parse_register
  if "%flag%"=="--register" goto parse_register
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

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

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

  :parse_invoke
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set invoke_main=true
    set main=%~1
    shift
  goto parse_flags

  :parse_register
    set register_modules=true
  goto parse_flags

:done_parse_flags

if "%config_js%"=="" set config_js=config/bolt/prod.js
if "%output_dir%"=="" set output_dir=scratch/main/js/compile
if "%register_modules%"=="" set register_modules=false
if "%invoke_main%"=="" set invoke_main=false

if not exist "%config_js%" echo %config_js% does not exist or is not a file && goto fail
for %%i in ("%config_js%") do if exist %%~si\NUL echo %config_js% does not exist or is not a file && goto fail

for %%i in (node.exe) do set node=%%~$PATH:i
if "%node%"=="" echo error: node.js is not on the system path && goto fail

if "%mode%"=="dev" goto jsc_dev
if "%mode%"=="compile" goto jsc_compile
if "%mode%"=="identify" goto jsc_identify
if "%mode%"=="inline" goto jsc_inline
if "%mode%"=="link" goto jsc_link
exit /b 0

:jsc_dev
  if "%~1"=="" for %%F in ("%config_js%") do (set bootstrap=%%~dpFbootstrap.js) && goto exec_jsc_dev
  if "%~2"=="" set bootstrap=%~1 && goto exec_jsc_dev
  echo invalid number of arguments for jsc %mode%
  goto fail_usage

  :exec_jsc_dev
    "%node%" "%base%jsc.js" "%mode%" "%bootstrap%" "%config_js%"
exit /b 0

:jsc_compile
  goto jsc_x

:jsc_identify
  if "%~1"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  if not "%~2"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  "%node%" "%base%jsc.js" "%mode%" "%~1"
exit /b 0

:jsc_inline
  if "%~1"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  if "%~2"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage

  :jsc_inline_remaining
  if "%~1"=="" goto end_jsc_inline_remaining
  set remaining=%remaining% "%~1"
  shift
  goto :jsc_inline_remaining
  :end_jsc_inline_remaining

  "%node%" "%base%jsc.js" "%mode%" "%config_js%" "%invoke_main%" "%main%" "%register_modules%" %remaining%
exit /b 0

:jsc_link
  goto jsc_x

:jsc_x
  if "%~1"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage
  if "%~2"=="" echo invalid number of arguments for jsc %mode% && goto fail_usage

  :jsc_x_remaining
  if "%~1"=="" goto end_jsc_x_remaining
  set remaining=%remaining% "%~1"
  shift
  goto :jsc_x_remaining
  :end_jsc_x_remaining

  "%node%" "%base%jsc.js" "%mode%" "%config_js%" %remaining%
exit /b 0

Add batch file implementation of jsc

Add batch file implementation of jsc


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

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\VolskNet.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=diag /nr:false

mkdir Build
mkdir Build\lib
mkdir Build\lib\net451

%nuget% pack "src\VolskNet.Core.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

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

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

REM %WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\VolskNet.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=diag /nr:false

mkdir Build
mkdir Build\lib
mkdir Build\lib\net451

%nuget% pack "src\VolskNet.Core.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

Update build.bat

Update build.bat


@echo on
setlocal

:: setup compil env
set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
:: find the varsall parameters
if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "static" set VC_VARSALL=amd64

set qtplatform=%PLATFORM%

call %VC_DIR% %VC_VARSALL%

for %%* in (.) do set CurrDirName=%%~nx*

echo C:\Qt\%QT_VER%\%qtplatform%\bin\qmake
ls C:\Qt\%QT_VER%\%qtplatform%\bin\
C:\Qt\%QT_VER%\%qtplatform%\bin\qmake .\app\ || exit /B 1

nmake qmake_all || exit /B 1
nmake || exit /B 1
nmake release || exit /B 1

nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1

@echo on
setlocal

:: setup compil env
set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
:: find the varsall parameters
if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "static" set VC_VARSALL=amd64

set qtplatform=%PLATFORM%
call %VC_DIR% %VC_VARSALL%

for %%* in (.) do set CurrDirName=%%~nx*
C:\Qt\%QT_VER%\%qtplatform%\bin\qmake .\app\ || exit /B 1

:: compilation
nmake qmake_all || exit /B 1
nmake || exit /B 1
nmake release || exit /B 1
:: qt deploy
echo "step 2"
echo pwd
echo "step 3"
C:\Qt\%QT_VER%\%qtplatform%\bin\windeployqt.exe C:\project\qregovar\release\ --qmldir C:\project\qregovar\app\UI\
echo "step 4"
nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1
echo "step 5"

Update build-msvc.bat

Update build-msvc.bat


echo OFF

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda%CONDA_VERSION%

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "%PLATFORM%"=="x86" set PLATFORM=x86_64

where curl
if errorlevel 1 (
    if not exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        echo You must first install the cURL program or download manually the Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe file
        echo User installation failed.
        exit 1
    )
)

if "%BATCH_MODE%"=="" set BATCH_MODE=false

if not exist %CONDA_DIR% (
    if exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        set CLEAN_MINICONDA=0
    ) else (
        curl https://repo.continuum.io/miniconda/Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe -o miniconda.exe
        set CLEAN_MINICONDA=1
    )
    if errorlevel 1 (
        echo Download of the Miniconda"%CONDA_VERSION%"-latest-Windows-"%PLATFORM%".exe file failed
        echo User installation failed.
        exit 1
    )
    if "%BATCH_MODE%"=="true" (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%CONDA_DIR%
    ) else (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /D=%CONDA_DIR%
    )
    if errorlevel 1 (
        echo Execution of the Miniconda"%CONDA_VERSION%"-latest-Windows-"%PLATFORM%".exe file failed
        echo User installation failed.
        exit 1
    )
    if "%CLEAN_MINICONDA%"=="1" del miniconda.exe
)

attrib +h %CONDA_DIR%
if errorlevel 1 echo Failed to hide the "%CONDA_DIR%" directory

set PATH=%CONDA_DIR%;%CONDA_DIR%\Scripts;%PATH%
call %CONDA_DIR%\Scripts\activate.bat root
if errorlevel 1 (
    echo Activation of Conda failed
    echo User installation failed.
    exit 1
)

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes %CONDA_ALWAYS_YES%
if errorlevel 1 (
    echo Configuration of Conda failed
    echo User installation failed.
    exit 1
)
conda config --set changeps1 %CONDA_CHANGE_PS1%
if errorlevel 1 (
    echo Configuration of Conda failed
    echo User installation failed.
    exit 1
)
conda update -q conda -y
if errorlevel 1 (
    echo Update of Conda failed
    echo User installation failed.
    exit 1
)

echo User installation succeded.

echo OFF

echo OFF

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda%CONDA_VERSION%

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "%PLATFORM%"=="x86" set PLATFORM=x86_64

where curl
if errorlevel 1 (
    if not exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        echo You must first install the cURL program or download manually the Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe file
        echo User installation failed.
        exit 1
    )
)

if "%BATCH_MODE%"=="" set BATCH_MODE=false

if exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
    set CLEAN_MINICONDA=0
) else (
    curl https://repo.continuum.io/miniconda/Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe -o miniconda.exe
    set CLEAN_MINICONDA=1
)

if not exist %CONDA_DIR% (
    if errorlevel 1 (
        echo Download of the Miniconda"%CONDA_VERSION%"-latest-Windows-"%PLATFORM%".exe file failed
        echo User installation failed.
        exit 1
    )
    if "%BATCH_MODE%"=="true" (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%CONDA_DIR%
    ) else (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /D=%CONDA_DIR%
    )
    if errorlevel 1 (
        echo Execution of the Miniconda"%CONDA_VERSION%"-latest-Windows-"%PLATFORM%".exe file failed
        echo User installation failed.
        exit 1
    )
)

if "%CLEAN_MINICONDA%"=="1" del miniconda.exe

attrib +h %CONDA_DIR%
if errorlevel 1 echo Failed to hide the "%CONDA_DIR%" directory

set PATH=%CONDA_DIR%;%CONDA_DIR%\Scripts;%PATH%
call %CONDA_DIR%\Scripts\activate.bat root
if errorlevel 1 (
    echo Activation of Conda failed
    echo User installation failed.
    exit 1
)

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes %CONDA_ALWAYS_YES%
if errorlevel 1 (
    echo Configuration of Conda failed
    echo User installation failed.
    exit 1
)
conda config --set changeps1 %CONDA_CHANGE_PS1%
if errorlevel 1 (
    echo Configuration of Conda failed
    echo User installation failed.
    exit 1
)
conda update -q conda -y
if errorlevel 1 (
    echo Update of Conda failed
    echo User installation failed.
    exit 1
)

echo User installation succeded.

echo OFF

Update user_install.bat

Update user_install.bat


setlocal EnableDelayedExpansion

echo ON

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda!CONDA_VERSION!

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "!PLATFORM!"=="x86" set PLATFORM=x86_64

where curl
if !ERRORLEVEL! neq 0 (
    echo "You must first install the cURL program"
    exit /b !ERRORLEVEL!
)

if not exist!CONDA_DIR! (
    curl https://repo.continuum.io/miniconda/Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe -o miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=!CONDA_DIR!
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    del miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
)

attrib +h !CONDA_DIR!
if !ERRORLEVEL! neq 0 echo Failed to hide the !CONDA_DIR! directory

set PATH=!CONDA_DIR!;!CONDA_DIR!\Scripts;%PATH%

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes !CONDA_ALWAYS_YES!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda config --set changeps1 !CONDA_CHANGE_PS1!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda update -q conda
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!

echo OFF

setlocal EnableDelayedExpansion

echo ON

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda!CONDA_VERSION!

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "!PLATFORM!"=="x86" set PLATFORM=x86_64

where curl
if !ERRORLEVEL! neq 0 (
    echo "You must first install the cURL program"
    exit /b !ERRORLEVEL!
)

if not exist !CONDA_DIR! (
    curl https://repo.continuum.io/miniconda/Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe -o miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=!CONDA_DIR!
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
    del miniconda.exe
    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
)

attrib +h !CONDA_DIR!
if !ERRORLEVEL! neq 0 echo Failed to hide the !CONDA_DIR! directory

set PATH=!CONDA_DIR!;!CONDA_DIR!\Scripts;%PATH%

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes !CONDA_ALWAYS_YES!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda config --set changeps1 !CONDA_CHANGE_PS1!
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
conda update -q conda
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!

echo OFF

Update user_install.bat

Update user_install.bat


rem ""
rem "starting fasta36_t - protein on win32"
rem ""
..\bin\fasta36_t -q -m 6 -Z 100000 ..\seq\mgstm1.aa:1-100 q > results\test_m1.ok2_t.html
..\bin\fasta36_t -S -q -z 11 -O results\test_m1.ok2_t_p25 -s P250 ..\seq\mgstm1.aa:100-218 q
rem "done"
rem "starting fastxy36_t"
..\bin\fastx36_t -m 9c -S -q ..\seq\mgtt2_x.seq q 1 > results\test_t2.xk1_t
..\bin\fasty36_t -S -q ..\seq\mgtt2_x.seq q > results\test_t2.yk2_t
..\bin\fastx36_t -m 9c -S -q -z 2 ..\seq\mgstm1.esq a > results\test_m1.xk2_tz2
..\bin\fasty36_t -S -q -z 2 ..\seq\mgstm1.esq a > results\test_m1.yk2_tz2
rem "done"
rem "starting fastxy36_t rev"
..\bin\fastx36_t -m 9c -q -m 5 ..\seq\mgstm1.rev q > results\test_m1.xk2r_t
..\bin\fasty36_t -q -m 5 -M 200-300 -z 2 ..\seq\mgstm1.rev q > results\test_m1.yk2r_tz2
..\bin\fasty36_t -q -m 5 -z 11 ..\seq\mgstm1.rev q > results\test_m1.yk2rz11_t
rem "done"
rem "starting ssearch36_t"
..\bin\ssearch36_t -m 9c -S -z 3 -q ..\seq\mgstm1.aa  q > results\test_m1.ss_tz3
..\bin\ssearch36_t -q -M 200-300 -z 2 -Z 100000 -s P250 ..\seq\mgstm1.aa q > results\test_m1.ss_t_p25
rem "starting ssearch36_t"
..\bin\ssearch36sse2_t -m 9c -S -z 3 -q ..\seq\mgstm1.aa  q > results\test_m1.ss_tz3sse2
..\bin\ssearch36sse2_t -q -M 200-300 -z 2 -Z 100000 -s P250 ..\seq\mgstm1.aa q > results\test_m1.ss_t_p25sse2
rem "done"
rem "starting prss/prfx36"
..\bin\ssearch36_t -q -k 1000 -A ..\seq\mgstm1.aa ..\seq\xurt8c.aa  > results\test_m1.rss
..\bin\fastx36_t -q -k 1000 -A ..\seq\mgstm1.esq ..\seq\xurt8c.aa > results\test_m1.rfx
rem "done"
rem "starting fasta36_t - DNA"
..\bin\fasta36_t -S -q -z 2 ..\seq\mgstm1.seq %M 4 > results\test_m1.ok4_tz2
..\bin\fasta36_t -S -q ..\seq\mgstm1.rev %M 4 > results\test_m1.ok4r_t
rem "done"
rem "starting tfastxy36_t"
..\bin\tfastx36_t -m 9c -q -i -3 -m 6 ..\seq\mgstm1.aa %m > results\test_m1.tx2_t.html
..\bin\tfasty36_t -q -i -3 -N 5000 ..\seq\mgstm1.aa %m > results\test_m1.ty2_t
rem "done"
rem "starting fastf36_t"
..\bin\fastf36_t -q ..\seq\m1r.aa q > results\test_mf.ff_t
..\bin\fastf36 -q ..\seq\m1r.aa q > results\test_mf.ff_s
rem "done"
rem "starting tfastf36_t"
..\bin\tfastf36_t -q ..\seq\m1r.aa %m > results\test_mf.tf_tr
rem "done"
rem "starting fasts36_t"
..\bin\fasts36_t -q -V '*?@' ..\seq\ngts.aa q > results\test_m1.fs1_t
..\bin\fasts36_t -q ..\seq\ngt.aa q > results\test_m1.fs_t
..\bin\fasts36_t -q -n ..\seq\mgstm1.nts m > results\test_m1.nfs_t
rem "done"
rem "starting tfasts36_t"
..\bin\tfasts36_t -q ..\seq\n0.aa %m > results\test_m1.ts_r
rem "done"
rem "starting fasta36 - protein"
..\bin\fasta36 -q -z 2 ..\seq\mgstm1.aa q 1 > results\test_m1.ok1z2
..\bin\fasta36 -q -s P250 ..\seq\mgstm1.aa q > results\test_m1.ok2_p25
rem "done"
rem "starting fastx3"
..\bin\fastx36 -m 9c -q ..\seq\mgstm1.esq q > results\test_m1.ok2x
rem "done"
rem "starting fasty3"
..\bin\fasty36 -q ..\seq\mgstm1.esq q > results\test_m1.ok2y
rem "done"
rem "starting fasta36 - DNA "
..\bin\fasta36 -m 9c -q ..\seq\mgstm1.seq M 4 > results\test_m1.ok4
rem "done"
rem "starting ssearch3"
..\bin\ssearch36 -S -q -z 2 ..\seq\mgstm1.aa q > results\test_m1.ss_z2
..\bin\ssearch36 -q -s P250 ..\seq\mgstm1.aa q > results\test_m1.ss_p25
..\bin\ssearch36sse2 -S -q -z 2 ..\seq\mgstm1.aa q > results\test_m1.ss_z2_sse2
..\bin\ssearch36sse2 -q -s P250 ..\seq\mgstm1.aa q > results\test_m1.ss_p25_sse2
rem "done"
rem "starting tfastxy3"
..\bin\tfastx36 -q ..\seq\mgstm1.aa M > results\test_m1.tx2
..\bin\tfasty36 -m 9c -q ..\seq\mgstm1.aa M > results\test_m1.ty2
rem "done"
rem "starting fasts36"
..\bin\fasts36 -q -V '@?*' ..\seq\ngts.aa q > results\test_m1.fs1
..\bin\fasts36 -q ..\seq\ngt.aa q > results\ ..\seq\test_m1.fs
rem "done"

rem ""
rem "starting fasta36_t - protein on win32"
rem ""
..\bin\fasta36_t -q -m 6 -Z 100000 ..\seq\mgstm1.aa:1-100 q > results\test_m1.ok2_t.html
..\bin\fasta36_t -S -q -z 11 -O results\test_m1.ok2_t_p25 -s P250 ..\seq\mgstm1.aa:100-218 q
rem "done"
rem "starting fastxy36_t"
..\bin\fastx36_t -m 9c -S -q ..\seq\mgtt2_x.seq q 1 > results\test_t2.xk1_t
..\bin\fasty36_t -S -q ..\seq\mgtt2_x.seq q > results\test_t2.yk2_t
..\bin\fastx36_t -m 9c -S -q -z 2 ..\seq\mgstm1.esq a > results\test_m1.xk2_tz2
..\bin\fasty36_t -S -q -z 2 ..\seq\mgstm1.esq a > results\test_m1.yk2_tz2
rem "done"
rem "starting fastxy36_t rev"
..\bin\fastx36_t -m 9c -q -m 5 ..\seq\mgstm1.rev q > results\test_m1.xk2r_t
..\bin\fasty36_t -q -m 5 -M 200-300 -z 2 ..\seq\mgstm1.rev q > results\test_m1.yk2r_tz2
..\bin\fasty36_t -q -m 5 -z 11 ..\seq\mgstm1.rev q > results\test_m1.yk2rz11_t
rem "done"
rem "starting ssearch36_t"
..\bin\ssearch36_t -m 9c -S -z 3 -q ..\seq\mgstm1.aa  q > results\test_m1.ss_tz3
..\bin\ssearch36_t -q -M 200-300 -z 2 -Z 100000 -s P250 ..\seq\mgstm1.aa q > results\test_m1.ss_t_p25
rem "done"
rem "starting prss/prfx36"
..\bin\ssearch36_t -q -k 1000 -A ..\seq\mgstm1.aa ..\seq\xurt8c.aa  > results\test_m1.rss
..\bin\fastx36_t -q -k 1000 -A ..\seq\mgstm1.esq ..\seq\xurt8c.aa > results\test_m1.rfx
rem "done"
rem "starting fasta36_t - DNA"
..\bin\fasta36_t -S -q -z 2 ..\seq\mgstm1.seq %M 4 > results\test_m1.ok4_tz2
..\bin\fasta36_t -S -q ..\seq\mgstm1.rev %M 4 > results\test_m1.ok4r_t
rem "done"
rem "starting tfastxy36_t"
..\bin\tfastx36_t -m 9c -q -i -3 -m 6 ..\seq\mgstm1.aa %m > results\test_m1.tx2_t.html
..\bin\tfasty36_t -q -i -3 -N 5000 ..\seq\mgstm1.aa %m > results\test_m1.ty2_t
rem "done"
rem "starting fastf36_t"
..\bin\fastf36_t -q ..\seq\m1r.aa q > results\test_mf.ff_t
..\bin\fastf36 -q ..\seq\m1r.aa q > results\test_mf.ff_s
rem "done"
rem "starting tfastf36_t"
..\bin\tfastf36_t -q ..\seq\m1r.aa %m > results\test_mf.tf_tr
rem "done"
rem "starting fasts36_t"
..\bin\fasts36_t -q -V '*?@' ..\seq\ngts.aa q > results\test_m1.fs1_t
..\bin\fasts36_t -q ..\seq\ngt.aa q > results\test_m1.fs_t
..\bin\fasts36_t -q -n ..\seq\mgstm1.nts m > results\test_m1.nfs_t
rem "done"
rem "starting tfasts36_t"
..\bin\tfasts36_t -q ..\seq\n0.aa %m > results\test_m1.ts_r
rem "done"
rem "starting fasta36 - protein"
..\bin\fasta36 -q -z 2 ..\seq\mgstm1.aa q 1 > results\test_m1.ok1z2
..\bin\fasta36 -q -s P250 ..\seq\mgstm1.aa q > results\test_m1.ok2_p25
rem "done"
rem "starting fastx3"
..\bin\fastx36 -m 9c -q ..\seq\mgstm1.esq q > results\test_m1.ok2x
rem "done"
rem "starting fasty3"
..\bin\fasty36 -q ..\seq\mgstm1.esq q > results\test_m1.ok2y
rem "done"
rem "starting fasta36 - DNA "
..\bin\fasta36 -m 9c -q ..\seq\mgstm1.seq M 4 > results\test_m1.ok4
rem "done"
rem "starting ssearch3"
..\bin\ssearch36 -S -q -z 2 ..\seq\mgstm1.aa q > results\test_m1.ss_z2
..\bin\ssearch36 -q -s P250 ..\seq\mgstm1.aa q > results\test_m1.ss_p25
rem "done"
rem "starting tfastxy3"
..\bin\tfastx36 -q ..\seq\mgstm1.aa M > results\test_m1.tx2
..\bin\tfasty36 -m 9c -q ..\seq\mgstm1.aa M > results\test_m1.ty2
rem "done"
rem "starting fasts36"
..\bin\fasts36 -q -V '@?*' ..\seq\ngts.aa q > results\test_m1.fs1
..\bin\fasts36 -q ..\seq\ngt.aa q > results\ ..\seq\test_m1.fs
rem "done"

remove ssearch36sse2 tests

remove ssearch36sse2 tests


if not exist "C:\Windows\Temp\msys2.exe" (
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20161025.exe', 'C:\Windows\Temp\msys2.exe')" <NUL
)

start /wait C:\Windows\Temp\msys2.exe --script A:\msys2-install.qs
start /wait C:\msys64\usr\bin\bash.exe --login -c "pacman -Syu --noconfirm"
start /wait C:\msys64\usr\bin\bash.exe --login -c "pacman -Syu --noconfirm"
start /wait C:\msys64\usr\bin\bash.exe --login -c "pacman -S --noconfirm zip unzip"
start /wait C:\msys64\usr\bin\bash.exe --login -c "pacman -S --noconfirm base-devel"

Install the base-devel meta package on setup


@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20150930-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
	SET BRANCH=peterkir
) ELSE (
	SET BRANCH=%1
)

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET IDEFIX_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET BRANCH=master
SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::	'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::	SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
	GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # setup local %IDEFIX_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; (New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BINTRAY_BUILD_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph/1.3.0/%BRANCH%/%LATEST%
SET ECLIPSE_INSTALLER_WEB=%BINTRAY_BUILD_ROOT%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
	GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%IDEFIX_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%IDEFIX_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%IDEFIX_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%IDEFIX_NAME%')}"

ECHO.
ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%IDEFIX_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%IDEFIX_NAME%\jre\NUL (
	XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%IDEFIX_NAME%\jre 2>&1 > NUL
)

SET "IDEFIX_HOME=%SCRIPT_PATH%"
MKDIR %IDEFIX_HOME% 2>&1 > NUL

SET IDEFIX_HOME=%IDEFIX_HOME:\=/%
SET IDEFIX_INI=%SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.ini

ECHO adding vmArgs to ini file
:: allow installation of unsigned bundles
ECHO -Declipse.p2.unsignedPolicy=allow >> %IDEFIX_INI%

:: hidden p2 options (configured to default)
ECHO -Declipse.p2.max.threads=4  >> %IDEFIX_INI%
ECHO -Declipse.p2.force.threading=true >> %IDEFIX_INI%
ECHO -Declipse.p2.mirrors=true >> %IDEFIX_INI%

:: filtering user displayed catalogs/products/versions
ECHO -Doomph.setup.product.catalog.filter=io.klib.products >> %IDEFIX_INI%
::ECHO -Doomph.setup.product.filter=idefix.cec.161 >> %IDEFIX_INI%
::ECHO -Doomph.setup.product.version.filter=none >> %IDEFIX_INI%

ECHO -Doomph.setup.jre.choice=false >> %IDEFIX_INI%
::ECHO -Doomph.installer.update.url=%BINTRAY_BUILD_ROOT%/p2/installer >> %IDEFIX_INI%
::ECHO -Doomph.update.url=%BINTRAY_BUILD_ROOT%/p2/oomph >> %IDEFIX_INI%
ECHO -Doomph.setup.installer.mode=advanced >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/productsCatalog.setup >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/projectsCatalog.setup >> %IDEFIX_INI%

ECHO.
ECHO # launching %IDEFIX_NAME%
ECHO.
START /B %SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20150930-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
	SET BRANCH=peterkir
) ELSE (
	SET BRANCH=%1
)

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET IDEFIX_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET BRANCH=master
SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::	'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::	SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
	GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # setup local %IDEFIX_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; (New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BINTRAY_BUILD_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph/1.3.0/%BRANCH%/%LATEST%
SET ECLIPSE_INSTALLER_WEB=%BINTRAY_BUILD_ROOT%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
	GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%IDEFIX_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%IDEFIX_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%IDEFIX_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%IDEFIX_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%IDEFIX_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%IDEFIX_NAME%\jre\NUL (
	XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%IDEFIX_NAME%\jre 2>&1 > NUL
)

SET "IDEFIX_HOME=%SCRIPT_PATH%"
MKDIR %IDEFIX_HOME% 2>&1 > NUL

SET IDEFIX_HOME=%IDEFIX_HOME:\=/%
SET IDEFIX_INI=%SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.ini

ECHO    - adding vmArgs to ini file
:: allow installation of unsigned bundles
ECHO -Declipse.p2.unsignedPolicy=allow >> %IDEFIX_INI%

:: hidden p2 options (configured to default)
ECHO -Declipse.p2.max.threads=4        >> %IDEFIX_INI%
ECHO -Declipse.p2.force.threading=true >> %IDEFIX_INI%
ECHO -Declipse.p2.mirrors=true         >> %IDEFIX_INI%

:: filtering user displayed catalogs/products/versions
ECHO -Doomph.setup.product.catalog.filter=io.klib.products >> %IDEFIX_INI%
::ECHO -Doomph.setup.product.filter=idefix.cec.161 >> %IDEFIX_INI%
::ECHO -Doomph.setup.product.version.filter=none >> %IDEFIX_INI%

ECHO -Doomph.setup.jre.choice=false >> %IDEFIX_INI%
::ECHO -Doomph.installer.update.url=%BINTRAY_BUILD_ROOT%/p2/installer >> %IDEFIX_INI%
::ECHO -Doomph.update.url=%BINTRAY_BUILD_ROOT%/p2/oomph >> %IDEFIX_INI%
ECHO -Doomph.setup.installer.mode=advanced >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/productsCatalog.setup >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/projectsCatalog.setup >> %IDEFIX_INI%

ECHO.
ECHO # launching %IDEFIX_NAME%
ECHO.
START /B %SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

rework setup models

rework setup models


set NODIST_X64=0
call nodist use stable
call node -e "console.log(process.version + ' ' + process.arch)"
set PROJ_LIB=C:\mapnik-v2.3.0\share\proj
set GDAL_DATA=C:\mapnik-v2.3.0\share\gdal
rd /q /s build
del lib\\_mapnik.node
call npm install
npm test

set NODIST_X64=0
call nodist use stable
call node -e "console.log(process.version + ' ' + process.arch)"
set PROJ_LIB=C:\mapnik-v2.3.0\share\proj
set GDAL_DATA=C:\mapnik-v2.3.0\share\gdal
rd /q /s build
rd /q /s lib\binding
call npm install
npm test

clear correct directory

clear correct directory


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  @name@ start up script for Windows
@rem  This is simply a wrapper, launching the @cliName@.bat CLI
@rem
@rem ##########################################################################

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

set CLI_NAME=@cliName@.bat
set CLI_DIR=@cliDir@
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.

start /min cmd /c "%DIRNAME%%CLI_DIR%\%CLI_NAME% gui"

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  @name@ start up script for Windows
@rem  This is simply a wrapper, launching the @cliName@.bat CLI
@rem
@rem ##########################################################################

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

set CLI_NAME=@cliName@.bat
set CLI_DIR=@cliDir@
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.

start /min cmd /c ""%DIRNAME%%CLI_DIR%\%CLI_NAME%" gui"

handle white spaces in Windows start script


Add Windows wrapper for cli command

Add Windows wrapper for cli command


REM Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

REM Installing virtualbox
choco install virtualbox -y

REM Killing the default adapter and DHCP server to avoid network issues down the road
"C:\Program Files\Oracle\VirtualBox\VBoxManage" dhcpserver remove --netname "HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter"
"C:\Program Files\Oracle\VirtualBox\VBoxManage" hostonlyif remove "VirtualBox Host-Only Ethernet Adapter"

REM Installing vagrant
choco install vagrant -y

REM Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

REM Installing virtualbox
choco upgrade virtualbox -y

REM Killing the default adapter and DHCP server to avoid network issues down the road
"C:\Program Files\Oracle\VirtualBox\VBoxManage" dhcpserver remove --netname "HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter"
"C:\Program Files\Oracle\VirtualBox\VBoxManage" hostonlyif remove "VirtualBox Host-Only Ethernet Adapter"

REM Installing vagrant
choco upgrade vagrant -y

Use upgrade command with choco on Windows

`choco upgrade` will do `install` if the package is missing.


universe   = vanilla
executable = ./x_job_filexfer_testjob.pl
log = job_filexfer_output-withvacate_van.log
output = job_filexfer_output-withvacate_van.out
error = job_filexfer_output-withvacate_van.err
should_transfer_files = YES
when_to_transfer_output = ON_EXIT_OR_EVICT
transfer_output_files = submit_filetrans_output14821e.txt,submit_filetrans_output14821f.txt,submit_filetrans_output14821g.txt
Notification = NEVER
arguments = --job=14821 --long
queue

universe   = vanilla
executable = ./x_job_filexfer_testjob.pl
log = job_filexfer_output-withvacate_van.log
output = job_filexfer_output-withvacate_van.out
error = job_filexfer_output-withvacate_van.err
should_transfer_files = YES
when_to_transfer_output = ON_EXIT_OR_EVICT
transfer_output_files = submit_filetrans_output14821e.txt,submit_filetrans_output14821f.txt,submit_filetrans_output14821g.txt
Notification = NEVER
arguments = --job=14821 --forever
queue

Remove race condition on vacate in test by using -forever option. Fix parallel test behaviour.


@setlocal enableextensions enabledelayedexpansion & set "PATH0=%~f0" & PowerShell.exe -Command "& (Invoke-Expression -Command ('{#' + ((Get-Content '!PATH0:'=''!') -join \"`n\") + '}'))" %* & exit /b !errorlevel!
#
# - Name
#     ssh.bat
#
# - Contents
#     Simplify SSH Connect by Tera Term.
#     <Windows> + <R> => ssh root@192.168.1.100
#
# - Reference
#     http://pf-j.sakura.ne.jp/program/tips/ps1bat2.htm
#
# - Revision
#     2016-12-28 created.
#     2017-04-14 modified.
#     yyyy-MM-dd modified.
#

# constant
### 作業ディレクトリ
#[System.String] $base_dir = "$Env:Userprofile"             # ベースディレクトリ
[System.String] $base_dir = "$Env:Userprofile\GoogleDrive" # ベースディレクトリ
[System.String] $ssh_dir  = "$base_dir\ssh"                # teraterm起動ディレクトリ
[System.String] $log_dir  = "$ssh_dir\log"                 # teratermログ出力ディレクトリ
[System.String] $key_dir  = "$ssh_dir\key"                 # 秘密鍵設置ディレクトリ
[System.String] $csv_file = "$ssh_dir\hosts.csv"           # ログイン情報CSVファイル
### ログイン情報CSVファイル/記載内容について
###  +-----------------------------------------------------------------
###  |#Hostname,Port,Username,AuthType,Value,Alias
###  |192.168.1.100,22,root,publickey,id_rsa,root@192.168.1.100
###  |www.contoso.com,10022,admin,password,P@ssw0rd,admin@www.contoso.com
###  +-----------------------------------------------------------------
[System.String] $tt_install_uri = "https://ja.osdn.net/frs/redir.php?m=ymu&f=%2Fttssh2%2F67179%2Fteraterm-4.94.exe"
[System.String] $tt_install_exe = "$env:USERPROFILE\Downloads\teraterm-4.94.exe"

# variable
[System.String] $date = Get-Date -Format yyyyMMdd
[System.String] $time = Get-Date -Format HHmmss

# main
### teratemrインストールディレクトリからttermpro.exeを検索し、ttermpro.exeのフルパスを取得する
#[System.String] $ssh_client = Get-ChildItem -recurse "C:\Program Files*\teraterm" | Where-Object { $_.Name -match "ttermpro" } | ForEach-Object { $_.FullName }
###
if (-Not $? -Or -Not(Test-Path -Path (Get-ChildItem -recurse "C:\Program Files*\teraterm" | Where-Object { $_.Name -match "ttermpro" } | ForEach-Object { $_.FullName })))
{
    Invoke-WebRequest -Uri $tt_install_uri -OutFile $tt_install_exe
    Start-Process -FilePath $tt_install_exe -PassThru -Wait
    if (-Not $? -Or -Not(Test-Path -Path (Get-ChildItem -recurse "C:\Program Files*\teraterm" | Where-Object { $_.Name -match "ttermpro" } | ForEach-Object { $_.FullName })))
    {
        Write-Output "$(Get-Date -Format yyyy-MM-ddTHH:mm:sszzz) [ERROR]: ttermpro.exe not found in `"C:\Program Files*`"."
        [Console]::ReadKey() | Out-Null
        exit 1
    }
}

if ($args)
{
    ### $args[0]には<username>@<hostname>形式を想定
    [System.String] $ssh_alias = $args[0]
    [System.Array] $ssh_args = $args[0] -split "@"
    [System.String] $ssh_log = "$log_dir\" + $ssh_args[1] + "_" + $ssh_args[0] + "_" + $date + "_" + $time + ".log"

    ### $args[0]の値と、CSV内のAliasの値で、一致するものを取得する
    [System.Array] $csv_data = Import-Csv $csv_file | Where-Object { $_.Alias -eq $ssh_alias }

    ### $args[0]の値と、CSV内のAliasの値で、一致するものが存在する場合
    if ($csv_data)
    {
        ### TeraTermに渡す引数を作成
        [System.String] $opt_host = "ssh2://" + $csv_data[0].Hostname + ":" + $csv_data[0].Port
        [System.String] $opt_user = "/user=" + $csv_data[0].Username
        [System.String] $opt_auth = "/auth=" + $csv_data[0].AuthType
        if ($csv_data[0].AuthType -eq "password")
        {
            [System.String] $opt_value = "/passwd=" + $csv_data[0].Value
        }
        elseif ($csv_data[0].AuthType -eq "publickey")
        {
            [System.String] $opt_value = "/keyfile=$key_dir\" + $csv_data[0].Value
        }
        [System.String] $opt_dir = "/FD=$ssh_dir"
        [System.String] $opt_log = "/L=$ssh_log"

        [System.Array] $opt_array = @($opt_host,$opt_user,$opt_auth,$opt_value,$opt_dir,$opt_log,"/ssh-v","/LA=J")

    }
    ### $args[0]の値と、CSV内のAliasの値で、一致するものが存在しない場合
    else
    {
        ### CSVの内容を表示
        Import-Csv $csv_file | Where-Object { ($_.Alias) } | Select-Object Username,Hostname,Alias | Format-Table -AutoSize
        [Console]::ReadKey() | Out-Null
        exit 0
    }
}
else
{
    [System.String] $ssh_log = "$log_dir\undefined_undefined_" + $date + "_" + $time + ".log"
    [System.String] $opt_dir = "/FD=" + $ssh_dir
    [System.String] $opt_log = "/L=$ssh_log"
    [System.Array] $opt_array = @($opt_dir,$opt_log,"/ssh-v","/LA=J")
}

### teratermを実行
#$ssh_process = Start-Process -FilePath $ssh_client -ArgumentList $opt_array -PassThru -Wait
Start-Process -FilePath $ssh_client -ArgumentList $opt_array -PassThru -Wait
### teratermログファイルの属性を読み込み専用に変更
Set-ItemProperty -Path $ssh_log -Name Attributes -Value Readonly
### teratermログファイルの内容を表示(個人的な趣味)
Get-Content -Path $ssh_log
### teratermログファイルの情報を画面に出力
Write-Output "$(Get-Date -Format yyyy-MM-ddThh:mm:sszzz) [INFO]: Log file: $ssh_log"
### TeraTermが異常終了 => 既に確立済みのsshセッションが、ネットワーク切断等により強制終了した場合
if ($ssh_process.ExitCode -ne 0)
{
    Write-Output "$(Get-Date -Format yyyy-MM-ddThh:mm:sszzz) [ERROR]: ttermpro.exe exit code NOT equal 0."
}
[Console]::ReadKey() | Out-Null
exit 0

@setlocal enableextensions enabledelayedexpansion & set "PATH0=%~f0" & PowerShell.exe -Command "& (Invoke-Expression -Command ('{#' + ((Get-Content '!PATH0:'=''!') -join \"`n\") + '}'))" %* & exit /b !errorlevel!
#
# - Name
#     ssh.bat
#
# - Contents
#     Simplify SSH Connect by Tera Term.
#     <Windows> + <R> => ssh root@192.168.1.100
#
# - Reference
#     http://pf-j.sakura.ne.jp/program/tips/ps1bat2.htm
#
# - Revision
#     2016-12-28 created.
#     2017-04-14 modified.
#     yyyy-MM-dd modified.
#

# constant
### 作業ディレクトリ
#[System.String] $base_dir = "$Env:Userprofile"             # ベースディレクトリ
[System.String] $base_dir = "$Env:Userprofile\GoogleDrive" # ベースディレクトリ
[System.String] $ssh_dir  = "$base_dir\ssh"                # teraterm起動ディレクトリ
[System.String] $log_dir  = "$ssh_dir\log"                 # teratermログ出力ディレクトリ
[System.String] $key_dir  = "$ssh_dir\key"                 # 秘密鍵設置ディレクトリ
[System.String] $csv_file = "$ssh_dir\hosts.csv"           # ログイン情報CSVファイル
### ログイン情報CSVファイル/記載内容について
###  +-----------------------------------------------------------------
###  |#Hostname,Port,Username,AuthType,Value,Alias
###  |192.168.1.100,22,root,publickey,id_rsa,root@192.168.1.100
###  |www.contoso.com,10022,admin,password,P@ssw0rd,admin@www.contoso.com
###  +-----------------------------------------------------------------
[System.String] $tt_install_uri = "https://ja.osdn.net/frs/redir.php?m=ymu&f=%2Fttssh2%2F67179%2Fteraterm-4.94.exe"
[System.String] $tt_install_exe = "$env:USERPROFILE\Downloads\teraterm-4.94.exe"

# variable
[System.String] $date = Get-Date -Format yyyyMMdd
[System.String] $time = Get-Date -Format HHmmss

# main
### teratemrインストールディレクトリからttermpro.exeを検索し、ttermpro.exeのフルパスを取得する
[System.String] $ssh_client = Get-ChildItem -recurse "C:\Program Files*\teraterm" | Where-Object { $_.Name -match "ttermpro" } | ForEach-Object { $_.FullName }
###
if (-Not $? -Or -Not(Test-Path -Path $ssh_client))
{
    Invoke-WebRequest -Uri $tt_install_uri -OutFile $tt_install_exe
    Start-Process -FilePath $tt_install_exe -PassThru -Wait
    [System.String] $ssh_client = Get-ChildItem -recurse "C:\Program Files*\teraterm" | Where-Object { $_.Name -match "ttermpro" } | ForEach-Object { $_.FullName }
    if (-Not $? -Or -Not(Test-Path -Path $ssh_client))
    {
        Write-Output "$(Get-Date -Format yyyy-MM-ddTHH:mm:sszzz) [ERROR]: ttermpro.exe not found in `"C:\Program Files*`"."
        [Console]::ReadKey() | Out-Null
        exit 1
    }
}

if ($args)
{
    ### $args[0]には<username>@<hostname>形式を想定
    [System.String] $ssh_alias = $args[0]
    [System.Array] $ssh_args = $args[0] -split "@"
    [System.String] $ssh_log = "$log_dir\" + $ssh_args[1] + "_" + $ssh_args[0] + "_" + $date + "_" + $time + ".log"

    ### $args[0]の値と、CSV内のAliasの値で、一致するものを取得する
    [System.Array] $csv_data = Import-Csv $csv_file | Where-Object { $_.Alias -eq $ssh_alias }

    ### $args[0]の値と、CSV内のAliasの値で、一致するものが存在する場合
    if ($csv_data)
    {
        ### TeraTermに渡す引数を作成
        [System.String] $opt_host = "ssh2://" + $csv_data[0].Hostname + ":" + $csv_data[0].Port
        [System.String] $opt_user = "/user=" + $csv_data[0].Username
        [System.String] $opt_auth = "/auth=" + $csv_data[0].AuthType
        if ($csv_data[0].AuthType -eq "password")
        {
            [System.String] $opt_value = "/passwd=" + $csv_data[0].Value
        }
        elseif ($csv_data[0].AuthType -eq "publickey")
        {
            [System.String] $opt_value = "/keyfile=$key_dir\" + $csv_data[0].Value
        }
        [System.String] $opt_dir = "/FD=$ssh_dir"
        [System.String] $opt_log = "/L=$ssh_log"

        [System.Array] $opt_array = @($opt_host,$opt_user,$opt_auth,$opt_value,$opt_dir,$opt_log,"/ssh-v","/LA=J")

    }
    ### $args[0]の値と、CSV内のAliasの値で、一致するものが存在しない場合
    else
    {
        ### CSVの内容を表示
        Import-Csv $csv_file | Where-Object { ($_.Alias) } | Select-Object Username,Hostname,Alias | Format-Table -AutoSize
        [Console]::ReadKey() | Out-Null
        exit 0
    }
}
else
{
    [System.String] $ssh_log = "$log_dir\undefined_undefined_" + $date + "_" + $time + ".log"
    [System.String] $opt_dir = "/FD=" + $ssh_dir
    [System.String] $opt_log = "/L=$ssh_log"
    [System.Array] $opt_array = @($opt_dir,$opt_log,"/ssh-v","/LA=J")
}

### teratermを実行
#$ssh_process = Start-Process -FilePath $ssh_client -ArgumentList $opt_array -PassThru -Wait
Start-Process -FilePath $ssh_client -ArgumentList $opt_array -PassThru -Wait
### teratermログファイルの属性を読み込み専用に変更
Set-ItemProperty -Path $ssh_log -Name Attributes -Value Readonly
### teratermログファイルの内容を表示(個人的な趣味)
Get-Content -Path $ssh_log
### teratermログファイルの情報を画面に出力
Write-Output "$(Get-Date -Format yyyy-MM-ddThh:mm:sszzz) [INFO]: Log file: $ssh_log"
### TeraTermが異常終了 => 既に確立済みのsshセッションが、ネットワーク切断等により強制終了した場合
if ($ssh_process.ExitCode -ne 0)
{
    Write-Output "$(Get-Date -Format yyyy-MM-ddThh:mm:sszzz) [ERROR]: ttermpro.exe exit code NOT equal 0."
}
[Console]::ReadKey() | Out-Null
exit 0

Update ssh.bat

Update ssh.bat


nuget push ./deploy/dotnet-retire.1.0.4.nupkg -Source https://www.nuget.org/api/v2/package -ApiKey %nugetorgapikey%

nuget push ./deploy/dotnet-retire.2.0.0.nupkg -src https://api.nuget.org/v3/index.json

update publish script

update publish script


@REM @file
@REM   Windows batch file to setup a WORKSPACE environment
@REM
@REM Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this 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 IMPLIED.
@REM

@REM set CYGWIN_HOME=C:\cygwin

@REM usage:
@REM   edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
@REM if the argument, skip is present, only the paths and the
@REM test and set of environment settings are performed.

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

@echo off

@REM
@REM Set the WORKSPACE to the current working directory
@REM
pushd .
cd %~dp0

if not defined WORKSPACE (
  goto SetWorkSpace
)

if %WORKSPACE% == %CD% (
  @REM Workspace is not changed.
  goto ParseArgs
)

:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
if not defined WORKSPACE (
  set WORKSPACE=%CD%
  set EFI_SOURCE=
  set EDK_SOURCE=
)

:ParseArgs
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"=="/?" goto Usage
if /I "%1"=="/help" goto Usage

if /I not "%1"=="--nt32" goto no_nt32

@REM Flag, --nt32 is set
@REM The Nt32 Emluation Platform requires Microsoft Libraries
@REM and headers to interface with Windows.

if not defined VCINSTALLDIR (
  if defined VS140COMNTOOLS (
    call "%VS140COMNTOOLS%\vsvars32.bat"
  ) else (
    if defined VS120COMNTOOLS (
      call "%VS120COMNTOOLS%\vsvars32.bat"
    ) else (
      if defined VS110COMNTOOLS (
        call "%VS110COMNTOOLS%\vsvars32.bat"
      ) else (
        if defined VS100COMNTOOLS (
          call "%VS100COMNTOOLS%\vsvars32.bat"
        ) else (
          if defined VS90COMNTOOLS (
            call "%VS90COMNTOOLS%\vsvars32.bat"
          ) else (
            if defined VS80COMNTOOLS (
              call "%VS80COMNTOOLS%\vsvars32.bat"
            ) else (
              if defined VS71COMNTOOLS (
                call "%VS71COMNTOOLS%\vsvars32.bat"
              ) else (
                echo.
                echo !!! WARNING !!! Cannot find Visual Studio !!!
                echo.
              )
            )
          )
        )
      )
    )
  )
)
shift

:no_nt32

if /I "%1"=="NewBuild" shift
if exist %WORKSPACE%\BaseTools (
  set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
) else (
  if defined PACKAGES_PATH (
    for %%i IN (%PACKAGES_PATH%) DO (
      if exist %%~fi\BaseTools (
        set EDK_TOOLS_PATH=%%~fi\BaseTools
        goto checkBaseTools
      )
    )
  ) else (
    echo.
    echo !!! ERROR !!! Cannot find BaseTools !!!
    echo.
    goto BadBaseTools
  )
)
if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%

:checkBaseTools
IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
call %EDK_TOOLS_PATH%\toolsetup.bat %*
if /I "%1"=="Reconfig" shift
goto check_cygwin

:BadBaseTools
  @REM
  REM Need the BaseTools Package in order to build
  @REM
  @echo.
  @echo !!! ERROR !!! The BaseTools Package was not found !!!
  @echo.
  @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
  @echo For example,
  @echo   set EDK_TOOLS_PATH=C:\MyTools\BaseTools
  @echo The setup script, toolsetup.bat must reside in this folder.
  @echo.
  goto end

:check_cygwin
if defined CYGWIN_HOME (
  if not exist "%CYGWIN_HOME%" (
    @echo.
    @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
    @echo.
  )
) else (
  if exist c:\cygwin (
    set CYGWIN_HOME=c:\cygwin
  ) else (
    @echo.
    @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
    @echo.
  )
)

:cygwin_done
if "%1"=="" goto end

:Usage
  @echo.
  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"
  @echo         --nt32         Call vsvars32.bat for NT32 platform build.
  @echo.
  @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.
  @echo  Note that target.template, tools_def.template and build_rules.template
  @echo  will only be copied to target.txt, tools_def.txt and build_rule.txt
  @echo  respectively if they do not exist. Use option [Reconfig] to force the copy.
  @echo.
  goto end

:end
  popd

@REM @file
@REM   Windows batch file to setup a WORKSPACE environment
@REM
@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this 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 IMPLIED.
@REM

@REM set CYGWIN_HOME=C:\cygwin

@REM usage:
@REM   edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
@REM if the argument, skip is present, only the paths and the
@REM test and set of environment settings are performed.

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

@echo off

@REM
@REM Set the WORKSPACE to the current working directory
@REM
pushd .
cd %~dp0

if not defined WORKSPACE (
  goto SetWorkSpace
)

if %WORKSPACE% == %CD% (
  @REM Workspace is not changed.
  goto ParseArgs
)

:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
if not defined WORKSPACE (
  set WORKSPACE=%CD%
  set EFI_SOURCE=
  set EDK_SOURCE=
)

:ParseArgs
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"=="/?" goto Usage
if /I "%1"=="/help" goto Usage

if /I not "%1"=="--nt32" goto no_nt32

@REM Flag, --nt32 is set
@REM The Nt32 Emluation Platform requires Microsoft Libraries
@REM and headers to interface with Windows.

if not defined VCINSTALLDIR (
  if defined VS140COMNTOOLS (
    call "%VS140COMNTOOLS%\vsvars32.bat"
  ) else (
    if defined VS120COMNTOOLS (
      call "%VS120COMNTOOLS%\vsvars32.bat"
    ) else (
      if defined VS110COMNTOOLS (
        call "%VS110COMNTOOLS%\vsvars32.bat"
      ) else (
        if defined VS100COMNTOOLS (
          call "%VS100COMNTOOLS%\vsvars32.bat"
        ) else (
          if defined VS90COMNTOOLS (
            call "%VS90COMNTOOLS%\vsvars32.bat"
          ) else (
            if defined VS80COMNTOOLS (
              call "%VS80COMNTOOLS%\vsvars32.bat"
            ) else (
              if defined VS71COMNTOOLS (
                call "%VS71COMNTOOLS%\vsvars32.bat"
              ) else (
                echo.
                echo !!! WARNING !!! Cannot find Visual Studio !!!
                echo.
              )
            )
          )
        )
      )
    )
  )
)
shift

:no_nt32

if /I "%1"=="NewBuild" shift
if not defined EDK_TOOLS_PATH (
  if exist %WORKSPACE%\BaseTools (
    set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
  ) else (
    if defined PACKAGES_PATH (
      for %%i IN (%PACKAGES_PATH%) DO (
        if exist %%~fi\BaseTools (
          set EDK_TOOLS_PATH=%%~fi\BaseTools
          goto checkBaseTools
        )
      )
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools !!!
      echo.
      goto BadBaseTools
    )
  )
)
if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%

:checkBaseTools
IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
call %EDK_TOOLS_PATH%\toolsetup.bat %*
if /I "%1"=="Reconfig" shift
goto check_cygwin

:BadBaseTools
  @REM
  REM Need the BaseTools Package in order to build
  @REM
  @echo.
  @echo !!! ERROR !!! The BaseTools Package was not found !!!
  @echo.
  @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
  @echo For example,
  @echo   set EDK_TOOLS_PATH=C:\MyTools\BaseTools
  @echo The setup script, toolsetup.bat must reside in this folder.
  @echo.
  goto end

:check_cygwin
if defined CYGWIN_HOME (
  if not exist "%CYGWIN_HOME%" (
    @echo.
    @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
    @echo.
  )
) else (
  if exist c:\cygwin (
    set CYGWIN_HOME=c:\cygwin
  ) else (
    @echo.
    @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
    @echo.
  )
)

:cygwin_done
if "%1"=="" goto end

:Usage
  @echo.
  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"
  @echo         --nt32         Call vsvars32.bat for NT32 platform build.
  @echo.
  @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.
  @echo  Note that target.template, tools_def.template and build_rules.template
  @echo  will only be copied to target.txt, tools_def.txt and build_rule.txt
  @echo  respectively if they do not exist. Use option [Reconfig] to force the copy.
  @echo.
  goto end

:end
  popd

Update edksetup.bat to check EDK_TOOLS_PATH before set it.

If EDK_TOOLS_PATH is set, then not set it again.
If EDK_TOOLS_PATH is not set, then set it.

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


@echo off

set MAYAVERSION=2016
set ADSKQTVERSION=4.8.6
set SIPVERSION=4.16.7
set PYQTVERSION=4.11.3
set MAYADRIVE=m:
set BUILDDRIVE=v:

if exist %MAYADRIVE%\nul subst %MAYADRIVE% /d
subst %MAYADRIVE% "C:\Program Files\Autodesk\Maya%MAYAVERSION%"
set MAYA_LOCATION=%MAYADRIVE%

set MAYAPYQTBUILD=%~dp0
rem Removing trailing \
set MAYAPYQTBUILD=%MAYAPYQTBUILD:~0,-1%

if exist %BUILDDRIVE%\nul subst %BUILDDRIVE% /d
subst %BUILDDRIVE% "%MAYAPYQTBUILD%"

set SIPDIR=%BUILDDRIVE%\sip-%SIPVERSION%
set PYQTDIR=%BUILDDRIVE%\PyQt-win-gpl-%PYQTVERSION%
rem set ADSKQTDIR=%BUILDDRIVE%\qt-%ADSKQTVERSION%
set QTDIR=%MAYA_LOCATION%

set PATH=%QTDIR%\bin;%PATH%
set MSVC_VERSION=2012
set MSVC_DIR=C:\Program Files (x86)\Microsoft Visual Studio 11.0
set QMAKESPEC=%QTDIR%\mkspecs\win32-msvc%MSVC_VERSION%
set _QMAKESPEC_=win32-msvc%MSVC_VERSION%

if ["%LIBPATH%"]==[""] call "%MSVC_DIR%\VC\vcvarsall" amd64

set INCLUDE=%INCLUDE%;%MAYA_LOCATION%\include\python2.7
set LIB=%LIB%;%MAYA_LOCATION%\lib

@echo off

set MAYAVERSION=2016.5
set ADSKQTVERSION=4.8.6
set SIPVERSION=4.18
set PYQTVERSION=4.11.4
set MAYADRIVE=m:
set BUILDDRIVE=v:

if exist %MAYADRIVE%\nul subst %MAYADRIVE% /d
subst %MAYADRIVE% "C:\Program Files\Autodesk\Maya%MAYAVERSION%"
set MAYA_LOCATION=%MAYADRIVE%

set MAYAPYQTBUILD=%~dp0
rem Removing trailing \
set MAYAPYQTBUILD=%MAYAPYQTBUILD:~0,-1%

if exist %BUILDDRIVE%\nul subst %BUILDDRIVE% /d
subst %BUILDDRIVE% "%MAYAPYQTBUILD%"

set SIPDIR=%BUILDDRIVE%\sip-%SIPVERSION%
set PYQTDIR=%BUILDDRIVE%\PyQt-win-gpl-%PYQTVERSION%
rem set ADSKQTDIR=%BUILDDRIVE%\qt-%ADSKQTVERSION%
set QTDIR=%MAYA_LOCATION%

set PATH=%QTDIR%\bin;%PATH%
set MSVC_VERSION=2012
set MSVC_DIR=C:\Program Files (x86)\Microsoft Visual Studio 11.0
set QMAKESPEC=%QTDIR%\mkspecs\win32-msvc%MSVC_VERSION%
set _QMAKESPEC_=win32-msvc%MSVC_VERSION%

if ["%LIBPATH%"]==[""] call "%MSVC_DIR%\VC\vcvarsall" amd64

set INCLUDE=%INCLUDE%;%MAYA_LOCATION%\include\python2.7
set LIB=%LIB%;%MAYA_LOCATION%\lib

Add Windows changes for Maya 2016.5

Add Windows changes for Maya 2016.5