@echo off
setlocal
if "%CI%" == "" (echo LOCAL BUILD)
if "%CI%" == "" (set PACKAGE_BASE=build)
if "%CI%" == "" (set ELECTRON_OUT=ream-editor-win32-x64)
if "%CI%" == "" (set OMNISHARP_ZIP=omnisharp-win-x64-netcoreapp1.0.zip)
if "%CI%" == "" (set REAMQUERY_ZIP=reamquery.zip)
if "%CI%" == "" (set DOTNET_RUNTIME=win10-x64)
if "%CI%" == "" (rmdir /s /q %ELECTRON_OUT%)
if "%CI%" == "" (rmdir /s /q %PACKAGE_BASE%)
if not "%CI%" == "" (call npm install)
if not "%CI%" == "" (dotnet restore query)
if not "%CI%" == "" (set DOTNET_RUNTIME=win81-x64)
mkdir %PACKAGE_BASE%
if %errorlevel% neq 0 goto errorexit
rem https://github.com/npm/npm/issues/2938#issuecomment-11337463
call npm run-script gulp-build
if %errorlevel% neq 0 goto errorexit
copy index.static.html %PACKAGE_BASE%\index.html
if %errorlevel% neq 0 goto errorexit
copy bundle.js %PACKAGE_BASE%\bundle.js
if %errorlevel% neq 0 goto errorexit
rem electron adds a LICSENSE as well
copy LICENSE %PACKAGE_BASE%\ream-editor-license.txt
if %errorlevel% neq 0 goto errorexit
copy electron-main.js %PACKAGE_BASE%\electron-main.js
if %errorlevel% neq 0 goto errorexit
copy package.json %PACKAGE_BASE%\package.json
if %errorlevel% neq 0 goto errorexit
xcopy resources %PACKAGE_BASE%\resources\ /S
if %errorlevel% neq 0 goto errorexit
dotnet build query\src\ReamQuery --runtime %DOTNET_RUNTIME%
dotnet publish query\src\ReamQuery --configuration Release --output %PACKAGE_BASE%\query --runtime %DOTNET_RUNTIME%
if %errorlevel% neq 0 goto errorexit
copy query\src\ReamQuery\nlog.config %PACKAGE_BASE%\query\nlog.config
if %errorlevel% neq 0 goto errorexit
7z x %OMNISHARP_ZIP% -y -o"%PACKAGE_BASE%\omnisharp"
if %errorlevel% neq 0 goto errorexit
echo Create a zip dist of reamquery that backends will run against
cd query
7z a %REAMQUERY_ZIP% NuGet.config global.json src\**\*.cs src\**\*.json -r
if %errorlevel% neq 0 goto errorexit
7z d %REAMQUERY_ZIP% bin\ -r
if %errorlevel% neq 0 goto errorexit
7z d %REAMQUERY_ZIP% obj\ -r
if %errorlevel% neq 0 goto errorexit
move %REAMQUERY_ZIP% ..\%PACKAGE_BASE%
if %errorlevel% neq 0 goto errorexit
echo Install startup dependencies
cd ..\scripts\startup
call npm install
if %errorlevel% neq 0 goto errorexit
xcopy node_modules ..\..\%PACKAGE_BASE%\node_modules\ /S /Y
if %errorlevel% neq 0 goto errorexit
copy omnisharp-setup.js ..\..\%PACKAGE_BASE%\omnisharp-setup.js
if %errorlevel% neq 0 goto errorexit
cd ..\..
call npm run-script package_electron_win32
endlocal
echo Build success
exit /b 0
:errorexit
echo Build failed
exit /b %errorlevel

@echo off
setlocal
set REAMQUERY_ZIP=reamquery.zip
rem CI builds must provide this file as well
set OMNISHARP_ZIP=omnisharp-win-x64-netcoreapp1.0.zip
if "%CI%" == "" (echo LOCAL BUILD)
if "%CI%" == "" (set PACKAGE_BASE=build)
if "%CI%" == "" (set ELECTRON_OUT=ream-editor-win32-x64)
if "%CI%" == "" (set DOTNET_RUNTIME=win10-x64)
if "%CI%" == "" (rmdir /s /q %ELECTRON_OUT%)
if "%CI%" == "" (rmdir /s /q %PACKAGE_BASE%)
if not "%CI%" == "" (call npm install)
if not "%CI%" == "" (dotnet restore query)
if not "%CI%" == "" (set DOTNET_RUNTIME=win81-x64)
mkdir %PACKAGE_BASE%
if %errorlevel% neq 0 goto errorexit
rem https://github.com/npm/npm/issues/2938#issuecomment-11337463
call npm run-script gulp-build
if %errorlevel% neq 0 goto errorexit
copy index.static.html %PACKAGE_BASE%\index.html
if %errorlevel% neq 0 goto errorexit
copy bundle.js %PACKAGE_BASE%\bundle.js
if %errorlevel% neq 0 goto errorexit
rem electron adds a LICSENSE as well
copy LICENSE %PACKAGE_BASE%\ream-editor-license.txt
if %errorlevel% neq 0 goto errorexit
copy electron-main.js %PACKAGE_BASE%\electron-main.js
if %errorlevel% neq 0 goto errorexit
copy package.json %PACKAGE_BASE%\package.json
if %errorlevel% neq 0 goto errorexit
xcopy resources %PACKAGE_BASE%\resources\ /S
if %errorlevel% neq 0 goto errorexit
dotnet build query\src\ReamQuery --runtime %DOTNET_RUNTIME%
dotnet publish query\src\ReamQuery --configuration Release --output %PACKAGE_BASE%\query --runtime %DOTNET_RUNTIME%
if %errorlevel% neq 0 goto errorexit
copy query\src\ReamQuery\nlog.config %PACKAGE_BASE%\query\nlog.config
if %errorlevel% neq 0 goto errorexit
7z x %OMNISHARP_ZIP% -y -o"%PACKAGE_BASE%\omnisharp"
if %errorlevel% neq 0 goto errorexit
echo Create a zip dist of reamquery that backends will run against
cd query
7z a %REAMQUERY_ZIP% NuGet.config global.json src\**\*.cs src\**\*.json -r
if %errorlevel% neq 0 goto errorexit
7z d %REAMQUERY_ZIP% bin\ -r
if %errorlevel% neq 0 goto errorexit
7z d %REAMQUERY_ZIP% obj\ -r
if %errorlevel% neq 0 goto errorexit
move %REAMQUERY_ZIP% ..\%PACKAGE_BASE%
if %errorlevel% neq 0 goto errorexit
echo Install startup dependencies
cd ..\scripts\startup
call npm install
if %errorlevel% neq 0 goto errorexit
xcopy node_modules ..\..\%PACKAGE_BASE%\node_modules\ /S /Y
if %errorlevel% neq 0 goto errorexit
copy omnisharp-setup.js ..\..\%PACKAGE_BASE%\omnisharp-setup.js
if %errorlevel% neq 0 goto errorexit
cd ..\..
call npm run-script package_electron_win32
endlocal
echo Build success
exit /b 0
:errorexit
echo Build failed
exit /b %errorlevel

Fix build for CI

Fix build for CI


@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.

@REM -----------------------------------------------------------------------------
@REM Apache Maven Startup Script
@REM
@REM Environment Variable Prerequisites
@REM
@REM   JAVA_HOME          Must point at your Java Development Kit installation.
@REM   MAVEN_BATCH_ECHO  (Optional) Set to 'on' to enable the echoing of the batch commands.
@REM   MAVEN_BATCH_PAUSE (Optional) set to 'on' to wait for a key stroke before ending.
@REM   MAVEN_OPTS        (Optional) Java runtime options used when Maven is executed.
@REM   MAVEN_SKIP_RC     (Optional) Flag to disable loading of mavenrc files.
@REM -----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

:chkMHome
set "MAVEN_HOME=%~dp0.."
if not "%MAVEN_HOME%"=="" goto valMHome
goto error

:valMHome

:stripMHome
if not "_%MAVEN_HOME:~-1%"=="_\" goto checkMCmd
set "MAVEN_HOME=%MAVEN_HOME:~0,-1%"
goto stripMHome

:checkMCmd
if exist "%MAVEN_HOME%\bin\mvn.cmd" goto init
goto error
@REM ==== END VALIDATION ====

:init

set MAVEN_CMD_LINE_ARGS=%*

@REM Find the project basedir, i.e., the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
if not "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set "EXEC_DIR=%CD%"
set "WDIR=%EXEC_DIR%"

:findBaseDir
if exist "%WDIR%\.mvn" goto baseDirFound
cd ..
if "%WDIR%"=="%CD%" goto baseDirNotFound
set "WDIR=%CD%"
goto findBaseDir

:baseDirFound
set "MAVEN_PROJECTBASEDIR=%WDIR%"
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
if "_%EXEC_DIR:~-1%"=="_\" set EXEC_DIR=%EXEC_DIR:~0,-1%
set "MAVEN_PROJECTBASEDIR=%EXEC_DIR%"
cd "%EXEC_DIR%"

:endDetectBaseDir

set "jvmConfig=\.mvn\jvm.config"
if not exist "%MAVEN_PROJECTBASEDIR%%jvmConfig%"  goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

set MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i"

set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.

