::You must keep this file in the solution folder for it to work.
::Make sure to pass the solution configuration when calling it (either Debug or Release)

::Set the directories in the setdirectories.bat file if you want a different folder than Kerbal Space Program
::EXAMPLE:
:: SET KSPPATH=C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program
:: SET KSPPATH2=C:\Users\Malte\Desktop\Kerbal Space Program
call "%~dp0\SetDirectories.bat"

IF DEFINED KSPPATH (ECHO KSPPATH is defined) ELSE (SET KSPPATH=C:\Kerbal Space Program)
IF DEFINED KSPPATH2 (ECHO KSPPATH2 is defined)
::%1
SET SOLUTIONCONFIGURATION=Debug

mkdir "%KSPPATH%\GameData\LunaMultiplayer\"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\")

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Plugins"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Plugins")

del "%KSPPATH%\GameData\LunaMultiplayer\Plugins\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Plugins\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Button"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Button")

del "%KSPPATH%\GameData\LunaMultiplayer\Button\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Button\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Localization"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Localization")

del "%KSPPATH%\GameData\LunaMultiplayer\Localization\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Localization\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\PartSync"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\PartSync")

del "%KSPPATH%\GameData\LunaMultiplayer\PartSync\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\PartSync\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Icons"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Icons")

del "%KSPPATH%\GameData\LunaMultiplayer\Icons\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Icons\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Flags"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Flags")

del "%KSPPATH%\GameData\LunaMultiplayer\Flags\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Flags\*.*" /Q /F)

xcopy /Y /s /e "%~dp0..\External\Dependencies\Harmony\" "%KSPPATH%\GameData\"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\External\Dependencies\Harmony\*.*" "%KSPPATH2%\GameData\")

xcopy /Y "%~dp0..\LmpClient\bin\%SOLUTIONCONFIGURATION%\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\bin\%SOLUTIONCONFIGURATION%\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Plugins")

xcopy /Y "%~dp0..\External\Dependencies\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\External\Dependencies\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Plugins")

xcopy /Y "%~dp0..\LmpClient\Resources\*.png" "%KSPPATH%\GameData\LunaMultiplayer\Button"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\Resources\*.png" "%KSPPATH2%\GameData\LunaMultiplayer\Button")

xcopy /Y /S "%~dp0..\LmpClient\Localization\XML\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Localization"
IF DEFINED KSPPATH2 (xcopy /Y /S "%~dp0..\LmpClient\Localization\XML\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Localization")

xcopy /Y /S "%~dp0..\LmpClient\ModuleStore\XML\*.xml" "%KSPPATH%\GameData\LunaMultiplayer\PartSync"
IF DEFINED KSPPATH2 (xcopy /Y /S "%~dp0..\LmpClient\ModuleStore\XML\*.xml" "%KSPPATH2%\GameData\LunaMultiplayer\PartSync")

xcopy /Y "%~dp0..\LmpClient\Resources\Icons\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Icons"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\Resources\Icons\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Icons")

xcopy /Y "%~dp0..\LmpClient\Resources\Flags\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Flags"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\Resources\Flags\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Flags")

::You must keep this file in the solution folder for it to work.
::Make sure to pass the solution configuration when calling it (either Debug or Release)

::Set the directories in the setdirectories.bat file if you want a different folder than Kerbal Space Program
::EXAMPLE:
:: SET KSPPATH=C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program
:: SET KSPPATH2=C:\Users\Malte\Desktop\Kerbal Space Program
call "%~dp0\SetDirectories.bat"

IF DEFINED KSPPATH (ECHO KSPPATH is defined) ELSE (SET KSPPATH=C:\Kerbal Space Program)
IF DEFINED KSPPATH2 (ECHO KSPPATH2 is defined)
::%1
SET SOLUTIONCONFIGURATION=Debug

mkdir "%KSPPATH%\GameData\LunaMultiplayer\"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\")

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Plugins"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Plugins")

del "%KSPPATH%\GameData\LunaMultiplayer\Plugins\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Plugins\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Button"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Button")

del "%KSPPATH%\GameData\LunaMultiplayer\Button\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Button\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Localization"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Localization")

del "%KSPPATH%\GameData\LunaMultiplayer\Localization\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Localization\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\PartSync"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\PartSync")

del "%KSPPATH%\GameData\LunaMultiplayer\PartSync\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\PartSync\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Icons"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Icons")

del "%KSPPATH%\GameData\LunaMultiplayer\Icons\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Icons\*.*" /Q /F)

mkdir "%KSPPATH%\GameData\LunaMultiplayer\Flags"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiplayer\Flags")

del "%KSPPATH%\GameData\LunaMultiplayer\Flags\*.*" /Q /F
IF DEFINED KSPPATH2 (del "%KSPPATH2%\GameData\LunaMultiplayer\Flags\*.*" /Q /F)

xcopy /Y /s /e "%~dp0..\External\Dependencies\Harmony\" "%KSPPATH%\GameData\"
IF DEFINED KSPPATH2 (xcopy /Y /s /e "%~dp0..\External\Dependencies\Harmony\" "%KSPPATH2%\GameData\")

xcopy /Y "%~dp0..\LmpClient\bin\%SOLUTIONCONFIGURATION%\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\bin\%SOLUTIONCONFIGURATION%\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Plugins")

xcopy /Y "%~dp0..\External\Dependencies\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\External\Dependencies\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Plugins")

xcopy /Y "%~dp0..\LmpClient\Resources\*.png" "%KSPPATH%\GameData\LunaMultiplayer\Button"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\Resources\*.png" "%KSPPATH2%\GameData\LunaMultiplayer\Button")

xcopy /Y /S "%~dp0..\LmpClient\Localization\XML\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Localization"
IF DEFINED KSPPATH2 (xcopy /Y /S "%~dp0..\LmpClient\Localization\XML\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Localization")

xcopy /Y /S "%~dp0..\LmpClient\ModuleStore\XML\*.xml" "%KSPPATH%\GameData\LunaMultiplayer\PartSync"
IF DEFINED KSPPATH2 (xcopy /Y /S "%~dp0..\LmpClient\ModuleStore\XML\*.xml" "%KSPPATH2%\GameData\LunaMultiplayer\PartSync")

xcopy /Y "%~dp0..\LmpClient\Resources\Icons\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Icons"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\Resources\Icons\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Icons")

xcopy /Y "%~dp0..\LmpClient\Resources\Flags\*.*" "%KSPPATH%\GameData\LunaMultiplayer\Flags"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\LmpClient\Resources\Flags\*.*" "%KSPPATH2%\GameData\LunaMultiplayer\Flags")

Fix copy script

Fix copy script


@echo off
rem
rem Install or update Cygwin.
rem

setlocal

set _PACKAGES=cron,diffutils,inetutils,ncurses,netcat,openssh,p7zip,procps,python,rsync,screen,unzip,vim,zip,genisoimage,w3m,wodim
set _ROOTDIR=C:\cygwin
set _SITE=http://mirrors.xmission.com/cygwin
set _PREFIX=CYGWIN-SETUP:

goto :main

:check_admin
    rem Check for ADMIN privileges
    rem https://sites.google.com/site/eneerge/home/BatchGotAdmin

    echo %_PREFIX% Checking for Administrator privileges
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    if "%ERRORLEVEL%" EQU "0" goto :endif_check_admin
        echo %_PREFIX% ERROR: You do not have Administrator privileges
        echo %_PREFIX% Rerun from a "Run as Administrator" command prompt
        exit /b 1
    :endif_check_admin
goto :eof

:stop_services
    for /f "usebackq" %%s in (`%_ROOTDIR%\bin\cygrunsrv.exe --list`) do (
        echo %_PREFIX% Stopping %%s
        %_ROOTDIR%\bin\cygrunsrv --stop %%s
    )
goto :eof

:start_services
    for /f "usebackq" %%s in (`%_ROOTDIR%\bin\cygrunsrv.exe --list`) do (
        echo %_PREFIX% Starting %%s
        %_ROOTDIR%\bin\cygrunsrv --start %%s
    )
goto :eof

:get_setup_exe
    if not exist %_ROOTDIR% (
        echo %_PREFIX% Creating %_ROOTDIR%
        mkdir %_ROOTDIR%
    )
    echo %_PREFIX% Fetching latest setup.exe from cygwin.com
    wget --quiet -O %_ROOTDIR%\setup.exe http://cygwin.com/setup.exe
goto :eof

:setup
    echo %_PREFIX% Running setup.exe
    %_ROOTDIR%\setup.exe --site %_SITE% --quiet-mode --no-shortcuts --root %_ROOTDIR% --local-package-dir %_ROOTDIR%\LocalPackageDir --packages %_PACKAGES%
goto :eof

:create_passwd
    if not exist %_ROOTDIR%\etc\passwd (
        echo %_PREFIX% Creating /etc/passwd
        %_ROOTDIR%\bin\bash --login -i -c '/usr/bin/mkpasswd --local > /etc/passwd'
    )
    if not exist %_ROOTDIR%\etc\group (
        echo %_PREFIX% Creating /etc/group
        %_ROOTDIR%\bin\bash --login -i -c '/usr/bin/mkgroup --local > /etc/group'
    )
goto :eof

:config_syslogd
    sc query syslogd | findstr "service does not exist" > NUL:
    if %ERRORLEVEL% NEQ 0 goto :eof

    echo %_PREFIX% Configuring syslogd
    if not exist %_ROOTDIR%\bin\syslogd-config (
        echo %_PREFIX% ERROR: inetutils not installed
        goto :eof
    )
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/syslogd-config"
goto :eof

:config_sshd
    sc query sshd | findstr "service does not exist" > NUL:
    if %ERRORLEVEL% NEQ 0 goto :eof

    echo %_PREFIX% Configuring sshd
    if not exist %_ROOTDIR%\bin\ssh-host-config (
        echo %_PREFIX% ERROR: opensshd not installed
        goto :eof
    )
    findstr /r "^sshd:" %_ROOTDIR%\etc\passwd
    if %ERRORLEVEL% EQL 0 (
        echo %_PREFIX% ERROR: sshd account found in /etc/passwd
        goto :eof
    )
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/ssh-host-config"
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/sed -i -e 's/#UseDNS yes/UseDNS no/' /etc/sshd_config"
    rem%_ROOTDIR%\bin\bash --login -i -c "/usr/bin/chown fdsv-sa-prx-sshdsrvr /etc/ssh* /var/empty /var/log/lastlog"
goto :eof

