@ECHO OFF
:: do not run this script manually

SETLOCAL
:: todo: support for authtentication

IF DEFINED YAWDS_CONF_GENERAL_CONSOLE_COLOR (
	COLOR %YAWDS_CONF_GENERAL_CONSOLE_COLOR%
)

IF NOT DEFINED YAWDS_CONF_UPDATE_CHECK_URL (
	ECHO Missing update.check_url config value in environment.ini
	ECHO Cannot checkout for new versions
	GOTO END
)

IF [%1]==[--confirm] (
	GOTO SET_NOCONFIRM
)
GOTO UPDATE

:SET_NOCONFIRM
SET yawds_from_start=1
GOTO UPDATE

:UPDATE

IF [%YAWDS_CONF_UPDATE_ENABLED%]==[0] (
	IF NOT DEFINED yawds_from_start (
		ECHO Environment update is disabled
	)
	GOTO END
)

IF NOT EXIST "%TEMP%" MKDIR "%TEMP%"

IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
	:: exit if it was called from start.cmd
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO Authentication is required to update
	CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\prompt\update_auth" "%TEMP%\yawds_update.bat" "update"
	IF NOT ERRORLEVEL 0 (
		ECHO Error setting authtentication credentials
		GOTO END_ERROR
	)
	GOTO CHECK_AUTH_HTTP
) ELSE (
	GOTO CHECK_HTTP
)

:CHECK_AUTH_HTTP
CALL "%TEMP%\yawds_update.bat"
IF NOT DEFINED YAWDS_UPDATE_USER (
	ECHO Authentication required
	GOTO END_ERROR
)
CALL wget -t 2 --timeout 2 -q -nv "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"
GOTO CONTINUE

:CHECK_HTTP
CALL wget wget -t 2 --timeout 2 -q -nv -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"

:CONTINUE
IF NOT ERRORLEVEL 0 (
	ECHO Cannot check out remote version for updates
	ECHO Be sure you have network connection and try again
	GOTO END_ERROR
)

CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\ini2batch" "%TEMP%\yawds_latest.ini" "update" > "%TEMP%\yawds_update.bat"
CALL "%TEMP%\yawds_update.bat"
IF NOT ERRORLEVEL 0 GOTO CONFIG_ERROR

IF NOT DEFINED YAWDS_UPDATE_VERSION (
	ECHO Cannot check the latest version
	GOTO END_ERROR
)

IF NOT DEFINED YAWDS_UPDATE_DOWNLOAD (
	ECHO Download URL not defined. Cannot update
	GOTO END
)

IF [%YAWDS_VERSION%]==[%YAWDS_UPDATE_VERSION%] (
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO You are on the latest version: %YAWDS_VERSION%
	ECHO Nothing to update
	GOTO END
)

IF DEFINED yawds_from_start ECHO.
ECHO There is a new version available: %YAWDS_UPDATE_VERSION%

IF DEFINED YAWDS_UPDATE_RELEASE_NOTES (
	ECHO.
	ECHO Release notes:
	ECHO "%YAWDS_UPDATE_RELEASE_NOTES%"
	ECHO.
)
IF DEFINED YAWDS_UPDATE_RELEASE_NOTES_URL (
	IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
		CALL wget -t 2 --timeout 2 -q "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\release_notes" %YAWDS_UPDATE_RELEASE_NOTES_URL%
	) ELSE (
		CALL wget -t 2 --timeout 2 -q -O "%TEMP%\release_notes" "%YAWDS_UPDATE_RELEASE_NOTES_URL%"
	)
	IF EXIST "%TEMP%\release_notes" (
		ECHO.
		ECHO Release notes
		ECHO ---------------------------------------------
		TYPE "%TEMP%\release_notes"
		ECHO.
		ECHO ---------------------------------------------
		ECHO.
	)
)

:: require to run from update.cmd (due to windows files blocking issues)
IF DEFINED yawds_from_start (
	ECHO.
	ECHO To proceed with the update, you must run update.cmd
	ECHO.
	PAUSE
	GOTO END
)

SET /P confirm_update=Do you want to process with the update? [y/n]:
IF NOT [%confirm_update%]==[y] (
	ECHO Canceled
	GOTO END
)

ECHO.
ECHO IMPORTANT:
ECHO You must close all the running processes before continue
ECHO You can use stack\tools\cprocess.exe to see the running processes
ECHO.

PAUSE

ECHO Downloading latest version...

IF [%YAWDS_UPDATE_DOWNLOAD_AUTH%]==[1] SET require_auth=1
IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] SET require_auth=1

IF [%require_auth%]==[1] (
	CALL wget -t 2 --timeout 5 --progress=bar "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
) ELSE (
	CALL wget -t 2 --timeout 5 --progress=bar -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
)
IF NOT ERRORLEVEL 0 (
	ECHO Download error
	GOTO END
)
IF NOT EXIST "%TEMP%\yawds-latest-win32.zip" (
	ECHO Download error: file do not exist
	ECHO Check your network connectivity
	GOTO END
)

ECHO.
ECHO Download completed!
ECHO.

:: backup filename
FOR /F "tokens=* delims= " %%a IN ("%TIME:~0,2%") DO SET hour=%%a
FOR /F "tokens=* delims= " %%a IN ("%TIME:~3,2%") DO SET minute=%%a
SET backup_file=stack-%YAWDS_VERSION%-%date:~6,4%-%date:~3,2%-%date:~0,2%-%hour%%minute%.zip

:: backup the current stack environment
SET /P backup=Do you want to backup the current environment? [Y/n]:
IF [%backup%]==[y] (
	IF NOT EXIST "%YAWDS_HOME%\backup" MKDIR "%YAWDS_HOME%\backup"
	CD "%YAWDS_HOME%\stack"
	:: create tarball
	CALL 7za -mx7 -y a "%backup_file%" *
	IF NOT ERRORLEVEL 0 (
		ECHO.
		ECHO Error while creating the backup...
		GOTO END_ERROR
	)
	:: move to backup folder
	MOVE /Y "%backup_file%" "%YAWDS_HOME%\backup"

	ECHO.
	ECHO Backup created succesfully in:
	ECHO %YAWDS_HOME%\backup\
	ECHO.
	CD "%YAWDS_HOME%"
	PAUSE
)

MOVE /Y "%YAWDS_HOME%\stack" "%YAWDS_HOME%\stack_old" > nul
IF NOT EXIST "%YAWDS_HOME%\stack_old" (
	ECHO.
	ECHO ERROR: cannot write new files
	ECHO Be sure there is not any blocking process still running
	ECHO You can exec stack\tools\cprocess.exe in to see the running processes
	ECHO.
	GOTO END_ERROR
)

ECHO.
ECHO Installing new version...
ECHO.

:: unzip directory
IF EXIST "%TEMP%\yawds_latest%" (
	DEL /Q /S "%TEMP%\yawds_latest%" > nul
)
MKDIR "%TEMP%\yawds_latest%"
CD "%TEMP%\yawds_latest"

:: install new version
CALL "%YAWDS_HOME%\stack_old\tools\7za.exe" -y e "%TEMP%\yawds-latest-win32.zip"
IF NOT EXIST "%TEMP%\yawds_latest\stack" (
	ECHO.
	ECHO ERROR: cannot extract and write new files
	ECHO Restoring old stack environment version...
	ECHO.
	MOVE /Y "%YAWDS_HOME%\stack_old" "%YAWDS_HOME%\stack"
	GOTO END_ERROR
)

MOVE /Y "%TEMP%\yawds_latest\stack" "%YAWDS_HOME%\stack"
IF NOT EXIST "%YAWDS_HOME%\stack" (
	ECHO.
	ECHO ERROR: cannot write stack directory
	ECHO Restoring old stack environment version...
	ECHO.
	MOVE /Y "%YAWDS_HOME%\stack_old" "%YAWDS_HOME%\stack"
	GOTO END_ERROR)

:: removing old version
ECHO Removing old version...
DEL /Q /S "%YAWDS_HOME%\stack_old" > nul
:: removing old version
ECHO Cleaning download files...
DEL /Q /S "%TEMP%\yawds_latest" > nul

ECHO.
ECHO %YAWDS_CONF_GENERAL_SHORTNAME% was updated succesfully!
ECHO.

IF DEFINED YAWDS_UPDATE_POST_UPDATE_SCRIPT (
	IF EXIST "%YAWDS_STACK_PATH%\%YAWDS_UPDATE_POST_UPDATE_SCRIPT%" (
		CALL "%YAWDS_STACK_PATH%\%YAWDS_UPDATE_POST_UPDATE_SCRIPT%"
	)
)

GOTO END

:VERSION_ERROR
ECHO Cannot check the latest version: error while reading the ini file
ECHO Cannot update. Try it again

:END
ECHO.
GOTO CLEAN

:END_ERROR
ECHO Cannot update. Try it again

:CLEAN
ECHO Cleaning temporary files...
IF EXIST "%TEMP%\yawds_update.bat" DEL /Q /F "%TEMP%\yawds_update.bat" > nul
IF EXIST "%TEMP%\yawds_latest.ini" DEL /Q /F "%TEMP%\yawds_latest.ini" > nul
IF EXIST "%TEMP%\release_notes" DEL /Q /F "%TEMP%\release_notes" > nul
IF EXIST "%TEMP%\yawds-latest-win32.zip" DEL /Q /F "%TEMP%\yawds-latest-win32.zip" > nul
IF DEFINED yawds_from_start CLS

ENDLOCAL

@ECHO OFF
:: do not run this script manually

SETLOCAL
:: todo: support for authtentication

IF DEFINED YAWDS_CONF_GENERAL_CONSOLE_COLOR (
	COLOR %YAWDS_CONF_GENERAL_CONSOLE_COLOR%
)