@REM -----------------------------------------------------------------------------
@REM Apache Maven Startup Script
@REM
@REM Environment Variable Prerequisites
@REM
@REM   JAVA_HOME          Must point at your Java Development Kit installation.
@REM   MAVEN_BATCH_ECHO  (Optional) Set to 'on' to enable the echoing of the batch commands.
@REM   MAVEN_BATCH_PAUSE (Optional) set to 'on' to wait for a key stroke before ending.
@REM   MAVEN_OPTS        (Optional) Java runtime options used when Maven is executed.
@REM   MAVEN_SKIP_RC     (Optional) Flag to disable loading of mavenrc files.
@REM -----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat"
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

:chkMHome
set "MAVEN_HOME=%~dp0.."
if not "%MAVEN_HOME%"=="" goto valMHome
goto error

:valMHome

:stripMHome
if not "_%MAVEN_HOME:~-1%"=="_\" goto checkMCmd
set "MAVEN_HOME=%MAVEN_HOME:~0,-1%"
goto stripMHome

:checkMCmd
if exist "%MAVEN_HOME%\bin\mvn.cmd" goto init
goto error
@REM ==== END VALIDATION ====

:init

set MAVEN_CMD_LINE_ARGS=%*

@REM Find the project basedir, i.e., the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
if not "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set "EXEC_DIR=%CD%"
set "WDIR=%EXEC_DIR%"

:findBaseDir
if exist "%WDIR%\.mvn" goto baseDirFound
cd ..
if "%WDIR%"=="%CD%" goto baseDirNotFound
set "WDIR=%CD%"
goto findBaseDir

:baseDirFound
set "MAVEN_PROJECTBASEDIR=%WDIR%"
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
if "_%EXEC_DIR:~-1%"=="_\" set EXEC_DIR=%EXEC_DIR:~0,-1%
set "MAVEN_PROJECTBASEDIR=%EXEC_DIR%"
cd "%EXEC_DIR%"

:endDetectBaseDir

set "jvmConfig=\.mvn\jvm.config"
if not exist "%MAVEN_PROJECTBASEDIR%%jvmConfig%"  goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

set MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i"

set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

[MNG-6001] Replace %HOME% with %USERPROFILE% in mvn.cmd


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

echo on

set GYP_MSVS_VERSION=2008

:: Blow away path for now if on the bots (to be more hermetic).
if %BUILDBOT_SLAVENAME% equ "" goto SkipPathReset
set PATH=
set PATH=%PATH%;c:\b\depot_tools;c:\b\depot_tools\python_bin
set PATH=%PATH%;c:\b\build_internal\tools
set PATH=%PATH%;e:\b\depot_tools;e:\b\depot_tools\python_bin
set PATH=%PATH%;e:\b\build_internal\tools
set PATH=%PATH%;C:\WINDOWS\system32;C:\WINDOWS\system32\WBEM
:SkipPathReset

:: Adding in both the 32-bit on 64-bit program files install location for both
:: MSVS2008 and MSVS2005 including the team tools.

set MSVS8=c:\Program Files\Microsoft Visual Studio 8.0
set MSVS8_X86=c:\Program Files (x86)\Microsoft Visual Studio 8.0
set MSVS9=c:\Program Files\Microsoft Visual Studio 9.0
set MSVS9_X86=c:\Program Files (x86)\Microsoft Visual Studio 9.0

if [%1] equ [32] goto :Set32
set VS90COMNTOOLS=%MSVS9_X86%\Common7\Tools\
set VS80COMNTOOLS=%MSVS8_X86%\Common7\Tools\
goto :SetEnd
:Set32
set VS90COMNTOOLS=%MSVS9%\Common7\Tools\
set VS80COMNTOOLS=%MSVS8%\Common7\Tools\
:SetEnd
set SCONS_MSCOMMON_DEBUG=-

set PATH=%PATH%;%MSVS9%\VC
set PATH=%PATH%;%MSVS9_X86%\VC
set PATH=%PATH%;%MSVS9%\Common7\Tools
set PATH=%PATH%;%MSVS9_X86%\Common7\Tools
set PATH=%PATH%;%MSVS9%\Team Tools\Performance Tools
set PATH=%PATH%;%MSVS9_X86%\Team Tools\Performance Tools

set PATH=%PATH%;%MSVS8%\VC
set PATH=%PATH%;%MSVS8_X86%\VC
set PATH=%PATH%;%MSVS8%\Common7\Tools
set PATH=%PATH%;%MSVS8_X86%\Common7\Tools
set PATH=%PATH%;%MSVS8%\Team Tools\Performance Tools
set PATH=%PATH%;%MSVS8_X86%\Team Tools\Performance Tools

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

echo on

set GYP_MSVS_VERSION=2008

:: Blow away path for now if on the bots (to be more hermetic).
if "%BUILDBOT_SLAVENAME%" equ "" goto SkipPathReset
set PATH=
set PATH=%PATH%;c:\b\depot_tools;c:\b\depot_tools\python_bin
set PATH=%PATH%;c:\b\build_internal\tools
set PATH=%PATH%;e:\b\depot_tools;e:\b\depot_tools\python_bin
set PATH=%PATH%;e:\b\build_internal\tools
set PATH=%PATH%;C:\WINDOWS\system32;C:\WINDOWS\system32\WBEM
:SkipPathReset

:: Adding in both the 32-bit on 64-bit program files install location for both
:: MSVS2008 and MSVS2005 including the team tools.

set MSVS8=c:\Program Files\Microsoft Visual Studio 8.0
set MSVS8_X86=c:\Program Files (x86)\Microsoft Visual Studio 8.0
set MSVS9=c:\Program Files\Microsoft Visual Studio 9.0
set MSVS9_X86=c:\Program Files (x86)\Microsoft Visual Studio 9.0

if [%1] equ [32] goto :Set32
set VS90COMNTOOLS=%MSVS9_X86%\Common7\Tools\
set VS80COMNTOOLS=%MSVS8_X86%\Common7\Tools\
goto :SetEnd
:Set32
set VS90COMNTOOLS=%MSVS9%\Common7\Tools\
set VS80COMNTOOLS=%MSVS8%\Common7\Tools\
:SetEnd
set SCONS_MSCOMMON_DEBUG=-

set PATH=%PATH%;%MSVS9%\VC
set PATH=%PATH%;%MSVS9_X86%\VC
set PATH=%PATH%;%MSVS9%\Common7\Tools
set PATH=%PATH%;%MSVS9_X86%\Common7\Tools
set PATH=%PATH%;%MSVS9%\Team Tools\Performance Tools
set PATH=%PATH%;%MSVS9_X86%\Team Tools\Performance Tools

set PATH=%PATH%;%MSVS8%\VC
set PATH=%PATH%;%MSVS8_X86%\VC
set PATH=%PATH%;%MSVS8%\Common7\Tools
set PATH=%PATH%;%MSVS8_X86%\Common7\Tools
set PATH=%PATH%;%MSVS8%\Team Tools\Performance Tools
set PATH=%PATH%;%MSVS8_X86%\Team Tools\Performance Tools

Fix error that prevents testing buildbot script locally.

BUG= none
TEST= run buildbot\buildbot+windows-glibc-makefile.bat
Review URL: https://chromiumcodereview.appspot.com/10827413

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@9527 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2


@if exist setup-scripts.cmd (
echo %path%|findstr /i /c:"%cd%">nul  || setx path "%path%;%cd%"
) else (
echo Run this from the scripts folder
)

@if exist setup-scripts.cmd (
echo %%path%%|findstr /i /c:"%cd%">nul  || setx path "%path%;%cd%"
) else (
echo Run this from the scripts folder
)

Fix escaping

Fix escaping


@echo on

set APPVEYOR_CI=1

:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS140COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS120COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0

:vsversionset
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :failure

if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"      set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :failure

:: See <http://www.appveyor.com/docs/environment-variables>
if defined APPVEYOR (
    rem See <http://www.appveyor.com/docs/build-phase>
    if exist "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" (
	rem HACK HACK HACK
	set _msbuildexe=%_msbuildexe% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    )
)

set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure

.\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget\nuget.config
@if ERRORLEVEL 1 echo Error: Nuget restore failed  && goto :failure

:: Build
%_msbuildexe% src\fsharp-proto-build.proj
@if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure

%_ngenexe% install Proto\net40\bin\fsc-proto.exe
@if ERRORLEVEL 1 echo Error: NGen of proto failed  && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:Configuration=Release  /v:diag
@if ERRORLEVEL 1 echo Error: library build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=coreclr /p:Configuration=Release /p:RestorePackages=true
@if ERRORLEVEL 1 echo Error: library coreclr build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:TargetFramework=coreclr /p:Configuration=Release /p:RestorePackages=true
@if ERRORLEVEL 1 echo Error: compiler coreclr build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable7 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable78 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable259 build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable47 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable7 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable78 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable259 && goto :failure

%_msbuildexe% vsintegration\fsharp-vsintegration-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration build failed && goto :failure

%_msbuildexe% vsintegration\fsharp-vsintegration-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration unit tests build failed && goto :failure

@echo on
call src\update.cmd release -ngen
pushd tests

@echo on
call BuildTestTools.cmd release
@if ERRORLEVEL 1 echo Error: 'BuildTestTools.cmd release' failed && goto :failure