:config_lsa
    reg query HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v "Authentication Packages" | findstr cyglsa > NUL:
    if %ERRORLEVEL% EQU 0 goto :eof

    echo %_PREFIX% Configuring cyglsa
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/cyglsa-config"
goto :eof

:main
    call :check_admin ||exit /b 1
    call :get_setup_exe
    call :stop_services
    call :setup
    call :create_passwd
    call :config_syslogd
    call :config_sshd
    call :start_services
    rem Do config_lsa last so that reboot message is last
    call :config_lsa

:exit

@echo off
rem
rem Install or update Cygwin.
rem

setlocal

set _PACKAGES=cron,diffutils,inetutils,ncurses,netcat,openssh,p7zip,procps,python,rsync,screen,unzip,vim,zip,genisoimage,w3m,wodim
set _ROOTDIR=C:\cygwin
set _SITE=http://mirrors.xmission.com/cygwin
set _PREFIX=CYGWIN-SETUP:

goto :main

:check_admin
    rem Check for ADMIN privileges
    rem https://sites.google.com/site/eneerge/home/BatchGotAdmin

    echo %_PREFIX% Checking for Administrator privileges
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    if "%ERRORLEVEL%" EQU "0" goto :endif_check_admin
        echo %_PREFIX% ERROR: You do not have Administrator privileges
        echo %_PREFIX% Rerun from a "Run as Administrator" command prompt
        exit /b 1
    :endif_check_admin
goto :eof

:stop_services
    if not exist "%_ROOTDIR%\bin\cygrunsrv.exe" goto :eof
    for /f "usebackq" %%s in (`%_ROOTDIR%\bin\cygrunsrv.exe --list`) do (
        echo %_PREFIX% Stopping %%s
        %_ROOTDIR%\bin\cygrunsrv --stop %%s
    )
goto :eof

:start_services
    for /f "usebackq" %%s in (`%_ROOTDIR%\bin\cygrunsrv.exe --list`) do (
        echo %_PREFIX% Starting %%s
        %_ROOTDIR%\bin\cygrunsrv --start %%s
    )
goto :eof

:get_setup_exe
    if not exist %_ROOTDIR% (
        echo %_PREFIX% Creating %_ROOTDIR%
        mkdir %_ROOTDIR%
    )
    echo %_PREFIX% Fetching latest setup.exe from cygwin.com
    wget --quiet -O %_ROOTDIR%\setup.exe http://cygwin.com/setup.exe
goto :eof

:setup
    echo %_PREFIX% Running setup.exe
    %_ROOTDIR%\setup.exe --site %_SITE% --quiet-mode --no-shortcuts --root %_ROOTDIR% --local-package-dir %_ROOTDIR%\LocalPackageDir --packages %_PACKAGES%
goto :eof

:create_passwd
    if not exist %_ROOTDIR%\etc\passwd (
        echo %_PREFIX% Creating /etc/passwd
        %_ROOTDIR%\bin\bash --login -i -c '/usr/bin/mkpasswd --local > /etc/passwd'
    )
    if not exist %_ROOTDIR%\etc\group (
        echo %_PREFIX% Creating /etc/group
        %_ROOTDIR%\bin\bash --login -i -c '/usr/bin/mkgroup --local > /etc/group'
    )
goto :eof

:config_syslogd
    sc query syslogd | findstr "service does not exist" > NUL:
    if %ERRORLEVEL% NEQ 0 goto :eof

    echo %_PREFIX% Configuring syslogd
    if not exist %_ROOTDIR%\bin\syslogd-config (
        echo %_PREFIX% ERROR: inetutils not installed
        goto :eof
    )
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/syslogd-config"
goto :eof

:config_sshd
    sc query sshd | findstr "service does not exist" > NUL:
    if %ERRORLEVEL% NEQ 0 goto :eof

    echo %_PREFIX% Configuring sshd
    if not exist %_ROOTDIR%\bin\ssh-host-config (
        echo %_PREFIX% ERROR: opensshd not installed
        goto :eof
    )
    findstr /r "^sshd:" %_ROOTDIR%\etc\passwd
    if %ERRORLEVEL% EQU 0 (
        echo %_PREFIX% ERROR: sshd account found in /etc/passwd
        goto :eof
    )
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/ssh-host-config"
    echo %_PREFIX% Disabling reverse DNS lookup by sshd
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/sed -i -e 's/#UseDNS yes/UseDNS no/' /etc/sshd_config"
goto :eof

:config_lsa
    reg query HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v "Authentication Packages" | findstr cyglsa > NUL:
    if %ERRORLEVEL% EQU 0 goto :eof

    echo %_PREFIX% Configuring cyglsa
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/cyglsa-config"
goto :eof

:main
    call :check_admin ||exit /b 1
    call :get_setup_exe
    call :stop_services
    call :setup
    call :create_passwd
    call :config_syslogd
    call :config_sshd
    call :start_services
    rem Do config_lsa last so that reboot message is last
    call :config_lsa

:exit

cygwin-setup.bat: fix syntax error, check for cygrunsrv before stopping services


@rem Fetches (and builds if necessary) external dependencies

@rem Assume we start inside the Python source directory
cd ..

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
   devenv db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static
)

@rem Fetches (and builds if necessary) external dependencies

@rem Assume we start inside the Python source directory
cd ..
call "%VS71COMNTOOLS%vsvars32.bat"

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
if not exist db-4.4.20\build_win32\debug\libdb44sd.lib (
   devenv db-4.4.20\build_win32\Berkeley_DB.sln /build Debug /project db_static
)

Initialize VS environment in external.bat as well.


@echo off

goto start
:rmdir
if exist "%~1" rmdir "%~1" /s /q
goto :eof

:rmfiles
if "%~1"=="" goto :eof
if exist "%~1" del /f "%~1"
shift
goto rmfiles

:start
call :rmdir Install
call :rmdir Install_Debug
call :rmdir "NetKVM Package\VistaRelease"
call :rmdir "NetKVM Package\VistaDebug"
call :rmdir "NetKVM Package\Win8Release"
call :rmdir "NetKVM Package\Win8Debug"
call :rmdir "NetKVM Package\Win7Release"
call :rmdir "NetKVM Package\Win7Debug"
call :rmdir "NetKVM Package\x64"
call :rmdir x64
call :rmdir x86
call clean_dvl_log.cmd

pushd CoInstaller
call clean.bat
popd

pushd NDIS5
call clean.bat
popd

@echo off

goto start
:rmdir
if exist "%~1" rmdir "%~1" /s /q
goto :eof

:rmfiles
if "%~1"=="" goto :eof
if exist "%~1" del /f "%~1"
shift
goto rmfiles

:start
call :rmdir Install
call :rmdir Install_Debug
call :rmdir "NetKVM Package\VistaRelease"
call :rmdir "NetKVM Package\VistaDebug"
call :rmdir "NetKVM Package\Win8Release"
call :rmdir "NetKVM Package\Win8Debug"
call :rmdir "NetKVM Package\Win7Release"
call :rmdir "NetKVM Package\Win7Debug"
call :rmdir "NetKVM Package\x64"
call :rmdir x64
call :rmdir x86
del build.err
del build.log
del buildfre_*.log
del buildchk_*.log
del msbuild.log
del netkvm.DVL.XML
call clean_dvl_log.cmd

pushd CoInstaller
call clean.bat
popd

pushd NDIS5
call clean.bat
popd

Improve clean.bat

NetKVM: Improve clean.bat

Several logs were not removed during the run of clean.bat.

Signed-off-by: Yan Vugenfirer <42a2f19fc0e2f936689088d7ea4bb1f2d7be23d6@redhat.com>


@echo ON
cd win
if errorlevel 1 exit 1
dir
nmake /f Makefile.msc FOSSIL_DYNAMIC_BUILD=1 FOSSIL_ENABLE_SSL=1 FOSSIL_ENABLE_JSON=1 FOSSIL_ENABLE_TCL=1 FOSSIL_BUILD_ZLIB=0 PERLDIR=%PREFIX%\Library\bin
if errorlevel 1 exit 1
dir
copy fossil.exe %SCRIPTS%\fossil.exe
if errorlevel 1 exit 1

@echo ON
cd win
if errorlevel 1 exit 1
nmake /f Makefile.msc FOSSIL_DYNAMIC_BUILD=1 FOSSIL_ENABLE_SSL=1 FOSSIL_ENABLE_JSON=1 FOSSIL_ENABLE_TCL=1 FOSSIL_BUILD_ZLIB=0 PERLDIR=%PREFIX%\Library\bin
if errorlevel 1 exit 1
copy fossil.exe %SCRIPTS%\fossil.exe
if errorlevel 1 exit 1

remove some debuging

remove some debuging


:: Helper script for vcpkg-based x64-windows vscode build tasks

:: This script assumes that cmake is in PATH
:: TODO Auto-detect latest platform
set SCRIPT_DIR=%~dp0

if not defined TOOLCHAIN set TOOLCHAIN=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
if not defined BUILD_TYPE set BUILD_TYPE=Release
if not defined ARCH set ARCH=x64
if not defined TARGET_OS set TARGET_OS=windows

set TRIPLET=%ARCH%-%TARGET_OS%

set BUILD_DIR=%SCRIPT_DIR%\build\%TRIPLET%

if exist "%BUILD_DIR%\pdal-c.sln" (
	pushd "%BUILD_DIR%"
) else (
	mkdir "%BUILD_DIR%"
	pushd "%BUILD_DIR%"

	cmake ../.. ^
		-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
		-DCMAKE_TOOLCHAIN_FILE=%TOOLCHAIN% ^
		-DVCPKG_TARGET_TRIPLET=%TRIPLET% ^
		-DCMAKE_GENERATOR_PLATFORM=%ARCH%
)

:: Build and install solution
cmake --build . --target INSTALL --config %BUILD_TYPE%

popd

Update bld.bat

Update bld.bat


..\..\build\scripts\dist\builder -external -vs2010
pause

add gen_external_vs2010.bat

add gen_external_vs2010.bat


@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

set SCRIPTPATH=%~dp0

REM Does the path have a trailing slash? If so, remove it.
if %SCRIPTPATH:~-1%== set SCRIPTPATH=%SCRIPTPATH:~0,-1%

set arguments=%*
rem set SNAPSHOTNAME="%SCRIPTPATH%dartdoc.snapshot"
rem if exist %SNAPSHOTNAME% set SNAPSHOT=--use-script-snapshot=%SNAPSHOTNAME%

:: The trailing forward slash in --package-root is required because of issue
:: 9499.
"%SCRIPTPATH%dart" --heap_growth_rate=32 "--package-root=%SCRIPTPATH%..\packages/" %SNAPSHOT% "%SCRIPTPATH%..\lib\_internal\dartdoc\bin\dartdoc.dart" %arguments%

