::HELP Redirects output of command line tools to GUI application.
::HELP
::HELP
::HELP USAGE
::HELP
::HELP command | 2 [OPTIONS] [APP[.EXT] | EXT] [APP-OPTIONS]
::HELP
::HELP
::HELP OPTIONS
::HELP
::HELP -d DIR     use DIR for storing temp files
::HELP -n NAME    use NAME as the name of temp file
::HELP --debug    turn on debug information
::HELP --dry-run  don't invoke a command, display only
::HELP
::HELP
::HELP DESCRIPTION
::HELP
::HELP The script is flexible enough to enable many ways to invoke GUI
::HELP applications. Which GUI application would be invoked is defined by
::HELP the arguments. Depending on what is this, it will be called to
::HELP declare few specific environment variables.
::HELP
::HELP
::HELP INVOCATION
::HELP
::HELP commands | 2
::HELP
::HELP With no parameters runs Notepad. Always.
::HELP
::HELP commands | 2 APP
::HELP
::HELP "APP" is the parameter defining an application or a family of
::HELP applications or an extension (without the leading "dot" symbol).
::HELP The script looks around for the file called as "2.APP.bat". If the
::HELP file exists, invokes it to set the needful environment variables.
::HELP The script should declare few specific environment variables (see
::HELP the "ENVIRONMENT" section below).
::HELP
::HELP commands | 2 APP.EXT
::HELP
::HELP The same as above but ".EXT" overrides early declared extension.
::HELP
::HELP commands | 2 EXT
::HELP
::HELP If there is no file "2.APP.bat", the argument is assumed as the
::HELP extension (without the leading "dor" symbol), the script does
::HELP attempt to find an executable command (using "assoc" and "ftype")
::HELP and prepare invocation of the command found by these commands.
::HELP
::HELP
::HELP ENVIRONMENT
::HELP
::HELP %pipecmd%
::HELP
::HELP (Mandatory)
::HELP Invocation string for the application. It could or could not
::HELP contain additional parameters supported by the application.
::HELP
::HELP %pipeext%
::HELP
::HELP (Optional, but recommended to set)
::HELP Extenstion (like ".txt" or ".html" etc). It can be useful in the
::HELP case if the application is able to handle different data files.
::HELP
::HELP %pipetmpsave%
::HELP
::HELP (Optional)
::HELP The command line tool used for capturing output of commands and
::HELP redirecting to a resulting file. By default it is set as follows:
::HELP
::HELP set "pipetmpsave=more"
::HELP
::HELP Another possible setting is:
::HELP
::HELP set "pipetmpsave=findstr "$""
::HELP
::HELP
::HELP SEE ALSO
::HELP
::HELP ASSOC /?
::HELP FTYPE /?

:: ========================================================================

@echo off

timeout /t 0 >nul 2>&1 && (
	call :pipe-help
	goto :EOF
)

:: ========================================================================

setlocal

set "pipedbg="
set "pipedry="

set "pipecmd="
set "pipecmdopts="
set "pipetitle="
set "pipeext="

set "pipetmpdir=%TEMP%"
set "pipetmpname=pipe.%RANDOM%"
set "pipetmpfile="
set "pipetmpsave=more"

:: ========================================================================

:pipe-options-begin

if "%~1" == "" goto :pipe-options-end

if "%~1" == "-d" (
	set "pipetmpdir=%~2"
	shift /1
	shift /1
) else if "%~1" == "-n" (
	set "pipetmpname=%~2"
	shift /1
	shift /1
) else if "%~1" == "--debug" (
	set "pipedbg=1"
	shift /1
) else if "%~1" == "--dry-run" (
	set "pipedry=1"
	shift /1
) else (
	goto :pipe-options-end
)

goto :pipe-options-begin
:pipe-options-end

:: ========================================================================

if "%~1" == "" (

	rem command | 2

	set "pipecmd=notepad"
	set "pipetitle=[app = notepad]"
	set "pipeext=.txt"

) else if exist "%~dpn0.%~n1.bat" (

	rem command | 2 app[.ext]

	call :pipe-configure "%~dpn0.%~n1.bat" "%~x1"

	set "pipetitle=[app = %~n1]"
	if not "%~x1" == "" set "pipeext=%~x1"

	shift /1

) else (

	rem command | 2 ext

	for /f "tokens=1,* delims==" %%a in ( '
		2^>nul assoc ".%~n1"
	' ) do for /f "tokens=1,* delims==" %%c in ( '
		2^>nul ftype "%%b"
	' ) do (

		set "pipecmd=%%d"
		set "pipetitle=[%%a = %%b]"
		set "pipeext=%%a"

	)
	if not "%~x1" == "" set "pipeext=%~x1"

	shift /1

)

if defined pipedbg call :pipe-debug "After parsing options"

:: ========================================================================

if not defined pipecmd (
	>&2 echo:Bad invocation
	goto :EOF
)

:: ========================================================================

if not defined pipeext set "pipeext=.txt"
if not defined pipetitle set "pipetitle=[%pipeext%]"

for %%f in ( "%pipetmpdir%" ) do set "pipetmpfile=%%~ff\%pipetmpname%%pipeext%"

:: ========================================================================

setlocal enabledelayedexpansion

set "pipecmdopt="

:pipe-app-options-begin
set pipecmdopt=%1
if not defined pipecmdopt goto :pipe-app-options-end

set "pipecmdopts=%pipecmdopts% %pipecmdopt%"
shift /1

goto :pipe-app-options-begin
:pipe-app-options-end

set "pipecmd=!pipecmd:%%1="%%1"!"
set "pipecmd=!pipecmd:""%%1""="%%1"!"
if "!pipecmd!" == "!pipecmd:%%1=!" set "pipecmd=!pipecmd! "%%1""
set "pipecmd=!pipecmd:%%1=%pipetmpfile%!"

endlocal & set "pipecmd=%pipecmd%" & set "pipecmdopts=%pipecmdopts%"

:: ========================================================================

if defined pipedbg call :pipe-debug "Before invocation"

call :pipe-invoke %pipecmdopts%

endlocal
goto :EOF

:: ========================================================================

:pipe-configure
setlocal
call "%~1" "%~2"
endlocal & set "pipecmd=%pipecmd%" & set "pipeext=%pipeext%" & set "pipetmpsave=%pipetmpsave%"
goto :EOF

:pipe-invoke
if defined pipedry (
	echo:Invocation ^(dry-run^)
	echo:call %pipetmpsave% ^> "%pipetmpfile%"
	echo:call start "Starting %pipetitle%" %pipecmd%
	goto :EOF
)

call %pipetmpsave% > "%pipetmpfile%"
call start "Starting %pipetitle%" %pipecmd%
goto :EOF

:: ========================================================================

:pipe-help
for /f "tokens=1,* delims= " %%a in ( '
	findstr /b "::HELP" "%~f0"
' ) do (
	echo:%%~b
)
goto :EOF

:pipe-debug
echo:%~1...
set pipe
echo:
goto :EOF

:: ========================================================================

:: EOF

::HELP Redirects output of command line tools to GUI application.
::HELP
::HELP
::HELP USAGE
::HELP
::HELP command | 2 [OPTIONS] [APP[.EXT] | EXT] [APP-OPTIONS]
::HELP
::HELP
::HELP OPTIONS
::HELP
::HELP -d DIR     use DIR for storing temp files
::HELP -n NAME    use NAME as the name of temp file
::HELP --debug    turn on debug information
::HELP --dry-run  don't invoke a command, display only
::HELP
::HELP
::HELP DESCRIPTION
::HELP
::HELP The script is flexible enough to enable many ways to invoke GUI
::HELP applications. Which GUI application would be invoked is defined by
::HELP the arguments. Depending on what is this, it will be called to
::HELP declare few specific environment variables.
::HELP
::HELP
::HELP INVOCATION
::HELP
::HELP commands | 2
::HELP
::HELP With no parameters runs Notepad. Always.
::HELP
::HELP commands | 2 APP
::HELP
::HELP "APP" is the parameter defining an application or a family of
::HELP applications or an extension (without the leading "dot" symbol).
::HELP The script looks around for the file called as "2.APP.bat". If the
::HELP file exists, invokes it to set the needful environment variables.
::HELP The script should declare few specific environment variables (see
::HELP the "ENVIRONMENT" section below).
::HELP
::HELP commands | 2 APP.EXT
::HELP
::HELP The same as above but ".EXT" overrides early declared extension.
::HELP
::HELP commands | 2 EXT
::HELP
::HELP If there is no file "2.APP.bat", the argument is assumed as the
::HELP extension (without the leading "dor" symbol), the script does
::HELP attempt to find an executable command (using "assoc" and "ftype")
::HELP and prepare invocation of the command found by these commands.
::HELP
::HELP
::HELP ENVIRONMENT
::HELP
::HELP %pipecmd%
::HELP
::HELP (Mandatory)
::HELP Invocation string for the application. It could or could not
::HELP contain additional parameters supported by the application.
::HELP
::HELP %pipeext%
::HELP
::HELP (Optional, but recommended to set)
::HELP Extenstion (like ".txt" or ".html" etc). It can be useful in the
::HELP case if the application is able to handle different data files.
::HELP
::HELP %pipetmpsave%
::HELP
::HELP (Optional)
::HELP The command line tool used for capturing output of commands and
::HELP redirecting to a resulting file. By default it is set as follows:
::HELP
::HELP set "pipetmpsave=more"
::HELP
::HELP Another possible setting is:
::HELP
::HELP set "pipetmpsave=findstr "$""
::HELP
::HELP
::HELP CONFIGURATION
::HELP
::HELP Using the file "2-settings.bat" located in the same directory
::HELP allows to configure the global environment variables of the main
::HELP script. It is good place for setting such kind of variables as
::HELP %pipetempdir%, %pipetempname% and %pipetempsave%.
::HELP
::HELP
::HELP SEE ALSO
::HELP
::HELP ASSOC /?
::HELP FTYPE /?

:: ========================================================================

@echo off

timeout /t 0 >nul 2>&1 && (
	call :pipe-help
	goto :EOF
)

:: ========================================================================

setlocal

set "pipedbg="
set "pipedry="

set "pipecmd="
set "pipecmdopts="
set "pipetitle="
set "pipeext="

set "pipetmpdir=%TEMP%"
set "pipetmpname=pipe.%RANDOM%"
set "pipetmpfile="
set "pipetmpsave=more"

if exist "%~dpn0-settings.bat" call "%~dpn0-settings.bat"

:: ========================================================================

:pipe-options-begin

if "%~1" == "" goto :pipe-options-end

if "%~1" == "-d" (
	set "pipetmpdir=%~2"
	shift /1
	shift /1
) else if "%~1" == "-n" (
	set "pipetmpname=%~2"
	shift /1
	shift /1
) else if "%~1" == "--debug" (
	set "pipedbg=1"
	shift /1
) else if "%~1" == "--dry-run" (
	set "pipedry=1"
	shift /1
) else (
	goto :pipe-options-end
)

goto :pipe-options-begin
:pipe-options-end

:: ========================================================================

if "%~1" == "" (

	rem command | 2

	set "pipecmd=notepad"
	set "pipetitle=[app = notepad]"
	set "pipeext=.txt"

) else if exist "%~dpn0.%~n1.bat" (

	rem command | 2 app[.ext]

	call :pipe-configure "%~dpn0.%~n1.bat" "%~x1"

	set "pipetitle=[app = %~n1]"
	if not "%~x1" == "" set "pipeext=%~x1"

	shift /1

) else (

	rem command | 2 ext

	for /f "tokens=1,* delims==" %%a in ( '
		2^>nul assoc ".%~n1"
	' ) do for /f "tokens=1,* delims==" %%c in ( '
		2^>nul ftype "%%b"
	' ) do (

		set "pipecmd=%%d"
		set "pipetitle=[%%a = %%b]"
		set "pipeext=%%a"

	)
	if not "%~x1" == "" set "pipeext=%~x1"

	shift /1

)

if defined pipedbg call :pipe-debug "After parsing options"

:: ========================================================================

if not defined pipecmd (
	>&2 echo:Bad invocation
	goto :EOF
)

:: ========================================================================

if not defined pipeext set "pipeext=.txt"
if not defined pipetitle set "pipetitle=[%pipeext%]"

for %%f in ( "%pipetmpdir%" ) do set "pipetmpfile=%%~ff\%pipetmpname%%pipeext%"

:: ========================================================================

setlocal enabledelayedexpansion