@echo on
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=true

%_msbuildexe% fsharp\fsharp.tests.fsproj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: fsharp cambridge tests for nunit failed && goto :failure

call RunTests.cmd release fsharp Smoke
@if ERRORLEVEL 1 type testresults\fsharp_failures.log && echo Error: 'RunTests.cmd release fsharp Smoke' failed && goto :failure
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=

call RunTests.cmd release fsharpqa Smoke
@if ERRORLEVEL 1 type testresults\fsharpqa_failures.log && echo Error: 'RunTests.cmd release fsharpqa Smoke' failed && goto :failure

call RunTests.cmd release compilerunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release compilerunit' failed && goto :failure

call RunTests.cmd release coreunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunit' failed && goto :failure

call RunTests.cmd release fsharp coreclr
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreclr' failed && goto :failure

popd

goto :eof

:failure
exit /b 1

@echo on

set APPVEYOR_CI=1

:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS140COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS120COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0

:vsversionset
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :failure

if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"      set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :failure

:: See <http://www.appveyor.com/docs/environment-variables>
if defined APPVEYOR (
    rem See <http://www.appveyor.com/docs/build-phase>
    if exist "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" (
	rem HACK HACK HACK
	set _msbuildexe=%_msbuildexe% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    )
)

set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure

.\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget\nuget.config
@if ERRORLEVEL 1 echo Error: Nuget restore failed  && goto :failure

:: Build
%_msbuildexe% src\fsharp-proto-build.proj
@if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure

%_ngenexe% install Proto\net40\bin\fsc-proto.exe
@if ERRORLEVEL 1 echo Error: NGen of proto failed  && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:Configuration=Release  /v:diag
@if ERRORLEVEL 1 echo Error: library build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=coreclr /p:Configuration=Release /p:RestorePackages=true
@if ERRORLEVEL 1 echo Error: library coreclr build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:TargetFramework=coreclr /p:Configuration=Release /p:RestorePackages=true
@if ERRORLEVEL 1 echo Error: compiler coreclr build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable7 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable78 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable259 build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable47 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable7 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable78 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable259 && goto :failure

%_msbuildexe% vsintegration\fsharp-vsintegration-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration build failed && goto :failure

%_msbuildexe% vsintegration\fsharp-vsintegration-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration unit tests build failed && goto :failure

@echo on
call src\update.cmd release -ngen
pushd tests

@echo on
call BuildTestTools.cmd release
@if ERRORLEVEL 1 echo Error: 'BuildTestTools.cmd release' failed && goto :failure

@echo on
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=true

%_msbuildexe% fsharp\fsharp.tests.fsproj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: fsharp cambridge tests for nunit failed && goto :failure

call RunTests.cmd release fsharp Smoke
@if ERRORLEVEL 1 type testresults\fsharp_failures.log && echo Error: 'RunTests.cmd release fsharp Smoke' failed && goto :failure
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=

call RunTests.cmd release fsharpqa Smoke
@if ERRORLEVEL 1 type testresults\fsharpqa_failures.log && echo Error: 'RunTests.cmd release fsharpqa Smoke' failed && goto :failure

call RunTests.cmd release compilerunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release compilerunit' failed && goto :failure

call RunTests.cmd release coreunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunit' failed && goto :failure

call RunTests.cmd release coreunitportable259
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable259' failed && goto :failure

call RunTests.cmd release fsharp coreclr
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreclr' failed && goto :failure

popd

goto :eof

:failure
exit /b 1

Add portable 259 unittests to appveyor-build.cmd


@echo off

title Audit.NET Unit Tests Runner

echo Disabling GitHub nuget source to avoid conflicts
nuget sources disable -name GitHub
echo.

call start-services

cd ..
dotnet restore
cd test

cd Audit.Mvc.UnitTest
echo ---------------------------------------------- RUNNING MVC UNIT TESTS (1) ----------------------------------------------
TITLE RUNNING MVC UNIT TESTS (1)
dotnet test --logger:"console;verbosity=normal"

echo Running...

cd ..

cd Audit.UnitTest
echo ---------------------------------------------- RUNNING GENERAL UNIT TESTS (2.1) ----------------------------------------------
TITLE RUNNING GENERAL UNIT TESTS (2.1)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

echo ---------------------------------------------- RUNNING JSON ADAPTER UNIT TESTS (2.2) ----------------------------------------------
TITLE RUNNING JSON ADAPTER UNIT TESTS (2.2)
cd Audit.JsonAdapter.UnitTest
dotnet test --logger:"console;verbosity=normal"
cd ..

cd Audit.WebApi.UnitTest
echo ---------------------------------------------- RUNNING WEB API UNIT TESTS (3) ----------------------------------------------
TITLE RUNNING WEB API UNIT TESTS (3)
dotnet test --logger:"console;verbosity=normal"

echo Running...

cd ..

cd Audit.Integration.AspNetCore
echo ---------------------------------------------- RUNNING ASP NET CORE UNIT TESTS (4) ----------------------------------------------
TITLE RUNNING ASP NET CORE UNIT TESTS (4)
dotnet run
cd ..

cd Audit.DynamicProxy.UnitTest
echo ---------------------------------------------- RUNNING DYNAMIC PROXY UNIT TESTS (5) ----------------------------------------------
TITLE RUNNING DYNAMIC PROXY UNIT TESTS (5)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.Core.UnitTest
echo ---------------------------------------------- RUNNING EF CORE UNIT TESTS (6) ----------------------------------------------
TITLE RUNNING EF CORE UNIT TESTS (6)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.Core.v3.UnitTest
echo ---------------------------------------------- RUNNING EF CORE UNIT TESTS V3 (7) ----------------------------------------------
TITLE RUNNING EF CORE UNIT TESTS V3 (7)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.UnitTest
echo ---------------------------------------------- RUNNING EF UNIT TESTS (8) ----------------------------------------------
TITLE RUNNING EF UNIT TESTS (8)
IF NOT EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe" (
	echo The file does not exist
        exit /B 1
)
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=LocalDb
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=Sql
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=Stress

echo Running...
cd ..

cd Audit.EntityFramework.Full.UnitTest
echo ---------------------------------------------- RUNNING EF FULL UNIT TESTS (9) ----------------------------------------------
TITLE RUNNING EF FULL UNIT TESTS (9)
dotnet test --logger:"console;verbosity=normal"
echo Running...
cd ..

cd Audit.Redis.UnitTest
echo ---------------------------------------------- RUNNING REDIS UNIT TESTS (10.1) ----------------------------------------------
TITLE RUNNING REDIS UNIT TESTS (10.1)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.Wcf.UnitTest
echo ---------------------------------------------- RUNNING WCF CLIENT TESTS (10.2) ----------------------------------------------
TITLE RUNNING WCF CLIENT TESTS (10.2)
dotnet test --logger:"console;verbosity=normal"
echo Running...
cd ..

cd Audit.RavenDB.UnitTest
echo ---------------------------------------------- RUNNING RAVEN TESTS (10.3) ----------------------------------------------
TITLE RUNNING RAVEN TESTS (10.3)
dotnet test --logger:"console;verbosity=normal"
echo Running...
cd ..

cd Audit.IntegrationTest
echo ---------------------------------------------- RUNNING GENERAL INTEGRATION TEST (11) ----------------------------------------------
TITLE RUNNING GENERAL INTEGRATION TEST (11)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory!=AzureDocDb&TestCategory!=AzureBlob&TestCategory!=WCF&TestCategory!=Elasticsearch&TestCategory!=Dynamo&TestCategory!=PostgreSQL&TestCategory!=Kafka"
echo ---------------------------------------------- RUNNING Kafka INTEGRATION TEST (12) ----------------------------------------------
TITLE RUNNING Kafka INTEGRATION TEST (12)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Kafka"
echo ---------------------------------------------- RUNNING PostgreSQL INTEGRATION TEST (13) ----------------------------------------------
TITLE RUNNING PostgreSQL INTEGRATION TEST (13)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=PostgreSQL"
echo ---------------------------------------------- RUNNING Azure Cosmos DB INTEGRATION TEST (14) ----------------------------------------------
TITLE Azure Cosmos DB INTEGRATION TEST (14)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=AzureDocDb"
echo ---------------------------------------------- RUNNING Azure BLOB INTEGRATION TEST (15) ----------------------------------------------
TITLE RUNNING Azure BLOB INTEGRATION TEST (15)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=AzureBlob"
echo ---------------------------------------------- RUNNING WCF SYNC INTEGRATION TEST (16) ----------------------------------------------
TITLE RUNNING WCF SYNC INTEGRATION TEST (16)
dotnet test --logger:"console;verbosity=normal" -f net452 --filter "TestCategory=WCF&TestCategory!=Async"
echo ---------------------------------------------- RUNNING WCF ASYNC INTEGRATION TEST (17) ----------------------------------------------
TITLE RUNNING WCF ASYNC INTEGRATION TEST (17)
dotnet test --logger:"console;verbosity=normal" -f net452 --filter "TestCategory=WCF&TestCategory=Async"
echo ---------------------------------------------- RUNNING ELASTICSEARCH INTEGRATION TEST (18) ----------------------------------------------
TITLE RUNNING ELASTICSEARCH INTEGRATION TEST (18)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Elasticsearch"
echo ---------------------------------------------- RUNNING DYNAMO DB INTEGRATION TEST (19) ----------------------------------------------
TITLE RUNNING DYNAMO DB INTEGRATION TEST (19)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Dynamo"