@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

rem Remove trailing backslash if there is one
IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%

set DARTDOC=%SDK_DIR%\lib\_internal\dartdoc\bin\dartdoc.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot

if not defined DART_CONFIGURATION set DART_CONFIGURATION=ReleaseIA32

set BUILD_DIR=%SDK_DIR%\..\build\%DART_CONFIGURATION%
if exist "%SNAPSHOT%" (
  "%DART%" "%SNAPSHOT%" "dartdoc" %*
) else (
  :: The trailing forward slash in --package-root is required because of issue
  :: 9499.
  "%BUILD_DIR%\dart-sdk\bin\dart" "--package-root=%BUILD_DIR%\packages/" "%DARTDOC%" %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
                                     ^| find ">     %~n1 ["') do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

Make dartdoc.bat work with snapshots and run in the repo.

This supercedes https://codereview.chromium.org/16415003/.

BUG=
R=dgrove@google.com

Review URL: https://codereview.chromium.org//15645010

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@23722 260f80e4-7a28-3924-810f-c04153c831b5


cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.3.2\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.3.3\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

bump to report generator dep

chore: bump to report generator dep


@echo off
REM Need delayed expansion !PATH! so parens in the path don't mess up the parens for the if statements that use parens for blocks
setlocal enabledelayedexpansion

REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with these variables
set $target=%1
set $sdkVersion=%2
set $runtimeVersion=%3
set $helixQueue=%4
set $arch=%5
set $quarantined=%6
set $efVersion=%7

set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
set DOTNET_ROOT=%DOTNET_HOME%\%$arch%
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home

set PATH=%DOTNET_ROOT%;!PATH!;%HELIX_CORRELATION_PAYLOAD%\node\bin
echo Set path to: %PATH%
echo "Installing SDK"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$arch% -Version %$sdkVersion% -InstallDir %DOTNET_ROOT%"
echo "Installing Runtime"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$arch% -Runtime dotnet -Version %$runtimeVersion% -InstallDir %DOTNET_ROOT%"
echo "Checking for Microsoft.AspNetCore.App"
if EXIST ".\Microsoft.AspNetCore.App" (
    echo "Found Microsoft.AspNetCore.App, copying to %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%"
    xcopy /i /y ".\Microsoft.AspNetCore.App" %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%\

    echo "Adding current directory to nuget sources: %HELIX_WORKITEM_ROOT%"
    dotnet nuget add source %HELIX_WORKITEM_ROOT%
    dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
    dotnet nuget list source
    dotnet tool install dotnet-ef --global --version %$efVersion%

    set PATH=!PATH!;%DOTNET_CLI_HOME%\.dotnet\tools
)

echo "Current Directory: %HELIX_WORKITEM_ROOT%"
set HELIX=%$helixQueue%
set HELIX_DIR=%HELIX_WORKITEM_ROOT%
set NUGET_FALLBACK_PACKAGES=%HELIX_DIR%
set NUGET_RESTORE=%HELIX_DIR%\nugetRestore
set DotNetEfFullPath=%HELIX_DIR%\nugetRestore\dotnet-ef\%$efVersion%\tools\netcoreapp3.1\any\dotnet-ef.exe
echo "Set DotNetEfFullPath: %DotNetEfFullPath%"
echo "Setting HELIX_DIR: %HELIX_DIR%"
echo Creating nuget restore directory: %NUGET_RESTORE%
mkdir %NUGET_RESTORE%
mkdir logs

REM "Rename default.runner.json to xunit.runner.json if there is not a custom one from the project"
if not EXIST ".\xunit.runner.json" (
    copy default.runner.json xunit.runner.json
)

dir

%DOTNET_ROOT%\dotnet vstest %$target% -lt >discovered.txt
find /c "Exception thrown" discovered.txt
REM "ERRORLEVEL is not %ERRORLEVEL%" https://blogs.msdn.microsoft.com/oldnewthing/20080926-00/?p=20743/
if not errorlevel 1 (
    echo Exception thrown during test discovery. 1>&2
    type discovered.txt 1>&2
    exit /b 1
)

set exit_code=0

if %$quarantined%==True (
    set %$quarantined=true
)

REM Disable "!Foo!" expansions because they break the filter syntax
setlocal disabledelayedexpansion
set NONQUARANTINE_FILTER="Quarantined!=true"
set QUARANTINE_FILTER="Quarantined=true"
if %$quarantined%==true (
    echo Running quarantined tests.
    %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --TestCaseFilter:%QUARANTINE_FILTER%
    if errorlevel 1 (
        echo Failure in quarantined test 1>&2
        REM DO NOT EXIT and DO NOT SET EXIT_CODE to 1
    )
) else (
    REM Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md
    echo Running non-quarantined tests.
    %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --TestCaseFilter:%NONQUARANTINE_FILTER%
    if errorlevel 1 (
        echo Failure in non-quarantined test 1>&2
        set exit_code=1
        REM DO NOT EXIT
    )
)

echo "Copying TestResults\TestResults.xml to ."
copy TestResults\TestResults.xml testResults.xml
echo "Copying artifacts/logs to %HELIX_WORKITEM_UPLOAD_ROOT%\..\"
for /R artifacts/log %%f in (*.log) do (
    echo "Copying: %%f"
    copy "%%f" %HELIX_WORKITEM_UPLOAD_ROOT%\..\
    copy "%%f" %HELIX_WORKITEM_UPLOAD_ROOT%\
)

exit /b %exit_code%

@echo off
REM Need delayed expansion !PATH! so parens in the path don't mess up the parens for the if statements that use parens for blocks
setlocal enabledelayedexpansion

REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with these variables
set $target=%1
set $sdkVersion=%2
set $runtimeVersion=%3
set $helixQueue=%4
set $arch=%5
set $quarantined=%6
set $efVersion=%7

set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
set DOTNET_ROOT=%DOTNET_HOME%\%$arch%
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home

set PATH=%DOTNET_ROOT%;!PATH!;%HELIX_CORRELATION_PAYLOAD%\node\bin
echo Set path to: %PATH%
echo "Installing SDK"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$arch% -Version %$sdkVersion% -InstallDir %DOTNET_ROOT%"
echo "Installing Runtime"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$arch% -Runtime dotnet -Version %$runtimeVersion% -InstallDir %DOTNET_ROOT%"
echo "Checking for Microsoft.AspNetCore.App"
if EXIST ".\Microsoft.AspNetCore.App" (
    echo "Found Microsoft.AspNetCore.App, copying to %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%"
    xcopy /i /y ".\Microsoft.AspNetCore.App" %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%\

    echo "Adding current directory to nuget sources: %HELIX_WORKITEM_ROOT%"
    dotnet nuget add source %HELIX_WORKITEM_ROOT%
    dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
    dotnet nuget list source
    dotnet tool install dotnet-ef --global --version %$efVersion%

    set PATH=!PATH!;%DOTNET_CLI_HOME%\.dotnet\tools
)

echo "Current Directory: %HELIX_WORKITEM_ROOT%"
set HELIX=%$helixQueue%
set HELIX_DIR=%HELIX_WORKITEM_ROOT%
set NUGET_FALLBACK_PACKAGES=%HELIX_DIR%
set NUGET_RESTORE=%HELIX_DIR%\nugetRestore
set DotNetEfFullPath=%HELIX_DIR%\nugetRestore\dotnet-ef\%$efVersion%\tools\netcoreapp3.1\any\dotnet-ef.exe
echo "Set DotNetEfFullPath: %DotNetEfFullPath%"
echo "Setting HELIX_DIR: %HELIX_DIR%"
echo Creating nuget restore directory: %NUGET_RESTORE%
mkdir %NUGET_RESTORE%
mkdir logs

REM "Rename default.runner.json to xunit.runner.json if there is not a custom one from the project"
if not EXIST ".\xunit.runner.json" (
    copy default.runner.json xunit.runner.json
)

dir

%DOTNET_ROOT%\dotnet vstest %$target% -lt >discovered.txt
find /c "Exception thrown" discovered.txt
REM "ERRORLEVEL is not %ERRORLEVEL%" https://blogs.msdn.microsoft.com/oldnewthing/20080926-00/?p=20743/
if not errorlevel 1 (
    echo Exception thrown during test discovery. 1>&2
    type discovered.txt 1>&2
    exit /b 1
)

set exit_code=0

if %$quarantined%==True (
    set %$quarantined=true
)

REM Disable "!Foo!" expansions because they break the filter syntax
setlocal disabledelayedexpansion
set NONQUARANTINE_FILTER="Quarantined!=true"
set QUARANTINE_FILTER="Quarantined=true"
if %$quarantined%==true (
    echo Running quarantined tests.
    %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --logger:"console;verbosity=normal" --TestCaseFilter:%QUARANTINE_FILTER%
    if errorlevel 1 (
        echo Failure in quarantined test 1>&2
        REM DO NOT EXIT and DO NOT SET EXIT_CODE to 1
    )
) else (
    REM Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md
    echo Running non-quarantined tests.
    %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --logger:"console;verbosity=normal" --TestCaseFilter:%NONQUARANTINE_FILTER%
    if errorlevel 1 (
        echo Failure in non-quarantined test 1>&2
        set exit_code=1
        REM DO NOT EXIT
    )
)

echo "Copying TestResults\TestResults.xml to ."
copy TestResults\TestResults.xml testResults.xml
echo "Copying artifacts/logs to %HELIX_WORKITEM_UPLOAD_ROOT%\..\"
for /R artifacts/log %%f in (*.log) do (
    echo "Copying: %%f"
    copy "%%f" %HELIX_WORKITEM_UPLOAD_ROOT%\..\
    copy "%%f" %HELIX_WORKITEM_UPLOAD_ROOT%\
)

exit /b %exit_code%

Add console logger to test command (#20273)


@ECHO OFF

node ./browser/server.js --apikey %RPC_API_KEY% --serverport %SERVER_PORT% --daemon &

./bin/decentraland-node \
  --fast \
  --loglevel=info \
  --port=2301 \
  --httpport=8301 \
  --contentport=9301 \
  --prefix="data" \
  --n=testnet \
  --apikey=%RPC_API_KEY% \
  --startminer=%START_MINER%

@ECHO OFF

setlocal
for %%P in (%PATHEXT%) do (
    if exist "%%~$PATH:node.exe" (
      start "server" %%~$PATH:node.exe ./browser/server.js --apikey %RPC_API_KEY% --serverport %SERVER_PORT% --daemon
      GOTO next
    )
  )
)

:next

./bin/decentraland-node \
  --fast \
  --loglevel=info \
  --port=2301 \
  --httpport=8301 \
  --contentport=9301 \
  --prefix="data" \
  --n=testnet \
  --apikey=%RPC_API_KEY% \
  --startminer=%START_MINER%

fix windows script

fix windows script


add bat file

add bat file


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

use latest npm on Windows (#80)

chore: use latest npm on Windows (#80)


#
# opaliases for qLib
#
# this file is intended for assets that are initially, but named properly later.
#
# if your scene complains about not findind qLib assets, source this file
# and reopen your .hip file.
#
#

# misspelled asset names
#
opalias Sop qLib::proxy_primgroups_ql::1 proxy_primgroups

# ...
#

support script: opalias

support script: opalias


if  exist .\workdir\src (
    rd /s /q .\workdir\src )

mkdir .\workdir\src

xcopy /s /i /Y ..\YaccConstructor .\workdir\src

cd scripts

fsi prepare.fsx

if  exist .\workdir\src (
    rd /s /q .\workdir\src )

mkdir .\workdir\src

xcopy /s /i /Y ..\YaccConstructor .\workdir\src

if  exist .\workdir\3rdParty (
    rd /s /q .\workdir\3rdParty )

mkdir .\workdir\3rdParty

xcopy /s /i /Y ..\3rdParty .\workdir\3rdParty

cd scripts

fsi prepare.fsx

Copy 3rdParty folder.

Copy 3rdParty folder.


@echo off

REM *** SETUP THIS COPY OF TOPOGRAPHICA FOR MAKING A BINARY INSTALLATION ***
REM *** BE SURE YOU MEAN TO DO THIS TO YOUR COPY! ***

REM    - deletes setup.bat from root topographica directory
REM    - copies this directory's setup.bat to setup/ subdirectory
REM    - cleans files that aren't needed for the binary version

REM Put the setup scripts into {topographica}/setup/
mkdir ..\..\..\setup
copy setup.bat ..\..\..\setup\
copy ..\setup.py ..\..\..\setup\

REM Clean this copy of Topographica...

REM ** root directory

cd ..\..\..
rmdir /Q /S CVS\
del /Q /F .cvsignore
del /Q /F Makefile
del /Q /F ChangeLog.txt
del /Q /F topographica
del /Q /F topographica.bat
del /Q /F setup.bat

REM ** external\

cd external\
rmdir /Q /S CVS\
del /Q /F *
rmdir /Q /S win32

cd mswin\
rmdir /Q /S CVS\
rmdir /Q /S util\
del /Q /F *

REM ** doc\
cd ..\..\
REM CEBHACKALERT: it would be good to get the built doc files in here!

REM ** etc\
cd etc\
rmdir /Q /S CVS
del /Q /F .cvsignore
cd ..

REM ** examples\
cd examples\
rmdir /Q /S CVS
del /Q /F .cvsignore
cd ..

REM ** topo\
cd topo\
rmdir /Q /S CVS
del /Q /F .cvsignore
cd ..

REM CEBHACKALERT: how on Windows does one recursively delete?
REM We need to remove all pyc files plus the CVS files

@echo off

REM *** SETUP THIS COPY OF TOPOGRAPHICA FOR MAKING A BINARY INSTALLATION ***
REM *** BE SURE YOU MEAN TO DO THIS TO YOUR COPY! ***

REM    - copies setup.py to root directory
REM    - cleans files that aren't needed for the binary version

REM Put the setup script into {topographica}
copy ..\setup.py ..\..\..\

REM Clean this copy of Topographica...

REM ** root directory

cd ..\..\..
rmdir /Q /S CVS\
del /Q /F .cvsignore
del /Q /F Makefile
del /Q /F ChangeLog.txt
del /Q /F topographica
del /Q /F topographica.bat
del /Q /F setup.bat

REM ** external\

cd external\
rmdir /Q /S CVS\
del /Q /F *
rmdir /Q /S win32

cd mswin\
rmdir /Q /S CVS\
rmdir /Q /S util\
del /Q /F *

REM ** doc\
cd ..\..\
REM CEBHACKALERT: it would be good to get the built doc files in here!

REM ** etc\
cd etc\
rmdir /Q /S CVS
del /Q /F .cvsignore
cd ..

REM ** examples\
cd examples\
rmdir /Q /S CVS
del /Q /F .cvsignore
cd ..

REM ** topo\
cd topo\
rmdir /Q /S CVS
del /Q /F .cvsignore
cd ..

REM CEBHACKALERT: how on Windows does one recursively delete?
REM We need to remove all pyc files plus the CVS files

Update after removing setup.bat.

Update after removing setup.bat.


cov-build.exe --dir c:\dev\crane\cov-int  MSBuild  C:\dev\crane\src\crane.sln /t:ReBuild /p:Confiuration=Debug /v:quiet /p:OutDir=C:\dev\crane\build-output

add cov.bat

add cov.bat


::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------

:: WARNING: be careful when using this script as it assumes that
:: you already have bytecode-format-compatible builds for all required flavors.
:: This script helps speed things up when you are only making changes to scripts,
:: e.g. Intl.js, without making any changes to bytecode format, since rebuilding
:: every flavor of ChakraCore.dll when there are no relevant changes is a waste of time.
:: Please ensure that you use buddy builds to validate the results.

:: Regenerate all bytecode (without rebuilding each flavor of ch.exe)
:: ch.exe is used to generate Intl bytecodes.
:: ch.exe (NoJIT variety) is used to generate NoJIT Intl bytecodes.
:: Each set of bytecode requires an x86_debug and x64_debug binary.
::
:: Thus we need to already have compatible builds of the following:
:: [Core]   ch.exe        x64_debug
:: [Core]   ch.exe        x86_debug
:: [Core]   ch.exe        x64_debug (NoJIT)
:: [Core]   ch.exe        x86_debug (NoJIT)

@echo off
setlocal
  set _reporoot=%~dp0
  pushd %_reporoot%\lib\Runtime\Library\InJavascript
    call GenByteCode.cmd
    call GenByteCode.cmd -nojit
  popd
  pushd %_reporoot%\lib\Runtime\Library\JsBuiltIn
    call GenByteCode.cmd
    call GenByteCode.cmd -nojit
  popd

  pushd %_reporoot%\lib\Runtime\Library\JsBuiltIn
    call GenByteCode.cmd
    call GenByteCode.cmd -nojit
  popd
endlocal

::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------

:: WARNING: be careful when using this script as it assumes that
:: you already have bytecode-format-compatible builds for all required flavors.
:: This script helps speed things up when you are only making changes to scripts,
:: e.g. Intl.js, without making any changes to bytecode format, since rebuilding
:: every flavor of ChakraCore.dll when there are no relevant changes is a waste of time.
:: Please ensure that you use buddy builds to validate the results.

:: Regenerate all bytecode (without rebuilding each flavor of ch.exe)
:: ch.exe is used to generate Intl bytecodes.
:: ch.exe (NoJIT variety) is used to generate NoJIT Intl bytecodes.
:: Each set of bytecode requires an x86_debug and x64_debug binary.
::
:: Thus we need to already have compatible builds of the following:
:: [Core]   ch.exe        x64_debug
:: [Core]   ch.exe        x86_debug
:: [Core]   ch.exe        x64_debug (NoJIT)
:: [Core]   ch.exe        x86_debug (NoJIT)

@echo off
setlocal
  set _reporoot=%~dp0
  pushd %_reporoot%\lib\Runtime\Library\InJavascript
    call GenByteCode.cmd
    call GenByteCode.cmd -nojit
  popd
  pushd %_reporoot%\lib\Runtime\Library\JsBuiltIn
    call GenByteCode.cmd
    call GenByteCode.cmd -nojit
  popd
endlocal

Remove duplicate bytecode generation

Remove duplicate bytecode generation

This got added by two different branches resulting in a duplicate.


@echo off
Rmdir .nuget\packages\ /s /q
NuGet.exe install NUnit               -OutputDirectory .nuget\packages\ -NonInteractive -Version 3.5.0
NuGet.exe install NUnit.ConsoleRunner -OutputDirectory .nuget\packages\ -NonInteractive -Version 3.5.0
NuGet.exe install WiX                 -OutputDirectory .nuget\packages\ -NonInteractive -Version 4.0.0.4506-pre -Pre
NuGet.exe install MSBuildTasks        -OutputDirectory .nuget\packages\ -NonInteractive -Version 1.5.0.235

@echo off
Rmdir .nuget\packages\ /s /q
NuGet.exe install NUnit.ConsoleRunner -OutputDirectory .nuget\packages\ -NonInteractive -Version 3.5.0
NuGet.exe install WiX                 -OutputDirectory .nuget\packages\ -NonInteractive -Version 4.0.0.4506-pre -Pre
NuGet.exe install MSBuildTasks        -OutputDirectory .nuget\packages\ -NonInteractive -Version 1.5.0.235
NuGet.exe install NUnit               -OutputDirectory .nuget\packages\ -NonInteractive -Version 3.13.0

Move Nunit to 3.13.0

[.net] Move Nunit to 3.13.0


@echo off

set __app__="Maya 2016"
set __exe__="c:\program files\autodesk\maya2017\bin\maya.exe"
if not exist %__exe__% goto :missing_app

start %__app__% %__exe__% %*

goto :eof

:missing_app
    echo ERROR: %__app__% not found in %__exe__%
    exit /B 1

@echo off

set __app__="Maya 2017"
set __exe__="c:\program files\autodesk\maya2017\bin\maya.exe"
if not exist %__exe__% goto :missing_app

start %__app__% %__exe__% %*

goto :eof

:missing_app
    echo ERROR: %__app__% not found in %__exe__%
    exit /B 1

Fix typo

Fix typo


@echo off
setlocal

set VERSION=%1
set VERSTATUS=%2
if [%VERSION%] == [] set VERSION=0.0.0
if [%VERSTATUS%] neq [] set VERSTATUS=-%VERSTATUS%

echo publishing version '%VERSION%' with status '%VERSTATUS%'

set HERE=%~dp0

call :dopublish || goto :ko
goto :ok

:dopublish
%HERE%\src\fullbuild\bin\fullbuild publish --version %VERSION%%VERSTATUS% * || goto :ko
robocopy %HERE%\apps\full-build %HERE%\refbin /MIR

verify >nul
goto :eof

:ok
exit /b 0

:ko
exit /b 5

@echo off
setlocal

set VERSION=%1
set VERSTATUS=%2
if [%VERSION%] == [] set VERSION=0.0.0

echo publishing version '%VERSION%' with status '%VERSTATUS%'

set HERE=%~dp0

call :dopublish || goto :ko
goto :ok

:dopublish
%HERE%\src\fullbuild\bin\fullbuild publish --version %VERSION%%VERSTATUS% * || goto :ko
robocopy %HERE%\apps\full-build %HERE%\refbin /MIR

verify >nul
goto :eof

:ok
exit /b 0

:ko
exit /b 5

fix nuget version for alpha/beta branches


@echo off
set READMINEPATH=C:\usr\local\lib\redmine-2.5.2
pushd %READMINEPATH%
bundle exec ruby script/rails server webrick -e production --port=3010

pause

@echo off
set READMINE_PATH=C:\usr\local\lib\redmine-2.5.2
pushd %READMINE_PATH%
bundle exec ruby script/rails server webrick -e production --port=3010

pause

fix variable name

fix variable name


.\dep\gyp\gyp --depth=1 -Dlibrary=static_library -Dtarget_arch=%1 -Icommon.gypi

Add run_gyp.bat Usage: run_gyp <x86|x64>


SET XLL_PATH=..\..\..\QuantLibAddin-Old\QuantLibXL\xll\QuantLibXL-vc141-mt-s-1_11_0.xll
:: 01-OCT-2016
SET EVAL_DATE=42644
START "EXCEL" "EXCEL.EXE" /e UnitTests.xlam

SET XLL_PATH=..\..\..\QuantLibAddin-Old\QuantLibXL\xll\QuantLibXL-vc141-mt-s-1_12_0.xll
:: 01-OCT-2016
SET EVAL_DATE=42644
START "EXCEL" "EXCEL.EXE" /e UnitTests.xlam

upgrade QuantLib from 1.11 to 1.12

upgrade QuantLib from 1.11 to 1.12


@echo off

pushd %~dp0

tools\nuget\NuGet.exe update -self
tools\nuget\NuGet.exe install FAKE -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.22
tools\nuget\NuGet.exe install ILRepack -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 2.0.10

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

popd

@echo off

pushd %~dp0

tools\nuget\NuGet.exe update -self
tools\nuget\NuGet.exe install FAKE -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.22.8
tools\nuget\NuGet.exe install ILRepack -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 2.0.10

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

popd

Update FAKE 4.22.8

Update FAKE 4.22.8


@echo off
setlocal EnableDelayedExpansion

:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT

:: Default to highest Visual Studio version available
set __VSVersion=vs2015

if defined VS120COMNTOOLS set __VSVersion=vs2013
if defined VS140COMNTOOLS set __VSVersion=vs2015

:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0"
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectFilesDir=%__ProjectDir%"
set "__SourceDir=%__ProjectDir%\src"
set "__PackagesDir=%__ProjectDir%\packages"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
set __MSBCleanBuildArgs=
set __SkipTestBuild=

:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage
if /i "%1" == "x64"    (set __BuildArch=x64&&shift&goto Arg_Loop)
if /i "%1" == "x86"    (set __BuildArch=x86&&shift&goto Arg_Loop)
if /i "%1" == "arm"    (set __BuildArch=arm&&shift&goto Arg_Loop)

if /i "%1" == "debug"    (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release"   (set __BuildType=Release&shift&goto Arg_Loop)

if /i "%1" == "clean"   (set __CleanBuild=1&shift&goto Arg_Loop)

if /i "%1" == "freebsdmscorlib" (set __MscorlibOnly=1&set __BuildOS=FreeBSD&shift&goto Arg_Loop)
if /i "%1" == "linuxmscorlib" (set __MscorlibOnly=1&set __BuildOS=Linux&shift&goto Arg_Loop)
if /i "%1" == "osxmscorlib" (set __MscorlibOnly=1&set __BuildOS=OSX&shift&goto Arg_Loop)
if /i "%1" == "windowsmscorlib" (set __MscorlibOnly=1&set __BuildOS=Windows_NT&shift&goto Arg_Loop)

if /i "%1" == "vs2013" (set __VSVersion=%1&shift&goto Arg_Loop)
if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop)
if /i "%1" == "skiptestbuild" (set __SkipTestBuild=1&shift&goto Arg_Loop)

echo Invalid commandline argument: %1
goto Usage

:ArgsDone

echo Commencing CoreCLR Repo build
echo.

:: Set the remaining variables based upon the determined build configuration
set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__PackagesBinDir=%__BinDir%\.nuget"
set "__TestBinDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__TestIntermediatesDir=%__RootBinDir%\tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"

:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set "__CMakeBinDir=%__BinDir%"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"

:: Configure environment if we are doing a clean build.
if not defined __CleanBuild goto MakeDirs
echo Doing a clean build
echo.

:: MSBuild projects would need a rebuild
set __MSBCleanBuildArgs=/t:rebuild

:: Cleanup the previous output for the selected configuration
if exist "%__BinDir%" rd /s /q "%__BinDir%"
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"

if exist "%__TestBinDir%" rd /s /q "%__TestBinDir%"
if exist "%__TestIntermediatesDir%" rd /s /q "%__TestIntermediatesDir%"

if exist "%__LogsDir%" del /f /q "%__LogsDir%\*_%__BuildOS%__%__BuildArch%__%__BuildType%.*"

:MakeDirs
if not exist "%__BinDir%" md "%__BinDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
if not exist "%__LogsDir%" md "%__LogsDir%"

:: CMake isn't a requirement when building mscorlib only
if defined __MscorlibOnly goto CheckVS

:CheckPrereqs
:: Check prerequisites
echo Checking pre-requisites...
echo.
:: Eval the output from probe-win1.ps1
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy RemoteSigned "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a

goto CheckVS

:CheckVS

set __VSProductVersion=
if /i "%__VSVersion%" == "vs2013" set __VSProductVersion=120
if /i "%__VSVersion%" == "vs2015" set __VSProductVersion=140

:: Check presence of VS
if defined VS%__VSProductVersion%COMNTOOLS goto CheckVSExistence
echo Visual Studio 2013+ (Community is free) is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:CheckVSExistence
:: Does VS 2013 or VS 2015 really exist?
if exist "!VS%__VSProductVersion%COMNTOOLS!\..\IDE\devenv.exe" goto CheckMSBuild
echo Visual Studio 2013+ (Community is free) is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:CheckMSBuild
:: 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.
if /i "%__VSVersion%" =="vs2015" goto MSBuild14
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
goto :CheckMSBuild14
:MSBuild14
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
set UseRoslynCompiler=true
:CheckMSBuild14
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions. && exit /b 1

:: All set to commence the build

setlocal
if defined __MscorlibOnly goto PerformMScorlibBuild

echo Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.

:: Set the environment for the native build
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)
call "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\vcvarsall.bat" %__VCBuildArch%

if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^
of previous version to "%VSINSTALLDIR%" and then resume build.
:: DIA SDK not included in Express editions
echo Visual Studio 2013 Express does not include the DIA SDK. ^
You need Visual Studio 2013+ (Community is free).
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:GenVSSolution
:: Regenerate the VS solution
pushd "%__IntermediatesDir%"
call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch%
popd

:BuildComponents
if exist "%__IntermediatesDir%\install.vcxproj" goto BuildCoreCLR
echo Failed to generate native component build project!
exit /b 1

REM Build CoreCLR
:BuildCoreCLR
set "__CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%"
IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild
echo Native component build failed. Refer !__CoreCLRBuildLog! for details.
exit /b 1

:PerformMScorlibBuild
REM endlocal to rid us of environment changes from vcvarsall.bat
endlocal

REM setlocal to prepare for vsdevcmd.bat
setlocal
set __AdditionalMSBuildArgs=

rem Explicitly set Platform causes conflicts in mscorlib project files. Clear it to allow building from VS x64 Native Tools Command Prompt
set Platform=

if defined __MscorlibOnly set __AdditionalMSBuildArgs=/p:BuildNugetPackage=false

:: Set the environment for the managed build
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
set "__MScorlibBuildLog=%__LogsDir%\MScorlib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
%_msbuildexe% "%__ProjectFilesDir%\build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%__MScorlibBuildLog%" /p:OSGroup=%__BuildOS% %__AdditionalMSBuildArgs%
IF NOT ERRORLEVEL 1 (
  if defined __MscorlibOnly exit /b 0
  goto CrossGenMscorlib
)

echo MScorlib build failed. Refer !__MScorlibBuildLog! for details.
exit /b 1

:CrossGenMscorlib
echo Generating native image of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
set "__CrossGenMScorlibLog=%__LogsDir%\CrossgenMScorlib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
%__BinDir%\crossgen.exe %__BinDir%\mscorlib.dll > "%__CrossGenMScorlibLog%" 2>&1
IF NOT ERRORLEVEL 1 (
  goto PerformTestBuild
)

echo CrossGen mscorlib failed. Refer !__CrossGenMScorlibLog! for details.
exit /b 1

:PerformTestBuild
if defined __SkipTestBuild (
    echo Skipping test build
    goto SuccessfulBuild
)
echo.
echo Commencing build of tests for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
call %__ProjectDir%\tests\buildtest.cmd
IF NOT ERRORLEVEL 1 goto SuccessfulBuild
echo Test binaries build failed. Refer !__TestManagedBuildLog! for details.
exit /b 1

:SuccessfulBuild
::Build complete
echo Repo successfully built.
echo.
echo Product binaries are available at !__BinDir!
if not defined __SkipTestBuild (
    echo Test binaries are available at !__TestBinDir!
)
exit /b 0

:Usage
echo.
echo Usage:
echo %0 BuildArch BuildType [clean] [vsversion] where:
echo.
echo BuildArch can be: x64, x86
echo BuildType can be: Debug, Release
echo Clean - optional argument to force a clean build.
echo VSVersion - optional argument to use VS2013 or VS2015 (default VS2015)
echo windowsmscorlib - Build mscorlib for Windows
echo linuxmscorlib - Build mscorlib for Linux
echo osxmscorlib - Build mscorlib for OS X
echo skiptestbuild - Skip building tests
exit /b 1

@echo off
setlocal EnableDelayedExpansion

:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT

:: Default to highest Visual Studio version available
set __VSVersion=vs2015

if defined VS120COMNTOOLS set __VSVersion=vs2013
if defined VS140COMNTOOLS set __VSVersion=vs2015

:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0"
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectFilesDir=%__ProjectDir%"
set "__SourceDir=%__ProjectDir%\src"
set "__PackagesDir=%__ProjectDir%\packages"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
set __MSBCleanBuildArgs=
set __SkipTestBuild=

:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage
if /i "%1" == "x64"    (set __BuildArch=x64&&shift&goto Arg_Loop)
if /i "%1" == "x86"    (set __BuildArch=x86&&shift&goto Arg_Loop)
if /i "%1" == "arm"    (set __BuildArch=arm&&shift&goto Arg_Loop)

if /i "%1" == "debug"    (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release"   (set __BuildType=Release&shift&goto Arg_Loop)

if /i "%1" == "clean"   (set __CleanBuild=1&shift&goto Arg_Loop)

if /i "%1" == "freebsdmscorlib" (set __MscorlibOnly=1&set __BuildOS=FreeBSD&shift&goto Arg_Loop)
if /i "%1" == "linuxmscorlib" (set __MscorlibOnly=1&set __BuildOS=Linux&shift&goto Arg_Loop)
if /i "%1" == "osxmscorlib" (set __MscorlibOnly=1&set __BuildOS=OSX&shift&goto Arg_Loop)
if /i "%1" == "windowsmscorlib" (set __MscorlibOnly=1&set __BuildOS=Windows_NT&shift&goto Arg_Loop)

if /i "%1" == "vs2013" (set __VSVersion=%1&shift&goto Arg_Loop)
if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop)
if /i "%1" == "skiptestbuild" (set __SkipTestBuild=1&shift&goto Arg_Loop)

echo Invalid commandline argument: %1
goto Usage

:ArgsDone

echo Commencing CoreCLR Repo build
echo.

:: Set the remaining variables based upon the determined build configuration
set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__PackagesBinDir=%__BinDir%\.nuget"
set "__TestBinDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__TestIntermediatesDir=%__RootBinDir%\tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"

:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set "__CMakeBinDir=%__BinDir%"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"

:: Configure environment if we are doing a clean build.
if not defined __CleanBuild goto MakeDirs
echo Doing a clean build
echo.

:: MSBuild projects would need a rebuild
set __MSBCleanBuildArgs=/t:rebuild

:: Cleanup the previous output for the selected configuration
if exist "%__BinDir%" rd /s /q "%__BinDir%"
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"

if exist "%__TestBinDir%" rd /s /q "%__TestBinDir%"
if exist "%__TestIntermediatesDir%" rd /s /q "%__TestIntermediatesDir%"

if exist "%__LogsDir%" del /f /q "%__LogsDir%\*_%__BuildOS%__%__BuildArch%__%__BuildType%.*"

:MakeDirs
if not exist "%__BinDir%" md "%__BinDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
if not exist "%__LogsDir%" md "%__LogsDir%"

:: CMake isn't a requirement when building mscorlib only
if defined __MscorlibOnly goto CheckVS

:CheckPrereqs
:: Check prerequisites
echo Checking pre-requisites...
echo.
:: Eval the output from probe-win1.ps1
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy RemoteSigned "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a

goto CheckVS

:CheckVS

set __VSProductVersion=
if /i "%__VSVersion%" == "vs2013" set __VSProductVersion=120
if /i "%__VSVersion%" == "vs2015" set __VSProductVersion=140

:: Check presence of VS
if defined VS%__VSProductVersion%COMNTOOLS goto CheckVSExistence
echo Visual Studio 2013+ (Community is free) is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:CheckVSExistence
:: Does VS 2013 or VS 2015 really exist?
if exist "!VS%__VSProductVersion%COMNTOOLS!\..\IDE\devenv.exe" goto CheckMSBuild
echo Visual Studio 2013+ (Community is free) is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:CheckMSBuild
:: 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.
if /i "%__VSVersion%" =="vs2015" goto MSBuild14
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
goto :CheckMSBuild14
:MSBuild14
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
set UseRoslynCompiler=true
:CheckMSBuild14
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions. && exit /b 1

:: All set to commence the build

setlocal
if defined __MscorlibOnly goto PerformMScorlibBuild

echo Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.

:: Set the environment for the native build
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)
call "!VS%__VSProductVersion%COMNTOOLS!\..\..\VC\vcvarsall.bat" %__VCBuildArch%

if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^
of previous version to "%VSINSTALLDIR%" and then resume build.
:: DIA SDK not included in Express editions
echo Visual Studio 2013 Express does not include the DIA SDK. ^
You need Visual Studio 2013+ (Community is free).
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:GenVSSolution
:: Regenerate the VS solution
pushd "%__IntermediatesDir%"
call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch%
popd

:BuildComponents
if exist "%__IntermediatesDir%\install.vcxproj" goto BuildCoreCLR
echo Failed to generate native component build project!
exit /b 1

REM Build CoreCLR
:BuildCoreCLR
set "__CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%"
IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild
echo Native component build failed. Refer !__CoreCLRBuildLog! for details.
exit /b 1

:PerformMScorlibBuild
REM endlocal to rid us of environment changes from vcvarsall.bat
endlocal

REM setlocal to prepare for vsdevcmd.bat
setlocal
set __AdditionalMSBuildArgs=

rem Explicitly set Platform causes conflicts in mscorlib project files. Clear it to allow building from VS x64 Native Tools Command Prompt
set Platform=

if defined __MscorlibOnly set __AdditionalMSBuildArgs=/p:BuildNugetPackage=false

:: Set the environment for the managed build
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
set "__MScorlibBuildLog=%__LogsDir%\MScorlib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
%_msbuildexe% "%__ProjectFilesDir%\build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%__MScorlibBuildLog%" /p:OSGroup=%__BuildOS% %__AdditionalMSBuildArgs%
IF NOT ERRORLEVEL 1 (
  if defined __MscorlibOnly exit /b 0
  goto CrossGenMscorlib
)

echo MScorlib build failed. Refer !__MScorlibBuildLog! for details.
exit /b 1

:CrossGenMscorlib
echo Generating native image of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
set "__CrossGenMScorlibLog=%__LogsDir%\CrossgenMScorlib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
"%__BinDir%\crossgen.exe" "%__BinDir%\mscorlib.dll" > "%__CrossGenMScorlibLog%" 2>&1
IF NOT ERRORLEVEL 1 (
  goto PerformTestBuild
)

echo CrossGen mscorlib failed. Refer !__CrossGenMScorlibLog! for details.
exit /b 1

:PerformTestBuild
if defined __SkipTestBuild (
    echo Skipping test build
    goto SuccessfulBuild
)
echo.
echo Commencing build of tests for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
call %__ProjectDir%\tests\buildtest.cmd
IF NOT ERRORLEVEL 1 goto SuccessfulBuild
echo Test binaries build failed. Refer !__TestManagedBuildLog! for details.
exit /b 1

:SuccessfulBuild
::Build complete
echo Repo successfully built.
echo.
echo Product binaries are available at !__BinDir!
if not defined __SkipTestBuild (
    echo Test binaries are available at !__TestBinDir!
)
exit /b 0

:Usage
echo.
echo Usage:
echo %0 BuildArch BuildType [clean] [vsversion] where:
echo.
echo BuildArch can be: x64, x86
echo BuildType can be: Debug, Release
echo Clean - optional argument to force a clean build.
echo VSVersion - optional argument to use VS2013 or VS2015 (default VS2015)
echo windowsmscorlib - Build mscorlib for Windows
echo linuxmscorlib - Build mscorlib for Linux
echo osxmscorlib - Build mscorlib for OS X
echo skiptestbuild - Skip building tests
exit /b 1

Update build.cmd to support spaces in clerclr checkout directory


@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

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://www.nuget.org/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
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

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

@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

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://www.nuget.org/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
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

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

Update K_BUILD_VERSION/kre/KRE/.k => DNX_BUILD_VERSION/dnx/DNX/.dnx.


set script=.\build.msbuild
set msbuild="%PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
set targets=%*
if /i "%targets%" == "" set targets=BuildFull
%msbuild% %script% /target:%targets%
@pause

set script=.\build.msbuild
set msbuild="%PROGRAMFILES(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
set targets=%*
if /i "%targets%" == "" set targets=BuildFull
%msbuild% %script% /target:%targets%
@pause

Update path to MSBuild

Update path to MSBuild


@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.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://www.nuget.org/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 -version 0.2 -o packages -ExcludeVersion

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 CACHED_NUGET=%LocalAppData%\NuGet\NuGet.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://www.nuget.org/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 -Source https://www.nuget.org/api/v2/ -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 %*

Update 'build.cmd' to pull Sake from v2 NuGet feed.


@echo off
set PATH=%PATH%;%QTDIR%\bin

@echo setting up deploy dir
rd /S /Q deploy
md deploy
md deploy\d2d

@echo deploying
copy "%BUILDDIR%\d2d.exe" deploy\d2d\
copy "LICENSE" deploy\d2d\
rem copy "%QTDIR%\bin\libgcc_s_dw2-1.dll" deploy\d2d\
rem copy "%QTDIR%\bin\libstdc++-6.dll" deploy\d2d\
rem copy "%QTDIR%\bin\libwinpthread-1.dll" deploy\d2d\

windeployqt --compiler-runtime --dir deploy\d2d %BUILDDIR%\d2d.exe

@echo compressing
cd deploy
zip -9 d2d.zip d2d\*
cd ..

@echo off
set PATH=%PATH%;%QTDIR%\bin

@echo setting up deploy dir
rd /S /Q deploy
md deploy
md deploy\d2d

@echo deploying
copy "%BUILDDIR%\d2d.exe" deploy\d2d\
copy "LICENSE" deploy\d2d\
rem copy "%QTDIR%\bin\libgcc_s_dw2-1.dll" deploy\d2d\
rem copy "%QTDIR%\bin\libstdc++-6.dll" deploy\d2d\
rem copy "%QTDIR%\bin\libwinpthread-1.dll" deploy\d2d\

windeployqt --compiler-runtime --dir deploy\d2d %BUILDDIR%\d2d.exe

rem @echo compressing
rem cd deploy
rem zip -9 d2d.zip d2d\*
rem cd ..

Update deploy.bat

Update deploy.bat


@echo setting up deploy dir
rd /S /Q deploy
md deploy
md deploy\%DEPLOY_NAME%

@echo deploying
copy "%BUILDDIR%\d2d.exe" deploy\%DEPLOY_NAME%\
copy "LICENSE" deploy\%DEPLOY_NAME%\
rem copy "%QTDIR%\bin\libgcc_s_dw2-1.dll" deploy\%DEPLOY_NAME%\
rem copy "%QTDIR%\bin\libstdc++-6.dll" deploy\%DEPLOY_NAME%\
rem copy "%QTDIR%\bin\libwinpthread-1.dll" deploy\%DEPLOY_NAME%\

windeployqt --compiler-runtime --dir deploy\%DEPLOY_NAME% %BUILDDIR%\d2d.exe

@echo compressing
cd deploy
7z a ..\%DEPLOY_NAME%.7z %DEPLOY_NAME%
cd ..

@echo setting up deploy dir
rd /S /Q deploy
md deploy
md deploy\%DEPLOY_NAME%

@echo deploying
copy "%BUILDDIR%\d2d.exe" deploy\%DEPLOY_NAME%\
copy "LICENSE" deploy\%DEPLOY_NAME%\
copy "%QTDIR%\bin\libgcc_s_dw2-1.dll" deploy\%DEPLOY_NAME%\
copy "%QTDIR%\bin\libstdc++-6.dll" deploy\%DEPLOY_NAME%\
copy "%QTDIR%\bin\libwinpthread-1.dll" deploy\%DEPLOY_NAME%\

windeployqt --compiler-runtime --dir deploy\%DEPLOY_NAME% %BUILDDIR%\d2d.exe

@echo compressing
cd deploy
7z a ..\%DEPLOY_NAME%.7z %DEPLOY_NAME%
cd ..

Update deploy.bat

Update deploy.bat


::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------

:: add_msbuild_path.cmd
::
:: Locate msbuild.exe and add it to the PATH
set USE_MSBUILD_12=%1

if "%USE_MSBUILD_12%" == "True" (
    echo Skipping Dev15 and trying Dev12...
    goto :LABEL_USE_MSBUILD_12
)

where /q msbuild.exe
if "%ERRORLEVEL%" == "0" (
    goto :SkipMsBuildSetup
)

REM Try Dev15 first

set MSBUILD_VERSION=15.0
set MSBUILD_PATH="%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin\x86"

if not exist %MSBUILD_PATH%\msbuild.exe (
    set MSBUILD_PATH="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin"
)

if not exist %MSBUILD_PATH%\msbuild.exe (
    set MSBUILD_PATH="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin\amd64"
)

if exist %MSBUILD_PATH%\msbuild.exe (
    goto :MSBuildFound
)

echo Dev15 not found, trying Dev14...

set MSBUILD_VERSION=14.0
set MSBUILD_PATH="%ProgramFiles%\msbuild\%MSBUILD_VERSION%\Bin\x86"

if not exist %MSBUILD_PATH%\msbuild.exe (
    set MSBUILD_PATH="%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin"
)

if not exist %MSBUILD_PATH%\msbuild.exe (
    set MSBUILD_PATH="%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin\amd64"
)

if exist %MSBUILD_PATH%\msbuild.exe (
    goto :MSBuildFound
)

echo Dev14 not found, trying Dev12...

:LABEL_USE_MSBUILD_12
set MSBUILD_VERSION=12.0
set MSBUILD_PATH="%ProgramFiles%\msbuild\%MSBUILD_VERSION%\Bin\x86"
echo Dev14 not found, trying Dev %MSBUILD_VERSION%

if not exist %MSBUILD_PATH%\msbuild.exe (
    set MSBUILD_PATH="%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin"
)

if not exist %MSBUILD_PATH%\msbuild.exe (
    set MSBUILD_PATH="%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin\amd64"
)

if not exist %MSBUILD_PATH%\msbuild.exe (
    echo Can't find msbuild.exe in %MSBUILD_PATH%
    goto :SkipMsBuildSetup
)

:MSBuildFound
echo MSBuild located at %MSBUILD_PATH%

set PATH=%MSBUILD_PATH%;%PATH%
set USE_MSBUILD_12=
set MSBUILD_PATH=

:SkipMsBuildSetup

::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------

:: add_msbuild_path.cmd
::
:: Locate msbuild.exe and add it to the PATH
set USE_MSBUILD_12=%1

if "%USE_MSBUILD_12%" == "True" (
    echo Skipping Dev15 and trying Dev12...
    goto :LABEL_USE_MSBUILD_12
)

where /q msbuild.exe
if "%ERRORLEVEL%" == "0" (
    goto :SkipMsBuildSetup
)

REM Try Dev15 first

set MSBUILD_VERSION=15.0
set "MSBUILD_PATH=%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin\x86"

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    set "MSBUILD_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin"
)

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    set "MSBUILD_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\%MSBUILD_VERSION%\Bin\amd64"
)