IF NOT DEFINED YAWDS_CONF_UPDATE_CHECK_URL (
	ECHO Missing update.check_url config value in environment.ini
	ECHO Cannot checkout for new versions
	GOTO END
)

IF [%1]==[--confirm] (
	GOTO SET_NOCONFIRM
)
GOTO UPDATE

:SET_NOCONFIRM
SET yawds_from_start=1
GOTO UPDATE

:UPDATE

IF [%YAWDS_CONF_UPDATE_ENABLED%]==[0] (
	IF NOT DEFINED yawds_from_start (
		ECHO Environment update is disabled
	)
	GOTO END
)

IF NOT EXIST "%TEMP%" MKDIR "%TEMP%"

IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
	:: exit if it was called from start.cmd
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO Authentication is required to update
	CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\prompt\update_auth" "%TEMP%\yawds_update.bat" "update"
	IF NOT ERRORLEVEL 0 (
		ECHO Error setting authtentication credentials
		GOTO END_ERROR
	)
	GOTO CHECK_AUTH_HTTP
) ELSE (
	GOTO CHECK_HTTP
)

:CHECK_AUTH_HTTP
CALL "%TEMP%\yawds_update.bat"
IF NOT DEFINED YAWDS_UPDATE_USER (
	ECHO Authentication required
	GOTO END_ERROR
)
CALL wget -t 2 --timeout 2 -q -nv "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"
GOTO CONTINUE

:CHECK_HTTP
CALL wget wget -t 2 --timeout 2 -q -nv -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"

:CONTINUE
IF NOT ERRORLEVEL 0 (
	ECHO Cannot check out remote version for updates
	ECHO Be sure you have network connection and try again
	GOTO END_ERROR
)

CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\ini2batch" "%TEMP%\yawds_latest.ini" "update" > "%TEMP%\yawds_update.bat"
CALL "%TEMP%\yawds_update.bat"
IF NOT ERRORLEVEL 0 GOTO CONFIG_ERROR

IF NOT DEFINED YAWDS_UPDATE_VERSION (
	ECHO Cannot check the latest version
	GOTO END_ERROR
)

IF NOT DEFINED YAWDS_UPDATE_DOWNLOAD (
	ECHO Download URL not defined. Cannot update
	GOTO END
)

IF [%YAWDS_VERSION%]==[%YAWDS_UPDATE_VERSION%] (
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO You are on the latest version: %YAWDS_VERSION%
	ECHO Nothing to update
	GOTO END
)

IF DEFINED yawds_from_start ECHO.
ECHO There is a new version available: %YAWDS_UPDATE_VERSION%

IF DEFINED YAWDS_UPDATE_RELEASE_NOTES (
	ECHO.
	ECHO Release notes:
	ECHO "%YAWDS_UPDATE_RELEASE_NOTES%"
	ECHO.
)
IF DEFINED YAWDS_UPDATE_RELEASE_NOTES_URL (
	IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
		CALL wget -t 2 --timeout 2 -q "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\release_notes" %YAWDS_UPDATE_RELEASE_NOTES_URL%
	) ELSE (
		CALL wget -t 2 --timeout 2 -q -O "%TEMP%\release_notes" "%YAWDS_UPDATE_RELEASE_NOTES_URL%"
	)
	IF EXIST "%TEMP%\release_notes" (
		ECHO.
		ECHO Release notes
		ECHO ---------------------------------------------
		TYPE "%TEMP%\release_notes"
		ECHO.
		ECHO ---------------------------------------------
		ECHO.
	)
)

:: require to run from update.cmd (due to windows files blocking issues)
IF DEFINED yawds_from_start (
	ECHO.
	ECHO To proceed with the update, you must run update.cmd
	ECHO.
	PAUSE
	GOTO END
)

SET /P confirm_update=Do you want to process with the update? [y/n]:
IF NOT [%confirm_update%]==[y] (
	ECHO Canceled
	GOTO END
)

ECHO.
ECHO IMPORTANT:
ECHO You must close all the running processes before continue
ECHO You can use stack\tools\cprocess.exe to see the running processes
ECHO.

PAUSE

ECHO Downloading latest version...

IF [%YAWDS_UPDATE_DOWNLOAD_AUTH%]==[1] SET require_auth=1
IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] SET require_auth=1

IF [%require_auth%]==[1] (
	CALL wget -t 2 --timeout 5 --progress=bar "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
) ELSE (
	CALL wget -t 2 --timeout 5 --progress=bar -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
)
IF NOT ERRORLEVEL 0 (
	ECHO Download error
	GOTO END
)
IF NOT EXIST "%TEMP%\yawds-latest-win32.zip" (
	ECHO Download error: file do not exist
	ECHO Check your network connectivity
	GOTO END
)

ECHO.
ECHO Download completed!
ECHO.

:: backup filename
FOR /F "tokens=* delims= " %%a IN ("%TIME:~0,2%") DO SET hour=%%a
FOR /F "tokens=* delims= " %%a IN ("%TIME:~3,2%") DO SET minute=%%a
SET backup_file=stack-%YAWDS_VERSION%-%date:~6,4%-%date:~3,2%-%date:~0,2%-%hour%%minute%.zip

:: backup the current stack environment
SET /P backup=Do you want to backup the current environment? [Y/n]:
IF [%backup%]==[y] (
	IF NOT EXIST "%YAWDS_HOME%\backup" MKDIR "%YAWDS_HOME%\backup"
	CD "%YAWDS_HOME%\stack"
	:: create tarball
	CALL 7za -mx7 -y a "%backup_file%" *
	IF NOT ERRORLEVEL 0 (
		ECHO.
		ECHO Error while creating the backup...
		GOTO END_ERROR
	)
	:: move to backup folder
	MOVE /Y "%backup_file%" "%YAWDS_HOME%\backup"

	ECHO.
	ECHO Backup created succesfully in:
	ECHO %YAWDS_HOME%\backup\
	ECHO.
	CD "%YAWDS_HOME%"
	PAUSE
)

MOVE /Y "%YAWDS_HOME%\stack" "%YAWDS_HOME%\stack_old" > nul
IF NOT EXIST "%YAWDS_HOME%\stack_old" (
	ECHO.
	ECHO ERROR: cannot write new files
	ECHO Be sure there is not any blocking process still running
	ECHO You can exec stack\tools\cprocess.exe in to see the running processes
	ECHO.
	GOTO END_ERROR
)

ECHO.
ECHO Installing new version...
ECHO.

:: unzip directory
IF EXIST "%TEMP%\yawds_latest%" (
	DEL /Q /S "%TEMP%\yawds_latest%" > nul
)
MKDIR "%TEMP%\yawds_latest%"
CD "%TEMP%\yawds_latest"

:: install new version
CALL "%YAWDS_HOME%\stack_old\tools\7za.exe" -y e "%TEMP%\yawds-latest-win32.zip"
IF NOT EXIST "%TEMP%\yawds_latest\stack" (
	ECHO.
	ECHO ERROR: cannot extract and write new files
	ECHO Restoring old stack environment version...
	ECHO.
	MOVE /Y "%YAWDS_HOME%\stack_old" "%YAWDS_HOME%\stack" > nul
	GOTO END_ERROR
)

MOVE /Y "%TEMP%\yawds_latest\stack" "%YAWDS_HOME%\stack"
IF NOT EXIST "%YAWDS_HOME%\stack" (
	ECHO.
	ECHO ERROR: cannot write stack directory
	ECHO Restoring old stack environment version...
	ECHO.
	MOVE /Y "%YAWDS_HOME%\stack_old" "%YAWDS_HOME%\stack"
	GOTO END_ERROR)

:: removing old version
ECHO Removing old version...
DEL /Q /S "%YAWDS_HOME%\stack_old" > nul
:: removing old version
ECHO Cleaning download files...
DEL /Q /S "%TEMP%\yawds_latest" > nul

ECHO.
ECHO %YAWDS_CONF_GENERAL_SHORTNAME% was updated succesfully!
ECHO.

IF DEFINED YAWDS_UPDATE_POST_UPDATE_SCRIPT (
	IF EXIST "%YAWDS_STACK_PATH%\%YAWDS_UPDATE_POST_UPDATE_SCRIPT%" (
		CALL "%YAWDS_STACK_PATH%\%YAWDS_UPDATE_POST_UPDATE_SCRIPT%"
	)
)

GOTO END

:VERSION_ERROR
ECHO Cannot check the latest version: error while reading the ini file
ECHO Cannot update. Try it again

:END
ECHO.
GOTO CLEAN

:END_ERROR
ECHO Cannot update. Try it again

:CLEAN
ECHO Cleaning temporary files...
IF EXIST "%TEMP%\yawds_update.bat" DEL /Q /F "%TEMP%\yawds_update.bat" > nul
IF EXIST "%TEMP%\yawds_latest.ini" DEL /Q /F "%TEMP%\yawds_latest.ini" > nul
IF EXIST "%TEMP%\release_notes" DEL /Q /F "%TEMP%\release_notes" > nul
IF EXIST "%TEMP%\yawds-latest-win32.zip" DEL /Q /F "%TEMP%\yawds-latest-win32.zip" > nul
IF DEFINED yawds_from_start CLS

ENDLOCAL

Update script general improvements

Update script general improvements


@rem Schema downloader
@rem
@rem Tool to download schemas.

@echo off

setlocal
if "%XMLBEANS_HOME%" EQU "" (set XMLBEANS_HOME=%~dp0..)

set cp=
set cp=%cp%;%XMLBEANS_HOME%\build\ar\xbean.jar

java -classpath %cp% org.apache.xmlbeans.impl.tool.SchemaResourceManager %*

:done

@rem Schema downloader
@rem
@rem Tool to download schemas.

@echo off

setlocal
if "%XMLBEANS_HOME%" EQU "" (set XMLBEANS_HOME=%~dp0..)