cd ..

title Audit.NET Unit Tests Runner

ECHO.
ECHO --- PRESS ENTER TO STOP THE SERVICES (or CTRL+C to cancel)
pause>nul

call stop-services

echo Enabling GitHub nuget source
nuget sources enable -name GitHub
echo.

test fix commit user

test fix commit user


setlocal enableextensions

if "%PY_VER%" == "3.4" (
    set MSVC_VER="10.0"
) else (
    if "%PY_VER%" == "3.5" (
        set MSVC_VER="14.0"
    ) else (
        set MSVC_VER="9.0"
    )
)

set EXTRA_ARGS=""
if %ARCH% EQU 64 (
	set EXTRA_ARGS="address-model=64"
)

python -c "from __future__ import print_function; import distutils.sysconfig; print(distutils.sysconfig.get_python_inc(True))" > temp.txt
set /p PYTHON_INCLUDE_DIR=<temp.txt

call bootstrap.bat

bjam.exe --debug-configuration ^
         --user-config="%RECIPE_DIR%/user-config-win.jam" ^
		 -sBZIP2_LIBPATH="%LIBRARY_LIB%" -sBZIP2_INCLUDE="%LIBRARY_INC%" -sBZIP2_BINARY=bzip2 ^
		 -sZLIB_INCLUDE="%LIBRARY_INC%" -sZLIB_LIBPATH="%LIBRARY_LIB%" -sZLIB_BINARY=zlib ^
		 link=shared toolset="msvc-%MSVC_VER%" %EXTRA_ARGS% stage

robocopy "stage\lib" "%LIBRARY_BIN%" /E /NFL
robocopy "boost" "%LIBRARY_INC%\boost" /E /NFL /NDL

exit 0

setlocal enableextensions

if "%PY_VER%" == "3.4" (
    set MSVC_VER="10.0"
) else (
    if "%PY_VER%" == "3.5" (
        set MSVC_VER="14.0"
    ) else (
        set MSVC_VER="9.0"
    )
)

set EXTRA_ARGS=""
if %ARCH% EQU 64 (
	set EXTRA_ARGS="address-model=64"
)

%PYTHON% -c "from __future__ import print_function; import distutils.sysconfig; print(distutils.sysconfig.get_python_inc(True))" > temp.txt
set /p PYTHON_INCLUDE_DIR=<temp.txt

call bootstrap.bat

bjam.exe --debug-configuration ^
         --user-config="%RECIPE_DIR%/user-config-win.jam" ^
		 -sBZIP2_LIBPATH="%LIBRARY_LIB%" -sBZIP2_INCLUDE="%LIBRARY_INC%" -sBZIP2_BINARY=bzip2 ^
		 -sZLIB_INCLUDE="%LIBRARY_INC%" -sZLIB_LIBPATH="%LIBRARY_LIB%" -sZLIB_BINARY=zlib ^
		 link=shared toolset="msvc-%MSVC_VER%" %EXTRA_ARGS% stage

robocopy "stage\lib" "%LIBRARY_BIN%" /E /NFL
robocopy "boost" "%LIBRARY_INC%\boost" /E /NFL /NDL

exit 0

Use conda Python rather than system

Use conda Python rather than system


@setlocal enabledelayedexpansion

REM Parse Arguments.

set RoslynRoot=%~dp0
set BuildConfiguration=Debug

REM Because override the C#/VB toolset to build against our LKG package, it is important
REM that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise,
REM we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211.
set MSBuildAdditionalCommandLineArgs=/nologo /m /nodeReuse:false /consoleloggerparameters:Verbosity=minimal /filelogger /fileloggerparameters:Verbosity=normal

:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
if /I "%1" == "/test32" set Test64=false&&shift&& goto :ParseArguments
if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
if /I "%1" == "/testDeterminism" set TestDeterminism=true&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" || goto :BuildFailed

powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-branch.ps1" || goto :BuildFailed

REM Output the commit that we're building, for reference in Jenkins logs
echo Building this commit:
git show --no-patch --pretty=raw HEAD

REM Restore the NuGet packages
    call "%RoslynRoot%\Restore.cmd" || goto :BuildFailed

REM Ensure the binaries directory exists because msbuild can fail when part of the path to LogFile isn't present.
set bindir=%RoslynRoot%Binaries
if not exist "%bindir%" mkdir "%bindir%" || goto :BuildFailed

REM Set the build version only so the assembly version is set to the semantic version,
REM which allows analyzers to load because the compiler has binding redirects to the
REM semantic version
msbuild %MSBuildAdditionalCommandLineArgs% /p:BuildVersion=0.0.0.0 "%RoslynRoot%build\Toolset.sln" /p:NuGetRestorePackages=false /p:Configuration=%BuildConfiguration% /fileloggerparameters:LogFile="%bindir%\Bootstrap.log" || goto :BuildFailed
powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-msbuild.ps1" "%bindir%\Bootstrap.log" || goto :BuildFailed

if not exist "%bindir%\Bootstrap" mkdir "%bindir%\Bootstrap" || goto :BuildFailed
move "Binaries\%BuildConfiguration%\*" "%bindir%\Bootstrap" || goto :BuildFailed
copy "build\scripts\*" "%bindir%\Bootstrap" || goto :BuildFailed

REM Clean the previous build
msbuild %MSBuildAdditionalCommandLineArgs% /t:Clean build/Toolset.sln /p:Configuration=%BuildConfiguration%  /fileloggerparameters:LogFile="%bindir%\BootstrapClean.log" || goto :BuildFailed

call :TerminateBuildProcesses

if defined TestDeterminism (
    powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\test-determinism.ps1" "%bindir%\Bootstrap" || goto :BuildFailed
    call :TerminateBuildProcesses
    exit /b 0
)

msbuild %MSBuildAdditionalCommandLineArgs% /p:BootstrapBuildPath="%bindir%\Bootstrap" BuildAndTest.proj /p:Configuration=%BuildConfiguration% /p:Test64=%Test64% /fileloggerparameters:LogFile="%bindir%\Build.log";verbosity=diagnostic || goto :BuildFailed
powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-msbuild.ps1" "%bindir%\Build.log" || goto :BuildFailed

call :TerminateBuildProcesses

REM Verify that our project.lock.json files didn't change as a result of
REM restore.  If they do then the commit changed the dependencies without
REM updating the lock files.
REM git diff --exit-code --quiet
REM if ERRORLEVEL 1 (
REM    echo Commit changed dependencies without updating project.lock.json
REM    git diff --exit-code
REM    exit /b 1
REM )

REM Ensure caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release] [/test32^|/test64] [/restore]
@echo   /debug   Perform debug build.  This is the default.
@echo   /release Perform release build.
@echo   /test32  Run unit tests in the 32-bit runner.  This is the default.
@echo   /test64  Run units tests in the 64-bit runner.
@echo.
@goto :eof

:BuildFailed
echo Build failed with ERRORLEVEL %ERRORLEVEL%
call :TerminateBuildProcesses
exit /b 1

:TerminateBuildProcesses
@REM Kill any instances VBCSCompiler.exe to release locked files, ignoring stderr if process is not open
@REM This prevents future CI runs from failing while trying to delete those files.
@REM Kill any instances of msbuild.exe to ensure that we never reuse nodes (e.g. if a non-roslyn CI run
@REM left some floating around).

taskkill /F /IM vbcscompiler.exe 2> nul
taskkill /F /IM msbuild.exe 2> nul

@setlocal enabledelayedexpansion

REM Parse Arguments.

set RoslynRoot=%~dp0
set BuildConfiguration=Debug

REM Because override the C#/VB toolset to build against our LKG package, it is important
REM that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise,
REM we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211.
set MSBuildAdditionalCommandLineArgs=/nologo /m /nodeReuse:false /consoleloggerparameters:Verbosity=minimal /filelogger /fileloggerparameters:Verbosity=normal

:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
if /I "%1" == "/test32" set Test64=false&&shift&& goto :ParseArguments
if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
if /I "%1" == "/testDeterminism" set TestDeterminism=true&&shift&& goto :ParseArguments

REM /buildTimeLimit is the time limit, measured in minutes, for the Jenkins job that runs
REM the build. The Jenkins script netci.groovy passes the time limit to this script.

REM netci.groovy does not yet pass the time limit to cibuild.cmd. We are making this
REM change to cibuild.cmd in all branches *before* modifying netci.groovy. If we didn't
REM do things in this order, we'd have to modify cibuild.cmd in *all* branches *at the
REM same time* we made the change to netci.groovy. This way, we'll be able to first
REM modify netci.groovy to pass the new parameter without causing any harm. Then we'll
REM be able go to each branch in turn, modifying cibuild.cmd and BuildAndTest.cmd to
REM actually make use of the new parameter.
if /I "%1" == "/buildTimeLimit" set BuildTimeLimit=%2&&shift&&shift&& goto:ParseArguments

call :Usage && exit /b 1
:DoneParsing

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" || goto :BuildFailed

powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-branch.ps1" || goto :BuildFailed