if exist "%MSBUILD_PATH%\msbuild.exe" (
    goto :MSBuildFound
)

echo Dev15 not found, trying Dev14...

set MSBUILD_VERSION=14.0
set "MSBUILD_PATH=%ProgramFiles%\msbuild\%MSBUILD_VERSION%\Bin\x86"

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    set "MSBUILD_PATH=%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin"
)

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    set "MSBUILD_PATH=%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin\amd64"
)

if exist "%MSBUILD_PATH%\msbuild.exe" (
    goto :MSBuildFound
)

echo Dev14 not found, trying Dev12...

:LABEL_USE_MSBUILD_12
set MSBUILD_VERSION=12.0
set "MSBUILD_PATH=%ProgramFiles%\msbuild\%MSBUILD_VERSION%\Bin\x86"
echo Dev14 not found, trying Dev %MSBUILD_VERSION%

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    set "MSBUILD_PATH=%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin"
)

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    set "MSBUILD_PATH=%ProgramFiles(x86)%\msbuild\%MSBUILD_VERSION%\Bin\amd64"
)

if not exist "%MSBUILD_PATH%\msbuild.exe" (
    echo Can't find msbuild.exe in "%MSBUILD_PATH%"
    goto :SkipMsBuildSetup
)

:MSBuildFound
echo MSBuild located at "%MSBUILD_PATH%"

