REM init developer command prompt
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"

set msbuild_cmd=msbuild.exe
set devenv_cmd=devenv.exe
where /q devenv.exe
if not %errorlevel%==0 set devenv_cmd="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe"
where /q msbuild.exe
if not %errorlevel%==0 set msbuild_cmd="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"

REM put butler in path or in ..\butler\
SET PATH=%PATH%;..\butler\

REM clean everything
git.exe clean -f -x -d

REM download physx
mkdir 3rdparty
cd 3rdparty
git.exe clone --depth=1 https://github.com/nem0/PhysX.git physx

REM build static physx
cd PhysX\physx
call generate_projects.bat lumix_vc16win64_static
%msbuild_cmd% "compiler\vc16win64\PhysXSDK.sln" /p:Configuration=Release /p:Platform=x64

REM deploy physx
cd ..\..\..\
if not exist "..\external\physx\lib\vs2017\win64\release_static\" mkdir ..\external\physx\lib\vs2017\win64\release_static\
del /Q ..\external\physx\lib\vs2017\win64\release_static\*
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXCharacterKinematic_static_64.lib ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXCommon_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXCooking_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXExtensions_static_64.lib		   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXFoundation_static_64.lib		   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXPvdSDK_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXVehicle_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysX_static_64.lib				   ..\external\physx\lib\vs2017\win64\release_static\

REM create engine project
genie.exe --embed-resources --static-physx vs2019

REM build engine.exe with bundled data
cd ..\data
tar -cvf data.tar .
move data.tar ../src/studio
cd ..\projects\
%msbuild_cmd% tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
del ..\src\studio\data.tar

REM push gl version
mkdir itch_io
copy tmp\vs2019\bin\RelWithDebInfo\studio.exe itch_io\
butler.exe push itch_io mikulasflorek/lumix-engine:win-64-gl

REM download dx
pushd ..\plugins
git.exe clone https://github.com/nem0/lumixengine_dx.git dx
popd

REM build engine.exe with bundled data
cd ..\data
tar -cvf data.tar .
move data.tar ../src/studio
cd ..\projects\
%msbuild_cmd% tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
del ..\src\studio\data.tar

REM push gl version
mkdir itch_io
copy tmp\vs2019\bin\RelWithDebInfo\studio.exe itch_io\
butler.exe push itch_io mikulasflorek/lumix-engine:win-64-dx
pause

REM init developer command prompt
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"

set msbuild_cmd=msbuild.exe
set devenv_cmd=devenv.exe
where /q devenv.exe
if not %errorlevel%==0 set devenv_cmd="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe"
where /q msbuild.exe
if not %errorlevel%==0 set msbuild_cmd="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"

REM put butler in path or in ..\butler\
SET PATH=%PATH%;..\..\butler\

REM clean everything
git.exe clean -f -x -d ..\
if not %errorlevel%==0 pause

REM download physx
mkdir 3rdparty
if not %errorlevel%==0 pause

cd 3rdparty
git.exe clone --depth=1 https://github.com/nem0/PhysX.git physx
if not %errorlevel%==0 pause

REM build static physx
cd PhysX\physx
call generate_projects.bat lumix_vc16win64_static
if not %errorlevel%==0 pause

%msbuild_cmd% "compiler\vc16win64\PhysXSDK.sln" /p:Configuration=Release /p:Platform=x64
if not %errorlevel%==0 pause

REM deploy physx
cd ..\..\..\
if not exist "..\external\physx\lib\vs2017\win64\release_static\" mkdir ..\external\physx\lib\vs2017\win64\release_static\
del /Q ..\external\physx\lib\vs2017\win64\release_static\*
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXCharacterKinematic_static_64.lib ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXCommon_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXCooking_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXExtensions_static_64.lib		   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXFoundation_static_64.lib		   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXPvdSDK_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysXVehicle_static_64.lib			   ..\external\physx\lib\vs2017\win64\release_static\
copy 3rdparty\PhysX\physx\bin\win.x86_64.vc141.md\release\PhysX_static_64.lib				   ..\external\physx\lib\vs2017\win64\release_static\

REM create engine project
genie.exe --embed-resources --static-physx vs2019
if not %errorlevel%==0 pause

REM build engine.exe with bundled data
cd ..\data
tar -cvf data.tar .
move data.tar ../src/studio
cd ..\projects\
%msbuild_cmd% tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
if not %errorlevel%==0 pause
del ..\src\studio\data.tar

REM push gl version
mkdir itch_io
copy tmp\vs2019\bin\RelWithDebInfo\studio.exe itch_io\
butler.exe push itch_io mikulasflorek/lumix-engine:win-64-gl
if not %errorlevel%==0 pause

REM download dx
pushd ..\plugins
git.exe clone https://github.com/nem0/lumixengine_dx.git dx
if not %errorlevel%==0 pause
popd

REM build engine.exe with bundled data
cd ..\data
tar -cvf data.tar .
move data.tar ../src/studio
cd ..\projects\
%msbuild_cmd% tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
if not %errorlevel%==0 pause
del ..\src\studio\data.tar

REM push gl version
mkdir itch_io
copy tmp\vs2019\bin\RelWithDebInfo\studio.exe itch_io\
butler.exe push itch_io mikulasflorek/lumix-engine:win-64-dx
pause

clean all data before publishing

clean all data before publishing


set "VSCMD_START_DIR=%CD%"
call %1
msbuild main.sln -nologo -t:Rebuild -p:Configuration=Release /p:Platform=x86 /t:demo

Add to set VSCMD_START_DIR

Add to set VSCMD_START_DIR


@if not defined _echo echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
SET _originalScript=%~f0

:parseArguments
if "%1"=="" goto doneParsingArguments
if /i "%1"=="--scope" set SCOPE=%2&& shift && shift && goto parseArguments
if /i "%1"=="--target" set TARGET=%2&& shift && shift && goto parseArguments
if /i "%1"=="--host" set HOST=%2&& shift && shift && goto parseArguments
if /i "%1"=="--build-only" set BUILD_ONLY=true&& shift && goto parseArguments
if /i "%1"=="--bootstrap-only" set BOOTSTRAP_ONLY=true&& shift && goto parseArguments
if /i "%1"=="--localized-build" set LOCALIZED_BUILD=true&& shift && goto parseArguments
if /i "%1"=="--sync-xlf" set SYNC_XLF=true&& shift && goto parseArguments

:: Unknown parameters
goto :usage

:doneParsingArguments

:: Default target
set TARGET_ARG=RebuildAndTest

if /i "%SCOPE%"=="Compile" set TARGET_ARG=Build
if /i "%SCOPE%"=="Build" set TARGET_ARG=Build

:: Assign target configuration

:: Default to full-framework build
if not defined TARGET (
    set TARGET=Full
)

set BUILD_CONFIGURATION=
if /i "%TARGET%"=="CoreCLR" (
    set BUILD_CONFIGURATION=Debug-NetCore
) else if /i "%TARGET%"=="Full" (
    set BUILD_CONFIGURATION=Debug
) else if /i "%TARGET%"=="All" (
    SET _originalArguments=%*
    CALL "!_originalScript!" !_originalArguments:All=Full!
    IF ERRORLEVEL 1 GOTO :error
    CALL "!_originalScript!" !_originalArguments:All=CoreCLR!
    IF ERRORLEVEL 1 GOTO :error
    EXIT /B 0
) else (
    echo Unsupported target detected: %TARGET%. Configuring as if for Full.
    set TARGET=Full
    set BUILD_CONFIGURATION=Debug
)

:: Assign runtime host

:: By default match host to target
if not defined HOST (
    if /i "%TARGET%"=="CoreCLR" (
        set HOST=CoreCLR
    ) else (
        set HOST=Full
    )
)

set RUNTIME_HOST=
if /i "%HOST%"=="CoreCLR" (
    set RUNTIME_HOST=%~dp0Tools\DotNetCLI\Dotnet.exe
    set MSBUILD_CUSTOM_PATH=%~dp0Tools\MSBuild.exe
) else if /i "%HOST%"=="Full" (
    set RUNTIME_HOST=
) else (
    echo Unsupported host detected: %HOST%. Aborting.
    goto :error
)

set LOCALIZED_BUILD_ARGUMENT=
if "%LOCALIZED_BUILD%"=="true" (
    set LOCALIZED_BUILD_ARGUMENT="/p:LocalizedBuild=true"
)

set SYNC_XLF_ARGUMENT=
if "%SYNC_XLF%"=="true" (
    set SYNC_XLF_ARGUMENT="/p:SyncXlf=true"
)

:: Full Framework MSBuild does not have the new built-in property MSBuildRuntimeType
set RUNTIMETYPE_ARGUMENT=
if "%TARGET%"=="Full" (
    set RUNTIMETYPE_ARGUMENT="/p:MSBuildRuntimeType=Full"
)

:: Restore build tools
call %~dp0init-tools.cmd

echo.
echo ** Rebuilding MSBuild with downloaded binaries

set MSBUILDLOGPATH=%~dp0msbuild_bootstrap_build-%HOST%.log
call "%~dp0build.cmd" /t:Rebuild /p:Configuration=%BUILD_CONFIGURATION% /p:"SkipBuildPackages=true" %LOCALIZED_BUILD_ARGUMENT% %SYNC_XLF_ARGUMENT% %RUNTIMETYPE_ARGUMENT%

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo Bootstrap build failed with errorlevel %ERRORLEVEL% 1>&2
    goto :error
)
if "%BUILD_ONLY%"=="true" goto :success

:: Move initial build to bootstrap directory

echo.
echo ** Moving bootstrapped MSBuild to the bootstrap folder

:: Kill Roslyn, which may have handles open to files we want
taskkill /F /IM vbcscompiler.exe

set MSBUILDLOGPATH=%~dp0msbuild_move_bootstrap-%HOST%.log
set MSBUILD_ARGS=/verbosity:minimal targets\BootStrapMSbuild.proj /p:Configuration=%BUILD_CONFIGURATION% %RUNTIMETYPE_ARGUMENT%

call "%~dp0build.cmd"
if %ERRORLEVEL% NEQ 0 (
    echo.
    echo Failed to create bootstrap folder with errorlevel %ERRORLEVEL% 1>&2
    goto :error
)
if "%BOOTSTRAP_ONLY%"=="true" goto :success

set MSBUILD_ARGS=

:: Rebuild with bootstrapped msbuild
set MSBUILDLOGPATH=%~dp0msbuild_local_build-%HOST%.log

:: Only CoreCLR requires an override--it should use the host
:: downloaded as part of its NuGet package references, rather
:: than the possibly-stale one from Tools.
if /i "%TARGET%"=="CoreCLR" (
    set RUNTIME_HOST=%~dp0Tools\DotNetCLI\Dotnet.exe
)

if /i "%TARGET%"=="CoreCLR" (
    set MSBUILD_CUSTOM_PATH="%~dp0bin\Bootstrap-NetCore\MSBuild.dll"
) else (
    set MSBUILD_CUSTOM_PATH="%~dp0bin\Bootstrap\15.0\Bin\MSBuild.exe"
)

:: The set of warnings to suppress for now
:: warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.
:: warning MSB3026: Could not copy "XXX" to "XXX". Beginning retry 1 in 1000ms.
:: warning MSB3073: Exec task failure (when set to be a warning) -- needed to keep from failing on dev desktops that don't have C++ tools
:: warning AL1053: The version '1.2.3.4-foo' specified for the 'product version' is not in the normal 'major.minor.build.revision' format
SET _NOWARN=MSB3277;MSB3026;MSB3073;AL1053

echo.
echo ** Rebuilding MSBuild with locally built binaries

call "%~dp0build.cmd" /t:%TARGET_ARG% /p:Configuration=%BUILD_CONFIGURATION% %LOCALIZED_BUILD_ARGUMENT% "/nowarn:%_NOWARN%" /warnaserror

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo Local build failed with error level %ERRORLEVEL% 1>&2
    goto :error
)

:: Only detect source control changes when running in the CI environment
:: Detect if there are any changed files which should fail the build
if DEFINED JENKINS_URL (
    echo Detecting changed files...
    git status
    git --no-pager diff HEAD --word-diff=plain --exit-code
    if ERRORLEVEL 1 (
        echo.
        echo [ERROR] After building, there are changed files.  Please build locally ^(cibuild.cmd --target All^) and include these changes in your pull request. 1>&2
        goto :error
    )
    goto :EOF
)

:success
echo.
echo ++++++++++++++++
echo + SUCCESS  :-) +
echo ++++++++++++++++
echo.
exit /b 0