REM Output the commit that we're building, for reference in Jenkins logs
echo Building this commit:
git show --no-patch --pretty=raw HEAD

REM Restore the NuGet packages
    call "%RoslynRoot%\Restore.cmd" || goto :BuildFailed

REM Ensure the binaries directory exists because msbuild can fail when part of the path to LogFile isn't present.
set bindir=%RoslynRoot%Binaries
if not exist "%bindir%" mkdir "%bindir%" || goto :BuildFailed

REM Set the build version only so the assembly version is set to the semantic version,
REM which allows analyzers to load because the compiler has binding redirects to the
REM semantic version
msbuild %MSBuildAdditionalCommandLineArgs% /p:BuildVersion=0.0.0.0 "%RoslynRoot%build\Toolset.sln" /p:NuGetRestorePackages=false /p:Configuration=%BuildConfiguration% /fileloggerparameters:LogFile="%bindir%\Bootstrap.log" || goto :BuildFailed
powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-msbuild.ps1" "%bindir%\Bootstrap.log" || goto :BuildFailed

if not exist "%bindir%\Bootstrap" mkdir "%bindir%\Bootstrap" || goto :BuildFailed
move "Binaries\%BuildConfiguration%\*" "%bindir%\Bootstrap" || goto :BuildFailed
copy "build\scripts\*" "%bindir%\Bootstrap" || goto :BuildFailed

REM Clean the previous build
msbuild %MSBuildAdditionalCommandLineArgs% /t:Clean build/Toolset.sln /p:Configuration=%BuildConfiguration%  /fileloggerparameters:LogFile="%bindir%\BootstrapClean.log" || goto :BuildFailed

call :TerminateBuildProcesses

if defined TestDeterminism (
    powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\test-determinism.ps1" "%bindir%\Bootstrap" || goto :BuildFailed
    call :TerminateBuildProcesses
    exit /b 0
)

msbuild %MSBuildAdditionalCommandLineArgs% /p:BootstrapBuildPath="%bindir%\Bootstrap" BuildAndTest.proj /p:Configuration=%BuildConfiguration% /p:Test64=%Test64% /fileloggerparameters:LogFile="%bindir%\Build.log";verbosity=diagnostic || goto :BuildFailed
powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-msbuild.ps1" "%bindir%\Build.log" || goto :BuildFailed

call :TerminateBuildProcesses

REM Verify that our project.lock.json files didn't change as a result of
REM restore.  If they do then the commit changed the dependencies without
REM updating the lock files.
REM git diff --exit-code --quiet
REM if ERRORLEVEL 1 (
REM    echo Commit changed dependencies without updating project.lock.json
REM    git diff --exit-code
REM    exit /b 1
REM )

REM Ensure caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release] [/test32^|/test64] [/restore]
@echo   /debug   Perform debug build.  This is the default.
@echo   /release Perform release build.
@echo   /test32  Run unit tests in the 32-bit runner.  This is the default.
@echo   /test64  Run units tests in the 64-bit runner.
@echo.
@goto :eof

:BuildFailed
echo Build failed with ERRORLEVEL %ERRORLEVEL%
call :TerminateBuildProcesses
exit /b 1

:TerminateBuildProcesses
@REM Kill any instances VBCSCompiler.exe to release locked files, ignoring stderr if process is not open
@REM This prevents future CI runs from failing while trying to delete those files.
@REM Kill any instances of msbuild.exe to ensure that we never reuse nodes (e.g. if a non-roslyn CI run
@REM left some floating around).

taskkill /F /IM vbcscompiler.exe 2> nul
taskkill /F /IM msbuild.exe 2> nul

Prepare cibuild.cmd to receive /buildTimeLimit


@echo on
cd %APPVEYOR_BUILD_FOLDER%
SET "PREVPATH=%PATH%"
SET "PREVMSYSEM=%MSYSTEM%"

SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
SET "MSYSTEM=MINGW64"
SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy"

bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-6.0.0-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/ziglang.org/deps/llvm%%2bclang-6.0.0-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-6.0.0-win64-msvc-release.tar.xz" || exit /b

SET "PATH=%PREVPATH%"
SET "MSYSTEM=%PREVMSYSTEM%"
SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release"
SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-6.0.0-win64-msvc-release"

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
>>>>>>> origin/master

mkdir %ZIGBUILDDIR%
cd %ZIGBUILDDIR%
cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release "-DZIG_LIBC_INCLUDE_DIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" "-DZIG_LIBC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt" "-DZIG_LIBC_STATIC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" || exit /b
msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b

bin\zig.exe build --build-file ..\build.zig test || exit /b

@echo "MSVC build succeeded"

@echo on
cd %APPVEYOR_BUILD_FOLDER%
SET "PREVPATH=%PATH%"
SET "PREVMSYSEM=%MSYSTEM%"

SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
SET "MSYSTEM=MINGW64"
SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy"

bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-6.0.0-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/ziglang.org/deps/llvm%%2bclang-6.0.0-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-6.0.0-win64-msvc-release.tar.xz" || exit /b

SET "PATH=%PREVPATH%"
SET "MSYSTEM=%PREVMSYSTEM%"
SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release"
SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-6.0.0-win64-msvc-release"

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64

mkdir %ZIGBUILDDIR%
cd %ZIGBUILDDIR%
cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release "-DZIG_LIBC_INCLUDE_DIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" "-DZIG_LIBC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt" "-DZIG_LIBC_STATIC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" || exit /b
msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b

bin\zig.exe build --build-file ..\build.zig test || exit /b

@echo "MSVC build succeeded"

fix conflict artifact accidentally in appveyor script


java -cp out/production/inference_engine com.github.pineasaurusrex.inference_engine.Main %*

add script

add script


@echo off

C:
chdir "<%= @cygwin_home %>\bin"