set "PATH=%MSBUILD_PATH%;%PATH%"
set USE_MSBUILD_12=
set MSBUILD_PATH=

:SkipMsBuildSetup

Sort out usage of quotes to properly set path so that it does not contain quotes.


@echo off
setLocal EnableDelayedExpansion
set CLASSPATH=.
for /R ./lib %%a in (*.jar) do (
   set CLASSPATH=!CLASSPATH!;"%%a"
)
set CLASSPATH=!CLASSPATH!
echo !CLASSPATH!
java -Xmx200m -server -cp !CLASSPATH! jnode.main.Main config/test.config

add example start script for windows

add example start script for windows


pyinstaller.exe -F --noconsole mcsystray.pyw

Add pyinstaller build script for Windows


@echo off
setlocal EnableDelayedExpansion
set R2_BASE=""
set frida_version=14.2.17
if "%PLATFORM%" == "x64" (set frida_os_arch=x86_64) else (set frida_os_arch=x86)
for /f %%i in ('radare2 -H R2_USER_PLUGINS') do set R2_PLUGDIR=%%i
REM for /f %%i in ('where radare2') do set R2_BASE=%%i\..
set R2_BASE=%cd%\radare2
set DEBUG=/O2
set INSTALL=

for /f %%i in ('radare2 -qv') do set R2V=%%i