set cp=
set cp=%cp%;%XMLBEANS_HOME%\build\ar\xbean.jar
set cp=%cp%;%XMLBEANS_HOME%\build\lib\jsr173_api.jar
set cp=%cp%;%XMLBEANS_HOME%\build\lib\resolver.jar

java -classpath %cp% org.apache.xmlbeans.impl.tool.SchemaResourceManager %*

:done

Fix for sDownload tool. Added correct v2 classpath entries.
Submitted by: Jacob Danner

git-svn-id: 297cb4147f50b389680bb5ad136787e97b9148ae@111095 13f79535-47bb-0310-9956-ffa450edef68


:: Copyright 2015 Rouslan Solomakhin
::
:: 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.

set ALTERNATE_EDITOR=emacs
set EDITOR=emacs
set GYP_DEFINES=component=shared_library fastbuild=2 disable_nacl=1 disable_pnacl=1
set GYP_GENERATORS=ninja
set HOME=%USERPROFILE%
set JAVA_HOME=%SYSTEMDRIVE%\java\jdk

doskey e=start /b emacsclient.exe $*
doskey v=start /b gvim.exe $*

if not "%PATH%" == "%PATH:depot_tools=%" (
  goto skip_path
)

for /d %%g in (%SYSTEMDRIVE%\src\depot_tools\git*chromium*) do set PATH=%PATH%;%%g\cmd
set PATH=%PATH%;%HOME%\.third_party\cask\bin
set PATH=%PATH%;%JAVA_HOME%\bin
set PATH=%PATH%;%SYSTEMDRIVE%\console2
set PATH=%PATH%;%SYSTEMDRIVE%\emacs\bin
set PATH=%PATH%;%SYSTEMDRIVE%\maven\bin
set PATH=%PATH%;%SYSTEMDRIVE%\src\depot_tools
set PATH=%PATH%;C:\Program Files (x86)\Vim\vim74

:skip_path

where cl > NUL 2>&1
if errorlevel 1 (
  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
    call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
  )
)

if not exist c:\src\depot_tools\win_toolchain\vs2013_files (
  set DEPOT_TOOLS_WIN_TOOLCHAIN=0
)

if exist local-env.bat (
  call local-env.bat
)

:: Copyright 2015 Rouslan Solomakhin
::
:: 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.

set ALTERNATE_EDITOR=emacs
set EDITOR=emacs
set GYP_DEFINES=component=shared_library fastbuild=2 disable_nacl=1 disable_pnacl=1
set GYP_GENERATORS=ninja
set HOME=%USERPROFILE%
set JAVA_HOME=%SYSTEMDRIVE%\java\jdk

doskey e=start /b emacsclient.exe $*
doskey v=start /b gvim.exe $*

if not "%PATH%" == "%PATH:depot_tools=%" (
  goto skip_path
)

for /d %%g in (%SYSTEMDRIVE%\src\depot_tools\git*chromium*) do set PATH=%PATH%;%%g\cmd
set PATH=%PATH%;%HOME%\.third_party\cask\bin
set PATH=%PATH%;%JAVA_HOME%\bin
set PATH=%PATH%;%SYSTEMDRIVE%\console2
set PATH=%PATH%;%SYSTEMDRIVE%\emacs\bin
set PATH=%PATH%;%SYSTEMDRIVE%\Go\bin
set PATH=%PATH%;%SYSTEMDRIVE%\go_appengine
set PATH=%PATH%;%SYSTEMDRIVE%\maven\bin
set PATH=%PATH%;%SYSTEMDRIVE%\Program Files (x86)\Vim\vim74
set PATH=%PATH%;%SYSTEMDRIVE%\src\depot_tools

:skip_path

where cl > NUL 2>&1
if errorlevel 1 (
  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
    call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
  )
)

if not exist c:\src\depot_tools\win_toolchain\vs2013_files (
  set DEPOT_TOOLS_WIN_TOOLCHAIN=0
)

if exist local-env.bat (
  call local-env.bat
)

Add go appengine path.

Add go appengine path.


echo off

set MSPEC=%HOMEPATH%\.nuget\packages\Machine.Specifications.Runner.Console\0.9.3\tools\mspec-clr4.exe
set OPENCOVER=%HOMEPATH%\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe
set REPORTGENERATOR=%HOMEPATH%\.nuget\packages\ReportGenerator\3.0.2\tools\ReportGenerator.exe

rem this runs mspec standalone, not needed because it is run in OpenCover
rem %MSPEC% --html coverage\mspec --xml coverage\mspec\mspec.xml BellRichM.Weather.Api.Test\bin\Debug\net462\BellRichM.Weather.Api.Test.dll

%OPENCOVER% -register:user -output:coverage\opencover\opencover.xml -filter:"+[BellRichM*]* -[*.Test]*" -target:%MSPEC% -targetargs:"--html coverage\mspec --xml coverage\mspec\mspec.xml BellRichM.Weather.Api.Test\bin\Debug\net462\BellRichM.Weather.Api.Test.dll"

%REPORTGENERATOR% -reporttypes:Html;XmlSummary;Xml -reports:coverage\opencover\opencover.xml -targetdir:coverage\report -historydir:coverage\report\history

echo off

set MSPEC=%HOMEPATH%\.nuget\packages\Machine.Specifications.Runner.Console\0.9.3\tools\mspec-clr4.exe
set OPENCOVER=%HOMEPATH%\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe
set REPORTGENERATOR=%HOMEPATH%\.nuget\packages\ReportGenerator\3.0.2\tools\ReportGenerator.exe

dotnet build BellRichM.Weather.Api.Test/BellRichM.Weather.Api.Test.csproj

rem this runs mspec standalone, not needed because it is run in OpenCover
rem %MSPEC% --html coverage\mspec --xml coverage\mspec\mspec.xml BellRichM.Weather.Api.Test\bin\Debug\net462\BellRichM.Weather.Api.Test.dll

%OPENCOVER% -register:user -output:coverage\opencover\opencover.xml -filter:"+[BellRichM*]* -[*.Test]*" -target:%MSPEC% -targetargs:"--html coverage\mspec --xml coverage\mspec\mspec.xml BellRichM.Weather.Api.Test\bin\Debug\net462\BellRichM.Weather.Api.Test.dll"

%REPORTGENERATOR% -reporttypes:Html;XmlSummary;Xml -reports:coverage\opencover\opencover.xml -targetdir:coverage\report -historydir:coverage\report\history

Add build step when running code coverage


set "PATH=%~dp0.;%PATH%"
set "PYTHONPATH=%~dp0.;%PYTHONPATH%"

set "PATH=%~dp0.;%PATH%"
set "CL=%CL% /I%~dp0..\include /I%~dp0..\include\deepcl /I%~dp0..\include\easycl"
set "LIB=%~dp0..\lib;%~dp0..\lib\import %LIB%"

improve activate.bat to incorporate LIB and CL vars


@rem *nix/OSX users: please just do: `./run`
@node run

Remove comment - people have brains ya know


email30.exe -f from@gmail.com -p mypassword -t toemail@gmail.com -s Mysubject -a scan.txt
pause

Create run.bat

Create run.bat


REM build-vc-programs.cmd

REM This script does the following:
REM     1) Bootstraps (builds) the VCPKG submodule; VCPKG is used to be the
REM        sample and tools programs that rely on Google Protocol Buffers.
REM     2) builds the Visual C++ samples and tools contained in this repository.
REM
REM PRECONDITIONS
REM -------------
REM     - You have recursively cloned this repo; if not, submodules/vcpkg will be empty.
REM     - You have installed Visual Studio 2017 C++ tools. 2015 may also work.
REM     - PowerShell is available on your computer.
REM     - You must run this script from within a Visual Studio Developer Command prompt.
REM     - You must have internet access.
REM
REM POSTCONDITIONS
REM --------------
REM On successful execution of this script the vcpkg tools will be built and
REM the projects built by this script will have been built successfully.

REM ---------------------------------------------------------------------------
REM Bootstrap and build vcpkg

IF "%VisualStudioVersion%" == "" GOTO VSCmdPrompt

pushd submodules\vcpkg
call .\bootstrap-vcpkg.bat
ECHO vcpkg build completed.

REM per https://github.com/Microsoft/vcpkg/issues/645
if not exist downloads mkdir downloads
echo "." > downloads\AlwaysAllowEverything
dir downloads\Always*

vcpkg install protobuf:x86-windows-static
vcpkg install protobuf:x64-windows-static
ECHO Installs completed.

popd

REM ---------------------------------------------------------------------------
REM Build the programs

REM Per https://github.com/NuGet/Home/issues/7386, /t:restore does not support
REM packages.config, and nuget.exe is therefore necessary. However, nuget 3.5.0,
REM as available in vcpkg\downloads, attempts to use the v14 build tools
REM ("Failed to load msbuild Toolset... Microsoft.Build, Version=14.0.0.0").
REM Don't use the old nuget.

REM NOTE
REM We're not currently building arislog or vc-using-framestream from this script,
REM they're built in separate build steps on the build server.

GOTO End

:VSCmdPrompt
ECHO Couldn't find environment variable 'VisualStudioVersion'.
ECHO Are you at a Visual Studio developer command prompt?
EXIT /B 1

:End

REM build-vc-programs.cmd

REM This script does the following:
REM     1) Bootstraps (builds) the VCPKG submodule; VCPKG is used to be the
REM        sample and tools programs that rely on Google Protocol Buffers.
REM     2) builds the Visual C++ samples and tools contained in this repository.
REM
REM PRECONDITIONS
REM -------------
REM     - You have recursively cloned this repo; if not, submodules/vcpkg will be empty.
REM     - You have installed Visual Studio 2017 C++ tools. 2015 may also work.
REM     - PowerShell is available on your computer.
REM     - You must run this script from within a Visual Studio Developer Command prompt.
REM     - You must have internet access.
REM
REM POSTCONDITIONS
REM --------------
REM On successful execution of this script the vcpkg tools will be built and
REM the projects built by this script will have been built successfully.