:usage
echo Options
echo   --scope ^<scope^>                Scope of the build ^(Compile / Test^)
echo   --target ^<target^>              CoreCLR, Full, or All ^(default: Full^)
echo   --host ^<host^>                  CoreCLR or Full ^(default: Full^)
echo   --build-only                     Only build using a downloaded copy of MSBuild but do not bootstrap
echo                                    or build again with those binaries
echo   --bootstrap-only                 Build and bootstrap MSBuild but do not build again with those binaries
echo   --localized-build                Do a localized build
echo   --sync-xlf                       Synchronize xlf files from resx files
exit /b 1

:error
echo.
echo ---------------------------------------
echo - cibuild.cmd FAILED. -
echo ---------------------------------------
exit /b 1

@if not defined _echo echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
SET _originalScript=%~f0

:parseArguments
if "%1"=="" goto doneParsingArguments
if /i "%1"=="--scope" set SCOPE=%2&& shift && shift && goto parseArguments
if /i "%1"=="--target" set TARGET=%2&& shift && shift && goto parseArguments
if /i "%1"=="--host" set HOST=%2&& shift && shift && goto parseArguments
if /i "%1"=="--build-only" set BUILD_ONLY=true&& shift && goto parseArguments
if /i "%1"=="--bootstrap-only" set BOOTSTRAP_ONLY=true&& shift && goto parseArguments
if /i "%1"=="--localized-build" set LOCALIZED_BUILD=true&& shift && goto parseArguments
if /i "%1"=="--sync-xlf" set SYNC_XLF=true&& shift && goto parseArguments

:: Unknown parameters
goto :usage

:doneParsingArguments

:: Default target
set TARGET_ARG=RebuildAndTest

if /i "%SCOPE%"=="Compile" set TARGET_ARG=Build
if /i "%SCOPE%"=="Build" set TARGET_ARG=Build

:: Assign target configuration

:: Default to full-framework build
if not defined TARGET (
    set TARGET=Full
)

set BUILD_CONFIGURATION=
if /i "%TARGET%"=="CoreCLR" (
    set BUILD_CONFIGURATION=Debug-NetCore
) else if /i "%TARGET%"=="Full" (
    set BUILD_CONFIGURATION=Debug
) else if /i "%TARGET%"=="All" (
    SET _originalArguments=%*
    CALL "!_originalScript!" !_originalArguments:All=Full!
    IF ERRORLEVEL 1 GOTO :error
    CALL "!_originalScript!" !_originalArguments:All=CoreCLR!
    IF ERRORLEVEL 1 GOTO :error
    EXIT /B 0
) else (
    echo Unsupported target detected: %TARGET%. Configuring as if for Full.
    set TARGET=Full
    set BUILD_CONFIGURATION=Debug
)

:: Assign runtime host

:: By default match host to target
if not defined HOST (
    if /i "%TARGET%"=="CoreCLR" (
        set HOST=CoreCLR
    ) else (
        set HOST=Full
    )
)

set RUNTIME_HOST=
if /i "%HOST%"=="CoreCLR" (
    set RUNTIME_HOST=%~dp0Tools\DotNetCLI\Dotnet.exe
    set MSBUILD_CUSTOM_PATH=%~dp0Tools\MSBuild.exe
) else if /i "%HOST%"=="Full" (
    set RUNTIME_HOST=
) else (
    echo Unsupported host detected: %HOST%. Aborting.
    goto :error
)

set LOCALIZED_BUILD_ARGUMENT=
if "%LOCALIZED_BUILD%"=="true" (
    set LOCALIZED_BUILD_ARGUMENT="/p:LocalizedBuild=true"
)

set SYNC_XLF_ARGUMENT=
if "%SYNC_XLF%"=="true" (
    set SYNC_XLF_ARGUMENT="/p:SyncXlf=true"
)

:: Restore build tools
call %~dp0init-tools.cmd

echo.
echo ** Rebuilding MSBuild with downloaded binaries

set MSBUILDLOGPATH=%~dp0msbuild_bootstrap_build-%HOST%.log
call "%~dp0build.cmd" /t:Rebuild /p:Configuration=%BUILD_CONFIGURATION% /p:"SkipBuildPackages=true" %LOCALIZED_BUILD_ARGUMENT% %SYNC_XLF_ARGUMENT% %RUNTIMETYPE_ARGUMENT%

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo Bootstrap build failed with errorlevel %ERRORLEVEL% 1>&2
    goto :error
)
if "%BUILD_ONLY%"=="true" goto :success

:: Move initial build to bootstrap directory

echo.
echo ** Moving bootstrapped MSBuild to the bootstrap folder

:: Kill Roslyn, which may have handles open to files we want
taskkill /F /IM vbcscompiler.exe

set MSBUILDLOGPATH=%~dp0msbuild_move_bootstrap-%HOST%.log
set MSBUILD_ARGS=/verbosity:minimal targets\BootStrapMSbuild.proj /p:Configuration=%BUILD_CONFIGURATION% %RUNTIMETYPE_ARGUMENT%

call "%~dp0build.cmd"
if %ERRORLEVEL% NEQ 0 (
    echo.
    echo Failed to create bootstrap folder with errorlevel %ERRORLEVEL% 1>&2
    goto :error
)
if "%BOOTSTRAP_ONLY%"=="true" goto :success

set MSBUILD_ARGS=

:: Rebuild with bootstrapped msbuild
set MSBUILDLOGPATH=%~dp0msbuild_local_build-%HOST%.log

:: Only CoreCLR requires an override--it should use the host
:: downloaded as part of its NuGet package references, rather
:: than the possibly-stale one from Tools.
if /i "%TARGET%"=="CoreCLR" (
    set RUNTIME_HOST=%~dp0Tools\DotNetCLI\Dotnet.exe
)

if /i "%TARGET%"=="CoreCLR" (
    set MSBUILD_CUSTOM_PATH="%~dp0bin\Bootstrap-NetCore\MSBuild.dll"
) else (
    set MSBUILD_CUSTOM_PATH="%~dp0bin\Bootstrap\15.0\Bin\MSBuild.exe"
)

:: The set of warnings to suppress for now
:: warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.
:: warning MSB3026: Could not copy "XXX" to "XXX". Beginning retry 1 in 1000ms.
:: warning MSB3073: Exec task failure (when set to be a warning) -- needed to keep from failing on dev desktops that don't have C++ tools
:: warning AL1053: The version '1.2.3.4-foo' specified for the 'product version' is not in the normal 'major.minor.build.revision' format
SET _NOWARN=MSB3277;MSB3026;MSB3073;AL1053

echo.
echo ** Rebuilding MSBuild with locally built binaries

call "%~dp0build.cmd" /t:%TARGET_ARG% /p:Configuration=%BUILD_CONFIGURATION% %LOCALIZED_BUILD_ARGUMENT% "/nowarn:%_NOWARN%" /warnaserror

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo Local build failed with error level %ERRORLEVEL% 1>&2
    goto :error
)

:: Only detect source control changes when running in the CI environment
:: Detect if there are any changed files which should fail the build
if DEFINED JENKINS_URL (
    echo Detecting changed files...
    git status
    git --no-pager diff HEAD --word-diff=plain --exit-code
    if ERRORLEVEL 1 (
        echo.
        echo [ERROR] After building, there are changed files.  Please build locally ^(cibuild.cmd --target All^) and include these changes in your pull request. 1>&2
        goto :error
    )
    goto :EOF
)

:success
echo.
echo ++++++++++++++++
echo + SUCCESS  :-) +
echo ++++++++++++++++
echo.
exit /b 0

:usage
echo Options
echo   --scope ^<scope^>                Scope of the build ^(Compile / Test^)
echo   --target ^<target^>              CoreCLR, Full, or All ^(default: Full^)
echo   --host ^<host^>                  CoreCLR or Full ^(default: Full^)
echo   --build-only                     Only build using a downloaded copy of MSBuild but do not bootstrap
echo                                    or build again with those binaries
echo   --bootstrap-only                 Build and bootstrap MSBuild but do not build again with those binaries
echo   --localized-build                Do a localized build
echo   --sync-xlf                       Synchronize xlf files from resx files
exit /b 1

:error
echo.
echo ---------------------------------------
echo - cibuild.cmd FAILED. -
echo ---------------------------------------
exit /b 1

Remove MSBuildRuntimeHost from cibuild.cmd


cd ..
del/q scintilla.zip
zip scintilla.zip scintilla\*.* scintilla\*\*.* -x *.o -x *.obj -x *.dll -x *.lib -x *.res -x *.exp
cd scintilla

cd ..
del/q scintilla.zip
zip scintilla.zip scintilla\*.* scintilla\*\*.* scintilla\*\*\*.* scintilla\*\*\*\*.* scintilla\*\*\*\*\*.* -x *.o -x *.obj -x *.dll -x *.lib -x *.res -x *.exp
cd scintilla

Store OS X files in zips.

Store OS X files in zips.


rem delete existing
rmdir "ZipPackage" /Q /S

rem Create required folders
mkdir "ZipPackage"
mkdir "ZipPackage\FNA"
mkdir "ZipPackage\x64"
mkdir "ZipPackage\x86"

set "CONFIGURATION=Release"

rem Copy output files
copy "Myra\bin\%CONFIGURATION%\Myra.dll" ZipPackage /Y
copy "Myra\bin\%CONFIGURATION%\Myra.pdb" ZipPackage /Y
copy "Myra\bin\FNA\%CONFIGURATION%\Myra.dll" "ZipPackage\FNA\" /Y
copy "Myra\bin\FNA\%CONFIGURATION%\Myra.pdb" "ZipPackage\FNA\" /Y
copy "Myra\bin\%CONFIGURATION%\Newtonsoft.Json.dll" ZipPackage /Y
copy "Myra\bin\%CONFIGURATION%\Newtonsoft.Json.xml" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\log4net.dll" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\log4net.xml" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\log4net.config" ZipPackage /Y
copy "Samples\Myra.Samples.AllWidgets\bin\%CONFIGURATION%\Myra.Samples.AllWidgets.exe" ZipPackage /Y
copy "Samples\Myra.Samples.CustomUIStylesheet\bin\%CONFIGURATION%\Myra.Samples.CustomUIStylesheet.exe" ZipPackage /Y
copy "Samples\Myra.Samples.FormattedTextSample\bin\%CONFIGURATION%\Myra.Samples.FormattedTextSample.exe" ZipPackage /Y
copy "Samples\Myra.Samples.GridContainer\bin\%CONFIGURATION%\Myra.Samples.GridContainer.exe" ZipPackage /Y
copy "Samples\Myra.Samples.Notepad\bin\%CONFIGURATION%\Myra.Samples.Notepad.exe" ZipPackage /Y
copy "Samples\Myra.Samples.SplitPaneContainer\bin\%CONFIGURATION%\Myra.Samples.SplitPaneContainer.exe" ZipPackage /Y
copy "Samples\Myra.Samples.TabControl\bin\%CONFIGURATION%\Myra.Samples.TabControl.exe" ZipPackage /Y
copy "Samples\Myra.Samples.TextBlocks\bin\%CONFIGURATION%\Myra.Samples.TextBlocks.exe" ZipPackage /Y
copy "Samples\Myra.Samples.FantasyMapGenerator\bin\%CONFIGURATION%\Myra.Samples.FantasyMapGenerator.exe" ZipPackage /Y
copy "Samples\Myra.UIEditor.Plugin.LibGDX\bin\%CONFIGURATION%\Myra.UIEditor.Plugin.LibGDX.dll" ZipPackage /Y
copy "Samples\Myra.UIEditor.Plugin.YellowMenuButtons\bin\%CONFIGURATION%\Myra.UIEditor.Plugin.YellowMenuButtons.dll" ZipPackage /Y
copy "Myra.Editor\bin\%CONFIGURATION%\Myra.Editor.dll" ZipPackage /Y
copy "Myra.Editor\bin\%CONFIGURATION%\Myra.Editor.pdb" ZipPackage /Y
copy "Myra.Editor\bin\FNA\%CONFIGURATION%\Myra.Editor.dll" "ZipPackage\FNA\" /Y
copy "Myra.Editor\bin\FNA\%CONFIGURATION%\Myra.Editor.pdb" "ZipPackage\FNA\" /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\Myra.UIEditor.exe" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\Myra.UIEditor.exe.config" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\Myra.UIEditor.pdb" ZipPackage /Y

copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\MonoGame.Framework.dll" "ZipPackage" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\MonoGame.Framework.dll.config" "ZipPackage" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\libSDL2-2.0.so.0" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\libopenal.so.1" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\SDL2.dll" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\soft_oal.dll" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\libSDL2-2.0.so.0" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\libopenal.so.1" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\SDL2.dll" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\soft_oal.dll" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\libSDL2-2.0.0.dylib" "ZipPackage" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\libopenal.1.dylib" "ZipPackage" /Y

rem delete existing
rmdir "ZipPackage" /Q /S

rem Create required folders
mkdir "ZipPackage"
mkdir "ZipPackage\FNA"
mkdir "ZipPackage\x64"
mkdir "ZipPackage\x86"

set "CONFIGURATION=Release"

rem Copy output files
copy "Myra\bin\%CONFIGURATION%\Myra.dll" ZipPackage /Y
copy "Myra\bin\%CONFIGURATION%\Myra.pdb" ZipPackage /Y
copy "Myra\bin\FNA\%CONFIGURATION%\Myra.dll" "ZipPackage\FNA\" /Y
copy "Myra\bin\FNA\%CONFIGURATION%\Myra.pdb" "ZipPackage\FNA\" /Y
copy "Myra\bin\%CONFIGURATION%\Newtonsoft.Json.dll" ZipPackage /Y
copy "Myra\bin\%CONFIGURATION%\Newtonsoft.Json.xml" ZipPackage /Y
copy "Samples\Myra.Samples.AllWidgets\bin\%CONFIGURATION%\Myra.Samples.AllWidgets.exe" ZipPackage /Y
copy "Samples\Myra.Samples.CustomUIStylesheet\bin\%CONFIGURATION%\Myra.Samples.CustomUIStylesheet.exe" ZipPackage /Y
copy "Samples\Myra.Samples.FormattedTextSample\bin\%CONFIGURATION%\Myra.Samples.FormattedTextSample.exe" ZipPackage /Y
copy "Samples\Myra.Samples.GridContainer\bin\%CONFIGURATION%\Myra.Samples.GridContainer.exe" ZipPackage /Y
copy "Samples\Myra.Samples.Notepad\bin\%CONFIGURATION%\Myra.Samples.Notepad.exe" ZipPackage /Y
copy "Samples\Myra.Samples.SplitPaneContainer\bin\%CONFIGURATION%\Myra.Samples.SplitPaneContainer.exe" ZipPackage /Y
copy "Samples\Myra.Samples.TabControl\bin\%CONFIGURATION%\Myra.Samples.TabControl.exe" ZipPackage /Y
copy "Samples\Myra.Samples.TextBlocks\bin\%CONFIGURATION%\Myra.Samples.TextBlocks.exe" ZipPackage /Y
copy "Samples\Myra.Samples.FantasyMapGenerator\bin\%CONFIGURATION%\Myra.Samples.FantasyMapGenerator.exe" ZipPackage /Y
copy "Samples\Myra.UIEditor.Plugin.LibGDX\bin\%CONFIGURATION%\Myra.UIEditor.Plugin.LibGDX.dll" ZipPackage /Y
copy "Samples\Myra.UIEditor.Plugin.YellowMenuButtons\bin\%CONFIGURATION%\Myra.UIEditor.Plugin.YellowMenuButtons.dll" ZipPackage /Y
copy "Myra.Editor\bin\%CONFIGURATION%\Myra.Editor.dll" ZipPackage /Y
copy "Myra.Editor\bin\%CONFIGURATION%\Myra.Editor.pdb" ZipPackage /Y
copy "Myra.Editor\bin\FNA\%CONFIGURATION%\Myra.Editor.dll" "ZipPackage\FNA\" /Y
copy "Myra.Editor\bin\FNA\%CONFIGURATION%\Myra.Editor.pdb" "ZipPackage\FNA\" /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\Myra.UIEditor.exe" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\Myra.UIEditor.exe.config" ZipPackage /Y
copy "Myra.UIEditor\bin\%CONFIGURATION%\Myra.UIEditor.pdb" ZipPackage /Y

copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\MonoGame.Framework.dll" "ZipPackage" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\MonoGame.Framework.dll.config" "ZipPackage" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\libSDL2-2.0.so.0" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\libopenal.so.1" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\SDL2.dll" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x64\soft_oal.dll" "ZipPackage\x64" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\libSDL2-2.0.so.0" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\libopenal.so.1" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\SDL2.dll" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\x86\soft_oal.dll" "ZipPackage\x86" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\libSDL2-2.0.0.dylib" "ZipPackage" /Y
copy "Myra-Dependencies\MonoGame.Framework.DesktopGL\libopenal.1.dylib" "ZipPackage" /Y

Build fix

Build fix


@echo off
REM Helper script to build and run IoTivity on Windows
SETLOCAL ENABLEDELAYEDEXPANSION

if [%1]==[] goto USAGE

set IOTIVITY_DIR=%~dp0
set HOME=%USERPROFILE%

IF "%1" == "msys" (
  set BUILD_MSYS="YES"
  SHIFT
) ELSE (
  set BUILD_MSYS=
)

set CURRENT_ARG=%1
set SECOND_ARG=%2
set DEBUG=

if "!SECOND_ARG!"=="debug" (
  set DEBUG="%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\cdb.exe" -2 -c "g"
)

REM We need to append the "PATH" so the octbstack.dll can be found by executables
IF "%BUILD_MSYS%" == "" (
  set BUILD_DIR=out\windows\amd64\debug
  set PATH=!PATH!;!IOTIVITY_DIR!!BUILD_DIR!;
) ELSE (
  set BUILD_DIR=out\msys_nt\x86_64\debug
  set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
)

REM *** BUILD OPTIONS ***
set TARGET_OS=windows
set TARGET_ARCH=amd64
set SECURED=1
set TEST=1
set LOGGING=OFF
set WITH_RD=1
set ROUTING=EP
set WITH_UPSTREAM_LIBCOAP=1

set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=0 WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=0 BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% WITH_RD=%WITH_RD% ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%

REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
IF NOT "%MSVC_VERSION%" == "" (
  set BUILD_OPTIONS=%BUILD_OPTIONS% MSVC_VERSION=%MSVC_VERSION%
)

REM *** BUILD OPTIONS ***

if "!CURRENT_ARG!"=="server" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserver.exe
) else if "!CURRENT_ARG!"=="client" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclient.exe
) else if "!CURRENT_ARG!"=="serverhq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserverHQ.exe
) else if "!CURRENT_ARG!"=="clienthq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclientHQ.exe
)else if "!CURRENT_ARG!"=="mediaclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaclient.exe
) else if "!CURRENT_ARG!"=="mediaserver" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaserver.exe
) else if "!CURRENT_ARG!"=="winuiclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% winuiclient.exe
) else if "!CURRENT_ARG!"=="occlient" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
) else if "!CURRENT_ARG!"=="ocserver" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% ocserverbasicops.exe
) else if "!CURRENT_ARG!"=="provclient" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% provisioningclient.exe
) else if "!CURRENT_ARG!"=="justworks" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% sampleserver_justworks.exe
) else if "!CURRENT_ARG!"=="test" (
  %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\ocrandom\test\randomtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_malloc\test\malloctests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_string\test\stringtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_time\test\timetests.exe
  %DEBUG% %BUILD_DIR%\resource\unittests\unittests.exe
) else if "!CURRENT_ARG!"=="build" (
  echo Starting IoTivity build with these options:
  echo   TARGET_OS=%TARGET_OS%
  echo   TARGET_ARCH=%TARGET_ARCH%
  echo   SECURED=%SECURED%
  echo   TEST=%TEST%
  echo   LOGGING=%LOGGING%
  echo   WITH_RD=%WITH_RD%
  echo   ROUTING=%ROUTING%
  echo   WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
  echo.scons VERBOSE=1 %BUILD_OPTIONS%
  scons VERBOSE=1 %BUILD_OPTIONS%
) else if "!CURRENT_ARG!"=="clean" (
  scons VERBOSE=1 %BUILD_OPTIONS% -c clean
  rd /s /q out
  del .sconsign.dblite
  del extlibs\gtest\gtest*.lib
  del extlibs\gtest\gtest-1.7.0\src\gtest*.obj
  erase /s *.obj
  erase resource\c_common\iotivity_config.h
  erase extlibs\libcoap\coap.lib
  erase extlibs\libcoap\libcoap\include\coap\coap_config.h
) else if "!CURRENT_ARG!"=="cleangtest" (
  rd /s /q extlibs\gtest\gtest-1.7.0
  del extlibs\gtest\gtest-1.7.0.zip
) else (
    echo %0 - Script requires a valid argument!
    goto :EOF
)

cd %IOTIVITY_DIR%

echo Done!

goto EOF

:USAGE
echo %0 - Helper to build/test iotivity.  Requires an argument.
echo Installation: Drop this into your iotivity root directory to use it.
echo.
echo. Usage examples:
echo   Launch SimpleClient with debugger:
echo      %0 client debug
echo.
echo   Launch SimpleServer:
echo      %0 server
echo.
echo   Launch WinUIClient built in msys:
echo      %0 msys winuiclient
echo.
echo   Build:
echo      %0 build
echo.
echo   Run all tests:
echo      %0 test
echo.
echo   Clean:
echo      %0 clean

:EOF

@echo off
REM Helper script to build and run IoTivity on Windows
SETLOCAL ENABLEDELAYEDEXPANSION

if [%1]==[] goto USAGE

set IOTIVITY_DIR=%~dp0
set HOME=%USERPROFILE%

IF "%1" == "msys" (
  set BUILD_MSYS="YES"
  SHIFT
) ELSE (
  set BUILD_MSYS=
)

REM *** Default BUILD OPTIONS ***
set TARGET_OS=windows

if "%TARGET_ARCH%" == "" (
  set TARGET_ARCH=amd64
)

if "%TEST%" == "" (
  set TEST=1
)

if "%LOGGING%" == "" (
  set LOGGING=0
)

if "%RELEASE%" == "" (
  set RELEASE=0
)

set SECURED=1
set WITH_RD=1
set ROUTING=EP
set WITH_UPSTREAM_LIBCOAP=1

set RUN_ARG=%1
SHIFT

set DEBUG=

:processArgs
IF NOT "%1"=="" (
  IF "%1"=="-arch" (
    SET TARGET_ARCH=%2
    SHIFT
  )
  IF "%1"=="-noTest" (
    SET TEST=0
  )
  IF "%1"=="-logging" (
    SET LOGGING=1
  )
  IF "%1"=="-debugger" (
    set DEBUG="%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\cdb.exe" -2 -c "g"
  )
  IF "%1"=="-release" (
    SET RELEASE=1
  )

  SHIFT
  GOTO :processArgs
)

REM We need to append the "PATH" so the octbstack.dll can be found by executables
IF "%BUILD_MSYS%" == "" (
  set BUILD_DIR=out\windows\%TARGET_ARCH%\debug
  set PATH=!PATH!;!IOTIVITY_DIR!!BUILD_DIR!;
) ELSE (
  set BUILD_DIR=out\msys_nt\x86_64\debug
  set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
)

set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=0 BUILD_SAMPLE=ON LOGGING=%LOGGING% TEST=%TEST% WITH_RD=%WITH_RD% ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%

REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
IF NOT "%MSVC_VERSION%" == "" (
  set BUILD_OPTIONS=%BUILD_OPTIONS% MSVC_VERSION=%MSVC_VERSION%
)

REM *** BUILD OPTIONS ***