set "pipecmdopt="

:pipe-app-options-begin
set pipecmdopt=%1
if not defined pipecmdopt goto :pipe-app-options-end

set "pipecmdopts=%pipecmdopts% %pipecmdopt%"
shift /1

goto :pipe-app-options-begin
:pipe-app-options-end

set "pipecmd=!pipecmd:%%1="%%1"!"
set "pipecmd=!pipecmd:""%%1""="%%1"!"
if "!pipecmd!" == "!pipecmd:%%1=!" set "pipecmd=!pipecmd! "%%1""
set "pipecmd=!pipecmd:%%1=%pipetmpfile%!"

endlocal & set "pipecmd=%pipecmd%" & set "pipecmdopts=%pipecmdopts%"

:: ========================================================================

if defined pipedbg call :pipe-debug "Before invocation"

call :pipe-invoke %pipecmdopts%

endlocal
goto :EOF

:: ========================================================================

:pipe-configure
setlocal
call "%~1" "%~2"
endlocal & set "pipecmd=%pipecmd%" & set "pipeext=%pipeext%" & set "pipetmpsave=%pipetmpsave%"
goto :EOF

:pipe-invoke
if defined pipedry (
	echo:Invocation ^(dry-run^)
	echo:call %pipetmpsave% ^> "%pipetmpfile%"
	echo:call start "Starting %pipetitle%" %pipecmd%
	goto :EOF
)

call %pipetmpsave% > "%pipetmpfile%"
call start "Starting %pipetitle%" %pipecmd%
goto :EOF

:: ========================================================================

:pipe-help
for /f "tokens=1,* delims= " %%a in ( '
	findstr /b "::HELP" "%~f0"
' ) do (
	echo:%%~b
)
goto :EOF

:pipe-debug
echo:%~1...
set pipe
echo:
goto :EOF

:: ========================================================================

:: EOF

enable configure file for 2.bat

enable configure file for 2.bat


@ECHO OFF
set LIBSASS="3.3.3"
set SASSC="3.3.2"

:: set git="%ProgramFiles(x86)%\Git\bin\git" :: for older git-bash installs
set git="%ProgramFiles%\Git\bin\git"

:: s/14/12/ for VS2013 (min req) instead of VS2015
set msbuild="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild"

%git% submodule init >nul
%git% submodule update >nul

cmd /c "cd libsass && %git% checkout tags/%LIBSASS%" >nul
cmd /c "cd sassc.git && %git% checkout tags/%SASSC%" >nul

xcopy sassc.git\* libsass\sassc /s /i >nul
cmd /c "cd libsass\sassc && %msbuild% win\sassc.sln /p:Configuration=Release" >nul

copy libsass\sassc\bin\sassc.exe sassc.exe >nul
echo "Built sassc.exe. Copy to appropriate directories."

@ECHO OFF
set LIBSASS="3.3.3"
set SASSC="3.3.2"

:: set git="%ProgramFiles(x86)%\Git\bin\git" :: for older git-bash installs
set git="%ProgramFiles%\Git\bin\git"

:: s/14/12/ for VS2013 (min req) instead of VS2015
set msbuild="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild"

if "%1"=="-m32" (
	set cfg="/p:Platform=Win32"
) else if "%1"="-m64" (
	set cfg="/p:Platform=Win64"
)

%git% submodule -q deinit -f .
%git% submodule -q init
%git% pull -q --recurse-submodule
%git% submodule update

cmd /c "cd libsass && %git% checkout tags/%LIBSASS%" >nul
cmd /c "cd sassc.git && %git% checkout tags/%SASSC%" >nul

xcopy sassc.git\* libsass\sassc /s /i >nul
cmd /c (
	cd libsass\sassc
	%msbuild% win\sassc.sln /m /p:Configuration=Release %cfg% /t:Clean;Build"
	cd ..\..
)

copy libsass\sassc\bin\sassc.exe sassc.exe >nul
echo "Built sassc.exe. Copy to appropriate directories."

Update build.bat for x-compile

Update build.bat for x-compile


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

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

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

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

REM pack Sigma.Core

cd Sigma.Core
%nuget% pack "Sigma.Core.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

cd ..

REM pack Sigma.Core.Monitors.WPF

cd Sigma.Core.Monitors.WPF

REM update the targets file

cd build
powershell -Command "(gc Sigma.Core.Monitors.WPF.targets) -replace '~version~', '%version%' | Out-File Sigma.Core.Monitors.WPF.targets"

cd ..
%nuget% pack "Sigma.Core.Monitors.WPF.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

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

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

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

dir

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

REM pack Sigma.Core

cd Sigma.Core
%nuget% pack "Sigma.Core.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

cd ..

REM pack Sigma.Core.Monitors.WPF

cd Sigma.Core.Monitors.WPF

REM update the targets file

cd build
powershell -Command "(gc Sigma.Core.Monitors.WPF.targets) -replace '~version~', '%version%' | Out-File Sigma.Core.Monitors.WPF.targets"

cd ..
%nuget% pack "Sigma.Core.Monitors.WPF.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

Improve build bat for debugging

Improve build bat for debugging


@echo off

pushd %~dp0

tools\nuget\NuGet.exe update -self
tools\nuget\NuGet.exe install FAKE -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.7.3
tools\nuget\NuGet.exe install xunit.runner.console -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages\FAKE -ExcludeVersion -Version 2.0.0

if not exist packages\SourceLink.Fake\tools\SourceLink.fsx (
  tools\nuget\nuget.exe install SourceLink.Fake -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion
)
rem cls

set encoding=utf-8
packages\FAKE\tools\FAKE.exe build.fsx %*

popd

@echo off

pushd %~dp0

tools\nuget\NuGet.exe update -self
tools\nuget\NuGet.exe install FAKE -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.21.4
tools\nuget\NuGet.exe install xunit.runner.console -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages\FAKE -ExcludeVersion -Version 2.1.0

if not exist packages\SourceLink.Fake\tools\SourceLink.fsx (
  tools\nuget\nuget.exe install SourceLink.Fake -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion
)
rem cls

set encoding=utf-8
packages\FAKE\tools\FAKE.exe build.fsx %*

popd

Update packaging utility

Update packaging utility


@echo off
cls

dotnet restore build.proj
dotnet tool install fake-cli --tool-path .fake
IF NOT EXIST build.fsx (
  .fake\fake run init.fsx
)
fake build %*

@echo off
cls

dotnet restore build.proj
dotnet tool install fake-cli --tool-path .fake
IF NOT EXIST build.fsx (
  .fake\fake run init.fsx
)
.fake\fake build %*

update script

update script


@echo OFF

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

set DIR=%~dp0
set DISTRIBUTION=wso2ei-@product.version@
REM get the desired profile
echo ***********************************************************************************
echo This tool will erase all the files which are not required for the selected profile.
echo WARNING:This may cause loss of any changes to the other profiles.
echo ***********************************************************************************
echo WSO2 Enterprise Integrator Supports following profiles.
echo 	1.Integrator profile
echo 	2.Analytics Profile
echo 	3.Business Process profile
echo 	4.Broker profile
echo    5.Msf4j profile

set /p profileNumber= [Please enter the desired profile number to create the profile specific distribution]

IF /I "%profileNumber%" EQU "1" goto Integrator
IF /I "%profileNumber%" EQU "2" goto Analytics
IF /I "%profileNumber%" EQU "3" goto BPS
IF /I "%profileNumber%" EQU "4" goto Broker
IF /I "%profileNumber%" EQU "5" goto Msf4j

echo Invalid profile identifier.
goto Exit

:Integrator
	echo Preparing the Integrator profile distribution.
	set DEFAULT_BUNDLES=%DIR%..\wso2\components\default\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info
    call :Remove_BPS
    call :Remove_BROKER
    call :Remove_ANALYTICS
    call :Remove_JARS
    call :Remove_MSF4J
    echo Integrator profile created successfully.
	goto Exit

:Broker
    echo Preparing the Broker profile.
    set DEFAULT_BUNDLES=%DIR%..\wso2\components\broker-default\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info
    call :Remove_BPS
    call :Remove_INTEGRATOR
    call :Remove_ANALYTICS
    call :Remove_JARS
    call :Remove_MSF4J
    echo Broker profile created successfully.
    goto Exit

:BPS
    echo Preparing the Business Process profile.
    set DEFAULT_BUNDLES=%DIR%..\wso2\components\business-process-default\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info
    call :Remove_BROKER
    call :Remove_INTEGRATOR
    call :Remove_ANALYTICS
    call :Remove_JARS
    call :Remove_MSF4J
    echo Business Process profile created successfully.
    goto Exit

:Analytics
    echo Preparing the Analytics profile.
    call :Remove_BPS
    call :Remove_BROKER
    call :Remove_MSF4J
    call :Remove_INTEGRATOR
    call :Remove_MSF4J
    IF EXIST %DIR%\..\conf @RD /S /Q %DIR%\..\conf
    IF EXIST %DIR%\..\lib @RD /S /Q %DIR%\..\lib
    IF EXIST %DIR%\..\dropins @RD /S /Q %DIR%\..\dropins
    IF EXIST %DIR%\..\dbscripts @RD /S /Q %DIR%\..\dbscripts
    IF EXIST %DIR%\..\patches @RD /S /Q %DIR%\..\patches
    IF EXIST %DIR%\..\repository @RD /S /Q %DIR%\..\repository
    IF EXIST %DIR%\..\resources @RD /S /Q %DIR%\..\resources
    IF EXIST %DIR%\..\samples @RD /S /Q %DIR%\..\samples
    IF EXIST %DIR%\..\servicepacks @RD /S /Q %DIR%\..\servicepacks
    IF EXIST %DIR%\..\webapp-mode @RD /S /Q %DIR%\..\webapp-mode
    IF EXIST %DIR%\..\wso2\analytics @RD /S /Q %DIR%\..\wso2\msf4j
    IF EXIST %DIR%\..\wso2\broker @RD /S /Q %DIR%\..\wso2\broker
    IF EXIST %DIR%\..\wso2\business-process @RD /S /Q %DIR%\..\wso2\business-process
    IF EXIST %DIR%\..\wso2\components @RD /S /Q %DIR%\..\wso2\components
    IF EXIST %DIR%\..\wso2\lib @RD /S /Q %DIR%\..\wso2\lib
    IF EXIST %DIR%\..\wso2\tmp @RD /S /Q %DIR%\..\wso2\tmp
    echo Analytics profile created successfully.
    goto Exit

:Msf4j
    echo Preparing the Msf4j profile.
    call :Remove_BPS
    call :Remove_BROKER
    call :Remove_ANALYTICS
    call :Remove_INTEGRATOR
    IF EXIST %DIR%\..\conf @RD /S /Q %DIR%\..\conf
    IF EXIST %DIR%\..\lib @RD /S /Q %DIR%\..\lib
    IF EXIST %DIR%\..\dropins @RD /S /Q %DIR%\..\dropins
    IF EXIST %DIR%\..\dbscripts @RD /S /Q %DIR%\..\dbscripts
    IF EXIST %DIR%\..\patches @RD /S /Q %DIR%\..\patches
    IF EXIST %DIR%\..\repository @RD /S /Q %DIR%\..\repository
    IF EXIST %DIR%\..\resources @RD /S /Q %DIR%\..\resources
    IF EXIST %DIR%\..\samples @RD /S /Q %DIR%\..\samples
    IF EXIST %DIR%\..\servicepacks @RD /S /Q %DIR%\..\servicepacks
    IF EXIST %DIR%\..\webapp-mode @RD /S /Q %DIR%\..\webapp-mode
    IF EXIST %DIR%\..\wso2\analytics @RD /S /Q %DIR%\..\wso2\analytics
    IF EXIST %DIR%\..\wso2\broker @RD /S /Q %DIR%\..\wso2\broker
    IF EXIST %DIR%\..\wso2\business-process @RD /S /Q %DIR%\..\wso2\business-process
    IF EXIST %DIR%\..\wso2\components @RD /S /Q %DIR%\..\wso2\components
    IF EXIST %DIR%\..\wso2\lib @RD /S /Q %DIR%\..\wso2\lib
    IF EXIST %DIR%\..\wso2\tmp @RD /S /Q %DIR%\..\wso2\tmp
    echo Msf4j profile created successfully.
    goto Exit