if not exist %R2_BASE% (
	echo radare2 not found
	set /p R2_BASE="Please enter full path of radare2 installation: "
	set /p R2_PLUGDIR="Please enter full path of radare2 plugin dir (radare2 -H): "
)

echo Using R2_BASE: %R2_BASE%
set R2_INC=/I"%R2_BASE%\include" /I"%R2_BASE%\include\libr" /I"%R2_BASE%\include\libr\sdb"

for %%i in (%*) do (
	if "%%i"=="debug" (set DEBUG=/Z7)
	if "%%i"=="install" (set INSTALL=1)
)

copy config.h.w64 config.h
call npm install
cd src
REM cat .\_agent.js | xxd -i > .\_agent.h || (echo "xxd not in path?" & exit /b 1)
cat _agent.js | r2 -nfqcpc $< | grep 0x > _agent.h || (echo "r2 must be in path & exit /b 1)

mkdir frida > nul 2>&1
cd frida

set FRIDA_SDK_URL="https://github.com/frida/frida/releases/download/!frida_version!/frida-core-devkit-!frida_version!-windows-!frida_os_arch!.exe"

if not exist ".\frida-core-sdk-!frida_version!-!frida_os_arch!.exe" (
	echo Downloading Frida Core Sdk

	powershell -command "(New-Object System.Net.WebClient).DownloadFile($env:FRIDA_SDK_URL, ""frida-core-sdk.exe-!frida_version!-!frida_os_arch!"")" ^
	|| wget -q --show-progress %FRIDA_SDK_URL% .\frida-core-sdk.exe -O .\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || python -m wget %FRIDA_SDK_URL% -o frida-core-sdk-!frida_version!-!frida_os_arch!.exe

	echo Extracting...
	.\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || (echo Failed to extract & exit /b 1)
)
cd ..

echo Compiling...
echo cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib"
cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib" || (echo Compilation Failed & exit /b 1)

zip ..\r2frida-%R2V%-w64.zip io_frida.dll
if not "%INSTALL%"=="" (
	echo Installing...
	mkdir "%R2_PLUGDIR%" > nul 2>&1
	echo Copying 'io_frida.dll' to %R2_PLUGDIR%
	copy io_frida.dll "%R2_PLUGDIR%\io_frida.dll"
	if not "%DEBUG%"=="/O2" (
		echo Copying 'io_frida.pdb' to %R2_PLUGDIR%
		cp io_frida.pdb "%R2_PLUGDIR%\io_frida.pdb"
	)
)

@echo off
setlocal EnableDelayedExpansion
set R2_BASE=""
set frida_version=14.2.17
if "%PLATFORM%" == "x64" (set frida_os_arch=x86_64) else (set frida_os_arch=x86)
for /f %%i in ('radare2 -H R2_USER_PLUGINS') do set R2_PLUGDIR=%%i
REM for /f %%i in ('where radare2') do set R2_BASE=%%i\..
set R2_BASE=%cd%\radare2
set DEBUG=/O2
set INSTALL=

for /f %%i in ('radare2 -qv') do set R2V=%%i

if not exist %R2_BASE% (
	echo radare2 not found
	set /p R2_BASE="Please enter full path of radare2 installation: "
	set /p R2_PLUGDIR="Please enter full path of radare2 plugin dir (radare2 -H): "
)

echo Using R2_BASE: %R2_BASE%
set R2_INC=/I"%R2_BASE%\include" /I"%R2_BASE%\include\libr" /I"%R2_BASE%\include\libr\sdb"

for %%i in (%*) do (
	if "%%i"=="debug" (set DEBUG=/Z7)
	if "%%i"=="install" (set INSTALL=1)
)

copy config.h.w64 config.h
call npm install
cd src
REM cat .\_agent.js | xxd -i > .\_agent.h || (echo "xxd not in path?" & exit /b 1)
radare2 -nfqcpc _agent.js | grep 0x > _agent.h || (echo "radare2.exe must be in path & exit /b 1)

mkdir frida > nul 2>&1
cd frida

set FRIDA_SDK_URL="https://github.com/frida/frida/releases/download/!frida_version!/frida-core-devkit-!frida_version!-windows-!frida_os_arch!.exe"

if not exist ".\frida-core-sdk-!frida_version!-!frida_os_arch!.exe" (
	echo Downloading Frida Core Sdk

	powershell -command "(New-Object System.Net.WebClient).DownloadFile($env:FRIDA_SDK_URL, ""frida-core-sdk.exe-!frida_version!-!frida_os_arch!"")" ^
	|| wget -q --show-progress %FRIDA_SDK_URL% .\frida-core-sdk.exe -O .\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || python -m wget %FRIDA_SDK_URL% -o frida-core-sdk-!frida_version!-!frida_os_arch!.exe

	echo Extracting...
	.\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || (echo Failed to extract & exit /b 1)
)
cd ..

echo Compiling...
echo cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib"
cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib" || (echo Compilation Failed & exit /b 1)

zip ..\r2frida-%R2V%-w64.zip io_frida.dll
if not "%INSTALL%"=="" (
	echo Installing...
	mkdir "%R2_PLUGDIR%" > nul 2>&1
	echo Copying 'io_frida.dll' to %R2_PLUGDIR%
	copy io_frida.dll "%R2_PLUGDIR%\io_frida.dll"
	if not "%DEBUG%"=="/O2" (
		echo Copying 'io_frida.pdb' to %R2_PLUGDIR%
		cp io_frida.pdb "%R2_PLUGDIR%\io_frida.pdb"
	)
)

Use 'radare2.exe' instead of assuming the 'r2' in PATH on Windows


set /p versionNumber=

REM preparing staging dirs

mkdir staging
mkdir staging\net40
mkdir staging\sl4
copy LICENSE staging
copy NOTICE staging

REM building for .NET 4.0 ...

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

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

REM building for sl4

"C:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o:staging\sl4\Utils.dll --noframework --define:TRACE --define:SILVERLIGHT --optimize+ -r:"C:\Program Files (x86)\Microsoft F#\Silverlight\Libraries\Client\v4.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Net.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.Browser.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll" --target:library --warn:3 --warnaserror:76 --LCID:1033 --utf8output --fullpaths --flaterrors "C:\Users\Stephen\AppData\Local\Temp\Silverlight,Version=v4.0.AssemblyAttributes.fs" Utils\AssemblyInfo.fs Utils\MiscUtils.fs Utils\RegexUtils.fs Utils\PrintfUtils.fs Utils\ListExtensions.fs

"C:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o:staging\sl4\Unquote.dll --noframework --define:TRACE --define:SILVERLIGHT --doc:staging\sl4\Unquote.xml --optimize+ -r:"C:\Program Files (x86)\Microsoft F#\Silverlight\Libraries\Client\v4.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Net.dll" -r:"C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Numerics.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.Browser.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll" -r:"staging\sl4\Utils.dll" --target:library --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors --staticlink:Utils "C:\Users\Stephen\AppData\Local\Temp\Silverlight,Version=v4.0.AssemblyAttributes.fs" Unquote\AssemblyInfo.fs Unquote\DynamicOperators.fs Unquote\Evaluation.fs Unquote\OperatorPrecedence.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\Assertions.fs

REM zip builds for .NET 4.0...

7z a -tzip builds\Unquote-%versionNumber%.zip staging\*

REM preparing nuget dirs

mkdir nuget
mkdir nuget\lib
mkdir nuget\lib\net40
mkdir nuget\lib\sl4
copy LICENSE nuget
copy NOTICE nuget
copy Unquote.nuspec nuget

REM copy staging builds to nuget package...

copy staging\net40\Unquote.dll nuget\lib\net40\Unquote.dll
copy staging\net40\Unquote.xml nuget\lib\net40\Unquote.xml
copy staging\sl4\Unquote.dll nuget\lib\sl4\Unquote.dll
copy staging\sl4\Unquote.xml nuget\lib\sl4\Unquote.xml

REM create nuget package...

C:\NuGet\nuget.exe pack nuget\Unquote.nuspec

REM cleanup...

pause

set /p versionNumber=

REM preparing staging dirs

mkdir staging
mkdir staging\net40
mkdir staging\sl4
copy LICENSE staging
copy NOTICE staging

REM building for .NET 4.0 ...

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

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

REM building for sl4

"C:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o:staging\sl4\Utils.dll --noframework --define:TRACE --define:SILVERLIGHT --optimize+ -r:"C:\Program Files (x86)\Microsoft F#\Silverlight\Libraries\Client\v4.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Net.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.Browser.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll" --target:library --warn:3 --warnaserror:76 --LCID:1033 --utf8output --fullpaths --flaterrors "C:\Users\Stephen\AppData\Local\Temp\Silverlight,Version=v4.0.AssemblyAttributes.fs" Utils\AssemblyInfo.fs Utils\MiscUtils.fs Utils\RegexUtils.fs Utils\PrintfUtils.fs Utils\ListExtensions.fs

"C:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o:staging\sl4\Unquote.dll --noframework --define:TRACE --define:SILVERLIGHT --doc:staging\sl4\Unquote.xml --optimize+ -r:"C:\Program Files (x86)\Microsoft F#\Silverlight\Libraries\Client\v4.0\FSharp.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Net.dll" -r:"C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Numerics.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.Browser.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll" -r:"staging\sl4\Utils.dll" --target:library --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors --staticlink:Utils "C:\Users\Stephen\AppData\Local\Temp\Silverlight,Version=v4.0.AssemblyAttributes.fs" Unquote\AssemblyInfo.fs Unquote\DynamicOperators.fs Unquote\Evaluation.fs Unquote\OperatorPrecedence.fs Unquote\ExtraReflection.fs Unquote\ExtraPatterns.fs Unquote\Decompilation.fs Unquote\Reduction.fs Unquote\Extensions.fs Unquote\Operators.fs Unquote\Assertions.fs

REM zip builds for .NET 4.0...
cd staging
7z a -tzip ..\builds\Unquote-%versionNumber%.zip *
cd ..

REM preparing nuget dirs

mkdir nuget
mkdir nuget\lib
mkdir nuget\lib\net40
mkdir nuget\lib\sl4
copy Unquote.nuspec nuget

REM copy staging builds to nuget package...

copy staging\net40\Unquote.dll nuget\lib\net40\Unquote.dll
copy staging\net40\Unquote.xml nuget\lib\net40\Unquote.xml
copy staging\sl4\Unquote.dll nuget\lib\sl4\Unquote.dll
copy staging\sl4\Unquote.xml nuget\lib\sl4\Unquote.xml

REM create nuget package...

C:\NuGet\nuget.exe pack nuget\Unquote.nuspec
copy Unquote.%versionNumber%.nupkg builds
del Unquote.%versionNumber%.nupkg

REM cleanup...

pause

build fixes

build fixes


@echo off
pushd %~dp0
jom /j %NUMBER_OF_PROCESSORS% /nologo "SL_RANDOM=%RANDOM%"
popd

@echo off
setlocal

pushd %~dp0
set t0=%time: =0%

jom /j %NUMBER_OF_PROCESSORS% /nologo "SL_RANDOM=%RANDOM%"

:: Capture the end time before doing anything else
set t=%time: =0%

:: make t0 into a scaler in 100ths of a second, being careful not
:: to let SET/A misinterpret 08 and 09 as octal
set /a h=1%t0:~0,2%-100
set /a m=1%t0:~3,2%-100
set /a s=1%t0:~6,2%-100
set /a c=1%t0:~9,2%-100
set /a starttime = %h% * 360000 + %m% * 6000 + 100 * %s% + %c%

:: make t into a scaler in 100ths of a second
set /a h=1%t:~0,2%-100
set /a m=1%t:~3,2%-100
set /a s=1%t:~6,2%-100
set /a c=1%t:~9,2%-100
set /a endtime = %h% * 360000 + %m% * 6000 + 100 * %s% + %c%

:: runtime in 100ths is now just end - start
set /a runtime = %endtime% - %starttime%
set runtime = %s%.%c%

:: echo Started at %t0%
echo Build time: %runtime%0 ms

popd

Add timing to build.bat

Add timing to build.bat


@echo off

pushd %~dp0

setlocal EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
    set PATH=!PATH!;!userprofile!\.dnx\bin
    set DNX_HOME=!USERPROFILE!\.dnx
    goto install
)

:install
call dnvm install 1.0.0-beta7
call dnvm use 1.0.0-beta7
rem set the runtime path because the above commands set \.dnx<space>\runtimes
set PATH=!USERPROFILE!\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta7\bin;!PATH!

call dnu restore
if %errorlevel% neq 0 exit /b %errorlevel%
call dnx -p .\tests\LightningQueues.Tests test
if %errorlevel% neq 0 exit /b %errorlevel%

echo Packing LightningQueues Nuget Version %LQ_NUGET_VERSION%
call dnu pack src\LightningQueues --configuration Release --out artifacts
call dnu pack src\LightningQueues.Storage.LMDB --configuration Release --out artifacts

popd

@echo off

pushd %~dp0

setlocal EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
    set PATH=!PATH!;!userprofile!\.dnx\bin
    set DNX_HOME=!USERPROFILE!\.dnx
    goto install
)

:install
call dnvm install 1.0.0-beta7 -arch x64
call dnvm use 1.0.0-beta7 -arch x64
rem set the runtime path because the above commands set \.dnx<space>\runtimes
set PATH=!USERPROFILE!\.dnx\runtimes\dnx-clr-win-x64.1.0.0-beta7\bin;!PATH!

call dnu restore
if %errorlevel% neq 0 exit /b %errorlevel%
call dnx -p .\tests\LightningQueues.Tests test
if %errorlevel% neq 0 exit /b %errorlevel%

echo Packing LightningQueues Nuget Version %LQ_NUGET_VERSION%
call dnu pack src\LightningQueues --configuration Release --out artifacts
call dnu pack src\LightningQueues.Storage.LMDB --configuration Release --out artifacts

popd

Use x64 for build server

Use x64 for build server


@echo off

pushd %~dp0

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

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

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

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

popd

@echo off

pushd %~dp0

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

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

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

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

popd

Update BuildLib 0.3.4

Update BuildLib 0.3.4