if "!RUN_ARG!"=="server" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserver.exe
) else if "!RUN_ARG!"=="client" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclient.exe
) else if "!RUN_ARG!"=="serverhq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleserverHQ.exe
) else if "!RUN_ARG!"=="clienthq" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% simpleclientHQ.exe
)else if "!RUN_ARG!"=="mediaclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaclient.exe
) else if "!RUN_ARG!"=="mediaserver" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% mediaserver.exe
) else if "!RUN_ARG!"=="winuiclient" (
  cd %BUILD_DIR%\resource\examples
  %DEBUG% winuiclient.exe
) else if "!RUN_ARG!"=="occlient" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% occlientbasicops.exe -u 0 -t 3 -c 1
) else if "!RUN_ARG!"=="ocserver" (
  cd %BUILD_DIR%\resource\csdk\stack\samples\linux\SimpleClientServer
  %DEBUG% ocserverbasicops.exe
) else if "!RUN_ARG!"=="provclient" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% provisioningclient.exe
) else if "!RUN_ARG!"=="justworks" (
  cd %BUILD_DIR%\resource\csdk\security\provisioning\sample
  %DEBUG% sampleserver_justworks.exe
) else if "!RUN_ARG!"=="test" (
  %DEBUG% %BUILD_DIR%\resource\csdk\connectivity\test\catests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\stacktests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\stack\test\cbortests.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\csdk\security\provisioning\unittest\unittest.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\ocrandom\test\randomtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_malloc\test\malloctests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_string\test\stringtests.exe
  %DEBUG% %BUILD_DIR%\resource\c_common\oic_time\test\timetests.exe
  %DEBUG% %BUILD_DIR%\resource\unittests\unittests.exe
) else if "!RUN_ARG!"=="build" (
  echo Starting IoTivity build with these options:
  echo   TARGET_OS=%TARGET_OS%
  echo   TARGET_ARCH=%TARGET_ARCH%
  echo   SECURED=%SECURED%
  echo   RELEASE=%RELEASE%
  echo   TEST=%TEST%
  echo   LOGGING=%LOGGING%
  echo   WITH_RD=%WITH_RD%
  echo   ROUTING=%ROUTING%
  echo   WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP%
  echo.scons VERBOSE=1 %BUILD_OPTIONS%
  scons VERBOSE=1 %BUILD_OPTIONS%
) else if "!RUN_ARG!"=="clean" (
  scons VERBOSE=1 %BUILD_OPTIONS% -c clean
  rd /s /q out
  del .sconsign.dblite
  del extlibs\gtest\gtest*.lib
  del extlibs\gtest\gtest-1.7.0\src\gtest*.obj
  erase /s *.obj
  erase resource\c_common\iotivity_config.h
  erase extlibs\libcoap\coap.lib
  erase extlibs\libcoap\libcoap\include\coap\coap_config.h
) else if "!RUN_ARG!"=="cleangtest" (
  rd /s /q extlibs\gtest\gtest-1.7.0
  del extlibs\gtest\gtest-1.7.0.zip
) else (
    echo %0 - Script requires a valid argument!
    goto :EOF
)

cd %IOTIVITY_DIR%

echo Done!

goto EOF

:USAGE
echo %0 - Helper to build/test iotivity.  Requires an argument.
echo Installation: Drop this into your iotivity root directory to use it.
echo.
echo. Default buidl settings are: debug binaries run unittests and no logging
echo.
echo. Default build parameters can be overridden using the following arguments
echo.
echo   -arch [x86 | amd64]    - Build either amd64 or x86 architecture binaries
echo.
echo   -noTest                - Don't run the unittests after building the binaries
echo.
echo   -logging               - Enable logging while building the binaries
echo.
echo   -debugger              - Debug the requested application
echo.
echo   -release               - Build release binaries
echo.
echo. Usage examples:
echo   Launch SimpleClient with debugger:
echo      %0 client -debugger
echo.
echo   Launch SimpleServer:
echo      %0 server
echo.
echo   Launch WinUIClient built in msys:
echo      %0 msys winuiclient
echo.
echo   Build amd64 debug binaries and run unit tests:
echo      %0 build
echo.
echo   Build amd64 release binaries w/o running tests:
echo      %0 build -arch amd64 -noTest -release
echo.
echo   Build x86 debug binaries and run unit tests:
echo      %0 build -arch x86
echo.
echo   Build amd64 release binaries with logging enabled:
echo      %0 build -arch amd64 -release -logging
echo.
echo   Run all tests:
echo      %0 test
echo.
echo   Clean:
echo      %0 clean

:EOF

Update run.bat to allow argument overrides

Add arguments to the run.bat cmdline to enable building
for both x86 and amd64 architecture, turning off tests,
enabling logging and building release binaries.

Change-Id: Ic381d258bf8465399d94319a93499365db7f8f24
Signed-off-by: Mike Fenelon <765c1ea1ad8b7b919b9c046cb20b518277e493ca@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13355
Tested-by: jenkins-iotivity <09cb29e8a2b473a2c978382eec13ee06fa017bda@opendaylight.org>
Reviewed-by: David Antler <847c7e7639e695cd03ee85957de4a1178f752d1b@intel.com>
Reviewed-by: Dave Thaler <8a98d0850f57b73c42d096f8f8b11e2d5522d554@microsoft.com>


"C:\Program Files\Java\jdk1.6.0_29\bin\java" -cp bin sg.edu.nus.iss.jcalc.JCalc

"C:\Program Files\Java\jdk1.6.0_45\bin\java" -cp bin sg.edu.nus.iss.jcalc.JCalc

change java version

change java version


del nupkgs\*.nupkg

dotnet restore

dotnet pack src\Zoxive.HttpLoadTesting.Client\Zoxive.HttpLoadTesting.Client.csproj --configuration release --output ..\..\nupkgs

c:\Utilities\nuget.exe push nupkgs\*.nupkg -source "https://api.nuget.org/v3/index.json"

del nupkgs\*.nupkg

dotnet restore

dotnet pack src\Zoxive.HttpLoadTesting.Client\Zoxive.HttpLoadTesting.Client.csproj --configuration release --output nupkgs

c:\Utilities\nuget.exe push nupkgs\*.nupkg -source "https://api.nuget.org/v3/index.json"

fix create packages

fix create packages


@echo off
setlocal enableDelayedExpansion

for /F %%f in ('dir /B/D ..\src\gamemodes') do (
  set FILENAME=..\src\gamemodes\%%f
  start "" compiler/pawncc.exe "../src/gamemodes/%%f" -o"src\gamemodes\mode.amx" -i"./src/includes" "-;" "-("
)

@echo off
setlocal enableDelayedExpansion

@echo on
for /F %%G in ('dir /B/D ..\src\gamemodes\*.pwn') do (
    "compiler\pawncc.exe" "..\src\gamemodes\%%G" -o"..\src\gamemodes\%%~nG.amx" -i"..\src\includes" "-;" "-("
)

Fix compile.bat

Fix compile.bat


CALL npm install
CALL bower install
CALL npm install grunt
CALL npm install -g grunt-cli
CALL grunt release

Add script install.bat for front install


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

set version=
if not "%BuildCounter%" == "" (
   set version=--version-suffix ci-%BuildCounter%
)

REM (optional) build.bat is in the root of our repo, cd to the correct folder where sources/projects are
echo %cd%

REM Restore
call dotnet restore
if not "%errorlevel%"=="0" goto failure

REM Build
REM - Option 1: Run dotnet build for every source folder in the project
REM   e.g. call dotnet build <path> --configuration %config%
REM - Option 2: Let msbuild handle things and build the solution
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" Nugety.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
REM call dotnet build --configuration %config%
if not "%errorlevel%"=="0" goto failure

REM Unit tests
cd Nugety\src\Tests\Nugety.Tests
call dotnet test  --configuration %config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

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

set version=
if not "%BuildCounter%" == "" (
   set version=--version-suffix ci-%BuildCounter%
)

REM (optional) build.bat is in the root of our repo, cd to the correct folder where sources/projects are
echo %cd%

REM Restore
call dotnet restore
if not "%errorlevel%"=="0" goto failure

REM Build
REM - Option 1: Run dotnet build for every source folder in the project
REM   e.g. call dotnet build <path> --configuration %config%
REM - Option 2: Let msbuild handle things and build the solution
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" Nugety.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
REM call dotnet build --configuration %config%
if not "%errorlevel%"=="0" goto failure

REM Unit tests
rem cd Nugety\src\Tests\Nugety.Tests
rem call dotnet test  --configuration %config%
rem if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

Remove unit tests from build. bat

Remove unit tests from build. bat


@echo off

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
if "%1" == "1" (
	set release_mode=1
) else if "%1" == "release" (
	set release_mode=1
) else (
	set release_mode=1
)

set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DLLVM_BACKEND_SUPPORT

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
	set compiler_defines=%compiler_defines% -DNO_ARRAY_BOUNDS_CHECK
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4189 ^
	-wd4201 -wd4204 ^
	-wd4456 -wd4457 -wd4480 ^
	-wd4512

set compiler_includes=
set libs= ^
	kernel32.lib ^
	bin\llvm\windows\LLVM-C.lib

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

rem cl %compiler_settings% "src\main.cpp" ^
rem 	/link %linker_settings% -OUT:%exe_name% ^
rem 	&& odin run examples/demo/demo.odin -llvm-api -vet
rem odin build examples/wasm.odin -llvm-api -target:wasm32 -keep-temp-files
rem odin run generate-wasm.odin
rem odin build examples/threading -llvm-api -target:darwin_amd64
odin run examples/threading -llvm-api

if %errorlevel% neq 0 (
	goto end_of_build
)

del *.obj > NUL 2> NUL

:end_of_build

@echo off

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
if "%1" == "1" (
	set release_mode=1
) else if "%1" == "release" (
	set release_mode=1
) else (
	set release_mode=0
)

set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DLLVM_BACKEND_SUPPORT

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
	set compiler_defines=%compiler_defines% -DNO_ARRAY_BOUNDS_CHECK
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4189 ^
	-wd4201 -wd4204 ^
	-wd4456 -wd4457 -wd4480 ^
	-wd4512

set compiler_includes=
set libs= ^
	kernel32.lib ^
	bin\llvm\windows\LLVM-C.lib

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

cl %compiler_settings% "src\main.cpp" ^
	/link %linker_settings% -OUT:%exe_name% ^
	&& odin run examples/demo/demo.odin
if %errorlevel% neq 0 (
	goto end_of_build
)

del *.obj > NUL 2> NUL

:end_of_build

Revert build.bat

Revert build.bat


@echo off

if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Java environment not found. Please set
echo your JAVA_HOME environment variable to
echo the home of you JDK.
goto :eof

:gotJavaHome
set ANT_HOME=%EXIST_HOME%\tools
set _LIBJARS=%CLASSPATH%;%ANT_HOME%\lib\ant-launcher.jar;%ANT_HOME%\lib\junit.jar;%JAVA_HOME%\lib\tools.jar

set JAVA_ENDORSED_DIRS=%EXIST_HOME%\lib\endorsed
set JAVA_OPTS=-Xms32000k -Xmx256000k -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS% -Dant.home=%ANT_HOME%

echo eXist Build
echo -------------------

echo Building with classpath %_LIBJARS%

echo Starting Ant...

java %JAVA_OPTS% -classpath %_LIBJARS% org.apache.tools.ant.launch.Launcher %1 %2 %3 %4 %5

@echo off

if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Java environment not found. Please set
echo your JAVA_HOME environment variable to
echo the home of you JDK.
goto :eof

:gotJavaHome
if not "%EXIST_HOME%" == "" goto gotExistHome
set EXIST_HOME=%CD%

:gotExistHome
set ANT_HOME=%EXIST_HOME%\tools
set _LIBJARS=%CLASSPATH%;%ANT_HOME%\lib\ant-launcher.jar;%ANT_HOME%\lib\junit.jar;%JAVA_HOME%\lib\tools.jar

set JAVA_ENDORSED_DIRS=%EXIST_HOME%\lib\endorsed
set JAVA_OPTS=-Xms64M -Xmx512M -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dant.home="%ANT_HOME%"

echo eXist Build
echo -------------------
echo JAVA_HOME=%JAVA_HOME%
echo EXIST_HOME=%EXIST_HOME%
echo _LIBJARS=%_LIBJARS%

echo Starting Ant...

"%JAVA_HOME%\bin\java" %JAVA_OPTS% -classpath "%_LIBJARS%" org.apache.tools.ant.launch.Launcher %1 %2 %3 %4 %5

XP: Correct java is used now (selected by %JAVA_HOME%) and EXIST_HOME is set now (if not set before)

svn path=/trunk/eXist-1.0/; revision=1308


@echo off
cd %~dp0

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

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

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

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

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

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

@echo off
cd %~dp0

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

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

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

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

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

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

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


cd src
msbuild MarkdownEdit.sln /t:Rebuild "/p:configuration=release;platform=Any CPU"
cd ..

cd src
msbuild MarkdownEdit.sln /p:configuration=release
cd ..

fix build cmd

fix build cmd


msbuild SharpDX.sln /t:Clean /m /p:Configuration=Release;Platform="Any CPU"

REM Build SharpDX.csproj first not in parallel so we don't have to worry about file locking issues
REM with shared files between the 4 different generators.
msbuild Source/SharpDX/SharpDX.csproj /restore /t:Build /p:Configuration=Release

msbuild SharpDX.sln /restore /t:Build;Pack /p:Configuration=Release;Platform="Any CPU" /m