:Remove_BPS
    echo Removing Business Process profile
    IF EXIST %DIR%\..\wso2\business-process @RD /S /Q %DIR%\..\wso2\business-process
    IF EXIST %DIR%\..\samples\business-process @RD /S /Q %DIR%\..\samples\business-process
    IF EXIST %DIR%\..\wso2\components\business-process-default @RD /S /Q %DIR%\..\wso2\components\business-process-default
    IF EXIST %DIR%\business-process.bat del %DIR%\business-process.bat
    IF EXIST %DIR%\business-process.sh del %DIR%\business-process.sh
    goto :eof

:Remove_BROKER
    echo Removing Broker profile
    IF EXIST %DIR%\..\wso2\broker @RD /S /Q %DIR%\..\wso2\broker
    IF EXIST %DIR%\..\wso2\components\broker-default @RD /S /Q %DIR%\..\wso2\components\broker-default
    IF EXIST %DIR%\broker.bat del %DIR%\broker.bat
    IF EXIST %DIR%\broker.sh del %DIR%\broker.sh
    goto :eof

:Remove_ANALYTICS
    echo Removing Analytics profile
    IF EXIST %DIR%\..\wso2\analytics @RD /S /Q %DIR%\..\wso2\analytics
    IF EXIST %DIR%\..\wso2\components\analytics-default @RD /S /Q %DIR%\..\wso2\components\analytics-default
    IF EXIST %DIR%\analytics.bat del %DIR%\analytics-worker.bat
    IF EXIST %DIR%\analytics.sh del %DIR%\analytics-worker.sh
    IF EXIST %DIR%\analytics.bat del %DIR%\analytics-dashboard.bat
    IF EXIST %DIR%\analytics.sh del %DIR%\analytics-dashboard.sh
    goto :eof

:Remove_INTEGRATOR
    echo Removing Integrator profile
    IF EXIST %DIR%\..\conf @RD /S /Q %DIR%\..\conf
    IF EXIST %DIR%\..\wso2\components\default @RD /S /Q %DIR%\..\wso2\components\default
    IF EXIST %DIR%\..\samples\service-bus @RD /S /Q %DIR%\..\samples\service-bus
    IF EXIST %DIR%\integrator.bat del %DIR%\integrator.bat
    IF EXIST %DIR%\integrator.sh del %DIR%\integrator.sh
    IF EXIST %DIR%\wso2ei-samples.bat del %DIR%\wso2ei-samples.bat
    IF EXIST %DIR%\wso2ei-samples.sh del %DIR%\wso2ei-samples.sh
    goto :eof

:Remove_JARS
    echo Removing unnecessary jars
    mkdir %DIR%\..\wso2\components\tmp_plugins

    FOR /F "tokens=1,2* delims=, " %%i in (%DEFAULT_BUNDLES%) do copy %DIR%\..\wso2\components\plugins\%%i_%%j.jar %DIR%\..\wso2\components\tmp_plugins

    @RD /S /Q %DIR%\..\wso2\components\plugins
    rename %DIR%\..\wso2\components\tmp_plugins plugins
    goto :eof

:Remove_MSF4J
    IF EXIST %DIR%\..\wso2\msf4j @RD /S /Q %DIR%\..\wso2\msf4j
    IF EXIST %DIR%\msf4j.bat del %DIR%\msf4j.bat
    IF EXIST %DIR%\msf4j.sh del %DIR%\msf4j.sh
    goto :eof

:Exit
    pause

Fix an indentation issue in profile-creator.bat

The issue was identified with wso2/product-ei#3719


mkdir build
cd build

cmake ^
    -G"Visual Studio 15 2017" ^
    -DBUILD_TESTS=no ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    ..

cmake --build . --target install --config Release

mkdir build
cd build

cmake ^
    -DBUILD_TESTS=no ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    ..

cmake --build . --target install --config Release

Update recipes/sleef/bld.bat

Update recipes/sleef/bld.bat

Co-authored-by: Isuru Fernando <47df6cafd3b4bed4c7bba9d00d0cf0fc680a9921@gmail.com>


@echo off

if "%1" == "" (
  echo Usage: buildrelease version-number
  goto end
)

if NOT EXIST "NodaTime Release.snk" (
  echo Copy NodaTime Release.snk into this directory first.
  goto end
)

set VERSION=%1

hg up -r '%VERSION%'
IF ERRORLEVEL 1 EXIT /B 1

hg archive -r '%VERSION%' NodaTime-%VERSION%-src.zip
IF ERRORLEVEL 1 EXIT /B 1

set STAGING=NodaTime-%VERSION%
IF EXIST %STAGING% rmdir /s /q %STAGING%
mkdir %STAGING%
mkdir %STAGING%\docs

call buildofflineguide.bat %1

call buildnuget
IF ERRORLEVEL 1 EXIT /B 1

xcopy /q /s /i docs\api %STAGING%\docs\api
xcopy /q /s /i tmpdocs\_site %STAGING%\docs\userguide
copy AUTHORS.txt %STAGING%
copy LICENSE.txt %STAGING%
copy NOTICE.txt %STAGING%
copy "NodaTime Release Public Key.snk" %STAGING%
copy readme.txt %STAGING%

mkdir %STAGING%\Portable
copy docs\PublicApi\NodaTime.xml %STAGING%
copy docs\PublicApi\NodaTime.Testing.xml %STAGING%
copy "src\NodaTime\bin\Signed Release\NodaTime.dll" %STAGING%
copy "src\NodaTime.Testing\bin\Signed Release\NodaTime.Testing.dll" %STAGING%
copy "src\NodaTime\bin\Signed Release Portable\NodaTime.dll" %STAGING%\Portable
copy "src\NodaTime.Testing\bin\Signed Release Portable\NodaTime.Testing.dll" %STAGING%\Portable

zip -r -9 %STAGING%.zip %STAGING%

:end

@echo off

if "%1" == "" (
  echo Usage: buildrelease version-number
  goto end
)

if NOT EXIST "NodaTime Release.snk" (
  echo Copy NodaTime Release.snk into this directory first.
  goto end
)

set VERSION=%1

hg up -r '%VERSION%'
IF ERRORLEVEL 1 EXIT /B 1

hg archive -r '%VERSION%' NodaTime-%VERSION%-src.zip
IF ERRORLEVEL 1 EXIT /B 1

set STAGING=NodaTime-%VERSION%
IF EXIST %STAGING% rmdir /s /q %STAGING%
mkdir %STAGING%
mkdir %STAGING%\docs

call buildofflineguide.bat %1

call buildnuget
IF ERRORLEVEL 1 EXIT /B 1

xcopy /q /s /i docs\api %STAGING%\docs\api
xcopy /q /s /i tmpdocs\_site %STAGING%\docs\userguide
copy AUTHORS.txt %STAGING%
copy LICENSE.txt %STAGING%
copy NOTICE.txt %STAGING%
copy "NodaTime Release Public Key.snk" %STAGING%
copy readme.txt %STAGING%

mkdir %STAGING%\Portable
copy docs\PublicApi\NodaTime.xml %STAGING%
copy docs\PublicApi\NodaTime.Testing.xml %STAGING%
copy docs\PublicApi\NodaTime.Serialization.JsonNet.xml %STAGING%
copy "src\NodaTime\bin\Signed Release\NodaTime.dll" %STAGING%
copy "src\NodaTime.Serialization.JsonNet\bin\Signed Release\NodaTime.Serialization.JsonNet.dll" %STAGING%
copy "src\NodaTime.Testing\bin\Signed Release\NodaTime.Testing.dll" %STAGING%
copy "src\NodaTime\bin\Signed Release Portable\NodaTime.dll" %STAGING%\Portable
copy "src\NodaTime.Serialization.JsonNet\bin\Signed Release Portable\NodaTime.Serialization.JsonNet.dll" %STAGING%\Portable
copy "src\NodaTime.Testing\bin\Signed Release Portable\NodaTime.Testing.dll" %STAGING%\Portable

zip -r -9 %STAGING%.zip %STAGING%

:end

Fix buildrelease.bat to include the Json.NET serialization binaries.


@echo off

SET DNX_FOLDER=dnx-clr-win-x64.1.0.0-rc1-update1
SET APP_ROOT_FOLDER=%HOME%\site\approot
SET DNX_PATH=%APP_ROOT_FOLDER%\runtimes\%DNX_FOLDER%\bin

%DNX_PATH%\dnx.exe ef database update -c SampleDbContext -p AspNetCoreDevOpsSample.Models

Add KUDU migration command

Add KUDU migration command


:<<"::IGNORE_THIS_LINE"
@ECHO OFF
GOTO :CMDSCRIPT
::IGNORE_THIS_LINE

# This is a small script to stitch panorama videos produced
# by Samsung Gear360
#
# TODOs:
# - output file name is currently static
# - add check for gear360pano script
# - ffmpeg and jpg or png?
#
# Trick with Win/Linux from here:
# http://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash

################################ Linux part here

# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
# Or dirname `dirname $0`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Clean-up function
function clean_up {
    echo "Removing temporary directories..."
    if [ -d "FRAMESTMPDIR" ]; then
        rm -rf "FRAMESTMPDIR"
    fi
    if [ -d "OUTTEMPDIR" ]; then
        rm -rf "OUTTEMPDIR"
    fi
}

# Function to check if a command fails
# http://stackoverflow.com/questions/5195607/checking-bash-exit-status-of-several-commands-efficiently
function run_command {
    "$@"
    local status=$?
    if [ $status -ne 0 ]; then
        echo "Error while running $1" >&2
        clean_up
        exit 1
    fi
    return $status
}

# Do stuff to make this thing run on various operating systems
# http://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux
function os_check {
    case "$(uname -s)" in

    Darwin)
        ;;

    Linux)
        ;;

    CYGWIN*|MINGW32*|MSYS*)
        # Naive approach, should read Hugin installation
        # path from registry or something...
        export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Hugin/bin":"/cygdrive/c/Program Files/Hugin/bin"
        ;;
    *)
        ;;
    esac
}

# Check argument(s)
if [ -z "$1" ]; then
    echo "Small script to stitch video panorama files."
    echo -e "Script originally writen for Samsung Gear 360.\n"
    echo -e "Usage:\n$0 inputdir [outputfile]\n"
    echo "Where inputfile is a panorama file from camera,"
    echo "output parameter is optional."
    exit 1
fi

# Output name as second argument
if [ -z "$2" ]; then
    OUTNAME=`basename "${1%.*}"`_pano.mp4
    echo "DEBUG: output filename: $OUTNAME"
fi

# OS check, custom settings for various OSes
os_check

# Check if we have the software to do it
# http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
type ffmpeg >/dev/null 2>&1 || { echo >&2 "ffmpeg required but it's not installed. Aborting."; exit 1; }
# TODO: add check for gear360pano.cmd script

# Create temporary directory locally to stay compatible with other OSes
FRAMESTEMPDIR=`mktemp -d -p .`
OUTTEMPDIR=`mktemp -d -p .`
IMAGETMPL="image%05d.jpg"
STARTTS=`date +%s`

# Stitch panorama (same file twice as input)
echo "Extracting frames from video (this might take a while..."
cmd="ffmpeg -i $1 -vf scale=7776:3888 $FRAMESTEMPDIR/$IMAGETMPL"
run_command $cmd