: Start in specified directory (http://sources.redhat.com/ml/cygwin/2002-05/msg01645.html)
: Modifications needed also in \cygwin\etc\profile
set BASHHERE=%1

: Use Windows' profile directory instead of Cygwin's home
set HOME=%USERPROFILE%

: Other environmental variables
set LANG=en_US.UTF-8

: Start the shell
rem bash --login -i
rem rxvt -sr -g 140x50 -sl 10000 -bg black -fg white -fn "Bitstream Vera Sans Mono" -fb "Bitstream Vera Sans Mono Bold" -e /usr/bin/bash --login -i
start mintty /usr/bin/bash --login -i

@echo off

C:
chdir "<%= @cygwin_home %>\bin"

: Start in specified directory (http://sources.redhat.com/ml/cygwin/2002-05/msg01645.html)
: Modifications needed also in \cygwin\etc\profile
set BASHHERE=%1

: Use Windows' profile directory instead of Cygwin's home
set HOME=%USERPROFILE%

: Other environmental variables
rem set LANG=en_US.UTF-8
set LANG=C.UTF-8

: Start the shell
rem bash --login -i
rem rxvt -sr -g 140x50 -sl 10000 -bg black -fg white -fn "Bitstream Vera Sans Mono" -fb "Bitstream Vera Sans Mono Bold" -e /usr/bin/bash --login -i
start mintty /usr/bin/bash --login -i

Use C.UTF-8 locale

Use C.UTF-8 locale


@TITLE Building Mesa3D
@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set oldpath=%PATH%
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%\Python\;%mesa%\Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=n
@where python.exe>pyupd.ini
@set /p pythonloc=<pyupd.ini
@set makoloc="%pythonloc:python.exe=%Lib\site-packages\mako"
@set sconsloc="%pythonloc:python.exe=%Scripts\scons.py"
@if NOT EXIST %makoloc% (
@python -m pip install -U pip
@python -m pip install -U wheel
@python -m pip install -U scons
@python -m pip install -U MarkupSafe
@python -m pip install -U mako
)
@if EXIST %makoloc% set /p pyupd=Install/update python modules (y/n):
@if /I "%pyupd%"=="y" (
@python -m pip install -U pip
@python -m pip install -U wheel
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
)
@set abi=x86
@set /p x64=Do you want to build for x64? (y/n) Otherwise build for x86:
@if /I "%x64%"=="y" set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set targetabi=x86
@if %abi%==x64 set targetabi=amd64
@set hostabi=x86
@if NOT "%ProgramW6432%"=="" set hostabi=amd64
@set vsabi=%minabi%
@if NOT %targetabi%==%hostabi% set vsabi=%hostabi%_%targetabi%
@set vsenv15="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv15=%vsenv15% (x86)
@set vsenv15=%vsenv15%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%vsabi%.bat"
@if %vsabi%==32 set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%vsabi%.bat"
@if %vsabi%==64 set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\%targetabi%\vcvars%vsabi%.bat"
@if NOT %targetabi%==%hostabi% set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\%vsabi%\vcvars%vsabi%.bat"
@set vsenvloaded=0
@set toolsets=0
@if EXIST %vsenv15% set toolsets=%toolsets%15
@if EXIST %vsenv14% set toolsets=%toolsets%14
@if %toolsets%==0 (
@echo Error: No Visual Studio installed.
@GOTO build_dxtn
)
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@TITLE Building Mesa3D %abi%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT "%buildllvm%"=="y" GOTO prep_mesa
@echo.
@cd %mesa%\llvm
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set ninja=n
@if %toolsets%==01514 GOTO dualtoolsets
@set toolset=%toolsets:~-2%
@set toolchain=Visual Studio %toolset%
@if EXIST %mesa%\ninja set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though - (y/n):
@GOTO llvm_build_exec

:dualtoolsets
@set oldtoolset=n
@set toolchain=Visual Studio 15
@set toolset=15
@if EXIST %mesa%\ninja set oldtoolset=1
@if %oldtoolset%==1 set /p ninja=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 - (y/n):
@if /i "%ninja%"=="y" set oldtoolset=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if /I "%oldtoolset%"=="1" set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though - (y/n):

:llvm_build_exec
@if /I "%ninja%"=="y" set toolchain=Ninja
@if /I "%ninja%"=="y" set PATH=%mesa%\ninja\;%PATH%
@if %abi%==x64 set toolchain=%toolchain% Win64
@if "%toolchain%"=="Ninja Win64" set toolchain=Ninja
@set x64compile=n
@if %hostabi%==amd64 set x64compile=1
@if /I NOT "%ninja%"=="y" set x64compile=%x64compile%2
@if %x64compile%==12 set x64compiler= -Thost=x64
@if %toolset%==15 set vsenv=%vsenv15%
@if %toolset%==14 set vsenv=%vsenv14%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@cd %llvmbuildsys%
@echo.
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%\cmake\bin\;%PATH%
@set ERRORLEVEL=0
@cmake -G "%toolchain%"%x64compiler% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" cmake --build . --config Release --target install
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > %mesa%\toolset-%abi%.ini

:prep_mesa
@set PATH=%oldpath%
@cd %mesa%
@set mesapatched=0
@set branch=none
@set haltmesabuild=n
@set prepfail=0
@where /q git.exe
@IF ERRORLEVEL 1 (
@set ERRORLEVEL=0
@echo Error: Git not found. Patching disabled.
@set prepfail=1
)
@if NOT EXIST mesa set mesapatched=0
@if NOT EXIST mesa echo Warning: Mesa3D source code not found.
@if NOT EXIST mesa set prepfail=%prepfail%2
@if %prepfail%==12 echo Fatal: Both Mesa code and Git are missing. At least one is required. Execution halted.
@if %prepfail%==12 GOTO build_dxtn
@if NOT EXIST mesa set /p haltmesabuild=Press Y to abort execution. Press any other key to download Mesa via Git:
@if /I "%haltmesabuild%"=="y" GOTO build_dxtn
@if NOT EXIST mesa set /p branch=Enter Mesa source code branch name - defaults to master:
@if "%branch%"=="" set branch=master
@if "%branch%"=="none" set branch=master
@if NOT EXIST mesa echo.
@if NOT EXIST mesa git clone --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa
@cd mesa
@set LLVM=%mesa%\llvm\%abi%
@set /p mesaver=<VERSION
@set branch=%mesaver:~0,4%
@if EXIST mesapatched.ini GOTO build_mesa
@if %prepfail%==1 GOTO build_dxtn
@git apply -v ..\mesa-dist-win\patches\s3tc.patch
@if NOT "%mesaver:~-5%"=="devel" git apply -v ..\mesa-dist-win\patches\scons3.patch
@set mesapatched=1
@echo %mesapatched% > mesapatched.ini
@echo.
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO build_dxtn
)

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO build_dxtn
@echo.
@cd %mesa%\mesa
@set openswr=n
@set sconscmd=python %sconsloc% build=release platform=windows machine=%longabi% libgl-gdi
@if %abi%==x64 set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@echo.
@if /I "%openswr%"=="y" set sconscmd=%sconscmd% swr=1
@set /p osmesa=Do you want to build off-screen rendering drivers (y/n):
@echo.
@if /I "%osmesa%"=="y" set sconscmd=%sconscmd% osmesa
@set /p graw=Do you want to build graw library (y/n):
@echo.
@if /I "%graw%"=="y" set sconscmd=%sconscmd% graw-gdi

:build_with_vs
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%\Python\;%mesa%\Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set PATH=%mesa%\flexbison\;%PATH%
@cd %mesa%\mesa
@set loadtoolset=0
@set /p toolset=<%mesa%\toolset-%abi%.ini
@if %toolset%==14 set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@if %vsenvloaded%==0 (
@call %vsenv%
@cd %mesa%\mesa
)

:build_mesa_exec
@set cleanbuild=n
@if EXIST build\windows-%longabi% set /p cleanbuild=Do you want to clean build (y/n):
@if EXIST build\windows-%longabi% echo.
@if /I "%cleanbuild%"=="y" RD /S /Q build\windows-%longabi%
@if NOT EXIST %mesa%\mesa\build md %mesa%\mesa\build
@if NOT EXIST %mesa%\mesa\build\windows-%abi% md %mesa%\mesa\build\windows-%abi%
@if NOT EXIST %mesa%\mesa\build\windows-%abi%\git_sha1.h echo 0 > %mesa%\mesa\build\windows-%longabi%\git_sha1.h
@echo.
@%sconscmd%
@echo.

:build_dxtn
@if NOT EXIST %mesa%\mesa GOTO exit
@set PATH=%oldpath%
@if NOT EXIST %mesa%\dxtn GOTO distcreate
@if "%mesaver:~-5%"=="devel" GOTO distcreate
@set gcchost=msys2
@set gcc=%mesa%\msys64
@if NOT EXIST %gcc% set gcc=%mesa%\msys32
@if NOT EXIST %gcc% set gcchost=standalone
@if NOT EXIST %gcc% set gcc=%mesa%\mingw-w64\%abi%\mingw%minabi%\bin
@if NOT EXIST %gcc% set gcchost=false
@set gccpath=
@if %gcchost%==false GOTO distcreate
@if %gcchost%==standalone set gccpath=%gcc%\;
@if %gcchost%==msys2 set gccpath=%gcc%\mingw%minabi%\bin\;%gcc%\usr\bin\;
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" set gcchost=false
@if /i NOT "%builddxtn%"=="y" GOTO distcreate
@set PATH=%gccpath%%PATH%
@cd %mesa%\dxtn
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared -m%minabi% -v *.c *.h -I ../mesa/include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%/dxtn.dll
@set msys2update=n
@if %gcchost%==msys2 set /p msys2update=Update MSYS2 packages (y/n):
@if /I "%msys2update%"=="y" (
@pacman -Syu
@pause
)
@%dxtn%
@echo.

:distcreate
@set /p dist=Create or update Mesa3D distribution package (y/n):
@echo.
@if /I NOT "%dist%"=="y" GOTO exit
@cd %mesa%
@if NOT EXIST mesa-dist-win MD mesa-dist-win
@cd mesa-dist-win
@if NOT EXIST bin MD bin
@cd bin
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@cd %abi%
@copy %mesa%\mesa\build\windows-%longabi%\gallium\targets\libgl-gdi\opengl32.dll opengl32.dll
@if %abi%==x64 copy %mesa%\mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@if %abi%==x64 copy %mesa%\mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX2.dll swrAVX2.dll
@copy %mesa%\mesa\build\windows-%longabi%\mesa\drivers\osmesa\osmesa.dll osmesa-swrast.dll
@copy %mesa%\mesa\build\windows-%longabi%\gallium\targets\osmesa\osmesa.dll osmesa-gallium.dll
@copy %mesa%\mesa\build\windows-%longabi%\gallium\targets\graw-gdi\graw.dll graw.dll
@if NOT "%mesaver:~-5%"=="devel" copy %mesa%\dxtn\%abi%\dxtn.dll dxtn.dll
@echo.

:exit
@pause
@exit

@TITLE Building Mesa3D
@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set oldpath=%PATH%
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%\Python\;%mesa%\Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=n
@where python.exe>pyupd.ini
@set /p pythonloc=<pyupd.ini
@set makoloc="%pythonloc:python.exe=%Lib\site-packages\mako"
@set sconsloc="%pythonloc:python.exe=%Scripts\scons.py"
@if NOT EXIST %makoloc% (
@python -m pip install -U pip
@python -m pip install -U wheel
@python -m pip install -U scons
@python -m pip install -U MarkupSafe
@python -m pip install -U mako
)
@if EXIST %makoloc% set /p pyupd=Install/update python modules (y/n):
@if /I "%pyupd%"=="y" (
@python -m pip install -U pip
@python -m pip install -U wheel
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
)
@set abi=x86
@set /p x64=Do you want to build for x64? (y/n) Otherwise build for x86:
@if /I "%x64%"=="y" set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set targetabi=x86
@if %abi%==x64 set targetabi=amd64
@set hostabi=x86
@if NOT "%ProgramW6432%"=="" set hostabi=amd64
@set vsabi=%minabi%
@if NOT %targetabi%==%hostabi% set vsabi=%hostabi%_%targetabi%
@set vsenv15="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv15=%vsenv15% (x86)
@set vsenv15=%vsenv15%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%vsabi%.bat"
@if %vsabi%==32 set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%vsabi%.bat"
@if %vsabi%==64 set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\%targetabi%\vcvars%vsabi%.bat"
@if NOT %targetabi%==%hostabi% set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\%vsabi%\vcvars%vsabi%.bat"
@set vsenvloaded=0
@set toolsets=0
@if EXIST %vsenv15% set toolsets=%toolsets%15
@if EXIST %vsenv14% set toolsets=%toolsets%14
@if %toolsets%==0 (
@echo Error: No Visual Studio installed.
@GOTO build_dxtn
)
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@TITLE Building Mesa3D %abi%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT "%buildllvm%"=="y" GOTO prep_mesa
@echo.
@cd %mesa%\llvm
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set ninja=n
@if %toolsets%==01514 GOTO dualtoolsets
@set toolset=%toolsets:~-2%
@set toolchain=Visual Studio %toolset%
@if EXIST %mesa%\ninja set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though - (y/n):
@GOTO llvm_build_exec

:dualtoolsets
@set oldtoolset=n
@set toolchain=Visual Studio 15
@set toolset=15
@if EXIST %mesa%\ninja set oldtoolset=1
@if %oldtoolset%==1 set /p ninja=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 - (y/n):
@if /i "%ninja%"=="y" set oldtoolset=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if /I "%oldtoolset%"=="1" set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though - (y/n):

:llvm_build_exec
@if /I "%ninja%"=="y" set toolchain=Ninja
@if /I "%ninja%"=="y" set PATH=%mesa%\ninja\;%PATH%
@if %abi%==x64 set toolchain=%toolchain% Win64
@if "%toolchain%"=="Ninja Win64" set toolchain=Ninja
@set x64compile=n
@if %hostabi%==amd64 set x64compile=1
@if /I NOT "%ninja%"=="y" set x64compile=%x64compile%2
@if %x64compile%==12 set x64compiler= -Thost=x64
@if %toolset%==15 set vsenv=%vsenv15%
@if %toolset%==14 set vsenv=%vsenv14%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@cd %llvmbuildsys%
@echo.
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%\cmake\bin\;%PATH%
@set ERRORLEVEL=0
@cmake -G "%toolchain%"%x64compiler% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" cmake --build . --config Release --target install
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > %mesa%\toolset-%abi%.ini

:prep_mesa
@set PATH=%oldpath%
@cd %mesa%
@set mesapatched=0
@set branch=none
@set haltmesabuild=n
@set prepfail=0
@where /q git.exe
@IF ERRORLEVEL 1 (
@set ERRORLEVEL=0
@echo Error: Git not found. Patching disabled.
@set prepfail=1
)
@if NOT EXIST mesa set mesapatched=0
@if NOT EXIST mesa echo Warning: Mesa3D source code not found.
@if NOT EXIST mesa set prepfail=%prepfail%2
@if %prepfail%==12 echo Fatal: Both Mesa code and Git are missing. At least one is required. Execution halted.
@if %prepfail%==12 GOTO build_dxtn
@if NOT EXIST mesa set /p haltmesabuild=Press Y to abort execution. Press any other key to download Mesa via Git:
@if /I "%haltmesabuild%"=="y" GOTO build_dxtn
@if NOT EXIST mesa set /p branch=Enter Mesa source code branch name - defaults to master:
@if "%branch%"=="" set branch=master
@if "%branch%"=="none" set branch=master
@if NOT EXIST mesa echo.
@if NOT EXIST mesa git clone --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa
@cd mesa
@set LLVM=%mesa%\llvm\%abi%
@set /p mesaver=<VERSION
@set branch=%mesaver:~0,4%
@if EXIST mesapatched.ini GOTO build_mesa
@if %prepfail%==1 GOTO build_dxtn
@git apply -v ..\mesa-dist-win\patches\s3tc.patch
@if NOT EXIST %mesa%\mesa\.git git apply -v ..\mesa-dist-win\patches\scons3.patch
@set mesapatched=1
@echo %mesapatched% > mesapatched.ini
@echo.
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO build_dxtn
)

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO build_dxtn
@echo.
@cd %mesa%\mesa
@set openswr=n
@set sconscmd=python %sconsloc% build=release platform=windows machine=%longabi% libgl-gdi
@if %abi%==x64 set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@echo.
@if /I "%openswr%"=="y" set sconscmd=%sconscmd% swr=1
@set /p osmesa=Do you want to build off-screen rendering drivers (y/n):
@echo.
@if /I "%osmesa%"=="y" set sconscmd=%sconscmd% osmesa
@set /p graw=Do you want to build graw library (y/n):
@echo.
@if /I "%graw%"=="y" set sconscmd=%sconscmd% graw-gdi