@ECHO OFF

REM ---------------------------------------------------------------------------
REM Bootstrap and build vcpkg

IF "%VisualStudioVersion%" == "" GOTO VSCmdPrompt

pushd submodules\vcpkg
call .\bootstrap-vcpkg.bat
ECHO vcpkg build completed.

REM per https://github.com/Microsoft/vcpkg/issues/645
if not exist downloads mkdir downloads
echo "." > downloads\AlwaysAllowEverything
dir downloads\Always*

vcpkg install protobuf:x86-windows-static
vcpkg install protobuf:x64-windows-static
ECHO Installs completed.

popd

REM ---------------------------------------------------------------------------
REM Build the programs

REM Per https://github.com/NuGet/Home/issues/7386, /t:restore does not support
REM packages.config, and nuget.exe is therefore necessary. However, nuget 3.5.0,
REM as available in vcpkg\downloads, attempts to use the v14 build tools
REM ("Failed to load msbuild Toolset... Microsoft.Build, Version=14.0.0.0").
REM Don't use the old nuget.

REM NOTE
REM We're not currently building arislog or vc-using-framestream from this script,
REM they're built in separate build steps on the build server.

GOTO End

:VSCmdPrompt
ECHO ------------------------------------------------------------------------
ECHO ERROR: Couldn't find environment variable 'VisualStudioVersion'.
ECHO You must run this script form a Visual Studio developer command prompt.
ECHO ------------------------------------------------------------------------
EXIT /B 1

:End

Clean up echo output in build-vc-programs.cmd


@echo off
setlocal

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

IF ["%MAINCLASS%"] EQU [""] (
  set MAINCLASS=com.jkoolcloud.tnt4j.streams.StreamsAgent
)

@echo on
java %STREAMSOPTS% -classpath "%LIBPATH%" %MAINCLASS% %*

@echo off
setlocal

set RUNDIR=%~dp0
set LIBPATH="%LIBPATH%;%RUNDIR%..\*;%RUNDIR%..\lib\*"
rem tnt4j property override
IF ["%TNT4J_PROPERTIES%"] EQU [""] set TNT4J_PROPERTIES=%RUNDIR%..\config\tnt4j.properties
set TNT4JOPTS=-Dtnt4j.config="%TNT4J_PROPERTIES%"
rem log4j property override
IF ["%TNT4J_LOG4J_PROPERTIES%"] EQU [""] set TNT4J_LOG4J_PROPERTIES=%RUNDIR%..\config\log4j.properties
set LOG4JOPTS=-Dlog4j.configuration="file:%TNT4J_LOG4J_PROPERTIES%"
REM set LOGBACKOPTS=-Dlogback.configurationFile="file:%RUNDIR%..\config\logback.xml"
set STREAMSOPTS=%STREAMSOPTS% %LOG4JOPTS% %TNT4JOPTS%

IF ["%MAINCLASS%"] EQU [""] (
  set MAINCLASS=com.jkoolcloud.tnt4j.streams.StreamsAgent
)

@echo on
java %STREAMSOPTS% -classpath "%LIBPATH%" %MAINCLASS% %*

allow override of tnt4j and log4j file location


@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set mesa=%mesa%\
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%cmake\bin\;%PATH%
@set ERRORLEVEL=0
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%Python\;%mesa%Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=y
@set pyfrstupd=1
@if EXIST pyupd.ini set /p pyfrstupd=<pyupd.ini
@if %pyfrstupd%==0 set /p pyupd=Install/update python modules (y/n):
@if "%pyupd%"=="y" (
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@echo 0 > pyupd.ini
)
@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 vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64\%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set PATH=%mesa%flexbison\;%PATH%

: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 build_dxtn
@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 toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@if EXIST %mesa%ninja set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I "%oldtoolset%"=="y" set ninja=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if /I "%ninja%"=="y" set toolchain=Ninja
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cd %llvmbuildsys%
@cmake -G "%toolchain%" -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

:build_dxtn
@if NOT EXIST %gcc% GOTO build_mesa
@if NOT EXIST %mesa%dxtn GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" GOTO build_mesa
@set PATH=%gcc%\;%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
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO distcreate
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO exit
)
@cd %mesa%mesa
@set openswr=n
@set sconscmd=python %mesa%Python\Scripts\scons.py build=release platform=windows machine=%longabi% libgl-gdi
@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
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST %gcc% set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST %msys2% set mingwtest=%mingwtest%2
@if %mingwtest%==12 set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 set PATH=%gcc%\;%PATH%
@if /I "%mingw%"=="y" set sconscmd=%sconscmd% toolchain=crossmingw
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ar.exe %gcc%\%altabi%-w64-mingw32-ar.exe
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe %gcc%\%altabi%-w64-mingw32-ranlib.exe
@if /I "%mingw%"=="y" call "%msys2%" -use-full-path
@if /I "%mingw%"=="y" (
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa
GOTO build_mesa_exec
)

:build_with_vs
@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 %vsenvloaded%==0 (
@call %vsenv%
@cd %mesa%mesa
@echo.
)

:build_mesa_exec
@%sconscmd%
@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
@copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@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
@copy %mesa%dxtn\%abi%\dxtn.dll dxtn.dll
@echo.
@pause

:exit
exit

@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set mesa=%mesa%\
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%cmake\bin\;%PATH%
@set ERRORLEVEL=0
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%Python\;%mesa%Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=y
@set pyfrstupd=1
@if EXIST pyupd.ini set /p pyfrstupd=<pyupd.ini
@if %pyfrstupd%==0 set pyupd=n
@if %pyfrstupd%==0 set /p pyupd=Install/update python modules (y/n):
@if "%pyupd%"=="y" (
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@echo 0 > pyupd.ini
)
@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 vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64\%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set PATH=%mesa%flexbison\;%PATH%

: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 build_dxtn
@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 toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@if EXIST %mesa%ninja set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I "%oldtoolset%"=="y" set ninja=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if /I "%ninja%"=="y" set toolchain=Ninja
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cd %llvmbuildsys%
@cmake -G "%toolchain%" -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

:build_dxtn
@if NOT EXIST %gcc% GOTO build_mesa
@if NOT EXIST %mesa%dxtn GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" GOTO build_mesa
@set PATH=%gcc%\;%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
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO distcreate
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO exit
)
@cd %mesa%mesa
@set openswr=n
@set sconscmd=python %mesa%Python\Scripts\scons.py build=release platform=windows machine=%longabi% libgl-gdi
@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
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST %gcc% set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST %msys2% set mingwtest=%mingwtest%2
@if %mingwtest%==12 set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 set PATH=%gcc%\;%PATH%
@if /I "%mingw%"=="y" set sconscmd=%sconscmd% toolchain=crossmingw
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ar.exe %gcc%\%altabi%-w64-mingw32-ar.exe
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe %gcc%\%altabi%-w64-mingw32-ranlib.exe
@if /I "%mingw%"=="y" call "%msys2%" -use-full-path
@if /I "%mingw%"=="y" (
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa
GOTO build_mesa_exec
)

:build_with_vs
@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 %vsenvloaded%==0 (
@call %vsenv%
@cd %mesa%mesa
@echo.
)

:build_mesa_exec
@%sconscmd%
@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
@copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@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
@copy %mesa%dxtn\%abi%\dxtn.dll dxtn.dll
@echo.
@pause

:exit
exit

Build script: Assume empty input is no when asking about python modules update


SET PACKAGE_VERSION=3.0.1

cd .\src\Templates

nuget pack -Version %PACKAGE_VERSION%
dotnet new -u GeneticSharp.Templates
dotnet new -i GeneticSharp.Templates.%PACKAGE_VERSION%.nupkg

echo GeneticSharpTspBlazorApp
dotnet new GeneticSharpTspBlazorApp -n TspBlazorApp -o TspBlazorApp

echo GeneticSharpConsoleApp
dotnet new GeneticSharpConsoleApp -n ConsoleApp -o ConsoleApp
dotnet build ConsoleApp/ConsoleApp.csproj

echo GeneticSharpTspConsoleApp
dotnet new GeneticSharpTspConsoleApp -n TspConsoleApp -o TspConsoleApp
dotnet build TspConsoleApp/TspConsoleApp.csproj

echo GeneticSharpTspUnity3d
dotnet new GeneticSharpTspUnity3d -n TspUnity3d -o TspUnity3d

cd ..\..

SET PACKAGE_VERSION=3.0.0

cd .\src\Templates

nuget pack -Version %PACKAGE_VERSION%
dotnet new -u GeneticSharp.Templates
dotnet new -i GeneticSharp.Templates.%PACKAGE_VERSION%.nupkg

echo GeneticSharpTspBlazorApp
dotnet new GeneticSharpTspBlazorApp -n TspBlazorApp -o TspBlazorApp

echo GeneticSharpConsoleApp
dotnet new GeneticSharpConsoleApp -n ConsoleApp -o ConsoleApp
dotnet build ConsoleApp/ConsoleApp.csproj

echo GeneticSharpTspConsoleApp
dotnet new GeneticSharpTspConsoleApp -n TspConsoleApp -o TspConsoleApp
dotnet build TspConsoleApp/TspConsoleApp.csproj

echo GeneticSharpTspUnity3d
dotnet new GeneticSharpTspUnity3d -n TspUnity3d -o TspUnity3d

cd ..\..

Fix the nuget templates version

Fix the nuget templates version


SET CURRENT_PATH_PREINSTALL=%CD%
setx PATH "%PATH%;C:\turbo.lua;C:\turbo.lua\luarocks\2.2" /M
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install visualstudio2013professional git mingw openssl.light gnuwin
SET PATH=%PATH%;C:\Program Files (x86)\Git\cmd;C:\GnuWin\bin;C:\tools\mingw64\bin;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\turbo.lua;C:\turbo.lua\luarocks\2.2
SET VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
rm -rf C:\turbo.lua
mkdir C:\turbo.lua
cd C:\turbo.lua
mkdir src
cd src