echo "Stitching frames..."
for i in $FRAMESTEMPDIR/*.jpg; do
    echo Frame: $i
    OUTFILENAME=`basename $i`
    cmd="/bin/bash ./gear360pano.cmd $i $OUTTEMPDIR/$OUTFILENAME"
	run_command $cmd
done

echo "Recoding the video..."
cmd="ffmpeg -f image2 -r 1 -i \"$OUTTEMPDIR/$IMAGETMPL\" -r 30 -s 3840:1920 -vcodec libx264 $OUTNAME"
run_command $cmd

# Remove temporary directories
clean_up

# Inform user about the result
ENDTS=`date +%s`
RUNTIME=$((ENDTS-STARTTS))
echo Video written to $OUTNAME, took: $RUNTIME s

exit 0

################################ Windows part here

:CMDSCRIPT

set FFMPEGPATH=c:/Program Files/ffmpeg/bin
set FRAMESTEMPDIR=frames
set OUTTEMPDIR=frames_stitched
:: %% is an escape character
set IMAGETMPL=image%%05d.jpg

:: Check arguments
IF [%1] == [] GOTO NOARGS

:: Check if second argument present, if not, set some default for output filename
IF NOT [%2] == [] GOTO SETNAMEOK
set OUTNAME="%~n1_pano.mp4"

:SETNAMEOK

:: Where's enblend? Prefer 64 bits
if exist "%FFMPEGPATH%/ffmpeg.exe" goto FFMPEGOK
:: 64 bits not found? Check x86
goto NOFFMPEG

:FFMPEGOK

:: Create temporary directories
mkdir %FRAMESTEMPDIR%
mkdir %OUTTEMPDIR%

:: Execute commands (as simple as it is)
echo Converting video to images...
"%FFMPEGPATH%/ffmpeg.exe" -i %1 -vf scale=7776:3888 %FRAMESTEMPDIR%/%IMAGETMPL%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Stitching
echo Stitching frames...
for %%f in (%FRAMESTEMPDIR%/*.jpg) do (
:: For whatever reason (this has to be at the beginning of the line!)
  echo Processing frame %FRAMESTEMPDIR%\%%f
:: There should be some error checking
  call gear360pano.cmd %FRAMESTEMPDIR%\%%f %OUTTEMPDIR%\%%f
)

"%FFMPEGPATH%/ffmpeg.exe" -f image2 -i %OUTTEMPDIR%/%IMAGETMPL% -r 30 -s 3840:1920 -vcodec libx264 %OUTNAME%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Clean-up (f - force, read-only & dirs, q - quiet)
del /f /q %FRAMESTEMPDIR%
del /f /q %OUTTEMPDIR%

echo Video written to %OUTNAME%
goto END

:NOARGS

echo Small script to stitch raw video panorama files.
echo Raw meaning two fisheye images side by side.
echo Script originally writen for Samsung Gear 360.
echo.
echo Usage:
echo %0 inputfile [outputfile]
echo.
echo Where inputfile is a panorama file from camera,
echo output parameter is optional
goto END

:NOFFMPEG

echo ffmpeg is found in %FFMPEGPATH%, download from: https://ffmpeg.zeranoe.com/builds/ and
echo unpack to program files directory
goto END

:FFMPEGERROR

echo ffmpeg failed, video not created
goto END

:STITCHINGERROR

echo Stitching failed, video not created
goto END

:END

:<<"::IGNORE_THIS_LINE"
@ECHO OFF
GOTO :CMDSCRIPT
::IGNORE_THIS_LINE

# This is a small script to stitch panorama videos produced
# by Samsung Gear360
#
# TODOs:
# - output file name is currently static
# - add check for gear360pano script
# - ffmpeg and jpg or png?
#
# Trick with Win/Linux from here:
# http://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash

################################ Linux part here

# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-which-directory-it-is-stored-in
# Or dirname `dirname $0`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Clean-up function
function clean_up {
    echo "Removing temporary directories..."
    if [ -d "FRAMESTMPDIR" ]; then
        rm -rf "FRAMESTMPDIR"
    fi
    if [ -d "OUTTEMPDIR" ]; then
        rm -rf "OUTTEMPDIR"
    fi
}

# Function to check if a command fails
# http://stackoverflow.com/questions/5195607/checking-bash-exit-status-of-several-commands-efficiently
function run_command {
    "$@"
    local status=$?
    if [ $status -ne 0 ]; then
        echo "Error while running $1" >&2
        clean_up
        exit 1
    fi
    return $status
}

# Do stuff to make this thing run on various operating systems
# http://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux
function os_check {
    case "$(uname -s)" in

    Darwin)
        ;;

    Linux)
        ;;

    CYGWIN*|MINGW32*|MSYS*)
        # Naive approach, should read Hugin installation
        # path from registry or something...
        export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Hugin/bin":"/cygdrive/c/Program Files/Hugin/bin"
        ;;
    *)
        ;;
    esac
}

# Check argument(s)
if [ -z "$1" ]; then
    echo "Small script to stitch video panorama files."
    echo -e "Script originally writen for Samsung Gear 360.\n"
    echo -e "Usage:\n$0 inputdir [outputfile]\n"
    echo "Where inputfile is a panorama file from camera,"
    echo "output parameter is optional."
    exit 1
fi

# Output name as second argument
if [ -z "$2" ]; then
    OUTNAME=`basename "${1%.*}"`_pano.mp4
    echo "DEBUG: output filename: $OUTNAME"
fi

# OS check, custom settings for various OSes
os_check

# Check if we have the software to do it
# http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
type ffmpeg >/dev/null 2>&1 || { echo >&2 "ffmpeg required but it's not installed. Aborting."; exit 1; }
# TODO: add check for gear360pano.cmd script

# Create temporary directory locally to stay compatible with other OSes
FRAMESTEMPDIR=`mktemp -d -p .`
OUTTEMPDIR=`mktemp -d -p .`
IMAGETMPL="image%05d.jpg"
STARTTS=`date +%s`

# Stitch panorama (same file twice as input)
echo "Extracting frames from video (this might take a while..."
cmd="ffmpeg -i $1 -vf scale=7776:3888 $FRAMESTEMPDIR/$IMAGETMPL"
run_command $cmd

echo "Stitching frames..."
for i in $FRAMESTEMPDIR/*.jpg; do
    echo Frame: $i
    OUTFILENAME=`basename $i`
    cmd="/bin/bash ./gear360pano.cmd $i $OUTTEMPDIR/$OUTFILENAME"
        run_command $cmd
done

echo "Recoding the video..."
cmd="ffmpeg -f image2 -i $OUTTEMPDIR/$IMAGETMPL -r 30 -s 3840:1920 -vcodec libx264 $OUTNAME"
run_command $cmd

# Remove temporary directories
clean_up

# Inform user about the result
ENDTS=`date +%s`
RUNTIME=$((ENDTS-STARTTS))
echo Video written to $OUTNAME, took: $RUNTIME s

exit 0

################################ Windows part here

:CMDSCRIPT

set FFMPEGPATH=c:/Program Files/ffmpeg/bin
set FRAMESTEMPDIR=frames
set OUTTEMPDIR=frames_stitched
:: %% is an escape character
set IMAGETMPL=image%%05d.jpg

:: Check arguments
IF [%1] == [] GOTO NOARGS

:: Check if second argument present, if not, set some default for output filename
IF NOT [%2] == [] GOTO SETNAMEOK
set OUTNAME="%~n1_pano.mp4"

:SETNAMEOK

:: Where's enblend? Prefer 64 bits
if exist "%FFMPEGPATH%/ffmpeg.exe" goto FFMPEGOK
:: 64 bits not found? Check x86
goto NOFFMPEG

:FFMPEGOK

:: Create temporary directories
mkdir %FRAMESTEMPDIR%
mkdir %OUTTEMPDIR%

:: Execute commands (as simple as it is)
echo Converting video to images...
"%FFMPEGPATH%/ffmpeg.exe" -i %1 -vf scale=7776:3888 %FRAMESTEMPDIR%/%IMAGETMPL%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Stitching
echo Stitching frames...
for %%f in (%FRAMESTEMPDIR%/*.jpg) do (
:: For whatever reason (this has to be at the beginning of the line!)
  echo Processing frame %FRAMESTEMPDIR%\%%f
:: There should be some error checking
  call gear360pano.cmd %FRAMESTEMPDIR%\%%f %OUTTEMPDIR%\%%f
)

"%FFMPEGPATH%/ffmpeg.exe" -f image2 -i %OUTTEMPDIR%/%IMAGETMPL% -r 30 -s 3840:1920 -vcodec libx264 %OUTNAME%
if %ERRORLEVEL% EQU 1 GOTO FFMPEGERROR

:: Clean-up (f - force, read-only & dirs, q - quiet)
del /f /q %FRAMESTEMPDIR%
del /f /q %OUTTEMPDIR%

echo Video written to %OUTNAME%
goto END

:NOARGS

echo Small script to stitch raw video panorama files.
echo Raw meaning two fisheye images side by side.
echo Script originally writen for Samsung Gear 360.
echo.
echo Usage:
echo %0 inputfile [outputfile]
echo.
echo Where inputfile is a panorama file from camera,
echo output parameter is optional
goto END

:NOFFMPEG

echo ffmpeg is found in %FFMPEGPATH%, download from: https://ffmpeg.zeranoe.com/builds/ and
echo unpack to program files directory
goto END

:FFMPEGERROR

echo ffmpeg failed, video not created
goto END

:STITCHINGERROR

echo Stitching failed, video not created
goto END

:END

Fix for final video assembly

Fix for final video assembly


@echo off

pushd %1

if exist %1\node_modules\azure-cli\bin\azure (
  cmd /c npm update azure-cli
) else (
  cmd /c npm install azure-cli
)

IF %ERRORLEVEL% NEQ 0 goto error

if exist %1\node_modules\kudusync\bin\kudusync (
  cmd /c npm update kudusync
) else (
  cmd /c npm install kudusync
)

IF %ERRORLEVEL% NEQ 0 goto error

popd

goto end

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

:end
echo Finished successfully.

@echo off

pushd %1

if exist %1\node_modules\azure-cli\bin\azure (
  cmd /c npm update https://github.com/amitapl/azure-sdk-tools-xplat/tarball/latest
) else (
  cmd /c npm install https://github.com/amitapl/azure-sdk-tools-xplat/tarball/latest
)

IF %ERRORLEVEL% NEQ 0 goto error

if exist %1\node_modules\kudusync\bin\kudusync (
  cmd /c npm update kudusync
) else (
  cmd /c npm install kudusync
)

IF %ERRORLEVEL% NEQ 0 goto error

popd

goto end

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

:end
echo Finished successfully.

Change script to install azure-cli from a private branch, so we have the latest fixes (not dependant on azure-cli schedule for them).


@REM  Copyright (c) Microsoft. All rights reserved.
@REM  Licensed under the MIT license. See LICENSE file in the project root for full license information.

echo Releasing mbed bits ...

call release_mbed_project.cmd iothub_amqp_transport ..\..\c\iothub_client\build iothub_amqp_transport_filelist.txt
call release_mbed_project.cmd iothub_http_transport ..\..\c\iothub_client\build iothub_http_transport_filelist.txt
call release_mbed_project.cmd iothub_client ..\..\c\iothub_client\build iothub_client_filelist.txt
call release_mbed_project.cmd serializer ..\..\c\serializer\build serializer_filelist.txt
call release_mbed_project.cmd azureiot_common ..\..\c\azure-c-shared-utility\c\build mbed\shared-util_filelist.txt
call release_mbed_project.cmd iothub_client_sample_amqp ..\..\c\iothub_client\samples\iothub_client_sample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd iothub_client_sample_http ..\..\c\iothub_client\samples\iothub_client_sample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd remote_monitoring ..\..\c\serializer\samples\remote_monitoring mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_amqp ..\..\c\serializer\samples\simplesample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_http ..\..\c\serializer\samples\simplesample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd temp_sensor_anomaly ..\..\c\serializer\samples\temp_sensor_anomaly mbed\filelist.txt FRDM-K64F

@REM  Copyright (c) Microsoft. All rights reserved.
@REM  Licensed under the MIT license. See LICENSE file in the project root for full license information.

echo Releasing mbed bits ...

call release_mbed_project.cmd iothub_amqp_transport ..\..\c\iothub_client\build iothub_amqp_transport_filelist.txt
call release_mbed_project.cmd iothub_http_transport ..\..\c\iothub_client\build iothub_http_transport_filelist.txt
call release_mbed_project.cmd iothub_client ..\..\c\iothub_client\build iothub_client_filelist.txt
call release_mbed_project.cmd serializer ..\..\c\serializer\build serializer_filelist.txt
call release_mbed_project.cmd azureiot_common ..\..\c\azure-c-shared-utility\c build\mbed\shared-util_filelist.txt
call release_mbed_project.cmd iothub_client_sample_amqp ..\..\c\iothub_client\samples\iothub_client_sample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd iothub_client_sample_http ..\..\c\iothub_client\samples\iothub_client_sample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd remote_monitoring ..\..\c\serializer\samples\remote_monitoring mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_amqp ..\..\c\serializer\samples\simplesample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_http ..\..\c\serializer\samples\simplesample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd temp_sensor_anomaly ..\..\c\serializer\samples\temp_sensor_anomaly mbed\filelist.txt FRDM-K64F

Adjust the mbed release script

Adjust the mbed release script


rmdir ipch /S /Q
rmdir Debug /S /Q
rmdir Release /S /Q
rmdir demo\Debug /S /Q
rmdir demo\Release /S /Q
del demo.VC.db

Add cleanup script

Add cleanup script


@echo off

pushd %~dp0..\Couchbase.Lite

echo.
echo *** TRANSFORMING TEMPLATES ***
echo.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" Couchbase.Lite.csproj /t:Transform /p:TransformFile="Properties\DynamicAssemblyInfo.tt"

echo.
echo *** RESTORING PACKAGES ***
echo *** MAIN ASSEMBLY ***
echo.
dotnet restore
cd ..\Couchbase.Lite.Support.NetDesktop
echo.
echo *** NET DESKTOP ***
echo.
dotnet restore

cd ..\Couchbase.Lite.Support.UWP
echo.
echo *** UWP ***
echo.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:Restore

echo.
echo *** IOS ***
echo.
cd ..\Couchbase.Lite.Support.Apple\iOS
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:     Restore

echo.
echo *** ANDROID ***
echo.
cd ..\..\Couchbase.Lite.Support.Android
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:     Restore

echo.
echo *** COPYING NATIVE RESOURCES ***
echo.
if not exist ..\Couchbase.Lite.Support.Apple\iOS\Resources mkdir ..\Couchbase.Lite.Support.Apple\iOS\Resources
xcopy /Y ..\..\vendor\couchbase-lite-core\build_cmake\ios-fat\libLiteCore.dylib ..\Couchbase.Lite.Support.Apple\iOS\Resources

echo.
echo *** BUILDING ***
echo.

cd ..
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" Couchbase.Lite.sln /p:Configuration=Packaging /p:SourceLinkCreate=true

popd

@echo off

pushd %~dp0..\Couchbase.Lite

echo.
echo *** TRANSFORMING TEMPLATES ***
echo.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" Couchbase.Lite.csproj /t:Transform /p:TransformFile="Properties\DynamicAssemblyInfo.tt"

echo.
echo *** RESTORING PACKAGES ***
echo *** MAIN ASSEMBLY ***
echo.
dotnet restore
cd ..\Couchbase.Lite.Support.NetDesktop
echo.
echo *** NET DESKTOP ***
echo.
dotnet restore

cd ..\Couchbase.Lite.Support.UWP
echo.
echo *** UWP ***
echo.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:Restore

echo.
echo *** IOS ***
echo.
cd ..\Couchbase.Lite.Support.Apple\iOS
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:Restore

echo.
echo *** ANDROID ***
echo.
cd ..\..\Couchbase.Lite.Support.Android
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:Restore

echo.
echo *** COPYING NATIVE RESOURCES ***
echo.
if not exist ..\Couchbase.Lite.Support.Apple\iOS\Resources mkdir ..\Couchbase.Lite.Support.Apple\iOS\Resources
xcopy /Y ..\..\vendor\couchbase-lite-core\build_cmake\ios-fat\libLiteCore.dylib ..\Couchbase.Lite.Support.Apple\iOS\Resources

echo.
echo *** BUILDING ***
echo.

cd ..
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" Couchbase.Lite.sln /p:Configuration=Packaging /p:SourceLinkCreate=true

popd

Fix typos in build script

Fix typos in build script


@Echo Off
powershell.exe -NoExit -noprofile -Command "& {. '%~dp0Nav.Language.Extension\bin\Debug\Pharmatechnik.Nav.Language.Extension.2017.vsix'}"

Install Script

Install Script


:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================

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

:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************

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

:gotPrivileges
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::

@echo off

cls
echo   ###                ###
echo  # CorpBot - CorpNewt #
echo ###                ###
echo.

REM echo Installing Chatterbot...
REM echo.
REM call :install "chatterbot"
REM echo.

REM echo Installing Discord...
REM echo.
REM call :install "discord.py[voice]"
REM echo.

echo Installing Discord [Development Version]...
echo.
call :install "https://github.com/Rapptz/discord.py/archive/rewrite.zip#egg=discord.py[voice]"
echo.

echo Installing Pillow...
echo.
call :install "Pillow"
echo.

echo Installing Youtube-dl...
echo.
call :install "youtube-dl"
echo.

echo Installing Requests...
echo.
call :install "requests"
echo.

echo Installing ParseDateTime...
echo.
call :install "parsedatetime"
echo.

echo Installing Psutil...
echo.
call :install "psutil"
echo.

echo Installing PyParsing...
echo.
call :install "pyparsing"
echo.

echo Installing PyQuery...
echo.
call :install "pyquery"
echo.

echo Installing PyAIML...
echo.
call :install "git+https://github.com/paulovn/python-aiml"
echo.

echo Installing PySpeedTest...
echo.
call :install "pyspeedtest"
echo.

echo Installing Pytz...
echo.
call :install "pytz"
echo.

echo Installing Wikipedia...
echo.
call :install "wikipedia"
echo.

echo Installing MTranslate...
echo.
call :install "mtranslate"
echo.

echo Installing GiphyPop
echo.
call :install "git+https://github.com/shaunduncan/giphypop.git#egg=giphypop"
echo.

echo Installing NumPy
echo.
call :install "numpy"
echo.

echo Installing Weather
echo.
call :install "weather-api"
echo.

echo Installing PyMongo
echo.
call :install "pymongo"
echo.

REM echo Installing Flask...
REM echo.
REM call :install "Flask"
REM echo.

REM echo Installing Levenshtein...
REM echo.
REM call :install "python-levenshtein"
REM echo.

echo Done.
timeout 5 > nul
exit /b

:install <module>
pip install -U %~1

:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================

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

:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************

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

:gotPrivileges
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::

@echo off

cls
echo   ###                ###
echo  # CorpBot - CorpNewt #
echo ###                ###
echo.

REM echo Installing Chatterbot...
REM echo.
REM call :install "chatterbot"
REM echo.

REM echo Installing Discord...
REM echo.
REM call :install "discord.py[voice]"
REM echo.

echo Installing Discord [Development Version]...
echo.
call :install "https://github.com/Rapptz/discord.py/archive/rewrite.zip#egg=discord.py[voice]"
echo.

echo Installing Pillow...
echo.
call :install "Pillow"
echo.

echo Installing Youtube-dl...
echo.
call :install "youtube-dl"
echo.

echo Installing Requests...
echo.
call :install "requests"
echo.

echo Installing ParseDateTime...
echo.
call :install "parsedatetime"
echo.

echo Installing Psutil...
echo.
call :install "psutil"
echo.

echo Installing PyParsing...
echo.
call :install "pyparsing"
echo.

echo Installing PyQuery...
echo.
call :install "pyquery"
echo.

echo Installing PyAIML...
echo.
call :install "git+https://github.com/paulovn/python-aiml"
echo.

echo Installing PySpeedTest...
echo.
call :install "pyspeedtest"
echo.

echo Installing Pytz...
echo.
call :install "pytz"
echo.

echo Installing Wikipedia...
echo.
call :install "wikipedia"
echo.

echo Installing MTranslate...
echo.
call :install "mtranslate"
echo.

echo Installing GiphyPop
echo.
call :install "git+https://github.com/shaunduncan/giphypop.git#egg=giphypop"
echo.

echo Installing NumPy
echo.
call :install "numpy"
echo.

echo Installing Weather
echo.
call :install "weather-api"
echo.

echo Installing PyMongo
echo.
call :install "pymongo"
echo.

echo Installing IGDB API
echo.
call :install "igdb_api_python"
echo.

REM echo Installing Flask...
REM echo.
REM call :install "Flask"
REM echo.

REM echo Installing Levenshtein...
REM echo.
REM call :install "python-levenshtein"
REM echo.

echo Done.
timeout 5 > nul
exit /b

:install <module>
pip install -U %~1

Add IGDB

Add IGDB


@echo off
setlocal
set GOPATH=%~dp0/deps
set GOBIN=%~dp0/bin
go install
endlocal

@echo off
set go-github=src\github.com\google\go-github
if not "%GOPATH%" == "" (
	if not exist %GOPATH%\%go-github% (
		mklink /D %~dp0\deps\%go-github% %GOPATH%\%go-github%
		cd %GOPATH%\%go-github%
		go install
	)
)
setlocal
set GOPATH=%~dp0/deps
set GOBIN=%~dp0/bin
go install
endlocal

gb.bat: add dependency to global GOPATH if not found


call git --version
IF ERRORLEVEL 1 (

echo #define GIT_VERSION "-unknown" > %1/gitversion.h

) ELSE (

call git log -n1 HEAD --pretty=format:"#define GIT_VERSION \"-g%%%%h\"%%%%n"> %1/gitversion.h

if "%APPVEYOR_BUILD_VERSION%" != "" (
echo #define BUILD_VER "%APPVEYOR_BUILD_VERSION%.%APPVEYOR_BUILD_NUMBER%" >> %1/gitversion.h
)

)

call git --version
IF ERRORLEVEL 1 (

echo #define GIT_VERSION "-unknown" > %1/gitversion.h

) ELSE (

call git log -n1 HEAD --pretty=format:"#define GIT_VERSION \"-g%%%%h\"%%%%n"> %1/gitversion.h

IF "%APPVEYOR_BUILD_VERSION%" == "" (
echo "not build in appveyor"
) ELSE (
echo #define BUILD_VER "%APPVEYOR_BUILD_VERSION%.%APPVEYOR_BUILD_NUMBER%" >> %1/gitversion.h
)

)

Fix windows build problem cause by createversion.bat

Signed-off-by: Frank Li <d9a81cb4fa8b4f356eefd38684e2f43f08dbec49@nxp.com>


@echo off
SETLOCAL EnableDelayedExpansion
REM ingress-ice start script
REM (http://github.com/nibogd/ingress-ice)
REM Double-click this file and follow the
REM instructions

set FILE="%APPDATA%\.ingress-ice.conf"
IF '%1'=='/?' GOTO :help
IF '%1'=='-h' GOTO :help
IF '%1'=='-r' GOTO :config
GOTO :check
:check
IF EXIST "ingress-ice.conf" (
        set FILE="ingress-ice.conf"
        GOTO :start
)
IF EXIST %FILE% (
	GOTO :start
) else (
        copy ice\ingress-ice.conf.sample %FILE%
	GOTO :config
)
:config
cls
echo Ingress ICE, Automatic screenshooter for ingress intel map
echo.
echo I've created a blank configuration file for you.
echo Notepad will be opened now. Insert your settings, save the file and close the notepad. Ice will start automatically
echo.
echo You can edit your configuration any time, just start 'reconfigure.cmd'
echo.
notepad %FILE%
:start
cls
echo Existing config file found (%FILE%). Starting ice...
phantom-bin\phantomjs.exe ice\ice.js %FILE%
pause
goto :eof
:help
echo Ingress ICE, an automated screenshooter for ingress intel map
echo Copyright (c) Nikitakun (github.com/nibogd)
echo.
echo Usage:
echo   ingress-ice.cmd [-r] [-h]
echo.
echo Options:
echo   -r      Edit the configuration
echo   -h      Print this help
echo.
echo Please visit https://ingress.netlify.com/ or http://github.com/nibogd/ingress-ice for more information
:eof

@echo off
SETLOCAL EnableDelayedExpansion
REM ingress-ice start script
REM (http://github.com/nibogd/ingress-ice)
REM Double-click this file and follow the
REM instructions

set FILE="%APPDATA%\.ingress-ice.conf"
:args
IF '%1'=='/?' GOTO :help
IF '%1'=='-h' GOTO :help
IF '%1'=='-r' GOTO :config
if '%1'=='-c' GOTO :count
GOTO :check
:count
shift
set COUNT=%1
shift
goto :args
:check
IF EXIST "ingress-ice.conf" (
        set FILE="ingress-ice.conf"
        GOTO :start
)
IF EXIST %FILE% (
	GOTO :start
) else (
        copy ice\ingress-ice.conf.sample %FILE%
	GOTO :config
)
:config
cls
echo Ingress ICE, Automatic screenshooter for ingress intel map
echo.
echo I've created a blank configuration file for you.
echo Notepad will be opened now. Insert your settings, save the file and close the notepad. Ice will start automatically
echo.
echo You can edit your configuration any time, just start 'reconfigure.cmd'
echo.
notepad %FILE%
:start
cls
echo Existing config file found (%FILE%). Starting ice...
if '%COUNT%' NEQ '' echo Taking %COUNT% screenshots...
phantom-bin\phantomjs.exe ice\ice.js %FILE% %COUNT%
pause
goto :eof
:help
echo Ingress ICE, an automated screenshooter for ingress intel map
echo Copyright (c) Nikitakun (github.com/nibogd)
echo.
echo Usage:
echo   ingress-ice.cmd [-r] [-h]
echo.
echo Options:
echo   -r      Edit the configuration
echo   -h      Print this help
echo.
echo Please visit https://ingress.netlify.com/ or http://github.com/nibogd/ingress-ice for more information
:eof

Implement -c COUNT on windows

Implement -c COUNT on windows

Now you can specify that you want x screenshots and then want to exit if you are
on windows. This was implemented at the JS side and on *ix, but not on windows.


%PYTHON%   setup.py ^
           install

Create build.bat

Create build.bat

bld.bat file


update nodejs run file

update nodejs run file


@echo off
net stop spooler
del %systemroot%\System32\spool\printers\* /Q /F /S
net start spooler

Create ClearPrintSpooler.bat

Create ClearPrintSpooler.bat


@echo off
REM # Copyright 2015 The Android Open Source Project
REM # Copyright (C) 2015 Valve Corporation
REM
REM # Licensed under the Apache License, Version 2.0 (the "License");
REM # you may not use this file except in compliance with the License.
REM # You may obtain a copy of the License at
REM
REM #      http://www.apache.org/licenses/LICENSE-2.0
REM
REM # Unless required by applicable law or agreed to in writing, software
REM # distributed under the License is distributed on an "AS IS" BASIS,
REM # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM # See the License for the specific language governing permissions and
REM # limitations under the License.

if exist generated (
  rmdir /s /q generated
)
mkdir generated\include generated\common

py ../scripts/vk_helper.py --gen_enum_string_helper ../include/vulkan/vulkan.h --abs_out_dir generated/include
py ../scripts/vk_helper.py --gen_struct_wrappers ../include/vulkan/vulkan.h --abs_out_dir generated/include

cd generated/include
py ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_dispatch_table_helper.h
py ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml thread_check.h
py ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml parameter_validation.h
py ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml unique_objects_wrappers.h
cd ../..

copy /Y ..\layers\vk_layer_config.cpp   generated\common\
copy /Y ..\layers\vk_layer_extension_utils.cpp  generated\common\
copy /Y ..\layers\vk_layer_utils.cpp    generated\common\
copy /Y ..\layers\vk_layer_table.cpp    generated\common\
copy /Y ..\layers\descriptor_sets.cpp   generated\common\

REM create build-script root directory
mkdir generated\gradle-build
cd generated\gradle-build
mkdir  core_validation image object_tracker parameter_validation swapchain threading unique_objects
cd ..\..
mkdir generated\layer-src
cd generated\layer-src
mkdir  core_validation image object_tracker parameter_validation swapchain threading unique_objects
cd ..\..
xcopy /s gradle-templates\*   generated\gradle-build\
for %%G in (core_validation image object_tracker parameter_validation swapchain threading unique_objects) Do (
    copy ..\layers\%%G.cpp   generated\layer-src\%%G
    echo apply from: "../common.gradle"  > generated\gradle-build\%%G\build.gradle
)
copy generated\common\descriptor_sets.cpp generated\layer-src\core_validation\descriptor_sets.cpp
copy generated\include\vk_safe_struct.cpp generated\layer-src\core_validation\vk_safe_struct.cpp
move generated\include\vk_safe_struct.cpp generated\layer-src\unique_objects\vk_safe_struct.cpp
echo apply from: "../common.gradle"  > generated\gradle-build\unique_objects\build.gradle

@echo off
REM # Copyright 2015 The Android Open Source Project
REM # Copyright (C) 2015 Valve Corporation
REM
REM # Licensed under the Apache License, Version 2.0 (the "License");
REM # you may not use this file except in compliance with the License.
REM # You may obtain a copy of the License at
REM
REM #      http://www.apache.org/licenses/LICENSE-2.0
REM
REM # Unless required by applicable law or agreed to in writing, software
REM # distributed under the License is distributed on an "AS IS" BASIS,
REM # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM # See the License for the specific language governing permissions and
REM # limitations under the License.

if exist generated (
  rmdir /s /q generated
)
mkdir generated\include generated\common

py -3 ../scripts/vk_helper.py --gen_enum_string_helper ../include/vulkan/vulkan.h --abs_out_dir generated/include
py -3 ../scripts/vk_helper.py --gen_struct_wrappers ../include/vulkan/vulkan.h --abs_out_dir generated/include

cd generated/include
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_dispatch_table_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml thread_check.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml parameter_validation.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml unique_objects_wrappers.h
cd ../..

copy /Y ..\layers\vk_layer_config.cpp   generated\common\
copy /Y ..\layers\vk_layer_extension_utils.cpp  generated\common\
copy /Y ..\layers\vk_layer_utils.cpp    generated\common\
copy /Y ..\layers\vk_layer_table.cpp    generated\common\
copy /Y ..\layers\descriptor_sets.cpp   generated\common\

REM create build-script root directory
mkdir generated\gradle-build
cd generated\gradle-build
mkdir  core_validation image object_tracker parameter_validation swapchain threading unique_objects
cd ..\..
mkdir generated\layer-src
cd generated\layer-src
mkdir  core_validation image object_tracker parameter_validation swapchain threading unique_objects
cd ..\..
xcopy /s gradle-templates\*   generated\gradle-build\
for %%G in (core_validation image object_tracker parameter_validation swapchain threading unique_objects) Do (
    copy ..\layers\%%G.cpp   generated\layer-src\%%G
    echo apply from: "../common.gradle"  > generated\gradle-build\%%G\build.gradle
)
copy generated\common\descriptor_sets.cpp generated\layer-src\core_validation\descriptor_sets.cpp
copy generated\include\vk_safe_struct.cpp generated\layer-src\core_validation\vk_safe_struct.cpp
move generated\include\vk_safe_struct.cpp generated\layer-src\unique_objects\vk_safe_struct.cpp
echo apply from: "../common.gradle"  > generated\gradle-build\unique_objects\build.gradle

android: Update windows script to request python3


"%R%" CMD INSTALL --build .
IF %ERRORLEVEL% NEQ 0 exit 1

Create bld.bat

Create bld.bat


@echo off
set var=%cd%

rem This batch file will initialize the ArcGIS version number the sample files.
rem It will also set the current folder as the working folder in the batch files and script files.

IF EXIST c:\python27\arcgis10.1\python.exe (

set id=10.1
goto :RunReplace
)

IF EXIST c:\python27\arcgis10.2\python.exe (

set id=10.2
goto :RunReplace

)
IF EXIST c:\python27\arcgis10.3\python.exe (

set id=10.3
goto :RunReplace
)

IF EXIST c:\python27\arcgis10.4\python.exe (

set id=10.4
goto :RunReplace

)
goto :ShowError

:RunReplace
c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles arcgisVer arcgis%id% *.bat
c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles currFolder %var% *.bat
c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\Parameter\Config currFolder %var% *.xml

copy /y nul Reset_Script_Paths.bat
echo @echo off
echo @echo This batch file was automatically created after successfully executing Intialize_Script_Paths.bat. >Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo @echo This batch file will reset the ArcGIS version number and current folder location to be used by the Sample files. >>Reset_Script_Paths.bat
echo @echo The batch files will be reset to the state when you first downloaded the batch file. >>Reset_Script_Paths.bat
echo @echo Type Ctrl + C to cancel execution. >>Reset_Script_Paths.bat
echo pause >>Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles arcgis%id% arcgisVer *.bat >>Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles %var% currFolder *.bat >>Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\Parameter\Config %var% currFolder *.xml >>Reset_Script_Paths.bat
echo pause >>Reset_Script_Paths.bat

ECHO "Successfully set ArcGIS version number to %id%."
ECHO "Successfully set sample paths to %var%."
goto :endofbatch

:ShowError
ECHO "ERROR: Could not find Python Install Location in C:\python27\"

:endofbatch
pause

@echo off
set var=%cd%

rem This batch file will initialize the ArcGIS version number the sample files.
rem It will also set the current folder as the working folder in the batch files and script files.

IF EXIST c:\python27\arcgis10.1\python.exe (

set id=10.1
goto :RunReplace
)

IF EXIST c:\python27\arcgis10.2\python.exe (

set id=10.2
goto :RunReplace

)
IF EXIST c:\python27\arcgis10.3\python.exe (

set id=10.3
goto :RunReplace
)

IF EXIST c:\python27\arcgis10.4\python.exe (

set id=10.4
goto :RunReplace

)
IF EXIST c:\python27\arcgis10.5\python.exe (

set id=10.5
goto :RunReplace
)
IF EXIST c:\python27\arcgis10.6\python.exe (

set id=10.6
goto :RunReplace
)

goto :ShowError

:RunReplace
c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles arcgisVer arcgis%id% *.bat
c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles currFolder %var% *.bat
c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\Parameter\Config currFolder %var% *.xml

copy /y nul Reset_Script_Paths.bat
echo @echo off
echo @echo This batch file was automatically created after successfully executing Intialize_Script_Paths.bat. >Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo @echo This batch file will reset the ArcGIS version number and current folder location to be used by the Sample files. >>Reset_Script_Paths.bat
echo @echo The batch files will be reset to the state when you first downloaded the batch file. >>Reset_Script_Paths.bat
echo @echo Type Ctrl + C to cancel execution. >>Reset_Script_Paths.bat
echo pause >>Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles arcgis%id% arcgisVer *.bat >>Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\batchFiles %var% currFolder *.bat >>Reset_Script_Paths.bat
echo. >>Reset_Script_Paths.bat
echo c:\python27\arcgis%id%\python.exe %var%\scripts\search_replace.py %var%\Parameter\Config %var% currFolder *.xml >>Reset_Script_Paths.bat
echo pause >>Reset_Script_Paths.bat

ECHO "Successfully set ArcGIS version number to %id%."
ECHO "Successfully set sample paths to %var%."
goto :endofbatch

:ShowError
ECHO "ERROR: Could not find Python Install Location in C:\python27\"

:endofbatch
pause

Update Initialize_Script_Paths.bat

Update Initialize_Script_Paths.bat

Updated Initialize_Script_Paths.bat to initilize for ArcGIS 10.5 and 10.6.
Issue #38


@echo off
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.

REM
REM Environment variables:
REM
REM GF_JAVA - java executable path.
REM
REM JAVA_ARGS - java arguments, i.e., -Xms1024m -Xmx1024m ...
REM
REM GEMFIRE - GemFire product Directory
REM
REM

@setlocal enableextensions
@set scriptdir=%~dp0
@set gf=%scriptdir:\bin\=%
REM echo %gf%
REM echo %scriptdir%
@if exist "%gf%\lib\geode-dependencies.jar" @goto gfok
@echo Could not determine GEMFIRE location
@verify other 2>nul
@goto done
:gfok
@set GEMFIRE=%gf%

@set GFSH_JARS=%GEMFIRE%\lib\gfsh-dependencies.jar
REM if a system level classpath is set, append it to the classes gfsh will need
@if defined CLASSPATH (
    @set DEPENDENCIES=%GFSH_JARS%;%CLASSPATH%
) else (
    @set DEPENDENCIES=%GFSH_JARS%
)

@if not defined GF_JAVA (
REM %GF_JAVA% is not defined, assume it is on the PATH
    @if defined JAVA_HOME (
    @set GF_JAVA=%JAVA_HOME%\bin\java.exe
) else (
    @set GF_JAVA=java
  )
)

REM
REM Copy default .gfshrc to the home directory. Uncomment if needed.
REM
REM @if not exist "%USERPROFILE%\.gemfire\.gfsh2rc" (
REM @xcopy /q "%GEMFIRE%\defaultConfigs\.gfsh2rc" "%USERPROFILE%\.gemfire"
REM )

REM
REM Make dir if .gemfire does not exist. Uncomment if needed.
REM
REM @if not exist "%USERPROFILE%\.gemfire" (
REM @mkdir "%USERPROFILE%\.gemfire"
REM )

REM  Expect to find the tools.jar from the JDK
@set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar
@IF EXIST "%TOOLS_JAR%" (
    @set DEPENDENCIES=%DEPENDENCIES%;%TOOLS_JAR%
) ELSE (
    set TOOLS_JAR=
)

@set LAUNCHER=org.apache.geode.management.internal.cli.Launcher
@if defined JAVA_ARGS (
    @set JAVA_ARGS="%JAVA_ARGS%"
)

REM Call java with our classpath
@"%GF_JAVA%" -Dgfsh=true -Dlog4j.configurationFile=classpath:log4j2-cli.xml -classpath %DEPENDENCIES% %JAVA_ARGS% %LAUNCHER% %*
:done

@echo off
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.

REM
REM Environment variables:
REM
REM GF_JAVA - java executable path.
REM
REM JAVA_ARGS - java arguments, i.e., -Xms1024m -Xmx1024m ...
REM
REM GEMFIRE - GemFire product Directory
REM
REM

@setlocal enableextensions
@set scriptdir=%~dp0
@set gf=%scriptdir:\bin\=%
REM echo %gf%
REM echo %scriptdir%
@if exist "%gf%\lib\geode-dependencies.jar" @goto gfok
@echo Could not determine GEMFIRE location
@verify other 2>nul
@goto done
:gfok
@set GEMFIRE=%gf%

@set GFSH_JARS=%GEMFIRE%\lib\gfsh-dependencies.jar
REM if a system level classpath is set, append it to the classes gfsh will need
@if defined CLASSPATH (
    @set DEPENDENCIES=%GFSH_JARS%;%CLASSPATH%
) else (
    @set DEPENDENCIES=%GFSH_JARS%
)

@if not defined GF_JAVA (
REM %GF_JAVA% is not defined, assume it is on the PATH
    @if defined JAVA_HOME (
    @set GF_JAVA=%JAVA_HOME%\bin\java.exe
) else (
    @set GF_JAVA=java
  )
)

REM
REM Copy default .gfshrc to the home directory. Uncomment if needed.
REM
REM @if not exist "%USERPROFILE%\.gemfire\.gfsh2rc" (
REM @xcopy /q "%GEMFIRE%\defaultConfigs\.gfsh2rc" "%USERPROFILE%\.gemfire"
REM )

REM
REM Make dir if .gemfire does not exist. Uncomment if needed.
REM
REM @if not exist "%USERPROFILE%\.gemfire" (
REM @mkdir "%USERPROFILE%\.gemfire"
REM )

REM  Expect to find the tools.jar from the JDK
@set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar
@IF EXIST "%TOOLS_JAR%" (
    @set DEPENDENCIES=%DEPENDENCIES%;%TOOLS_JAR%
) ELSE (
    set TOOLS_JAR=
)

@set LAUNCHER=org.apache.geode.management.internal.cli.Launcher
@if defined JAVA_ARGS (
    @set JAVA_ARGS="%JAVA_ARGS%"
)

REM Call java with our classpath
@"%GF_JAVA%" -Dgfsh=true -Dlog4j.configurationFile=classpath:log4j2-cli.xml -classpath "%DEPENDENCIES%" %JAVA_ARGS% %LAUNCHER% %*
:done

GEODE-1098: Fix gfsh.bat error with default Java installation

Paths to JAR dependencies quoted to prevent spaces from causing error

This closes #227


nuget pack AgateLib/AgateLib.csproj
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.AgateSDL/AgateLib.SDL.csproj
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.OpenGL/AgateLib.OpenGL.csproj
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.Platform.Test/AgateLib.Platform.Test.csproj
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.Platform.IntegrationTest/AgateLib.Platform.IntegrationTest.csproj
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib/AgateLib.csproj -IncludeReferencedProjects -properties Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.AgateSDL/AgateLib.SDL.csproj -IncludeReferencedProjects -properties Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.OpenGL/AgateLib.OpenGL.csproj -IncludeReferencedProjects -properties Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.Platform.WinForms/AgateLib.Platform.WinForms.csproj -IncludeReferencedProjects -properties Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.Platform.Test/AgateLib.Platform.Test.csproj -IncludeReferencedProjects -properties Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

nuget pack AgateLib.Platform.IntegrationTest/AgateLib.Platform.IntegrationTest.csproj -IncludeReferencedProjects -properties Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%

Update package.bat.

Update package.bat.


@echo off
REM  This file is part of the DITA Open Toolkit project hosted on
REM  Sourceforge.net. See the accompanying license.txt file for
REM  applicable licenses.
REM  (c) Copyright IBM Corp. 2006 All Rights Reserved.

REM Get the absolute path of DITAOT's home directory
set DITA_DIR=%~dp0

REM Set environment variables
set ANT_OPTS=-Xmx512m %ANT_OPTS%
set ANT_OPTS=%ANT_OPTS% -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
set ANT_HOME=%DITA_DIR%tools\ant
set PATH=%DITA_DIR%tools\ant\bin;%PATH%
set CLASSPATH=%DITA_DIR%lib;%DITA_DIR%lib\dost.jar;%DITA_DIR%lib\commons-codec-1.4.jar;%DITA_DIR%lib\dost.jar;%DITA_DIR%lib\resolver.jar;%DITA_DIR%lib\icu4j.jar;%CLASSPATH%
set CLASSPATH=%DITA_DIR%lib\saxon\saxon9.jar;%DITA_DIR%lib\saxon\saxon9-dom.jar;%CLASSPATH%
start "DITA-OT" cmd.exe

@echo off
REM  This file is part of the DITA Open Toolkit project hosted on
REM  Sourceforge.net. See the accompanying license.txt file for
REM  applicable licenses.
REM  (c) Copyright IBM Corp. 2006 All Rights Reserved.

REM Get the absolute path of DITAOT's home directory
set DITA_DIR=%~dp0

REM Set environment variables
set ANT_OPTS=-Xmx512m %ANT_OPTS%
set ANT_OPTS=%ANT_OPTS% -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
set ANT_HOME=%DITA_DIR%tools\ant
set PATH=%DITA_DIR%tools\ant\bin;%PATH%
set CLASSPATH=%DITA_DIR%lib;%DITA_DIR%lib\dost.jar;%DITA_DIR%lib\commons-codec-1.4.jar;%DITA_DIR%lib\resolver.jar;%DITA_DIR%lib\icu4j.jar;%CLASSPATH%
set CLASSPATH=%DITA_DIR%lib\saxon\saxon9.jar;%DITA_DIR%lib\saxon\saxon9-dom.jar;%CLASSPATH%
start "DITA-OT" cmd.exe

Remove duplicate dost.jar from CLASSPATH - ID: 3499953


cd /d %~dp0

REM Clean Plugins
cd ..\Output\Release\Plugins
del NLog.dll /s
del NLog.config /s
del Wox.Plugin.pdb /s
del Wox.Plugin.dll /s
del Wox.Core.dll /s
del Wox.Core.pdb /s
del ICSharpCode.SharpZipLib.dll /s
del NAppUpdate.Framework.dll /s
del Wox.Infrastructure.dll /s
del Wox.Infrastructure.pdb /s
del Newtonsoft.Json.dll /s
del WindowsInput.dll /s

REM Clean Wox
cd ..
del *.xml

cd /d %~dp0

REM Clean Plugins
echo "clean plugins"
cd ..\Output\Release\Plugins
del NLog.dll /s
del NLog.config /s
del Wox.Plugin.pdb /s
del Wox.Plugin.dll /s
del Wox.Core.dll /s
del Wox.Core.pdb /s
del ICSharpCode.SharpZipLib.dll /s
del NAppUpdate.Framework.dll /s
del Wox.Infrastructure.dll /s
del Wox.Infrastructure.pdb /s
del Newtonsoft.Json.dll /s
del WindowsInput.dll /s

REM Clean Wox
echo "wox"
cd ..
del *.xml

update cleanup.bat

update cleanup.bat


ECHO ON
SETLOCAL
SET VERSION=%1

rmdir obj /s /q
rmdir Release /s /q
msbuild tools\versionupdater\versionupdater.csproj /p:Configuration=Release /p:OutputPath=..\bin || exit /B 1
tools\bin\versionupdater -v %VERSION% || exit /B 1
msbuild.exe mapsui.sln /p:Configuration=Release /t:restore  || exit /B 1
msbuild.exe mapsui.sln /p:Configuration=Release  || exit /B 1
nuget pack NuSpec\Mapsui.nuspec -Version %VERSION% -outputdirectory Artifacts  || exit /B 1
nuget pack NuSpec\Mapsui.Forms.nuspec -Version %VERSION% -outputdirectory Artifacts  || exit /B 1
nuget pack NuSpec\Mapsui.Native.nuspec -Version %VERSION% -outputdirectory Artifacts  || exit /B 1

Revert buildpack.bat

Revert buildpack.bat


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

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional 5g/6g/8g arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.

@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c cmd/dist/arm.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
"%GOTOOLDIR%\go_bootstrap" clean -i std
echo.

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -v std
endlocal
if errorlevel 1 goto fail
echo.

:mainbuild
echo # Building packages and commands.
"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -a -v std
if errorlevel 1 goto fail
del "%GOTOOLDIR%\go_bootstrap.exe"
echo.

if x%1==x--no-banner goto nobanner
"%GOTOOLDIR%\dist" banner
:nobanner

goto end

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:fail
set GOBUILDFAIL=1

:end

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

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional 5g/6g/8g arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.

@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildgo.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c cmd/dist/arm.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
"%GOTOOLDIR%\go_bootstrap" clean -i std
echo.

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -v std
endlocal
if errorlevel 1 goto fail
echo.

:mainbuild
echo # Building packages and commands.
"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -a -v std
if errorlevel 1 goto fail
del "%GOTOOLDIR%\go_bootstrap.exe"
echo.

if x%1==x--no-banner goto nobanner
"%GOTOOLDIR%\dist" banner
:nobanner

goto end

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:fail
set GOBUILDFAIL=1

:end

fix windows build.

cmd/dist: fix windows build.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12351045


:: Requirements:
::   - Inno Setup unicode installed (http://www.jrsoftware.org/isdl.php)
::   - OracleJDK 10 installed
::     Note: OpenJDK 10 does not have the javapackager util, so must use OracleJDK
::   - Sign Tool installed (https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool)
::     Note: Sign Tool is part of Windows 10 SDK (https://go.microsoft.com/fwlink/?LinkID=698771)
::   - Code signing certificate installed
:: Prior to running this script:
::   - Update version below
::   - Ensure JAVA_HOME below is pointing to OracleJDK 10 directory

@echo off

set version=1.2.6
if not exist "%JAVA_HOME%\bin\javapackager.exe" (
    if not exist "%ProgramFiles%\Java\jdk-10.0.2" (
        echo Javapackager not found. Update JAVA_HOME variable to point to OracleJDK.
        exit /B 1
    )
    set JAVA_HOME=%ProgramFiles%\Java\jdk-10.0.2
)
set package_dir=%~dp0..
for /F "tokens=1,2,3 delims=.-" %%a in ("%version%") do (
   set file_version=%%a.%%b.%%c
)

cd %~dp0..\..\..

if exist "%package_dir%\desktop-%version%-all.jar" (
    set jar_dir=%package_dir%
    set jar_file=%package_dir%\desktop-%version%-all.jar
    set jar_filename=desktop-%version%-all.jar
    goto PackageJar
)

echo Building application
call gradlew.bat :desktop:clean :desktop:build -x test shadowJar
if exist "%~dp0..\..\..\desktop\build\libs\desktop-%version%-all.jar" (
    set jar_dir=%~dp0..\..\..\desktop\build\libs
    set jar_file=%~dp0..\..\..\desktop\build\libs\desktop-%version%-all.jar
    set jar_filename=desktop-%version%-all.jar
) else (
    echo No jar file available in %~dp0..\..\..\desktop\build\libs
    exit /B 2
)

if not exist "%TEMP%\7za920\7za.exe" (
    echo Downloading 7zip ^(command line version^) to %TEMP% in order to extract the jar
    powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
    powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"
)

set tmp_dir=%~dp0..\..\..\desktop\build\libs\tmp
echo Extracting jar file to %tmp_dir%
if exist "%tmp_dir%" (
    rmdir /S /Q "%tmp_dir%"
)
md "%tmp_dir%"
"%TEMP%\7za920\7za.exe" x "%jar_file%" -o"%tmp_dir%" -r -y

echo Deleting problematic module config from extracted jar
:: Strip out Java 9 module configuration used in the fontawesomefx library as it causes javapackager to stop
:: because of this existing module information, since it is not used as a module.
:: Sometimes module-info.class does not exist - TODO check why and if still needed
if exist "%tmp_dir%\module-info.class" (
    del /Q "%tmp_dir%\module-info.class"
)

echo Zipping jar again without module config
set jar_file=%package_dir%\%jar_filename%
if exist "%jar_file%" (
    del /Q "%jar_file%"
)
"%TEMP%\7za920\7za.exe" a -tzip "%jar_file%" "%tmp_dir%\*" -r
rmdir /S /Q "%tmp_dir%"

if exist "%TEMP%\7za920.zip" (
    echo Removing downloaded files
    del /Q "%TEMP%\7za920.zip"
)

echo SHA256 before stripping jar file:
for /F "delims=" %%h in ('certutil -hashfile "%jar_file%" SHA256 ^| findstr -i -v "SHA256" ^| findstr -i -v "certutil"') do (set hash=%%h)
echo %hash%

echo Making deterministic jar by stripping out parameters and comments that contain dates
:: Jar file created from https://github.com/ManfredKarrer/tools
:: TODO Is this step still necessary? Since we are using preserveFileTimestamps and reproducibleFileOrder in build.gradle
java -jar "%CD%\desktop\package\tools-1.0.jar" "%jar_file%"

echo SHA256 after stripping jar file:
for /F "delims=" %%h in ('certutil -hashfile "%jar_file%" SHA256 ^| findstr -i -v "SHA256" ^| findstr -i -v "certutil"') do (set hash=%%h)
echo %hash%
echo %hash% > "%package_dir%\%jar_filename%.txt"

:PackageJar
if exist "%package_dir%\windows\Bisq-%version%.exe" (
    del /Q "%package_dir%\windows\Bisq-%version%.exe"
)

cd desktop

echo Generating packaged executable
call "%JAVA_HOME%\bin\javapackager.exe" -deploy ^
-native exe ^
-name Bisq ^
-title Bisq ^
-vendor Bisq ^
-outdir "%package_dir%\windows" ^
-appclass bisq.desktop.app.BisqAppMain ^
-srcdir "%package_dir%" ^
-srcfiles %jar_filename% ^
-outfile Bisq ^
-v

if not exist "%package_dir%\windows\Bisq-%version%.exe" (
    echo No exe file found at %package_dir%\windows\Bisq-%version%.exe
    exit /B 3
)

echo Signing executable with default Code Signing Certificate
call "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe" sign /v /fd SHA256 /a "Bisq-%version%.exe"

echo SHA256 of %package_dir%\windows\Bisq-%version%.exe:
for /F "delims=" %%h in ('certutil -hashfile "%package_dir%\windows\Bisq-%version%.exe" SHA256 ^| findstr -i -v "SHA256" ^| findstr -i -v "certutil"') do (set hash=%%h)
echo %hash%
echo %hash% > "%package_dir%\windows\Bisq-%version%.exe.txt"

echo Done!
pause

:: Requirements:
::   - Inno Setup unicode installed (http://www.jrsoftware.org/isdl.php)
::   - OracleJDK 10 installed
::     Note: OpenJDK 10 does not have the javapackager util, so must use OracleJDK
::   - Sign Tool installed (https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool)
::     Note: Sign Tool is part of Windows 10 SDK (https://go.microsoft.com/fwlink/?LinkID=698771)
::   - Code signing certificate installed
:: Prior to running this script:
::   - Update version below
::   - Ensure JAVA_HOME below is pointing to OracleJDK 10 directory

@echo off

set version=1.2.6
if not exist "%JAVA_HOME%\bin\javapackager.exe" (
    if not exist "%ProgramFiles%\Java\jdk-10.0.2" (
        echo Javapackager not found. Update JAVA_HOME variable to point to OracleJDK.
        exit /B 1
    )
    set JAVA_HOME=%ProgramFiles%\Java\jdk-10.0.2
)
set package_dir=%~dp0..
for /F "tokens=1,2,3 delims=.-" %%a in ("%version%") do (
   set file_version=%%a.%%b.%%c
)

cd %~dp0..\..\..

if exist "%package_dir%\desktop-%version%-all.jar" (
    set jar_dir=%package_dir%
    set jar_file=%package_dir%\desktop-%version%-all.jar
    set jar_filename=desktop-%version%-all.jar
    goto PackageJar
)

echo Building application
call gradlew.bat :desktop:clean :desktop:build -x test shadowJar
if exist "%~dp0..\..\..\desktop\build\libs\desktop-%version%-all.jar" (
    set jar_dir=%~dp0..\..\..\desktop\build\libs
    set jar_file=%~dp0..\..\..\desktop\build\libs\desktop-%version%-all.jar
    set jar_filename=desktop-%version%-all.jar
) else (
    echo No jar file available in %~dp0..\..\..\desktop\build\libs
    exit /B 2
)

if not exist "%TEMP%\7za920\7za.exe" (
    echo Downloading 7zip ^(command line version^) to %TEMP% in order to extract the jar
    powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
    powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"
)

set tmp_dir=%~dp0..\..\..\desktop\build\libs\tmp
echo Extracting jar file to %tmp_dir%
if exist "%tmp_dir%" (
    rmdir /S /Q "%tmp_dir%"
)
md "%tmp_dir%"
"%TEMP%\7za920\7za.exe" x "%jar_file%" -o"%tmp_dir%" -r -y

echo Deleting problematic module config from extracted jar
:: Strip out Java 9 module configuration used in the fontawesomefx library as it causes javapackager to stop
:: because of this existing module information, since it is not used as a module.
:: Sometimes module-info.class does not exist - TODO check why and if still needed
if exist "%tmp_dir%\module-info.class" (
    del /Q "%tmp_dir%\module-info.class"
)

echo Zipping jar again without module config
set jar_file=%package_dir%\%jar_filename%
if exist "%jar_file%" (
    del /Q "%jar_file%"
)
"%TEMP%\7za920\7za.exe" a -tzip "%jar_file%" "%tmp_dir%\*" -r
rmdir /S /Q "%tmp_dir%"

if exist "%TEMP%\7za920.zip" (
    echo Removing downloaded files
    del /Q "%TEMP%\7za920.zip"
)

echo SHA256 before stripping jar file:
for /F "delims=" %%h in ('certutil -hashfile "%jar_file%" SHA256 ^| findstr -i -v "SHA256" ^| findstr -i -v "certutil"') do (set hash=%%h)
echo %hash%

echo Making deterministic jar by stripping out parameters and comments that contain dates
:: Jar file created from https://github.com/ManfredKarrer/tools
:: TODO Is this step still necessary? Since we are using preserveFileTimestamps and reproducibleFileOrder in build.gradle
java -jar "%CD%\desktop\package\tools-1.0.jar" "%jar_file%"

echo SHA256 after stripping jar file:
for /F "delims=" %%h in ('certutil -hashfile "%jar_file%" SHA256 ^| findstr -i -v "SHA256" ^| findstr -i -v "certutil"') do (set hash=%%h)
echo %hash%
echo %hash% > "%package_dir%\%jar_filename%.txt"

:PackageJar
if exist "%package_dir%\windows\Bisq-%version%.exe" (
    del /Q "%package_dir%\windows\Bisq-%version%.exe"
)

cd desktop

echo Generating packaged executable
call "%JAVA_HOME%\bin\javapackager.exe" -deploy ^
-native exe ^
-name Bisq ^
-title Bisq ^
-vendor Bisq ^
-outdir "%package_dir%\windows" ^
-appclass bisq.desktop.app.BisqAppMain ^
-srcdir "%package_dir%" ^
-srcfiles %jar_filename% ^
-outfile Bisq ^
-v

if not exist "%package_dir%\windows\Bisq-%version%.exe" (
    echo No exe file found at %package_dir%\windows\Bisq-%version%.exe
    exit /B 3
)

echo Signing executable with default Code Signing Certificate
call "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe" sign /v /fd SHA256 /a "%package_dir%\windows\Bisq-%version%.exe"

echo SHA256 of %package_dir%\windows\Bisq-%version%.exe:
for /F "delims=" %%h in ('certutil -hashfile "%package_dir%\windows\Bisq-%version%.exe" SHA256 ^| findstr -i -v "SHA256" ^| findstr -i -v "certutil"') do (set hash=%%h)
echo %hash%
echo %hash% > "%package_dir%\windows\Bisq-%version%.exe.txt"

echo Done!
pause

Fix wrong executable path for Windows signing


@echo off
setlocal enabledelayedexpansion

:: Try to find git.exe in path
for /f "tokens=*" %%G in ('where git') do set "apm_git_path=%%~dpG"
if not defined apm_git_path (
  :: Try to find git.exe in GitHub Desktop, oldest first so we end with newest
  for /f "tokens=*" %%d in ('dir /b /s /a:d /od "%LOCALAPPDATA%\GitHub\PortableGit*"') do (
    if exist %%d\cmd\git.exe set apm_git_path=%%d\cmd
  )
  :: Found one, add it to the path
  if defined apm_git_path set "Path=!apm_git_path!;%PATH%"
)

set maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js
if exist %maybe_node_gyp_path% (
  set npm_config_node_gyp=%maybe_node_gyp_path%
)

if exist "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
) else (
  node.exe "%~dp0/../lib/cli.js" %*
)

@echo off
setlocal enabledelayedexpansion

:: Try to find git.exe in path
for /f "tokens=*" %%G in ('where git') do set "apm_git_path=%%~dpG"
if not defined apm_git_path (
  :: Try to find git.exe in GitHub Desktop, oldest first so we end with newest
  for /f "tokens=*" %%d in ('dir /b /s /a:d /od "%LOCALAPPDATA%\GitHub\PortableGit*"') do (
    if exist %%d\cmd\git.exe set apm_git_path=%%d\cmd
  )
  :: Found one, add it to the path
  if defined apm_git_path set "Path=!apm_git_path!;!PATH!"
)

set maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js
if exist %maybe_node_gyp_path% (
  set npm_config_node_gyp=%maybe_node_gyp_path%
)

if exist "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
) else (
  node.exe "%~dp0/../lib/cli.js" %*
)

Handle PATH entries with quotes containing parens in apm.cmd


set TARGET_DIR=C:\Tools\Apache\logs
cd %%TARGET_DIR

rem JԂ{
FOR /L %%i IN (1,1,1000000) Do (

    rem t@CƂɎ{
    for %%f in (access*) do dir %%f

  )
)

@echo off

set TARGET_DIR=C:\Tools\Apache\logs
cd %TARGET_DIR%

@rem 繰り返し実施
FOR /L %%i IN (1,1,1000000000) Do (
    sleep 1
    @rem 発見したファイルごとに実施
    for %%f in (access*) do dir %%f

  )
)

Update check_apache_logs.bat

Update check_apache_logs.bat


@echo off
setlocal

if [%2]==[] goto :Usage
if [%1]==[/?] goto :Usage
if [%1]==[-?] goto :Usage
if [%1]==[/help] goto :Usage
if [%1]==[-help] goto :Usage

set _n=%1
set _exitCode=0
set _cmd=
set _cmd1=

:Loop
shift
if [%1]==[] goto :Continue
if [%1]==[#] (
    set _cmd1=%_cmd1% %_cmd%
    set _cmd=
    goto :Loop
)
set _cmd=%_cmd% %1
goto :Loop
:Continue

for /L %%i in (1,1,%_n%) do (
    echo Iteration: %%i
    if defined _cmd1 (
        call :Run %_cmd1% %%i %_cmd%
    ) else (
        call :Run %_cmd%
    )
    if ERRORLEVEL 1 goto :Failed
    echo.
)

echo All %_n% iterations completed successfully!
goto :Done

:Usage
echo.
echo Usage:
echo   %~n0 n command [parameters]
echo            n: [Required] The number of iterations to repeat the command
echo      command: [Required] The command to run for n iterations
echo   parameters: [Optional] The parameters of the command
echo               #: When parameters contain #, the last occurance in the parameter
echo               will be replace with the number of iteration.
echo.
echo Example:
echo   %~n0 42 work.cmd # param
echo   :The script 'work.cmd' will be called 42 times like
echo    work.cmd 1 param, work.cmd 2 param, ..., work.cmd 42 param
goto :Done

:Run
set cmdLine=%*
echo %cmdLine%
call %cmdLine%
exit /b

:Failed
set _exitCode=1
echo.
echo Aborted! Failed to complete all iterations.

:Done
exit /b %_exitCode%
endlocal

Add the script that is used to setup CI test server

Usage:
  Repeat n command [parameters]
           n: [Required] The number of iterations to repeat the command
     command: [Required] The command to run for n iterations
  parameters: [Optional] The parameters of the command
              #: When parameters contain #, the last occurance in the parameter
              will be replace with the number of iteration.

Example:
  Repeat 42 work.cmd # param
  :The script 'work.cmd' will be called 42 times like
   work.cmd 1 param, work.cmd 2 param, ..., work.cmd 42 param