:build_with_vs
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%\Python\;%mesa%\Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set PATH=%mesa%\flexbison\;%PATH%
@cd %mesa%\mesa
@set loadtoolset=0
@set /p toolset=<%mesa%\toolset-%abi%.ini
@if %toolset%==14 set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@if %vsenvloaded%==0 (
@call %vsenv%
@cd %mesa%\mesa
)

:build_mesa_exec
@set cleanbuild=n
@if EXIST build\windows-%longabi% set /p cleanbuild=Do you want to clean build (y/n):
@if EXIST build\windows-%longabi% echo.
@if /I "%cleanbuild%"=="y" RD /S /Q build\windows-%longabi%
@if NOT EXIST %mesa%\mesa\build md %mesa%\mesa\build
@if NOT EXIST %mesa%\mesa\build\windows-%abi% md %mesa%\mesa\build\windows-%abi%
@if NOT EXIST %mesa%\mesa\build\windows-%abi%\git_sha1.h echo 0 > %mesa%\mesa\build\windows-%longabi%\git_sha1.h
@echo.
@%sconscmd%
@echo.

:build_dxtn
@if NOT EXIST %mesa%\mesa GOTO exit
@set PATH=%oldpath%
@if NOT EXIST %mesa%\dxtn GOTO distcreate
@if "%mesaver:~-5%"=="devel" GOTO distcreate
@set gcchost=msys2
@set gcc=%mesa%\msys64
@if NOT EXIST %gcc% set gcc=%mesa%\msys32
@if NOT EXIST %gcc% set gcchost=standalone
@if NOT EXIST %gcc% set gcc=%mesa%\mingw-w64\%abi%\mingw%minabi%\bin
@if NOT EXIST %gcc% set gcchost=false
@set gccpath=
@if %gcchost%==false GOTO distcreate
@if %gcchost%==standalone set gccpath=%gcc%\;
@if %gcchost%==msys2 set gccpath=%gcc%\mingw%minabi%\bin\;%gcc%\usr\bin\;
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" set gcchost=false
@if /i NOT "%builddxtn%"=="y" GOTO distcreate
@set PATH=%gccpath%%PATH%
@cd %mesa%\dxtn
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared -m%minabi% -v *.c *.h -I ../mesa/include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%/dxtn.dll
@set msys2update=n
@if %gcchost%==msys2 set /p msys2update=Update MSYS2 packages (y/n):
@if /I "%msys2update%"=="y" (
@pacman -Syu
@pause
)
@%dxtn%
@echo.

:distcreate
@set /p dist=Create or update Mesa3D distribution package (y/n):
@echo.
@if /I NOT "%dist%"=="y" GOTO exit
@cd %mesa%
@if NOT EXIST mesa-dist-win MD mesa-dist-win
@cd mesa-dist-win
@if NOT EXIST bin MD bin
@cd bin
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@cd %abi%
@copy %mesa%\mesa\build\windows-%longabi%\gallium\targets\libgl-gdi\opengl32.dll opengl32.dll
@if %abi%==x64 copy %mesa%\mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@if %abi%==x64 copy %mesa%\mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX2.dll swrAVX2.dll
@copy %mesa%\mesa\build\windows-%longabi%\mesa\drivers\osmesa\osmesa.dll osmesa-swrast.dll
@copy %mesa%\mesa\build\windows-%longabi%\gallium\targets\osmesa\osmesa.dll osmesa-gallium.dll
@copy %mesa%\mesa\build\windows-%longabi%\gallium\targets\graw-gdi\graw.dll graw.dll
@if NOT "%mesaver:~-5%"=="devel" copy %mesa%\dxtn\%abi%\dxtn.dll dxtn.dll
@echo.

:exit
@pause
@exit

Build script: Restruct Scons 3.0.0 compatibility patch to already released Mesa versions. Patch is picked for 17.2.3 release and landed in 17.2 branch head.


REM Batch script to run each RDS import script sequentially
REM Spaces are not supported in script path
REM Must pass the thumbprint as the only parameter
REM Ex. "PSScript.bat {5}"

powershell.exe -ExecutionPolicy RemoteSigned -File ./Scripts/ImportRDListener.ps1 %*
powershell.exe -ExecutionPolicy RemoteSigned -File ./Scripts/ImportRDGateway.ps1 %*

REM Batch script to run each RDS import script sequentially
REM Spaces are not supported in script path
REM Must pass the thumbprint as the only parameter
REM Ex. "./Scripts/PSRDSCerts.bat {5}"

powershell.exe -ExecutionPolicy RemoteSigned -File ./Scripts/ImportRDListener.ps1 %*
powershell.exe -ExecutionPolicy RemoteSigned -File ./Scripts/ImportRDGateway.ps1 %*

Update PSRDSCerts.bat

Update PSRDSCerts.bat


### application.bat - 2015 - Merel ###
echo "Copyright Benoit MEREL - 2015"

version = "1.2.1"
echo "version ${version}"

update minor version

update minor version