msbuild SharpDX.sln /t:Clean /m /p:Configuration=Release;Platform="Any CPU"

msbuild SharpDX.sln /restore /t:Build;Pack /p:Configuration=Release;Platform="Any CPU" /m

Simplify build script.

Simplify build script.


@ECHO OFF

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

"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" /nologo /m /v:m /nr:false /flp:verbosity=normal %*

@ECHO OFF

if not exist bin mkdir bin

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

"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" /nologo /m /v:m /nr:false /flp:verbosity=normal;LogFile=bin\msbuild.log %*

Move msbuild.log to bin folder

Move msbuild.log to bin folder

All our build outputs should should go under bin. This makes CI drops
a tiny bit easier.


@echo off

for /d %%d in ("*") do rmdir /s /q "%%d\bin"
for /d %%d in ("*") do rmdir /s /q "%%d\obj"

rmdir /s /q "packages"
rmdir /s /q "TestResults"

@echo off

for /d %%d in ("*") do rmdir /s /q "%%d\bin"
for /d %%d in ("*") do rmdir /s /q "%%d\obj"

del /q *.db
del /q *.log

rmdir /s /q "packages"
rmdir /s /q "TestResults"

clean bitcoinj test run output files

clean bitcoinj test run output files


@echo off
del *.sdf
del /s *.aps
del /a:h *.suo
rmdir /s /q .vs
rmdir /s /q ipch
rmdir /s /q x64
rmdir /s /q Debug
rmdir /s /q Release
rmdir /s /q MemoryMon\x64
rmdir /s /q MemoryMon\Debug
rmdir /s /q MemoryMon\Release
cd HyperPlatform
clean.bat

@echo off
del *.sdf
del *.VC.db
del /s *.aps
del /a:h *.suo
rmdir /s /q .vs
rmdir /s /q ipch
rmdir /s /q x64
rmdir /s /q Debug
rmdir /s /q Release
rmdir /s /q MemoryMon\x64
rmdir /s /q MemoryMon\Debug
rmdir /s /q MemoryMon\Release
cd HyperPlatform
clean.bat

update clean.bat

update clean.bat


@echo off
echo CPU Time
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%
guetzli.exe big.jpg big.cpu.out.jpg
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%

echo OpenCL Time
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%
guetzli.exe --opencl big.jpg big.gpu.out.jpg
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%

echo CUDA Time
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%
guetzli.exe --cuda big.jpg big.gpu.out.jpg
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%

@echo off
echo CPU Time
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%
guetzli.exe big.jpg big.cout.jpg
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%

echo OpenCL Time
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%
guetzli.exe --opencl big.jpg big.opencl.jpg
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%

echo CUDA Time
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%
guetzli.exe --cuda big.jpg big.cuda.jpg
set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2%
echo %CURRENT_TIME%

fix test batch

fix test batch


@ECHO OFF

REM Windows version of icky compile script but it'll work. For now.

javac -classpath .;lib/c3p0-0.9.0.2.jar;lib/msnm.jar;lib/jcfd.jar;lib/jazzy-core.jar;lib/bsh-2.0b4.jar;lib/mysql-connector-java-3.1.10-bin.jar;lib/pircbot.jar;lib/js-rhino-1.6r2.jar org/uwcs/choob/*.java org/uwcs/choob/support/*.java org/uwcs/choob/modules/*.java org/uwcs/choob/plugins/*.java org/uwcs/choob/support/events/*.java %1 %2 %3

@ECHO OFF

REM Windows version of icky compile script but it'll work. For now.

REM This checks which file is newer. It's not nice, but it'll work.
CALL :compare-file-dates misc\HorriblePerlScript.java org\uwcs\choob\Choob.java
IF "%CompareFileDates%"=="1" (
	ECHO Rebuild event system...
	javac -d misc misc/HorriblePerlScript.java
	java -cp misc org.uwcs.choob.misc.HorriblePerlScript
)

javac -classpath .;lib/c3p0-0.9.0.2.jar;lib/msnm.jar;lib/jcfd.jar;lib/jazzy-core.jar;lib/bsh-2.0b4.jar;lib/mysql-connector-java-3.1.10-bin.jar;lib/pircbot.jar;lib/js-rhino-1.6r2.jar org/uwcs/choob/*.java org/uwcs/choob/support/*.java org/uwcs/choob/modules/*.java org/uwcs/choob/plugins/*.java org/uwcs/choob/support/events/*.java %1 %2 %3
GOTO :EOF

:compare-file-dates
REM Results (in %CompareFiles%):
REM   1 First file is newer.
REM   2 Second file is newer.

REM Copy files to the same location, so we can use dir /o:d to sort by date.
COPY %1 cmpf.1 >nul
COPY %2 cmpf.2 >nul

REM Compare both ways, since if they have the *same* time, the resulting dir
REM output will be the order we listed the filenames.
SET CompareFileDates1=0
SET CompareFileDates2=0
FOR /F "usebackq delims=. tokens=2" %%f IN (`DIR cmpf.1 cmpf.2 /o:d /b`) DO (
	SET CompareFileDates1=%%f
)
FOR /F "usebackq delims=. tokens=2" %%f IN (`DIR cmpf.2 cmpf.1 /o:d /b`) DO (
	SET CompareFileDates2=%%f
)
REM If the order affected the answer, they are the same date.
SET CompareFileDates=%CompareFileDates1%
IF NOT "%CompareFileDates1%"=="%CompareFileDates2%" SET CompareFileDates=0

REM Clean up, and return.
DEL cmpf.1 cmpf.2
SET CompareFileDates1=
SET CompareFileDates2=
GOTO :EOF

Update compile.bat to check the date of Choob.java and HorriblePerlScript.java, and rebuild the event system if needed. Involves implementing generic file-date-comparison in CMD. Woo.


::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
set autoRestVersion=1.0.0-Nightly20161218
if  "%1" == "" (
    set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/compositeNetworkClient.json"
) else (
    set specFile="%1"
)
set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%
call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Network %autoRestVersion% %generateFolder%
l

::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
set autoRestVersion=1.0.0-Nightly20161220
if  "%1" == "" (
    set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/compositeNetworkClient.json"
) else (
    set specFile="%1"
)
set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%
call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Network %autoRestVersion% %generateFolder%

update nightly version

update nightly version


@ECHO OFF

REM This script builds and signs the Windows packages on Gitlab

ECHO "Start Time"
TIME /T

REM List currently used cygwin and target folders for debugging / maintenance purposes

ECHO "Currently used cygwin folders"
DIR C:\ci\cygwin*
ECHO "Currently used target folders"
DIR C:\ci\coq*
ECHO "Root folders"
DIR C:\

if %ARCH% == 32 (
  SET ARCHLONG=i686
  SET SETUP=setup-x86.exe
)

if %ARCH% == 64 (
  SET ARCHLONG=x86_64
  SET SETUP=setup-x86_64.exe
)

SET CYGROOT=C:\ci\cygwin%ARCH%
SET DESTCOQ=C:\ci\coq%ARCH%

CALL :MakeUniqueFolder %CYGROOT% CYGROOT
CALL :MakeUniqueFolder %DESTCOQ% DESTCOQ

powershell -Command "(New-Object Net.WebClient).DownloadFile('http://www.cygwin.com/%SETUP%', '%SETUP%')"
SET CYGCACHE=%CYGROOT%\var\cache\setup
SET CI_PROJECT_DIR_MFMT=%CI_PROJECT_DIR:\=/%
SET CI_PROJECT_DIR_CFMT=%CI_PROJECT_DIR_MFMT:C:/=/cygdrive/c/%
SET COQREGTESTING=Y
SET PATH=%PATH%;C:\Program Files\7-Zip\;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

IF "%WINDOWS%" == "enabled_all_addons" (
  SET EXTRA_ADDONS=^
    -addon=bignums ^
    -addon=equations ^
    -addon=ltac2 ^
    -addon=mtac2 ^
    -addon=mathcomp ^
    -addon=menhir ^
    -addon=menhirlib ^
    -addon=compcert ^
    -addon=extlib ^
    -addon=quickchick ^
    -addon=coquelicot
  REM addons with build issues
  REM -addon=vst ^
  REM -addon=aactactics ^
) ELSE (
  SET "EXTRA_ADDONS= "
)

call %CI_PROJECT_DIR%\dev\build\windows\MakeCoq_MinGW.bat -threads=1 ^
  -arch=%ARCH% -installer=Y -coqver=%CI_PROJECT_DIR_CFMT% ^
  -destcyg=%CYGROOT% -destcoq=%DESTCOQ% -cygcache=%CYGCACHE% ^
  %EXTRA_ADDONS% ^
  -make=N ^
  -setup %CI_PROJECT_DIR%\%SETUP% || GOTO ErrorCopyLogFilesAndExit

ECHO "Start Artifact Creation"
TIME /T

mkdir artifacts

CALL :CopyLogFiles

copy "%CYGROOT%\build\coq-local\dev\nsis\*.exe" artifacts || GOTO ErrorExit
REM The open source archive is only required for release builds
IF DEFINED WIN_CERTIFICATE_PATH (
  7z a artifacts\coq-opensource-archive-windows-%ARCHLONG%.zip %CYGROOT%\build\tarballs\* || GOTO ErrorExit
) ELSE (
  REM In non release builds, create a dummy file
  ECHO "This is not a release build - open source archive not created / uploaded" > artifacts\coq-opensource-info.txt
)

REM DO NOT echo the signing command below, as this would leak secrets in the logs
IF DEFINED WIN_CERTIFICATE_PATH (
  IF DEFINED WIN_CERTIFICATE_PASSWORD (
    ECHO Signing package
    @signtool sign /f %WIN_CERTIFICATE_PATH% /p %WIN_CERTIFICATE_PASSWORD% dev\nsis\*.exe
    signtool verify /pa dev\nsis\*.exe
  )
)

ECHO "Finished Artifact Creation"
TIME /T

CALL :CleanupFolders

ECHO "Finished Cleanup"
TIME /T

GOTO :EOF

:CopyLogFiles
  ECHO Copy log files for artifact upload
  MKDIR artifacts\buildlogs
  COPY %CYGROOT%\build\buildlogs\* artifacts\buildlogs
  MKDIR artifacts\filelists
  COPY %CYGROOT%\build\filelists\* artifacts\filelists
  MKDIR artifacts\flagfiles
  COPY %CYGROOT%\build\flagfiles\* artifacts\flagfiles
  GOTO :EOF

:CleanupFolders
  ECHO "Cleaning %CYGROOT%"
  RMDIR /S /Q "%CYGROOT%"
  ECHO "Cleaning %DESTCOQ%"
  RMDIR /S /Q "%DESTCOQ%"
  GOTO :EOF

:MakeUniqueFolder
  REM Create a uniquely named folder
  REM This script is safe because folder creation is atomic - either we create it or fail
  REM %1 = base path or directory (_%RANDOM%_%RANDOM% is appended to this)
  REM %2 = name of the variable which receives the unique folder name
  SET "UNIQUENAME=%1_%RANDOM%_%RANDOM%"
  MKDIR "%UNIQUENAME%"
  IF ERRORLEVEL 1 GOTO :MakeUniqueFolder
  SET "%2=%UNIQUENAME%"
  GOTO :EOF

:ErrorCopyLogFilesAndExit
  CALL :CopyLogFiles
  REM fall through

:ErrorExit
  CALL :CleanupFolders
  ECHO ERROR %0 failed
  EXIT /b 1

@ECHO OFF

REM This script builds and signs the Windows packages on Gitlab

ECHO "Start Time"
TIME /T

REM List currently used cygwin and target folders for debugging / maintenance purposes

ECHO "Currently used cygwin folders"
DIR C:\ci\cygwin*
ECHO "Currently used target folders"
DIR C:\ci\coq*
ECHO "Root folders"
DIR C:\

if %ARCH% == 32 (
  SET ARCHLONG=i686
  SET SETUP=setup-x86.exe
)

if %ARCH% == 64 (
  SET ARCHLONG=x86_64
  SET SETUP=setup-x86_64.exe
)

SET CYGROOT=C:\ci\cygwin%ARCH%
SET DESTCOQ=C:\ci\coq%ARCH%

CALL :MakeUniqueFolder %CYGROOT% CYGROOT
CALL :MakeUniqueFolder %DESTCOQ% DESTCOQ

powershell -Command "(New-Object Net.WebClient).DownloadFile('http://www.cygwin.com/%SETUP%', '%SETUP%')"
SET CYGCACHE=%CYGROOT%\var\cache\setup
SET CI_PROJECT_DIR_MFMT=%CI_PROJECT_DIR:\=/%
SET CI_PROJECT_DIR_CFMT=%CI_PROJECT_DIR_MFMT:C:/=/cygdrive/c/%
SET COQREGTESTING=Y
SET PATH=%PATH%;C:\Program Files\7-Zip\;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

IF "%WINDOWS%" == "enabled_all_addons" (
  SET EXTRA_ADDONS=^
    -addon=bignums ^
    -addon=equations ^
    -addon=ltac2 ^
    -addon=mtac2 ^
    -addon=mathcomp ^
    -addon=menhir ^
    -addon=menhirlib ^
    -addon=compcert ^
    -addon=extlib ^
    -addon=quickchick ^
    -addon=coquelicot ^
    -addon=vst ^
    -addon=aactactics
) ELSE (
  SET "EXTRA_ADDONS= "
)

call %CI_PROJECT_DIR%\dev\build\windows\MakeCoq_MinGW.bat -threads=1 ^
  -arch=%ARCH% -installer=Y -coqver=%CI_PROJECT_DIR_CFMT% ^
  -destcyg=%CYGROOT% -destcoq=%DESTCOQ% -cygcache=%CYGCACHE% ^
  %EXTRA_ADDONS% ^
  -make=N ^
  -setup %CI_PROJECT_DIR%\%SETUP% || GOTO ErrorCopyLogFilesAndExit

ECHO "Start Artifact Creation"
TIME /T

mkdir artifacts

CALL :CopyLogFiles

copy "%CYGROOT%\build\coq-local\dev\nsis\*.exe" artifacts || GOTO ErrorExit
REM The open source archive is only required for release builds
IF DEFINED WIN_CERTIFICATE_PATH (
  7z a artifacts\coq-opensource-archive-windows-%ARCHLONG%.zip %CYGROOT%\build\tarballs\* || GOTO ErrorExit
) ELSE (
  REM In non release builds, create a dummy file
  ECHO "This is not a release build - open source archive not created / uploaded" > artifacts\coq-opensource-info.txt
)

REM DO NOT echo the signing command below, as this would leak secrets in the logs
IF DEFINED WIN_CERTIFICATE_PATH (
  IF DEFINED WIN_CERTIFICATE_PASSWORD (
    ECHO Signing package
    @signtool sign /f %WIN_CERTIFICATE_PATH% /p %WIN_CERTIFICATE_PASSWORD% dev\nsis\*.exe
    signtool verify /pa dev\nsis\*.exe
  )
)

ECHO "Finished Artifact Creation"
TIME /T

CALL :CleanupFolders

ECHO "Finished Cleanup"
TIME /T

GOTO :EOF

:CopyLogFiles
  ECHO Copy log files for artifact upload
  MKDIR artifacts\buildlogs
  COPY %CYGROOT%\build\buildlogs\* artifacts\buildlogs
  MKDIR artifacts\filelists
  COPY %CYGROOT%\build\filelists\* artifacts\filelists
  MKDIR artifacts\flagfiles
  COPY %CYGROOT%\build\flagfiles\* artifacts\flagfiles
  GOTO :EOF

:CleanupFolders
  ECHO "Cleaning %CYGROOT%"
  RMDIR /S /Q "%CYGROOT%"
  ECHO "Cleaning %DESTCOQ%"
  RMDIR /S /Q "%DESTCOQ%"
  GOTO :EOF

:MakeUniqueFolder
  REM Create a uniquely named folder
  REM This script is safe because folder creation is atomic - either we create it or fail
  REM %1 = base path or directory (_%RANDOM%_%RANDOM% is appended to this)
  REM %2 = name of the variable which receives the unique folder name
  SET "UNIQUENAME=%1_%RANDOM%_%RANDOM%"
  MKDIR "%UNIQUENAME%"
  IF ERRORLEVEL 1 GOTO :MakeUniqueFolder
  SET "%2=%UNIQUENAME%"
  GOTO :EOF

:ErrorCopyLogFilesAndExit
  CALL :CopyLogFiles
  REM fall through

:ErrorExit
  CALL :CleanupFolders
  ECHO ERROR %0 failed
  EXIT /b 1

Fix issue #9188 : Enable VST and aactactics in master


@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

Add dependencies needed to compile ncurses gem on cygwin


g++ -o main -std=c++11 main.cpp -fopenmp

add compile bat file

add compile bat file


@ECHO OFF

ECHO ** Clean out the existing deployment content.
rmdir /S /Q deploy

ECHO ** Copy config files (json, yaml ^& appengine_config.py) to deploy.
xcopy .\config\*.json .\deploy\config\
copy *.yaml .\deploy\
copy *.py .\deploy\

ECHO ** Copy server/*.py files (not tests) to deploy/server
xcopy .\server\*.py .\deploy\server\ /S
FOR /f %%f IN ('dir /s /b .\deploy\server\*_test.py') DO del %%f

ECHO ** Copy server/*.html files to deploy/server
xcopy .\server\*.html .\deploy\server\ /S

ECHO ** Copy third_party/py files to deploy/server/third_party
xcopy .\third_party\py\ .\deploy\server\third_party\ /S

ECHO ** Copy client/*.html template files to deploy/client.
xcopy .\client\*.html .\deploy\client\ /S

ECHO ** Compile client/*.js files to deploy/client/perfkit_scripts.js.
python %closurelib%/closure/bin/build/closurebuilder.py ^
 --root=%closurelib%/ ^
 --root=client/ ^
 --namespace="p3rf.perfkit.explorer.application.module" ^
 --output_mode=compiled ^
 --compiler_jar=bin/closure-compiler.jar ^
 --compiler_flags="--angular_pass" ^
 --compiler_flags="--compilation_level=WHITESPACE_ONLY" ^
 --compiler_flags="--language_in=ECMASCRIPT5" ^
 --compiler_flags="--formatting=PRETTY_PRINT" ^
 --output_file=deploy/client/perfkit_scripts.js

SET CSS_TEMPFILE=deploy\perfkit_styles_raw.css
ECHO ** Combine the client/*.css stylesheets into a single file.
ECHO. /* Concatenated CSS */ > %CSS_TEMPFILE%
FOR /F %%k in ('dir /b /s /-p client /o:n /a:-d ^| findstr /E .css') DO copy /y /b "%CSS_TEMPFILE%" + "%%k" "%CSS_TEMPFILE%"