git clone https://github.com/kernelsauce/turbo.git
cd C:\turbo.lua\src\turbo
mingw32-make SSL=none
mv libtffi_wrap.so libtffi_wrap.dll
setx TURBO_LIBTFFI "C:\turbo.lua\src\turbo\libtffi_wrap.dll" /M
setx TURBO_LIBSSL "C:\Program Files\OpenSSL\libeay32.dll" /M
SET TURBO_LIBTFFI=C:\turbo.lua\src\turbo\libtffi_wrap.dll
SET TURBO_LIBSSL=C:\Program Files\OpenSSL\libeay32.dll

cd C:\turbo.lua\src
git clone http://luajit.org/git/luajit-2.0.git
cd C:\turbo.lua\src\luajit-2.0\src
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
call msvcbuild
cp luajit.exe C:\turbo.lua
cp lua51.dll C:\turbo.lua

cd C:\turbo.lua\src
git clone https://github.com/keplerproject/luarocks.git
cd C:\turbo.lua\src\luarocks
SET LUA_PATH=C:\turbo.lua\rocks\share\lua\5.1\?.lua;C:\turbo.lua\rocks\share\lua\5.1\?\init.lua;C:\turbo.lua\src\turbo\?.lua;C:\turbo.lua\src\turbo\turbo\?.lua
SET LUA_CPATH=C:\turbo.lua\rocks\lib\lua\5.1\?.dll
setx LUA_PATH "%LUA_PATH%" /M
setx LUA_CPATH "%LUA_CPATH%" /M
call install.bat /TREE C:\turbo.lua\rocks\ /P C:\turbo.lua\luarocks\ /INC C:\turbo.lua\src\luajit-2.0\src /LIB C:\turbo.lua\src\luajit-2.0\src /LUA C:\turbo.lua /Q
call luarocks install luasocket luafilesystem

cd %CURRENT_PATH_PREINSTALL%
echo ===========================
echo Turbo is now installed. Try it by running 'luajit C:\turbo.lua\src\turbo\examples\helloworld.lua' and point your browser to http://localhost:8888.
echo Have a nice day!
echo ===========================

SET CURRENT_PATH_PREINSTALL=%CD%
setx PATH "%PATH%;C:\turbo.lua;C:\turbo.lua\luarocks\2.2" /M
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install visualstudio2013professional git mingw openssl.light gnuwin
SET PATH=%PATH%;C:\Program Files (x86)\Git\cmd;C:\GnuWin\bin;C:\tools\mingw64\bin;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\turbo.lua;C:\turbo.lua\luarocks\2.2
SET VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
rm -rf C:\turbo.lua
mkdir C:\turbo.lua
cd C:\turbo.lua
mkdir src
cd src

git clone https://github.com/kernelsauce/turbo.git
cd C:\turbo.lua\src\turbo
mingw32-make SSL=none
mv libtffi_wrap.so libtffi_wrap.dll
setx TURBO_LIBTFFI "C:\turbo.lua\src\turbo\libtffi_wrap.dll" /M
setx TURBO_LIBSSL "C:\Program Files\OpenSSL\libeay32.dll" /M
SET TURBO_LIBTFFI=C:\turbo.lua\src\turbo\libtffi_wrap.dll
SET TURBO_LIBSSL=C:\Program Files\OpenSSL\libeay32.dll

cd C:\turbo.lua\src
git clone http://luajit.org/git/luajit-2.0.git
cd C:\turbo.lua\src\luajit-2.0\src
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
call msvcbuild
cp luajit.exe C:\turbo.lua
cp lua51.dll C:\turbo.lua

cd C:\turbo.lua\src
git clone https://github.com/keplerproject/luarocks.git
cd C:\turbo.lua\src\luarocks
SET LUA_PATH=C:\turbo.lua\rocks\share\lua\5.1\?.lua;C:\turbo.lua\rocks\share\lua\5.1\?\init.lua;C:\turbo.lua\src\turbo\?.lua;C:\turbo.lua\src\turbo\turbo\?.lua
SET LUA_CPATH=C:\turbo.lua\rocks\lib\lua\5.1\?.dll
setx LUA_PATH "%LUA_PATH%" /M
setx LUA_CPATH "%LUA_CPATH%" /M
call install.bat /TREE C:\turbo.lua\rocks\ /P C:\turbo.lua\luarocks\ /INC C:\turbo.lua\src\luajit-2.0\src /LIB C:\turbo.lua\src\luajit-2.0\src /LUA C:\turbo.lua /Q
call luarocks install luasocket
call luarocks install luafilesystem

cd %CURRENT_PATH_PREINSTALL%
echo ===========================
echo Turbo is now installed. Try it by running 'luajit C:\turbo.lua\src\turbo\examples\helloworld.lua' and point your browser to http://localhost:8888.
echo Have a nice day!
echo ===========================

Split install via Luarocks into two...

Split install via Luarocks into two...


:: Windows batch script to prepare for the pip-accel test suite.
::
:: Author: Peter Odding <peter.odding@paylogic.com>
:: Last Change: November 11, 2015
:: URL: https://github.com/paylogic/pip-accel
::
:: This Windows batch script is used to run the pip-accel test suite on
:: AppVeyor CI with increased coverage collection (which requires some
:: preparations). It installs/upgrades/removes several Python packages whose
:: installation, upgrade and/or removal is tested in the test suite to make
:: sure that the test suite starts from a known state.

:: Install pip-accel in editable mode.
"%PYTHON%\Scripts\pip.exe" install --quiet --editable .

:: Install the test suite's dependencies.
"%PYTHON%\Scripts\pip.exe" install --quiet --requirement=requirements-testing.txt

:: Downgrade setuptools so that the test suite can verify that setuptools is
:: upgraded to >= 0.8 when a binary wheel is installed. Performing this
:: downgrade inside the test suite process doesn't work as expected because pip
:: (pkg_resources) will still think the newer version is installed (due to
:: caching without proper cache invalidation by pkg_resources).
"%PYTHON%\Scripts\pip.exe" install --quiet --no-binary=:all: "setuptools < 0.8"

:: Install requests==2.6.0 so the test suite can downgrade to requests==2.2.1
:: (to verify that downgrading of packages works). Ideally the test suite
:: should just be able to install requests==2.6.0 and then downgrade to
:: requests==2.2.1 but unfortunately this doesn't work reliably in the same
:: Python process due to (what looks like) caching in the pkg_resources module
:: bundled with pip (which in turn causes a variety of confusing internal
:: errors in pip and pip-accel).
"%PYTHON%\Scripts\pip.exe" install --quiet requests==2.6.0

:: Remove iPython so the test suite can install iPython in a clean environment,
:: allowing the test suite to compare the files installed and removed by pip
:: and pip-accel.
"%PYTHON%\Scripts\pip.exe" uninstall --quiet --yes ipython

:: If iPython wasn't installed to begin with, the previous command will have
:: returned with a nonzero exit code. We don't want this to terminate the
:: AppVeyor CI build.
exit /b 0

:: Windows batch script to prepare for the pip-accel test suite.
::
:: Author: Peter Odding <peter.odding@paylogic.com>
:: Last Change: November 11, 2015
:: URL: https://github.com/paylogic/pip-accel
::
:: This Windows batch script is used to run the pip-accel test suite on
:: AppVeyor CI with increased coverage collection (which requires some
:: preparations). It installs/upgrades/removes several Python packages whose
:: installation, upgrade and/or removal is tested in the test suite to make
:: sure that the test suite starts from a known state.

:: Install pip-accel in editable mode.
"%PYTHON%\Scripts\pip.exe" install --quiet --editable .