nexe src/electron.js -r public\ -r src\ -r package.json -r node_sqlite3_win64.rename  -r node_sqlite3_macos64.rename  -o pilot.exe
mv .\pilot.exe ..\nexe\pilot.exe
chmod +x ..\nexe\pilot.exe

nexe src/electron.js -r public\ -r src\ -r package.json -r node_sqlite3_win64.rename  -r node_sqlite3_macos64.rename  -o pilot.exe
copy .\pilot.exe ..\nexe\pilot.exe /Y

Update make_windows.bat

Update make_windows.bat


@echo off

node_modules\cuked-zombie\node_modules\.bin\cucumber-js.cmd features/%1.feature --format=pretty -r tests/js/cucumber/bootstrap.js --snippet-syntax=tests/js/cucumber/snippet-template.js %2 %3 %4 %5

@echo off

if [%1]==[] (
  node_modules\.bin\cucumber-js.cmd features --format=pretty -r tests/js/cucumber/bootstrap.js --snippet-syntax=tests/js/cucumber/snippet-template.js %1 %2 %3 %4
) else (
  node_modules\.bin\cucumber-js.cmd features/%1.feature --format=pretty -r tests/js/cucumber/bootstrap.js --snippet-syntax=tests/js/cucumber/snippet-template.js %2 %3 %4 %5
)

make cucumber.bat more intelligent

make cucumber.bat more intelligent


@echo off

:: install chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco feature enable -n allowGlobalConfirmation

:: general apps
choco upgrade chocolatey
choco upgrade 7zip 7zip.commandline adobereader gimp javaruntime paint.net pencil slack vlc
choco upgrade filezilla putty
choco upgrade autoruns procexp procmon sdelete
choco upgrade curl optipng rsync unzip wget wput zip
choco upgrade inconsolata

:: dev apps
choco upgrade pgadmin3
choco upgrade ankhsvn git gitkraken tortoisesvn
choco upgrade atom visualstudiocode
choco upgrade visualstudio2012professional -packageParameters "/Features:'OfficeTools'"
choco upgrade depends ilspy wixtoolset
choco upgrade dotnet4.6 dotnet4.5.2 dotnet4.5.1 dotnet4.5 dotnet3.5

@echo off

:: install chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco feature enable -n allowGlobalConfirmation

:: general apps
choco upgrade chocolatey
choco upgrade 7zip 7zip.commandline adobereader gimp javaruntime paint.net pencil slack vlc
choco upgrade filezilla putty
choco upgrade autoruns procexp procmon sdelete
choco upgrade curl optipng rsync unzip wget wput zip
choco upgrade inconsolata

:: dev apps
choco upgrade pgadmin3
choco upgrade ankhsvn git gitkraken tortoisesvn
choco upgrade atom visualstudiocode
choco upgrade visualstudio2012professional -packageParameters "/Features:'OfficeTools'"
choco upgrade depends ilmerge ilspy wixtoolset
choco upgrade dotnet4.6 dotnet4.5.2 dotnet4.5.1 dotnet4.5 dotnet3.5

Add ilmerge

Add ilmerge


@echo off

REM  Reference: http://www.wilsonmar.com/1envvars.htm
set home=%USERPROFILE%

copy /Y .\dist\ctags_lang %home%\.ctags
copy /Y .vimrc %home%\.vimrc
copy /Y .vimrc.plugins %home%\.vimrc.plugins
copy /Y .vimrc.local %home%\.vimrc.local
copy /Y .vimrc.plugins.local %home%\.vimrc.plugins.local
rmdir /S /Q %home%\.vim
xcopy /Y /E vimfiles %home%\.vim\

@echo on

@echo off

REM  Reference: http://www.wilsonmar.com/1envvars.htm
set home=%USERPROFILE%

copy /Y .\dist\ctags_lang "%home%\.ctags"
copy /Y .vimrc "%home%\.vimrc"
copy /Y .vimrc.plugins "%home%\.vimrc.plugins"
copy /Y .vimrc.local "%home%\.vimrc.local"
copy /Y .vimrc.plugins.local "%home%\.vimrc.plugins.local"
rmdir /S /Q "%home%\.vim"
xcopy /Y /E vimfiles "%home%\.vim\"

@echo on

Add quotation mark to windows path

Add quotation mark to windows path

In case the user's name contains space, the command to
replace the vimrc will fail. Adding quotation mark will
fix this issue

Signed-off-by: Zhenfang Wei <463949f2109b72a1c21e4b94cb6d47e3b151eabc@gmail.com>


@echo off
setlocal

REM Workaround https://github.com/dotnet/coreclr/issues/2153
set ComPlus_ReadyToRun=0

set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

@echo off
setlocal

set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

Remove ReadyToRun workaround

Remove ReadyToRun workaround


@echo off
REM @author Sebastian Thomschke, Vegard IT GmbH
REM
REM generates API documentation using dox

setlocal

set TOP_LEVEL_PACKAGE=hx.strings
set OWNER=http://vegardit.com

REM cd into project root
pushd .
cd %~dp0..

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url haxelib.json' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version haxelib.json' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%
echo PROJECT_VERSION=%PROJECT_VERSION%

REM extract project name from haxelib.json
for /f "tokens=*" %%a in ( 'findstr name haxelib.json' ) do (set textLine=%%a)
set PROJECT_NAME=%textLine:"name": "=%
set PROJECT_NAME=%PROJECT_NAME:",=%
set PROJECT_NAME=%PROJECT_NAME:"=%

REM extract project description from haxelib.json
for /f "tokens=*" %%a in ( 'findstr description haxelib.json' ) do (set textLine=%%a)
set PROJECT_DESCRIPTION=%textLine:"description": "=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:",=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:"=%

haxelib list | findstr dox >NUL
if %errorlevel% neq 0 (
    echo Installing [dox]...
    haxelib install dox
)

if exist target\site (
    echo Cleaning target\site...
    del target\doc.xml >NUL
    rd /s /q target\site
)

echo Analyzing source code...
haxe -cp src --no-output -D doc-gen -xml target\doc.xml --macro include('%TOP_LEVEL_PACKAGE%') || goto :eof

REM https://github.com/HaxeFoundation/dox/wiki/Commandline-arguments-overview
echo Generating HTML files...
haxelib run dox ^
 --title "%PROJECT_NAME% %PROJECT_VERSION% API documentation" ^
 --toplevel-package "%TOP_LEVEL_PACKAGE%" ^
 -D description "%PROJECT_NAME%: %PROJECT_DESCRIPTION%" ^
 -D source-path "%REPO_URL%/tree/master/src" ^
 -D themeColor 0x1690CC ^
 -D version "%PROJECT_VERSION%" ^
 -D website "%OWNER%" ^
 -ex "^%TOP_LEVEL_PACKAGE:.=\.%\.internal" ^
 -i target\doc.xml ^
 -o target\site || goto :eof

set INDEX_HTML=%CD%\target\site\index.html

echo.
echo Documentation generated at [file:///%INDEX_HTML:\=/%]...

:eof
popd
endlocal

@echo off
REM @author Sebastian Thomschke, Vegard IT GmbH
REM
REM generates API documentation using dox at <project_root>\target\site

setlocal

set TOP_LEVEL_PACKAGE=hx.strings
set OWNER=https://vegardit.com

REM cd into project root
pushd .
cd %~dp0..

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url haxelib.json' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version haxelib.json' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%
echo PROJECT_VERSION=%PROJECT_VERSION%

REM extract project name from haxelib.json
for /f "tokens=*" %%a in ( 'findstr name haxelib.json' ) do (set textLine=%%a)
set PROJECT_NAME=%textLine:"name": "=%
set PROJECT_NAME=%PROJECT_NAME:",=%
set PROJECT_NAME=%PROJECT_NAME:"=%

REM extract project description from haxelib.json
for /f "tokens=*" %%a in ( 'findstr description haxelib.json' ) do (set textLine=%%a)
set PROJECT_DESCRIPTION=%textLine:"description": "=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:",=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:"=%

haxelib list | findstr dox >NUL
if %errorlevel% neq 0 (
    echo Installing [dox]...
    haxelib install dox
)

if exist target\site (
    echo Cleaning target\site...
    del target\doc.xml >NUL
    rd /s /q target\site
)

echo Analyzing source code...
haxe -cp src --no-output -D doc-gen -xml target\doc.xml --macro include('%TOP_LEVEL_PACKAGE%') || goto :eof

REM https://github.com/HaxeFoundation/dox/wiki/Commandline-arguments-overview
echo Generating HTML files...
haxelib run dox ^
 --title "%PROJECT_NAME% %PROJECT_VERSION% API documentation" ^
 --toplevel-package "%TOP_LEVEL_PACKAGE%" ^
 -D description "%PROJECT_NAME%: %PROJECT_DESCRIPTION%" ^
 -D source-path "%REPO_URL%/tree/master/src" ^
 -D themeColor 0x1690CC ^
 -D version "%PROJECT_VERSION%" ^
 -D website "%OWNER%" ^
 -ex "^%TOP_LEVEL_PACKAGE:.=\.%\.internal" ^
 -i target\doc.xml ^
 -o target\site || goto :eof

set INDEX_HTML=%CD%\target\site\index.html

echo.
echo Documentation generated at [file:///%INDEX_HTML:\=/%]...

:eof
popd
endlocal

use https url

use https url