java -jar bin/closure-stylesheets.jar --pretty-print --output-file deploy/client/perfkit_styles.css ^
  --allow-unrecognized-functions --allow-unrecognized-properties "%CSS_TEMPFILE%"

ECHO Compilation complete.

Add a compile.cmd file for Windows development.


@echo off

setlocal EnableDelayedExpansion

for /f "usebackq tokens=1,2 delims=,=- " %%i in (`wmic os get LocalDateTime /value`) do @if %%i==LocalDateTime (
	set CURR_DATE_TIME=%%j
)

set curr_year=%CURR_DATE_TIME:~0,4%
set curr_month=%CURR_DATE_TIME:~4,2%

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
if "%1" == "1" (
	set release_mode=1
) else if "%1" == "release" (
	set release_mode=1
) else (
	set release_mode=0
)

:: Normal = 0, CI Nightly = 1
if "%2" == "1" (
	set nightly=1
) else (
	set nightly=0
)

set odin_version_raw="dev-%curr_year%-%curr_month%"

set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\"

for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i
if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\"
if %nightly% equ 1 set compiler_defines=%compiler_defines% -DNIGHTLY

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
	set compiler_defines=%compiler_defines% -DNO_ARRAY_BOUNDS_CHECK
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4146 ^
	-wd4456 -wd4457

set compiler_includes=
set libs= ^
	kernel32.lib ^
	bin\llvm\windows\LLVM-C.lib

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

rem cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%
rem if %errorlevel% neq 0 goto end_of_build

rem call build_vendor.bat
rem if %errorlevel% neq 0 goto end_of_build

rem if %release_mode% EQU 0 odin run examples/demo

odin check vendor/stb/image -no-entry-point -vet -strict-style

del *.obj > NUL 2> NUL

:end_of_build

@echo off

setlocal EnableDelayedExpansion

for /f "usebackq tokens=1,2 delims=,=- " %%i in (`wmic os get LocalDateTime /value`) do @if %%i==LocalDateTime (
	set CURR_DATE_TIME=%%j
)

set curr_year=%CURR_DATE_TIME:~0,4%
set curr_month=%CURR_DATE_TIME:~4,2%

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
if "%1" == "1" (
	set release_mode=1
) else if "%1" == "release" (
	set release_mode=1
) else (
	set release_mode=0
)

:: Normal = 0, CI Nightly = 1
if "%2" == "1" (
	set nightly=1
) else (
	set nightly=0
)

set odin_version_raw="dev-%curr_year%-%curr_month%"

set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\"

for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i
if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\"
if %nightly% equ 1 set compiler_defines=%compiler_defines% -DNIGHTLY

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
	set compiler_defines=%compiler_defines% -DNO_ARRAY_BOUNDS_CHECK
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4146 ^
	-wd4456 -wd4457

set compiler_includes=
set libs= ^
	kernel32.lib ^
	bin\llvm\windows\LLVM-C.lib

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%
if %errorlevel% neq 0 goto end_of_build

call build_vendor.bat
if %errorlevel% neq 0 goto end_of_build

if %release_mode% EQU 0 odin run examples/demo

del *.obj > NUL 2> NUL

:end_of_build

Revert build.bat

Revert build.bat


@echo off

SETLOCAL

SET NUGET=%LocalAppData%\NuGet\NuGet.exe
@echo off

SETLOCAL

SET NUGET=%LocalAppData%\NuGet\NuGet.exe
SET FAKE=%LocalAppData%\FAKE\tools\Fake.exe
SET NYX=%LocalAppData%\Nyx\tools\build.fsx
SET GITVERSION=%LocalAppData%\GitVersion.CommandLine\tools\GitVersion.exe
SET MSPEC=%LocalAppData%\Machine.Specifications.Runner.Console\tools\mspec-clr4.exe
SET MSBUILD14_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe"
SET MSBUILD12_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\12.0\bin\MSBuild.exe"
SET BUILD_TOOLS_PATH=%MSBUILD14_TOOLS_PATH%

IF NOT EXIST %MSBUILD14_TOOLS_PATH% (
  echo In order to run this tool you need either Visual Studio 2015 or
  echo Microsoft Build Tools 2015 tools installed.
  echo.
  echo Visit this page to download either:
  echo.
  echo http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs
  echo.
  echo Attempting to fall back to MSBuild 12 for building only
  echo.
  IF NOT EXIST %MSBUILD12_TOOLS_PATH% (
    echo Could not find MSBuild 12.  Please install build tools ^(See above^)
    exit /b 1
  ) else (
    set BUILD_TOOLS_PATH=%MSBUILD12_TOOLS_PATH%
  )
)

echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%NUGET%'"

echo Downloading latest version of FAKE...
IF NOT EXIST %LocalAppData%\FAKE %NUGET% "install" "FAKE" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "4.4.4"

echo Downloading latest version of NuGet.Core...
IF NOT EXIST %LocalAppData%\NuGet.Core %NUGET% "install" "NuGet.Core" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "2.8.6"

echo Downloading latest version of GitVersion.CommandLine...
IF NOT EXIST %LocalAppData%\GitVersion.CommandLine %NUGET% "install" "GitVersion.CommandLine" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "3.3.0"

echo Downloading latest version of Machine.Specifications.Runner.Console...
IF NOT EXIST %LocalAppData%\Machine.Specifications.Runner.Console %NUGET% "install" "Machine.Specifications.Runner.Console" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "0.9.2"

echo Downloading latest version of Nyx...
%NUGET% "install" "Nyx" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-PreRelease"

SET TARGET="Build"
IF NOT [%1]==[] (set TARGET="%1")

SET SUMMARY="Elders.Cronus.AtomicAction.Redis"
SET DESCRIPTION="Elders.Cronus.AtomicAction.Redis"

%FAKE% %NYX% "target=RunTests" appName=Elders.Cronus.AtomicAction.Redis.Tests appSummary=%SUMMARY% appDescription=%DESCRIPTION% nugetpacage=Cronus.AtomicAction.Redis.Tests
%FAKE% %NYX% "target=%TARGET%" appName=Elders.Cronus.AtomicAction.Redis appSummary=%SUMMARY% appDescription=%DESCRIPTION% nugetpackage=Cronus.AtomicAction.Redis