:: Install the test suite's dependencies. We ignore py.test wheels because of
:: an obscure issue that took me hours to debug and I really don't want to get
:: into it here :-(.
"%PYTHON%\Scripts\pip.exe" install --no-binary=pytest --quiet --requirement=requirements-testing.txt

:: Downgrade setuptools so that the test suite can verify that setuptools is
:: upgraded to >= 0.8 when a binary wheel is installed. Performing this
:: downgrade inside the test suite process doesn't work as expected because pip
:: (pkg_resources) will still think the newer version is installed (due to
:: caching without proper cache invalidation by pkg_resources).
"%PYTHON%\Scripts\pip.exe" install --quiet --no-binary=:all: "setuptools < 0.8"

:: Install requests==2.6.0 so the test suite can downgrade to requests==2.2.1
:: (to verify that downgrading of packages works). Ideally the test suite
:: should just be able to install requests==2.6.0 and then downgrade to
:: requests==2.2.1 but unfortunately this doesn't work reliably in the same
:: Python process due to (what looks like) caching in the pkg_resources module
:: bundled with pip (which in turn causes a variety of confusing internal
:: errors in pip and pip-accel).
"%PYTHON%\Scripts\pip.exe" install --quiet requests==2.6.0

:: Remove iPython so the test suite can install iPython in a clean environment,
:: allowing the test suite to compare the files installed and removed by pip
:: and pip-accel.
"%PYTHON%\Scripts\pip.exe" uninstall --quiet --yes ipython

:: If iPython wasn't installed to begin with, the previous command will have
:: returned with a nonzero exit code. We don't want this to terminate the
:: AppVeyor CI build.
exit /b 0

Fix the same bug again on AppVeyor ಠ_ಠ

Fix the same bug again on AppVeyor ಠ_ಠ

https://ci.appveyor.com/project/xolox/pip-accel/build/1.0.83


:<<"::CMDLITERAL"

IF [%1] == [] ECHO no args && EXIT /B
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', '%BASEFOLDER%\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', '%BASEFOLDER%\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
REM http://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if variable is set
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/ >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Log_Days=30 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000 >> %BASEFOLDER%\clientsettings.cfg

ECHO %0
ECHO %1
ECHO %MASTHEADURL%

%BASEFOLDER%\BESClient.exe /s /v"/l*voicewarmup %BASEFOLDER%\install.log /qn"

EXIT
::CMDLITERAL

:<<"::CMDLITERAL"

IF [%1] == [] ECHO no args && EXIT /B
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
SET BASEFOLDER=C:\Windows\Temp

REM  TODO: handle clientsettings.cfg or masthead.afxm or actionsite.afxm already in the CWD

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', '%BASEFOLDER%\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', '%BASEFOLDER%\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
REM http://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows
type NUL > %BASEFOLDER%\clientsettings.cfg
REM  TODO: only do the following line if variable is set
ECHO _BESClient_RelaySelect_FailoverRelay=http://%1:52311/bfmirror/downloads/ >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_StartupNormalSpeed=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_RetryMinutes=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_WorkIdle=20 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Resource_SleepIdle=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollEnable=1 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Comm_CommandPollIntervalSeconds=10800 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Log_Days=30 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_UtilitiesCacheLimitMB=500 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_DownloadsCacheLimitMB=5000 >> %BASEFOLDER%\clientsettings.cfg
ECHO _BESClient_Download_MinimumDiskFreeMB=2000 >> %BASEFOLDER%\clientsettings.cfg

ECHO %0
ECHO %1
ECHO %MASTHEADURL%

%BASEFOLDER%\BESClient.exe /s /v"/l*voicewarmup %BASEFOLDER%\install.log /qn"

EXIT /B
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


@echo off
echo HTTP/1.1 200 OK
echo Connection: close
echo.
echo CGI test:
echo.
set

Fix up batch script line endings

Fix up batch script line endings

The new .gitattributes solve issues with Windows specific files


@echo off

echo Building Dep...

echo Compiling libevent
"..\\Tool\\7z.exe" x libevent-2.0.22-stable.tar.gz -Y
"..\\Tool\\7z.exe" x libevent-2.0.22-stable.tar -Y
del libevent-2.0.22-stable.tar

if exist libevent rd /S /Q libevent
rename libevent-2.0.22-stable libevent
rd /S /Q libevent-2.0.22-stable

echo extract libevent libs
"..\\Tool\\7z.exe" x libevent_libs.zip -Y
copy lib\\Release\\libevent.a lib\\Debug\\ /Y
copy lib\\Release\\libevent.lib lib\\Debug\\ /Y
copy lib\\Release\\libevent_core.a lib\\Debug\\ /Y
copy lib\\Release\\libevent_core.lib lib\\Debug\\ /Y

@echo off

echo Building Dep...

echo Compiling libevent
"..\\Tool\\7z.exe" x libevent-release-2.1.8-stable.zip -Y

rd libevent  /q /s
rename libevent-release-2.1.8-stable libevent

echo Compiling evpp
"..\\Tool\\7z.exe" x evpp.zip -Y -o./evpp

echo Compiling glog
"..\\Tool\\7z.exe" x glog-0.3.5.zip -Y

rd glog  /q /s
rename glog-0.3.5 glog

fix build script

fix build script

Former-commit-id: 460f1915f26270fce47fa6efb139329a82132a70
Former-commit-id: 67585cd06819368405c18d01f18583a1381fc9e1
Former-commit-id: 2fb3ff0d2b527a0d57ae0616489ae70e72722229


@REM
@REM  Licensed to the Apache Software Foundation (ASF) under one or more
@REM  contributor license agreements.  See the NOTICE file distributed with
@REM  this work for additional information regarding copyright ownership.
@REM  The ASF licenses this file to You under the Apache License, Version 2.0
@REM  (the "License"); you may not use this file except in compliance with
@REM  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, software
@REM  distributed under the License is distributed on an "AS IS" BASIS,
@REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM  See the License for the specific language governing permissions and
@REM  limitations under the License.

@echo off

set ARG=%1
set INSTALL="INSTALL"
set UNINSTALL="UNINSTALL"

pushd %~dp0..
if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%
popd

if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.thrift.CassandraDaemon
if NOT DEFINED JAVA_HOME goto err

REM ***** JAVA options *****
set JAVA_OPTS=-ea^
 -javaagent:"%CASSANDRA_HOME%\lib\jamm-0.2.5.jar"^
 -Xms1G^
 -Xmx1G^
 -XX:+HeapDumpOnOutOfMemoryError^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:SurvivorRatio=8^
 -XX:MaxTenuringThreshold=1^
 -XX:CMSInitiatingOccupancyFraction=75^
 -XX:+UseCMSInitiatingOccupancyOnly^
 -Dcom.sun.management.jmxremote.port=7199^
 -Dcom.sun.management.jmxremote.ssl=false^
 -Dcom.sun.management.jmxremote.authenticate=false^
 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true

REM ***** CLASSPATH library setting *****

REM Ensure that any user defined CLASSPATH variables are not used on startup
set CLASSPATH="%CASSANDRA_HOME%\conf"

REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable.
for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i"
goto okClasspath

:append
set CLASSPATH=%CLASSPATH%;%1
goto :eof

:okClasspath
REM Include the build\classes\main directory so it works in development
set CASSANDRA_CLASSPATH=%CLASSPATH%;"%CASSANDRA_HOME%\build\classes\main";"%CASSANDRA_HOME%\build\classes\thrift"
set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
if /i "%ARG%" == "INSTALL" goto doInstallOperation
if /i "%ARG%" == "UNINSTALL" goto doInstallOperation
goto runDaemon

:runDaemon
echo Starting Cassandra Server
"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%"
goto finally

:doInstallOperation
set SERVICE_JVM="cassandra"
rem location of Prunsrv
set PATH_PRUNSRV=%CASSANDRA_HOME%\bin\daemon\
set PR_LOGPATH=%PATH_PRUNSRV%

rem fix up java ops replace ' -' with ' ;-'
set JAVA_OPTS_DELM=%JAVA_OPTS: -=;-%

rem Allow prunsrv to be overridden
if "%PRUNSRV%" == "" set PRUNSRV=%PATH_PRUNSRV%prunsrv

echo trying to delete service if it has been created already
"%PRUNSRV%" //DS//%SERVICE_JVM%
rem quit if we're just going to uninstall
if /i "%ARG%" == "UNINSTALL" goto finally

echo.
echo Installing %SERVICE_JVM%. If you get registry warnings, re-run as an Administrator
"%PRUNSRV%" //IS//%SERVICE_JVM%
echo Setting the parameters for %SERVICE_JVM%
rem set PR_CLASSPATH=%CASSANDRA_CLASSPATH%
"%PRUNSRV%" //US//%SERVICE_JVM% ^
 --Jvm=auto --StdOutput auto --StdError auto ^
 --Classpath=%CASSANDRA_CLASSPATH% ^
 --StartMode=jvm --StartClass=%CASSANDRA_MAIN% --StartMethod=main ^
 --StopMode=jvm --StopClass=%CASSANDRA_MAIN%  --StopMethod=stop ^
 ++JvmOptions=%JAVA_OPTS_DELM% ++JvmOptions=-DCassandra ^
 --PidFile pid.txt

echo Installation of %SERVICE_JVM% is complete
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

@REM
@REM  Licensed to the Apache Software Foundation (ASF) under one or more
@REM  contributor license agreements.  See the NOTICE file distributed with
@REM  this work for additional information regarding copyright ownership.
@REM  The ASF licenses this file to You under the Apache License, Version 2.0
@REM  (the "License"); you may not use this file except in compliance with
@REM  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, software
@REM  distributed under the License is distributed on an "AS IS" BASIS,
@REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM  See the License for the specific language governing permissions and
@REM  limitations under the License.

@echo off
if "%OS%" == "Windows_NT" setlocal

set ARG=%1
set INSTALL="INSTALL"
set UNINSTALL="UNINSTALL"

pushd %~dp0..
if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%
popd

if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.thrift.CassandraDaemon
if NOT DEFINED JAVA_HOME goto err

REM ***** JAVA options *****
set JAVA_OPTS=-ea^
 -javaagent:"%CASSANDRA_HOME%\lib\jamm-0.2.5.jar"^
 -Xms1G^
 -Xmx1G^
 -XX:+HeapDumpOnOutOfMemoryError^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:SurvivorRatio=8^
 -XX:MaxTenuringThreshold=1^
 -XX:CMSInitiatingOccupancyFraction=75^
 -XX:+UseCMSInitiatingOccupancyOnly^
 -Dcom.sun.management.jmxremote.port=7199^
 -Dcom.sun.management.jmxremote.ssl=false^
 -Dcom.sun.management.jmxremote.authenticate=false^
 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true

REM ***** CLASSPATH library setting *****

REM Ensure that any user defined CLASSPATH variables are not used on startup
set CLASSPATH="%CASSANDRA_HOME%\conf"

REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable.
for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i"
goto okClasspath

:append
set CLASSPATH=%CLASSPATH%;%1
goto :eof

:okClasspath
REM Include the build\classes\main directory so it works in development
set CASSANDRA_CLASSPATH=%CLASSPATH%;"%CASSANDRA_HOME%\build\classes\main";"%CASSANDRA_HOME%\build\classes\thrift"
set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
if /i "%ARG%" == "INSTALL" goto doInstallOperation
if /i "%ARG%" == "UNINSTALL" goto doInstallOperation
goto runDaemon

:runDaemon
echo Starting Cassandra Server
"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%"
goto finally

:doInstallOperation
set SERVICE_JVM="cassandra"
rem location of Prunsrv
set PATH_PRUNSRV=%CASSANDRA_HOME%\bin\daemon\
set PR_LOGPATH=%PATH_PRUNSRV%

rem fix up java ops replace ' -' with ' ;-'
set JAVA_OPTS_DELM=%JAVA_OPTS: -=;-%

rem Allow prunsrv to be overridden
if "%PRUNSRV%" == "" set PRUNSRV=%PATH_PRUNSRV%prunsrv

echo trying to delete service if it has been created already
"%PRUNSRV%" //DS//%SERVICE_JVM%
rem quit if we're just going to uninstall
if /i "%ARG%" == "UNINSTALL" goto finally

echo.
echo Installing %SERVICE_JVM%. If you get registry warnings, re-run as an Administrator
"%PRUNSRV%" //IS//%SERVICE_JVM%
echo Setting the parameters for %SERVICE_JVM%
rem set PR_CLASSPATH=%CASSANDRA_CLASSPATH%
"%PRUNSRV%" //US//%SERVICE_JVM% ^
 --Jvm=auto --StdOutput auto --StdError auto ^
 --Classpath=%CASSANDRA_CLASSPATH% ^
 --StartMode=jvm --StartClass=%CASSANDRA_MAIN% --StartMethod=main ^
 --StopMode=jvm --StopClass=%CASSANDRA_MAIN%  --StopMethod=stop ^
 ++JvmOptions=%JAVA_OPTS_DELM% ++JvmOptions=-DCassandra ^
 --PidFile pid.txt

echo Installation of %SERVICE_JVM% is complete
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

use setlocal in cassandra.bat
patch by Tyler Hobbs; reviewed by Ben Coverston for CASSANDRA-3506

git-svn-id: fad5a61f0599d0fa6686745ed37d3649e5fd7db1@1203840 13f79535-47bb-0310-9956-ffa450edef68


..\tools\Build.Tools\Fake\FAKE.exe ..\tools\Build.Tools\YC.Core.fsx "%1" "%2"

..\tools\Build.Tools\Fake\FAKE.exe ..\tools\Build.Tools\YC.Core.fsx "user=%1" "password=%2"

Correct arguments in YC.Core.bat

Correct arguments in YC.Core.bat


REM To avoid building in work/ alongside the source. Rather build in work/build/
mkdir build
cd build

REM Remove dot from PY_VER for use in library name
set MY_PY_VER=%PY_VER:.=%

REM set env variables needed by MKL
set MKL_INTERFACE_LAYER = LP64
set MKL_THREADING_LAYER = INTEL
set CONFIGURATION=Release
REM Configure step
cmake -G "Visual Studio 16 2019" ^
 -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
 -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
 -DCMAKE_SYSTEM_PREFIX_PATH="%LIBRARY_PREFIX%" ^
 -DCH_INSTALL_PYTHON_PACKAGE="%SP_DIR%" ^
 -DPYTHON_EXECUTABLE:FILEPATH="%PYTHON%" ^
 -DPYTHON_INCLUDE_DIR:PATH="%PREFIX%"/include ^
 -DPYTHON_LIBRARY:FILEPATH="%PREFIX%"/libs/python%MY_PY_VER%.lib ^
 -DSWIG_DIR="%CONDA_INSTALL_LOCN%"\pkgs\swig-4.0.2-1\Library\bin\Lib\ ^
 -DSWIG_EXECUTABLE="%CONDA_INSTALL_LOCN%"\pkgs\swig-4.0.2-1\Library\bin\swig.exe ^
 -DCMAKE_BUILD_TYPE="%CONFIGURATION%" ^
 -DENABLE_MODULE_IRRLICHT=ON ^
 -DENABLE_MODULE_POSTPROCESS=ON ^
 -DENABLE_MODULE_VEHICLE=ON ^
 -DENABLE_MODULE_PYTHON=ON ^
 -DBUILD_DEMOS=OFF ^
 -DBUILD_TESTING=OFF ^
 -DBUILD_GMOCK=OFF ^
 -DBUILD_BENCHMARKING=OFF ^
 -DIRRLICHT_ROOT="C:\Users\builder\Documents\irrlicht-1.8.4" ^
 -DIRRLICHT_LIBRARY="C:\Users\builder\Documents\irrlicht-1.8.4\lib\Win64-visualStudio\Irrlicht.lib" ^
 -DEIGEN3_INCLUDE_DIR="C:\Users\builder\Documents\eigen-3.3.9" ^
 -DENABLE_MODULE_CASCADE=ON ^
 -DCASCADE_INCLUDE_DIR="%CONDA_INSTALL_LOCN%"\Library\include\opencascade ^
 -DCASCADE_LIBDIR="%CONDA_INSTALL_LOCN%"\Library\lib ^
 -DENABLE_MODULE_PARDISO_MKL=ON ^
 -DMKL_INCLUDE_DIR="%CONDA_INSTALL_LOCN%"\Library\include ^
 -DMKL_RT_LIBRARY="%CONDA_INSTALL_LOCN%"\Library\lib\mkl_rt.lib ^
 -DIOMP5_LIBRARY="%CONDA_INSTALL_LOCN%"\Library\lib\libiomp5md.lib ^
 -DPYCHRONO_DATA_PATH="..\..\..\..\..\Library\data" ^
 .. >> "%LOG_DIR%"\cmakeconfiglog.txt 2>&1
if errorlevel 1 exit 1

REM Build step
cmake --build . --config "%CONFIGURATION%" >> "%LOG_DIR%"\cmakebuildlog.txt 2>&1
if errorlevel 1 exit 1

REM Install step
cmake --build . --config "%CONFIGURATION%" --target install
if errorlevel 1 exit 1

REM Install step
REM ninja install
REM if errorlevel 1 exit 1

REM To avoid building in work/ alongside the source. Rather build in work/build/
mkdir build
cd build

REM Remove dot from PY_VER for use in library name
set MY_PY_VER=%PY_VER:.=%

REM set env variables needed by MKL
set MKL_INTERFACE_LAYER = LP64
set MKL_THREADING_LAYER = INTEL
set CONFIGURATION=Release
REM Configure step
cmake -G "Visual Studio 16 2019" ^
 -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
 -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
 -DCMAKE_SYSTEM_PREFIX_PATH="%LIBRARY_PREFIX%" ^
 -DCH_INSTALL_PYTHON_PACKAGE="%SP_DIR%" ^
 -DPYTHON_EXECUTABLE:FILEPATH="%PYTHON%" ^
 -DPYTHON_INCLUDE_DIR:PATH="%PREFIX%"/include ^
 -DPYTHON_LIBRARY:FILEPATH="%PREFIX%"/libs/python%MY_PY_VER%.lib ^
 -DSWIG_DIR="%CONDA_INSTALL_LOCN%"/Library/bin/Lib ^
 -DSWIG_EXECUTABLE="%CONDA_INSTALL_LOCN%"/Library/bin/swig.exe ^
 -DCMAKE_BUILD_TYPE="%CONFIGURATION%" ^
 -DENABLE_MODULE_IRRLICHT=ON ^
 -DENABLE_MODULE_POSTPROCESS=ON ^
 -DENABLE_MODULE_VEHICLE=ON ^
 -DENABLE_MODULE_PYTHON=ON ^
 -DBUILD_DEMOS=OFF ^
 -DBUILD_TESTING=OFF ^
 -DBUILD_GMOCK=OFF ^
 -DBUILD_BENCHMARKING=OFF ^
 -DIRRLICHT_ROOT="C:\Users\builder\Documents\irrlicht-1.8.4" ^
 -DIRRLICHT_LIBRARY="C:\Users\builder\Documents\irrlicht-1.8.4\lib\Win64-visualStudio\Irrlicht.lib" ^
 -DEIGEN3_INCLUDE_DIR="C:\Users\builder\Documents\eigen-3.3.9" ^
 -DENABLE_MODULE_CASCADE=ON ^
 -DCASCADE_INCLUDE_DIR="%CONDA_INSTALL_LOCN%"\Library\include\opencascade ^
 -DCASCADE_LIBDIR="%CONDA_INSTALL_LOCN%"\Library\lib ^
 -DENABLE_MODULE_PARDISO_MKL=ON ^
 -DMKL_INCLUDE_DIR="%CONDA_INSTALL_LOCN%"\Library\include ^
 -DMKL_RT_LIBRARY="%CONDA_INSTALL_LOCN%"\Library\lib\mkl_rt.lib ^
 -DIOMP5_LIBRARY="%CONDA_INSTALL_LOCN%"\Library\lib\libiomp5md.lib ^
 -DPYCHRONO_DATA_PATH="..\..\..\..\..\Library\data" ^
 .. >> "%LOG_DIR%"\cmakeconfiglog.txt 2>&1
if errorlevel 1 exit 1

REM Build step
cmake --build . --config "%CONFIGURATION%" >> "%LOG_DIR%"\cmakebuildlog.txt 2>&1
if errorlevel 1 exit 1

REM Install step
cmake --build . --config "%CONFIGURATION%" --target install
if errorlevel 1 exit 1

REM Install step
REM ninja install
REM if errorlevel 1 exit 1

Fix swig location in conda

Fix swig location in conda


Create build.bat

Create build.bat


@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
	.nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\nuget.exe install Sake -ExcludeVersion -Out packages

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
	.nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\nuget.exe install Sake -ExcludeVersion -Out packages

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -alias default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Update 'build.cmd' alias parameter to use full name.


set GOPATH=%BuildFolder%
go get -v ./...
go test -v ./...

add Appveyor win build

add Appveyor win build


@echo off

@rem Check for mvn in path, use it if found, otherwise use maven wrapper
@set MAVEN_CMD=mvn
@where /q mvn

@if "%1" == "" call:help
@if "%1" == "sso-server" call:sso-server
@if "%1" == "sso-management" call:sso-management
@if "%1" == "sso-config" call:sso-config %2 %3 %4
@if "%1" == "cas-client-demo" call:cas-client-demo %2 %3 %4
@if "%1" == "shiro-client-demo" call:shiro-client-demo %2 %3 %4
@if "%1" == "help" call:help
@if "%1" == "run-all" call:run-all

@rem function section starts here
@goto:eof

:help
    @echo "Usage: build.bat [help|sso-server|sso-management|sso-config|cas-client-demo|shiro-client-demo|run-all]"

    @echo "sso-server: CAS server to run(2)"
    @echo "sso-management: Cas Management"
    @echo "sso-config: Config Server(1)"
    @echo "cas-client-demo: CasClient Demo"
    @echo "shiro-client-demo: ShiroDemo"
    @echo "run-all: Run all server"
@goto:eof

:sso-server
	@echo Startting sso server...
    call sso-server/build.cmd run
@goto:eof

:sso-management
	@echo Startting cas management...
    call sso-management /build.cmd run
@goto:eof

:sso-config
	@echo Startting config Server...
    call %MAVEN_CMD% spring-boot:run -T 5 %1 %2 %3 -f sso-config/pom.xml
@goto:eof

:cas-client-demo
	@echo Startting cas client demo...
    call %MAVEN_CMD% jetty:run -f sso-client-demo/sso-cas-client-demo/pom.xml
@goto:eof

:shiro-client-demo
	@echo Startting shiro client demo...
    call %MAVEN_CMD% spring-boot:run -T 5 %1 %2 %3 -f sso-client-demo/sso-client-shiro-demo/pom.xml
@goto:eof

:run-all
	@echo TODO...
@goto:eof

Create build.cmd

Create build.cmd

上传一键启动文件，待完善


@echo off

:: Note: We've disabled node reuse because it causes file locking issues.
::       The issue is that we extend the build with our own targets which
::       means that that rebuilding cannot successully delete the task
::       assembly.

:: Log build command line
set buildprefix=echo
set buildpostfix=^> "%~dp0msbuild.log"
call :build %*

:: Build
set buildprefix=
set buildpostfix=
call :build %*

goto :eof

:build
%buildprefix% "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" "%~dp0build.proj" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log";Append %* %buildpostfix%
goto :eof

@echo off
setlocal

:: Note: We've disabled node reuse because it causes file locking issues.
::       The issue is that we extend the build with our own targets which
::       means that that rebuilding cannot successully delete the task
::       assembly.

:: Check prerequisites
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe.  Please see http://go.microsoft.com/fwlink/?LinkID=518812 for build instructions. && goto :eof

:: Log build command line
set _buildprefix=echo
set _buildpostfix=^> "%~dp0msbuild.log"
call :build %*

:: Build
set _buildprefix=
set _buildpostfix=
call :build %*

goto :eof

:build
%_buildprefix% %_msbuildexe% "%~dp0build.proj" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log";Append %* %_buildpostfix%
goto :eof

Build bootstrapper looks for both WOW and native x86 msbuild

This change causes the build bootstrapper to look for the x86 MSBuild
in both the WOW and native Program Files, to enable building on x86
machines.  This change also provides a friendly error if MSBuild.exe
cannot be found in either location, directing users to our
contributing guide via http://go.microsoft.com/fwlink/?LinkID=518812


@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
xcopy ..\data\Sprites "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy ..\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy ..\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy ..\Tutorials "%kam_folder%"\Tutorials\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\Readme "%kam_folder%"\ /y /r /s
xcopy ..\lib "%kam_folder%"\lib\ /y /r /s

REM ============================================================
REM Copy video files
REM ============================================================
xcopy "%KMRVideosDir%" "%kam_folder%" /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
xcopy ..\KM_TextIDs.inc "%kam_folder%"\KM_TextIDs.inc* /y /r /i
xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
xcopy "%KMRPrevVersionDir%"\oalinst.exe "%kam_folder%"\oalinst.exe* /y /r /i

@REM copy ScriptingEditor
if %IncludeScriptingEditor%==True (
xcopy "%ScriptingEditorDir%"\bin\ScriptingEditor.exe* "%kam_folder%"\ScriptingEditor /y /r /i
xcopy "%ScriptingEditorDir%"\bin\SE_Data "%kam_folder%"\ScriptingEditor\SE_Data\ /y /r /s
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptingEditor\SE_Data\KMR\ScriptValidator.exe* /y /r /i
@REM no need for KP folder
rmdir /S /Q "%ScriptingEditorDir%"\bin\SE_Data\KP
)

@REM copy utility applications exe files
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\KaM_Remake_Server_linux_x86_64* /y /r /i

@REM ============================================================
@REM Copy music files from original KaM TPR game
@REM ============================================================
@REM take music from previous KMR version for now
@REM xcopy "%KaMOrigDir%"\data\sfx\songs\*.sng "%kam_folder%"\Music\*.mp2 /y /r /s

REM ============================================================
REM Copy data folders
REM ============================================================
@REM Copy all data files, except sfx, which should be copied from KMRPrevVersionDir
xcopy ..\data\defines "%kam_folder%"\data\defines\ /y /r /s
xcopy ..\data\gfx "%kam_folder%"\data\gfx\ /y /r /s
xcopy ..\data\Sprites "%kam_folder%"\data\Sprites\ /y /r /s
xcopy ..\data\text "%kam_folder%"\data\text\ /y /r /s
xcopy ..\data\locales.txt "%kam_folder%"\data\locales.txt* /y /r /i
xcopy ..\Campaigns "%kam_folder%"\Campaigns\ /y /r /s
xcopy ..\Maps "%kam_folder%"\Maps\ /y /r /s /exclude:excluded_test_maps.txt
xcopy ..\MapsMP "%kam_folder%"\MapsMP\ /y /r /s
xcopy ..\Tutorials "%kam_folder%"\Tutorials\ /y /r /s
xcopy ..\Sounds "%kam_folder%"\Sounds\ /y /r /s
xcopy ..\Music "%kam_folder%"\Music\ /y /r /s
xcopy ..\Readme "%kam_folder%"\ /y /r /s
xcopy ..\lib "%kam_folder%"\lib\ /y /r /s

REM ============================================================
REM Copy video files
REM ============================================================
xcopy "%KMRVideosDir%" "%kam_folder%" /y /r /s

REM ============================================================
REM Copy files from KMRPrevVersionDir
REM ============================================================
xcopy "%KMRPrevVersionDir%"\data\sfx "%kam_folder%"\data\sfx\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Music "%kam_folder%"\Music\ /y /r /s
xcopy "%KMRPrevVersionDir%"\Campaigns\*.mp3 "%kam_folder%"\Campaigns\ /y /r /s

@REM ============================================================
@REM Erase source-code files from copied "data\"
@REM ============================================================
@REM erase /F /Q /S .\"%kam_folder%"\*.inc

REM ============================================================
REM Copy selected executable files
REM ============================================================
@REM Adding * to the file name supresses the "Is it a file or a folder" query
@REM xcopy ..\data.pack .\"%kam_folder%"\data.pack* /y /r /i
xcopy ..\KaM_Remake.exe "%kam_folder%"\KaM_Remake.exe* /y /r /i
xcopy ..\KM_TextIDs.inc "%kam_folder%"\KM_TextIDs.inc* /y /r /i
xcopy ..\libzplay.dll "%kam_folder%"\libzplay.dll* /y /r /i
xcopy ..\ogg.dll "%kam_folder%"\ogg.dll* /y /r /i
xcopy ..\vorbis.dll "%kam_folder%"\vorbis.dll* /y /r /i
xcopy ..\vorbisfile.dll "%kam_folder%"\vorbisfile.dll* /y /r /i
xcopy "%KMRPrevVersionDir%"\oalinst.exe "%kam_folder%"\oalinst.exe* /y /r /i

@REM copy ScriptingEditor
if %IncludeScriptingEditor%==True (
xcopy "%ScriptingEditorDir%"\bin\ScriptingEditor.exe* "%kam_folder%"\ScriptingEditor /y /r /i
xcopy "%ScriptingEditorDir%"\bin\SE_Data_KMR "%kam_folder%"\ScriptingEditor\SE_Data\ /y /r /s
xcopy "%ScriptingEditorDir%"\bin\SE_Data\Examples "%kam_folder%"\ScriptingEditor\SE_Data\Examples\ /y /r /s
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptingEditor\SE_Data\ScriptValidator.exe* /y /r /i
@REM no need for OLD folder there
rmdir /S /Q "%kam_folder%"\bin\SE_Data\OLD
rmdir /S /Q "%kam_folder%"\bin\SE_Data\Logs
)

@REM copy utility applications exe files
xcopy "..\Utils\Campaign builder\KaM_Remake_Settings_ini_readme.txt" "%kam_folder%"\KaM_Remake_Settings_ini_readme.txt* /y /r /i
xcopy "..\Utils\Campaign builder\CampaignBuilder.exe" "%kam_folder%"\CampaignBuilder.exe* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_DedicatedServer.exe" "%kam_folder%"\KaM_Remake_Server_win32.exe* /y /r /i
xcopy "..\Utils\DedicatedServerGUI\KaM_DedicatedServerGUI.exe" "%kam_folder%"\KaM_Remake_ServerGUI_win32.exe* /y /r /i
xcopy "..\Utils\ScriptValidator\ScriptValidator.exe" "%kam_folder%"\ScriptValidator.exe* /y /r /i
xcopy "..\Utils\TranslationManager\TranslationManager.exe" "%kam_folder%"\TranslationManager.exe* /y /r /i
@REM copy linux dedicated servers
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86" "%kam_folder%"\KaM_Remake_Server_linux_x86* /y /r /i
xcopy "..\Utils\DedicatedServer\KaM_Remake_Server_linux_x86_64" "%kam_folder%"\KaM_Remake_Server_linux_x86_64* /y /r /i

Update bat for build with ScriptinEditor