@echo off

SETLOCAL

SET NUGET=%LocalAppData%\NuGet\NuGet.exe
@echo off

SETLOCAL

SET NUGET=%LocalAppData%\NuGet\NuGet.exe
SET FAKE=%LocalAppData%\FAKE\tools\Fake.exe
SET NYX=%LocalAppData%\Nyx\tools\build.fsx
SET GITVERSION=%LocalAppData%\GitVersion.CommandLine\tools\GitVersion.exe
SET MSPEC=%LocalAppData%\Machine.Specifications.Runner.Console\tools\mspec-clr4.exe
SET MSBUILD14_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe"
SET MSBUILD12_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\12.0\bin\MSBuild.exe"
SET BUILD_TOOLS_PATH=%MSBUILD14_TOOLS_PATH%

IF NOT EXIST %MSBUILD14_TOOLS_PATH% (
  echo In order to run this tool you need either Visual Studio 2015 or
  echo Microsoft Build Tools 2015 tools installed.
  echo.
  echo Visit this page to download either:
  echo.
  echo http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs
  echo.
  echo Attempting to fall back to MSBuild 12 for building only
  echo.
  IF NOT EXIST %MSBUILD12_TOOLS_PATH% (
    echo Could not find MSBuild 12.  Please install build tools ^(See above^)
    exit /b 1
  ) else (
    set BUILD_TOOLS_PATH=%MSBUILD12_TOOLS_PATH%
  )
)

echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%NUGET%'"

echo Downloading latest version of FAKE...
IF NOT EXIST %LocalAppData%\FAKE %NUGET% "install" "FAKE" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "4.4.4"

echo Downloading latest version of NuGet.Core...
IF NOT EXIST %LocalAppData%\NuGet.Core %NUGET% "install" "NuGet.Core" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "2.8.6"

echo Downloading latest version of GitVersion.CommandLine...
IF NOT EXIST %LocalAppData%\GitVersion.CommandLine %NUGET% "install" "GitVersion.CommandLine" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "3.3.0"

echo Downloading latest version of Machine.Specifications.Runner.Console...
IF NOT EXIST %LocalAppData%\Machine.Specifications.Runner.Console %NUGET% "install" "Machine.Specifications.Runner.Console" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-Version" "0.9.2"

echo Downloading latest version of Nyx...
%NUGET% "install" "Nyx" "-OutputDirectory" "%LocalAppData%" "-ExcludeVersion" "-PreRelease"

SET TARGET="Build"
IF NOT [%1]==[] (set TARGET="%1")

SET SUMMARY="Cronus.AtomicAction.Redis"
SET DESCRIPTION="Cronus.AtomicAction.Redis"

%FAKE% %NYX% "target=RunTests" appName=Cronus.AtomicAction.Redis.Tests appSummary=%SUMMARY% appDescription=%DESCRIPTION% nugetpacage=Cronus.AtomicAction.Redis.Tests
%FAKE% %NYX% "target=%TARGET%" appName=Cronus.AtomicAction.Redis appSummary=%SUMMARY% appDescription=%DESCRIPTION% nugetpackage=Cronus.AtomicAction.Redis

Remove Elders from app name

Remove Elders from app name


set PACKAGE_DIR="%CD%"

REM clean if requested
if "%1" == "clean" call clean-build.bat

REM perform 32-bit build
cd "%PACKAGE_DIR%"
mkdir build
cd build
del CMakeCache.txt
rmdir /s /q build\_CPack_Packages
cmake -G"MinGW Makefiles" -DRSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release -DRSTUDIO_PACKAGE_BUILD=1 ..\..\..
mingw32-make
cd ..

REM perform 64-bit build and install it into the 32-bit tree
REM (but only do this if we are on win64)
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" call make-install-win64.bat "%PACKAGE_DIR%\build\src\cpp\session" %1

REM create packages
cd build
cpack -G NSIS
REM cpack -G ZIP
cd ..

set PACKAGE_DIR="%CD%"

REM clean if requested
if "%1" == "clean" call clean-build.bat

REM perform 32-bit build
cd "%PACKAGE_DIR%"
mkdir build
cd build
del CMakeCache.txt
rmdir /s /q build\_CPack_Packages
cmake -G"MinGW Makefiles" -DRSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release -DRSTUDIO_PACKAGE_BUILD=1 ..\..\..
mingw32-make
cd ..

REM perform 64-bit build and install it into the 32-bit tree
REM (but only do this if we are on win64)
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" call make-install-win64.bat "%PACKAGE_DIR%\build\src\cpp\session" %1

REM create packages
cd build
cpack -G NSIS
cpack -G ZIP
cd ..

add ZIP bundling for windows

add ZIP bundling for windows


@echo off
 echo Copyright (c) 2014 Cai Guanhao (Choi Goon-ho)
 echo Licensed under the terms of the MIT license.
 echo Report bugs on https://github.com/caiguanhao/xen-config/issues
 echo --------------------------------------------------------------

rem Usage: Create or edit RDP.txt in the same directory or sub-directories
rem of this BAT file, type your IP address, username and password in order
rem and separate them by spaces or tabs. Each line represents an RDP
rem connection. For example:
rem     12.34.56.78 Administrator 123456

set /a count="0"
set k="HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\LocalDevices"

for /f "tokens=*" %%z in ('dir /s/b RDP.txt') do (
for /f "tokens=1-3" %%a in ('findstr /r "^[^#]" "%%z"') do (
for /f "tokens=*" %%d in ('RDP.exe %%c') do (
(
rem Required - User credential:
echo full address:s:%%a
echo username:s:%%b
echo password 51:b:%%d

rem You can create one RDP connection, adjust the options and then save it.
rem Open the saved file in Notepad, copy every line (except the lines contain
rem the IP address or the username) here to update settings:
echo screen mode id:i:1
echo desktopwidth:i:800
echo desktopheight:i:600
echo session bpp:i:32
echo winposstr:s:0,3,0,0,800,600
echo compression:i:1
echo keyboardhook:i:2
echo displayconnectionbar:i:1
echo disable wallpaper:i:1
echo disable full window drag:i:1
echo allow desktop composition:i:0
echo allow font smoothing:i:0
echo disable menu anims:i:1
echo disable themes:i:0
echo disable cursor setting:i:0
echo bitmapcachepersistenable:i:1
echo audiomode:i:0
echo redirectprinters:i:1
echo redirectcomports:i:0
echo redirectsmartcards:i:1
echo redirectclipboard:i:1
echo redirectposdevices:i:0
echo drivestoredirect:s:
echo autoreconnection enabled:i:1
echo authentication level:i:0
echo enablecredsspsupport:i:0
echo prompt for credentials:i:0
echo negotiate security layer:i:1
echo remoteapplicationmode:i:0
echo alternate shell:s:
echo shell working directory:s:
echo gatewayhostname:s:
) > %%z\..\%%a.rdp

rem Add host to registry to bypass the certificate warnings
reg add %k% /v %%a /f /t REG_DWORD /d 76 >nul

set /a count+=1
)
)
)

echo.
echo                 OK! %count% RDP connections generated.
echo              Press Enter or wait 2 seconds to exit
echo.

timeout /t 2 >nul

@echo off
 echo Copyright (c) 2014 Cai Guanhao (Choi Goon-ho)
 echo Licensed under the terms of the MIT license.
 echo Report bugs on https://github.com/caiguanhao/xen-config/issues
 echo --------------------------------------------------------------

rem Usage: Create or edit RDP.txt in the same directory or sub-directories
rem of this BAT file, type your IP address, username and password in order
rem and separate them by spaces or tabs. Each line represents an RDP
rem connection. For example:
rem     12.34.56.78 Administrator 123456

set /a count="0"
set k="HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\LocalDevices"

for /f "tokens=*" %%z in ('dir /s/b RDP.txt') do (
for /f "tokens=1-3" %%a in ('findstr /r "^[^#]" "%%z"') do (
for /f "tokens=1 delims=:" %%h in ("%%a") do (
for /f "tokens=*" %%d in ('RDP.exe %%c') do (
(
rem Required - User credential:
echo full address:s:%%a
echo username:s:%%b
echo password 51:b:%%d

rem You can create one RDP connection, adjust the options and then save it.
rem Open the saved file in Notepad, copy every line (except the lines contain
rem the IP address or the username) here to update settings:
echo screen mode id:i:1
echo desktopwidth:i:800
echo desktopheight:i:600
echo session bpp:i:32
echo winposstr:s:0,3,0,0,800,600
echo compression:i:1
echo keyboardhook:i:2
echo displayconnectionbar:i:1
echo disable wallpaper:i:1
echo disable full window drag:i:1
echo allow desktop composition:i:0
echo allow font smoothing:i:0
echo disable menu anims:i:1
echo disable themes:i:0
echo disable cursor setting:i:0
echo bitmapcachepersistenable:i:1
echo audiomode:i:0
echo redirectprinters:i:1
echo redirectcomports:i:0
echo redirectsmartcards:i:1
echo redirectclipboard:i:1
echo redirectposdevices:i:0
echo drivestoredirect:s:
echo autoreconnection enabled:i:1
echo authentication level:i:0
echo enablecredsspsupport:i:0
echo prompt for credentials:i:0
echo negotiate security layer:i:1
echo remoteapplicationmode:i:0
echo alternate shell:s:
echo shell working directory:s:
echo gatewayhostname:s:
) > %%z\..\%%h.rdp

rem Add host to registry to bypass the certificate warnings
reg add %k% /v %%h /f /t REG_DWORD /d 76 >nul

set /a count+=1
)
)
)
)

echo.
echo                 OK! %count% RDP connections generated.
echo              Press Enter or wait 2 seconds to exit
echo.

timeout /t 2 >nul

allow RDP to use port;

allow RDP to use port;


::batch file for win platform
@echo off
set BASE_DIR=%~dp0
set USB_VID=8087
set USB_PID=0a99
set /a TIMEOUT=60

::Phone flash tools configuration part
set DO_RECOVERY=0

:: Handle Ifwi file for DFU update
set IFWI_DFU_FILE=%BASE_DIR%edison_ifwi-dbg

set VAR_DIR=%BASE_DIR%u-boot-envs\
set VARIANT_NAME=edison-blankrndis

set LOG_FILENAME=flash.log
set /a verbose_output=0
:: ********************************************************************
:: parse arg
set show_help=0
set argcount=0
set appname=%0
:parse_arg_start
if -%1-==-- goto parse_arg_end
if -%1- == ---recovery- (
	set /a DO_RECOVERY=1
)
if -%1- == -/?- set /a show_help=1
if -%1- == --h- set /a show_help=1
if -%1- == ---help- set /a show_help=1
if -%1- == --v- set /a verbose_output=1
set /a argcount+= 1
shift
goto :parse_arg_start
:parse_arg_end

:: handle help on cmd arg
if %show_help% == 1 (
	call:print-usage %appname%
	exit /b
)

if %verbose_output% == 1 goto skip_init_log
echo ** Flashing Edison Board %date% %time% ** >> %LOG_FILENAME%
:skip_init_log

:: ********************************************************************
:: Ifwi flashing part
if %DO_RECOVERY% == 0 goto :skip_flash_ifwi
echo Starting Recovery mode
echo Please plug and reboot the board
echo Flashing IFWI
call:flash-ifwi
if %errorlevel% neq 0 ( exit /b %errorlevel%)
echo Recovery Success...
echo You can now try a regular flash
goto :skip_flash_kernel
:skip_flash_ifwi

:: ********************************************************************
:: Kernel & rootfs flashing part
echo Using U-boot target: %VARIANT_NAME%
set VARIANT_FILE="%VAR_DIR%%VARIANT_NAME%.bin"
	if not exist %VARIANT_FILE% (
		echo U-boot target %VARIANT_NAME%: %VARIANT_FILE% not found aborting
		exit /b 5
)

echo Now waiting for dfu device %USB_VID%:%USB_PID%
echo Please plug and reboot the board
call:dfu-wait
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing IFWI
call:flash-dfu-ifwi ifwi00 "%IFWI_DFU_FILE%-00-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib00 "%IFWI_DFU_FILE%-00-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi01 "%IFWI_DFU_FILE%-01-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib01 "%IFWI_DFU_FILE%-01-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi02 "%IFWI_DFU_FILE%-02-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib02 "%IFWI_DFU_FILE%-02-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi03 "%IFWI_DFU_FILE%-03-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib03 "%IFWI_DFU_FILE%-03-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi04 "%IFWI_DFU_FILE%-04-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib04 "%IFWI_DFU_FILE%-04-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi05 "%IFWI_DFU_FILE%-05-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib05 "%IFWI_DFU_FILE%-05-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi06 "%IFWI_DFU_FILE%-06-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib06 "%IFWI_DFU_FILE%-06-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot
call:flash-command --alt u-boot0 -D "%BASE_DIR%u-boot-edison.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot Environment
call:flash-command --alt u-boot-env0 -D %VARIANT_FILE%
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot Environment Backup
call:flash-command --alt u-boot-env1 -D %VARIANT_FILE% -R
if %errorlevel% neq 0 ( exit /b %errorlevel%)
echo Rebooting to apply partiton changes
call:dfu-wait
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing boot partition ^(kernel^)
call:flash-command --alt boot -D "%BASE_DIR%edison-image-edison.hddimg"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing rootfs, ^(it can take up to 5 minutes... Please be patient^)
call:flash-command --alt rootfs -D "%BASE_DIR%edison-image-edison.ext4" -R
if %errorlevel% neq 0 ( exit /b %errorlevel% )

echo Rebooting
echo U-boot ^& Kernel System Flash Success...
echo Your board needs to reboot to complete the flashing procedure, please do not unplug it for 2 minutes.
:skip_flash_kernel

:: ********************************************************************
:: The End
exit /b 0

:print-usage
	echo Usage: %1 [-h] [--help] [--recovery]
	echo Update all software and restore board to its initial state.
	echo  -h,--help     display this help and exit.
	echo  -v            verbose output
	echo  --recovery    recover the board to DFU mode using a dedicated tool,
	echo                available only on linux and window hosts.
	exit /b 5

:flash-dfu-ifwi
	(dfu-util -d %USB_VID%:%USB_PID% -l & call echo %%^^errorlevel%% ^>dfu_error.txt) | findstr "%1" > NUL 2>&1
	set /a flash_ifwi_error=%errorlevel%
	for /f %%E in (dfu_error.txt) do set /a dfu_error=%%E
	del dfu_error.txt
	if %dfu_error% == 0 (
		if %flash_ifwi_error% == 0 (
			call:flash-command --alt %1 -D %2
			exit /b %flash_ifwi_error%
		)
	) else (
		exit /b %dfu_error%
	)
	exit /b 0

:flash-command
	set filterout="on"
	if %verbose_output% == 1 ( set filterout="off")

	(dfu-util -d %USB_VID%:%USB_PID% %* 2>&1 & call echo %%^^errorlevel%% ^>dfu_error.txt) | cscript.exe /E:JScript //B filter-dfu-out.js %LOG_FILENAME% %filterout%
	for /f %%E in (dfu_error.txt) do set /a dfu_error=%%E
	del dfu_error.txt
	if %dfu_error% neq 0 echo Flash failed on %*
	exit /b %dfu_error%

:flash-debug
	echo DEBUG: dfu-util -l
	dfu-util -l
	exit /b

:flash-ifwi
	for %%X in (xfstk-dldr-solo.exe) do (set xfstk_tool_found=%%~$PATH:X)
	if defined xfstk_tool_found (
		call:flash-ifwi-xfstk
		exit /b %errorlevel%
	)
	echo !!! You should install xfstk tools, please visit http://xfstk.sourceforge.net/
	exit /b 3

:flash-ifwi-xfstk
	xfstk-dldr-solo.exe --gpflags 0x80000007 --osimage "%BASE_DIR%u-boot-edison.img"  --fwdnx "%BASE_DIR%edison_dnx_fwr.bin" --fwimage "%BASE_DIR%edison_ifwi-dbg-00.bin" --osdnx "%BASE_DIR%edison_dnx_osr.bin"
	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Ifwi Flash failed
	exit /b %err_num%

:dfu-wait
	setlocal
	set /a currtime=%TIMEOUT%
:start_wait
	(dfu-util -l -d %USB_VID%:%USB_PID% & call echo %%^^errorlevel%% ^>dfu_error.txt) | findstr "Found" | findstr "%USB_VID%" > NUL 2>&1
	set /a start_wait_error=%errorlevel%
	for /f %%E in (dfu_error.txt) do set /a dfu_error=%%E
	del dfu_error.txt
	if %dfu_error% == 0 (
		if %start_wait_error% == 0 (
			echo Dfu device found
			exit /b 0
		) else (
			set /a currtime-= 1
			timeout /t 1 /nobreak > nul
			if %currtime% gtr 0 goto:start_wait
		)
	) else (
		exit /b %dfu_error%
	)
	echo Dfu device not found Timeout
	echo Did you plug and reboot your board?
	echo If yes, please try a recovery by calling this script with the --recovery option
	exit /b 3

remove unix end lines from batch file

flashall.bat: remove unix end lines from batch file

Calling flashall.bat with any options makes the script failed.
This is because the file contains unix end lines.
This patch convert all unix end lines to dos end lines.

Tracked-On: EDISON-2591
Signed-off-by: Rodriguez Fabien <9977a78a23707868610ccbb15bf27c4cd752553a@intel.com>


@echo off
cls
:start
echo Starting server...

for %%* in (.) do set DIR=%%~nx*
if NOT "%DIR%" == "64" cd 64
FC_64.exe -batchmode -nographics

echo.
echo Restarting server...
timeout /t 10
echo.
goto start

Add example start .bat

[FortressCraft] Add example start .bat


Build 67

Build 67


python setup.py build --compiler=mingw32 install bdist_wininst sdist

pause

python setup.py build --compiler=mingw32 bdist_wininst bdist_wheel sdist

pause

fix winbuild script to not install directly


choco install -y firefox googlechrome wget
wget -c https://cygwin.com/setup-x86_64.exe
REM cygwin installation
setup-x86_64.exe -R "C:\cygwin64" -s http://cygwin.netbet.org/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion

add archival tools to cygwin

add archival tools to cygwin


@echo off
title winAutolink

rem Start program ----------------------------------------------------------
:init
  set target=%~dp0
  goto check_permissions

rem Check administrator permissions ----------------------------------------
:check_permissions
  echo Administrative permissions required. Detecting permissions...
  net session >nul 2>&1

  if %errorLevel% == 0 (
    echo Success: Administrative permissions confirmed.
    echo.
    goto select_links
  ) else (
    echo Requesting administrative privileges...
    goto UAC_prompt
  )

rem Show admin prompt ------------------------------------------------------
:UAC_prompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs" >nul
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    exit /B

rem Select what to link ----------------------------------------------------
:select_links
  echo Please select which files to link:
  echo 1. Vim
  echo 2. Vimperator
  echo 3. Both
  echo.

  set /p choose=
  if %choose% gtr 3 ( goto error )
  if %choose% lss 1 ( goto error )

  goto check_path

rem Check if current location contains repository -------------------------
:check_path
  cd %target%

  if %choose% == 1 (
    if exist vim/vimrc (
      goto link_vim
    )
  )
  if %choose% == 2 (
    if exist vimperator/vimperatorrc (
      goto link_vimp
    )
  )
  if %choose% == 3 (
    if exist vim\vimrc (
      if exist vimperator\vimperatorrc (
        goto link_vim
      )
    )
  )

  goto error

rem Link vim files ---------------------------------------------------------
:link_vim
  rem Go to home directory
  cd %USERPROFILE%

  echo Linking vim files...
  echo.

  if exist vimfiles (
    echo vimfiles folder already exists. Skipping to next file.
  ) else (
    mklink /D vimfiles %target%vim
  )

  if %choose% == 3 (
    echo.
    set choose=0
    goto link_vimp
  )

  if %errorLevel% == 0 (
    goto success
  ) else (
    goto error
  )

rem Link vimperator files --------------------------------------------------
:link_vimp
  rem Go to home directory
  cd %USERPROFILE%

  echo Linking vimperator files...
  echo.

  if exist vimperator (
    echo vimperator folder already exists. Skipping to next file.
  ) else (
    mklink /D vimperator %target%vimperator
  )
  if exist _vimperatorrc (
    echo _vimperatorrc file already exists. Skipping to next file.
  ) else (
    mklink _vimperatorrc %target%vimperator\vimperatorrc
  )

  if %errorLevel% == 0 (
    goto success
  ) else (
    goto error
  )

rem End program ------------------------------------------------------------
:error
  echo.
  echo Error: Something went wrong.
  goto end

:success
  echo.
  echo Success: All files liked correctly.
  goto end

:end
  pause >nul
  cls
  exit /B

@echo off
title winAutolink

rem Start program ----------------------------------------------------------
:init
  set target=%~dp0
  goto check_permissions

rem Check administrator permissions ----------------------------------------
:check_permissions
  echo Administrative permissions required. Detecting permissions...
  net session >nul 2>&1

  if %errorLevel% == 0 (
    echo Success: Administrative permissions confirmed.
    echo.
    goto select_links
  ) else (
    echo Requesting administrative privileges...
    goto UAC_prompt
  )

rem Show admin prompt ------------------------------------------------------
:UAC_prompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs" >nul
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    exit /B

rem Select what to link ----------------------------------------------------
:select_links
  echo Please select which files to link:
  echo 1. Vim
  echo 2. Vimperator
  echo 3. Both
  echo.

  set /p choose=
  if %choose% == 1 ( goto link_vim )
  if %choose% == 2 ( goto link_vimp )
  if %choose% == 3 ( goto link_vim )
  goto error

rem Link vim files ---------------------------------------------------------
:link_vim
  rem Go to home directory
  cd %USERPROFILE%

  echo Linking vim files...
  echo.

  if exist vimfiles (
    echo vimfiles folder already exists. Skipping to next file.
  ) else (
    mklink /D vimfiles %target%vim
  )

  if %choose% == 3 (
    echo.
    set choose=0
    goto link_vimp
  )

  if %errorLevel% == 0 (
    goto success
  ) else (
    goto error
  )

rem Link vimperator files --------------------------------------------------
:link_vimp
  rem Go to home directory
  cd %USERPROFILE%

  echo Linking vimperator files...
  echo.

  if exist vimperator (
    echo vimperator folder already exists. Skipping to next file.
  ) else (
    mklink /D vimperator %target%vimperator
  )
  if exist _vimperatorrc (
    echo _vimperatorrc file already exists. Skipping to next file.
  ) else (
    mklink _vimperatorrc %target%vimperator\vimperatorrc
  )

  if %errorLevel% == 0 (
    goto success
  ) else (
    goto error
  )

rem End program ------------------------------------------------------------
:error
  echo.
  echo Error: Something went wrong.
  goto end

:success
  echo.
  echo Success: All files liked correctly.
  goto end

:end
  pause >nul
  cls
  exit /B

Remove check path code

Remove check path code


@echo off

cd %~dp0
set "PATH=%PATH%;%CD%\releng\windows\support"

if exist build.ninja goto :build

py -3 configure.py
if errorlevel 1 goto :error

:build
ninja debug
goto :eof

:error
echo.
pause

@echo off

cd %~dp0
set "PATH=%PATH%;%CD%\releng\windows\support"

if exist build.ninja goto :build

py -3 configure.py
if errorlevel 1 goto :error

:build
ninja debug
if errorlevel 1 goto :error
goto :eof

:error
echo.
pause

Make sure windows_run.bat doesn't swallow errors.


java -jar myrobotlab.jar -service python Python webGui WebGui -invoke python execFile %cd%/script.py

Create mrl.bat

Create mrl.bat


@ECHO OFF
set COPYRIGHT="Copyright 2012 Matthias Huebner"
set LICENSE="APACHE"

set ROOT=%~dp0\..\
set GEN="%~dp0\genheader.pl"

set modules=gwtao-emul;gwtao-common;gwtao-ui;gwtao-digist;gwtao-showcase

FOR %%a in (%modules%) do %GEN% -M %ROOT%\%%a\src -R -C %COPYRIGHT% -L %LICENSE%

set ROOT=
set GEN=
set COPYRIGHT=
set LICENSE=

pause

rem @ECHO OFF
set COPYRIGHT="Copyright 2012 Matthias Huebner"
set LICENSE="APACHE"

set ROOT=%~dp0..
set GEN="%~dp0\genheader.pl"

FOR /f %%a in ('dir /B /A:D %ROOT%\gwtao-*') do %GEN% -M %ROOT%\%%a\src -R -C %COPYRIGHT% -L %LICENSE%

set ROOT=
set GEN=
set COPYRIGHT=
set LICENSE=

pause

fix to find folders

fix to find folders