@echo off

:: makeTradeWrightCommonProjects.bat
::
:: builds all the dll and ocx projects
::
:: Parameters:
::   %1 Binary compatibility setting- 'P' (project)or 'B' (binary)
::

set BINARY_COMPAT=B
if "%1" == "P" set BINARY_COMPAT=P
if "%1" == "B" set BINARY_COMPAT=B
if "%1" == "N" set BINARY_COMPAT=N

pushd %TW-PROJECTS-PATH%

:: note that we have to store the compatible version of
:: TWUtilities in the compat folder, because using the one
:: in Bin results in linker errors
call makedll TWUtilities dll %BINARY_COMPAT% compat

if not "%BINARY_COMPAT%" == "B" call makeSetProjectComp

call makedll ExtProps dll %BINARY_COMPAT%
call makedll ExtEvents dll %BINARY_COMPAT%
call makedll BusObjUtils dll %BINARY_COMPAT%
call makedll TWControls ocx %BINARY_COMPAT%
call makedll GraphicsUtils dll %BINARY_COMPAT%
call makedll LayeredGraphics dll %BINARY_COMPAT%
call makedll GraphObj dll %BINARY_COMPAT%
call makedll GraphObjUtils dll %BINARY_COMPAT%
popd

pushd %TW-PROJECTS-PATH%\SampleApps\LayeredGraphicsTest\
call makedll SpriteControlLib dll %BINARY_COMPAT%
popd

call includeExternalLibrary TLBINF32 dll
call includeExternalLibrary MSCOMCTL ocx

@echo off

:: makeTradeWrightCommonProjects.bat
::
:: builds all the dll and ocx projects
::
:: Parameters:
::   %1 Binary compatibility setting- 'P' (project)or 'B' (binary)
::

set BINARY_COMPAT=B
if "%1" == "P" set BINARY_COMPAT=P
if "%1" == "B" set BINARY_COMPAT=B
if "%1" == "N" set BINARY_COMPAT=N

pushd %TW-PROJECTS-PATH%

:: note that we have to store the compatible version of
:: TWUtilities in the compat folder, because using the one
:: in Bin results in linker errors
call makedll TWUtilities dll %BINARY_COMPAT% compat

if not "%BINARY_COMPAT%" == "B" call makeSetProjectComp

call makedll ExtProps dll %BINARY_COMPAT%
call makedll ExtEvents dll %BINARY_COMPAT%
call makedll BusObjUtils dll %BINARY_COMPAT%
call makedll TWControls ocx %BINARY_COMPAT%
call makedll GraphicsUtils dll %BINARY_COMPAT%
call makedll LayeredGraphics dll %BINARY_COMPAT%
call makedll GraphObjUtils dll %BINARY_COMPAT%
call makedll GraphObj dll %BINARY_COMPAT%
popd

pushd %TW-PROJECTS-PATH%\SampleApps\LayeredGraphicsTest\
call makedll SpriteControlLib dll %BINARY_COMPAT%
popd

call includeExternalLibrary TLBINF32 dll
call includeExternalLibrary MSCOMCTL ocx

Fix incorrect build order

Fix incorrect build order


SET msbuild="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
SET solution=%1
SET platform=%2

%msbuild% %solution% /t:rebuild /p:Configuration=Debug;Platform=%platform%
if errorlevel 1 exit /B 1
%msbuild% %solution% /t:rebuild /p:Configuration=Release;Platform=%platform%
if errorlevel 1 exit /B 1
%msbuild% %solution% /t:rebuild /p:Configuration=Production;Platform=%platform%
if errorlevel 1 exit /B 1

exit /B 0

SET msbuild="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
SET solution=%1
SET platform=%2
SET switches=/t:rebuild /v:m

%msbuild% %solution% %switches% /p:Configuration=Debug;Platform=%platform%
if errorlevel 1 exit /B 1
%msbuild% %solution% %switches% /p:Configuration=Release;Platform=%platform%
if errorlevel 1 exit /B 1
%msbuild% %solution% %switches% /p:Configuration=Production;Platform=%platform%
if errorlevel 1 exit /B 1

exit /B 0

Tools: Set build verbosity level to minimal in the build.bat


REM Copyright (c) 2017-2021, Patrick Pelissier
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM + Redistributions of source code must retain the above copyright
REM   notice, this list of conditions and the following disclaimer.
REM + Redistributions in binary form must reproduce the above copyright
REM   notice, this list of conditions and the following disclaimer in the
REM   documentation and/or other materials provided with the distribution.
REM
REM THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
REM EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
REM DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
REM DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REM Execute the test suite for Microsoft Visual Studio
REM
REM Load Micosoft Visual Studio environement file (2019 or 2022)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

REM Add clang-cl in the PATH. It is the default install of clang for MSVC:
REM %VCINSTALLDIR%\Tools\Llvm\bin;%VCINSTALLDIR%\Tools\Llvm\x64\bin
REM Adding x64 version
REM See https://docs.microsoft.com/de-de/cpp/build/clang-support-msbuild?view=vs-2019
SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin

REM Remove previous results
DEL *.log *.dat

REM Select compiler to use (either cl or clang-cl)
set "compiler=%1"

echo "Compiler full version (%compiler%):"
%compiler% /Bv
%compiler% -v

REM Perform for each test
for %%f in (test-*.c) do (
    echo =================================================
    echo Testing %%f
    REM Copy the test file as a C++ file as CL.EXE only support C++ file
    del test.exe
    copy %%f test.cpp || EXIT /B 1
    REM Compile the test suite
    REM /Zc:preprocessor is mandatory to have a compliant preprocessor
    REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation.
    REM Enable warnings and basic optimization
    REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
    echo Compiling %%f with %compiler%
    %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1  || (
        echo *** BUILD ERROR for %%f *** >> %%f.log
        type %%f.log
        EXIT /B 1
        )
    REM Execute it
    echo Running %%f
    test.exe >> %%f.log 2>&1 && echo Test OK for %%f  >> %%f.log || (
        echo *** RUNTIME ERROR for %%f ***  >> %%f.log
        type %%f.log
        EXIT /B 1
    )
    type %%f.log
)
echo "All tests passed"
exit /B 0

REM Copyright (c) 2017-2021, Patrick Pelissier
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM + Redistributions of source code must retain the above copyright
REM   notice, this list of conditions and the following disclaimer.
REM + Redistributions in binary form must reproduce the above copyright
REM   notice, this list of conditions and the following disclaimer in the
REM   documentation and/or other materials provided with the distribution.
REM
REM THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
REM EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
REM DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
REM DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REM Execute the test suite for Microsoft Visual Studio
REM
REM Load Micosoft Visual Studio environement file (2019 or 2022)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

IF EXIST "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

REM Add clang-cl in the PATH. It is the default install of clang for MSVC:
REM %VCINSTALLDIR%\Tools\Llvm\bin;%VCINSTALLDIR%\Tools\Llvm\x64\bin
REM Adding x64 version
REM See https://docs.microsoft.com/de-de/cpp/build/clang-support-msbuild?view=vs-2019
SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin

REM Remove previous results
DEL *.log *.dat

REM Select compiler to use (either cl or clang-cl)
set "compiler=%1"

echo "Compiler full version (%compiler%):"
%compiler% /Bv
%compiler% -v

REM Perform for each test
for %%f in (test-*.c) do (
    echo =================================================
    echo Testing %%f
    REM Copy the test file as a C++ file as CL.EXE only support C++ file
    del test.exe
    copy %%f test.cpp || EXIT /B 1
    REM Compile the test suite
    REM /Zc:preprocessor is mandatory to have a compliant preprocessor
    REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation.
    REM Enable warnings and basic optimization
    REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
    echo Compiling %%f with %compiler%
    %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1  || (
        echo *** BUILD ERROR for %%f *** >> %%f.log
        type %%f.log
        EXIT /B 1
        )
    REM Execute it
    echo Running %%f
    test.exe >> %%f.log 2>&1 && echo Test OK for %%f  >> %%f.log || (
        echo *** RUNTIME ERROR for %%f ***  >> %%f.log
        type %%f.log
        EXIT /B 1
    )
    type %%f.log
)
echo "All tests passed"
exit /B 0

Fix path of MS Visual Studio 2022

Fix path of MS Visual Studio 2022


@echo off
setlocal

set "output=nul"
set "times=1"

goto :parsePackage

:help

:: TODO: put something here.

goto :eof

:usage

call :help 1>&2
exit /b 1

:parsePackage

if "%~1" == "" goto usage
set "package=%~1"
shift

:parseArgs

if "%~1" == "" goto main

if /i "%~1" == "-?" goto help
if /i "%~1" == "-h" goto help
if /i "%~1" == "--help" goto help

if /i "%~1" == "-t" (
    set "times=%~2"
    shift
)

if /i "%~1" == "--times" (
    set "times=%~2"
    shift
)

if /i "%~1" == "-o" (
    set "output=%~2"
    shift
)

if /i "%~1" == "--output" (
    set "output=%~2"
    shift
)

shift
goto parseArgs

:curl

@powershell -NoProfile "iwr %~1 -OutFile %~2" 2> nul

goto :eof

:downloadPackage

set "url=https://www.nuget.org/api/v2/package/%~1"
call :curl "%url%" %2

goto :eof

:main

for /l %%i in (1, 1, %times%) do (
    call :downloadPackage "%package%" "%output%"
)

@echo off
setlocal

set "output=$null"
set "times=1"

goto :parsePackage

:help

:: TODO: put something here.

goto :eof

:usage

call :help 1>&2
exit /b 1

:parsePackage

if "%~1" == "" goto usage
set "package=%~1"
shift

:parseArgs

if "%~1" == "" goto main

if /i "%~1" == "-?" goto help
if /i "%~1" == "-h" goto help
if /i "%~1" == "--help" goto help

if /i "%~1" == "-t" (
    set "times=%~2"
    shift
)

if /i "%~1" == "--times" (
    set "times=%~2"
    shift
)

if /i "%~1" == "-o" (
    set "output=%~2"
    shift
)

if /i "%~1" == "--output" (
    set "output=%~2"
    shift
)

shift
goto parseArgs

:curl

@powershell -NoProfile "iwr %~1 -OutFile %~2 > $null"

goto :eof

:downloadPackage

set "url=https://www.nuget.org/api/v2/package/%~1"
call :curl "%url%" %2

goto :eof

:main

for /l %%i in (1, 1, %times%) do (
    call :downloadPackage "%package%" "%output%"
)

fix the cmd script (finally!)

fix the cmd script (finally!)


@echo off
set COMMON=-show-timings -no-bounds-check -vet -strict-style
set PATH_TO_ODIN==..\..\odin
python3 download_assets.py
echo ---
echo Running core:image tests
echo ---
%PATH_TO_ODIN% run image    %COMMON%

echo ---
echo Running core:compress tests
echo ---
%PATH_TO_ODIN% run compress %COMMON%

echo ---
echo Running core:strings tests
echo ---
%PATH_TO_ODIN% run strings %COMMON%

echo ---
echo Running core:hash tests
echo ---
%PATH_TO_ODIN% run hash %COMMON% -o:size

echo ---
echo Running core:odin tests
echo ---
%PATH_TO_ODIN% run odin %COMMON% -o:size

echo ---
echo Running core:crypto hash tests
echo ---
%PATH_TO_ODIN% run crypto %COMMON%

echo ---
echo Running core:encoding tests
echo ---
%PATH_TO_ODIN% run encoding/json %COMMON%
%PATH_TO_ODIN% run encoding/varint %COMMON%

echo ---
echo Running core:math/noise tests
echo ---
%PATH_TO_ODIN% run math/noise %COMMON%

echo ---
echo Running core:os/os2 tests
echo ---
%PATH_TO_ODIN% run os2 %COMMON%

@echo off
set COMMON=-show-timings -no-bounds-check -vet -strict-style
set PATH_TO_ODIN==..\..\odin
python3 download_assets.py
echo ---
echo Running core:image tests
echo ---
%PATH_TO_ODIN% run image    %COMMON%

echo ---
echo Running core:compress tests
echo ---
%PATH_TO_ODIN% run compress %COMMON%

echo ---
echo Running core:strings tests
echo ---
%PATH_TO_ODIN% run strings %COMMON%

echo ---
echo Running core:hash tests
echo ---
%PATH_TO_ODIN% run hash %COMMON% -o:size

echo ---
echo Running core:odin tests
echo ---
%PATH_TO_ODIN% run odin %COMMON% -o:size

echo ---
echo Running core:crypto hash tests
echo ---
%PATH_TO_ODIN% run crypto %COMMON%

echo ---
echo Running core:encoding tests
echo ---
%PATH_TO_ODIN% run encoding/json %COMMON%
%PATH_TO_ODIN% run encoding/varint %COMMON%

echo ---
echo Running core:math/noise tests
echo ---
%PATH_TO_ODIN% run math/noise %COMMON%

echo ---
echo Running core:os/os2 tests
echo ---
Rem Needed Shlwapi.lib for PathFileExistsW
%PATH_TO_ODIN% run os2 %COMMON% -extra-linker-flags:Shlwapi.lib

build os2 test on windows

build os2 test on windows


@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
libgcrypt ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF ERRORLEVEL 1 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR="%CD%"
cd "%~dp0"

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd "%CURRDIR%" >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF ERRORLEVEL 1 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF ERRORLEVEL 1 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
SET LIBNAME=
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO ( SET TEMPF=%%F
    SET TEMPF=!TEMPF:*name=!
    IF "!TEMPF:~1,3!"=="lib" ( SET LIBNAME=!TEMPF:~1! )
)
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF ERRORLEVEL 1 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF ERRORLEVEL 1 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd "%CURRDIR%"
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
libgcrypt ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF ERRORLEVEL 1 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR="%CD%"
cd "%~dp0"

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd "%CURRDIR%" >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF ERRORLEVEL 1 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "$currentMaxTls = [Math]::Max([Net.ServicePointManager]::SecurityProtocol.value__,[Net.SecurityProtocolType]::Tls.value__);$newTlsTypes = [enum]::GetValues('Net.SecurityProtocolType') | ?{ $_ -gt $currentMaxTls };ForEach ($newTls in $newTlsTypes) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $newTls };try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "$currentMaxTls = [Math]::Max([Net.ServicePointManager]::SecurityProtocol.value__,[Net.SecurityProtocolType]::Tls.value__);$newTlsTypes = [enum]::GetValues('Net.SecurityProtocolType') | ?{ $_ -gt $currentMaxTls };ForEach ($newTls in $newTlsTypes) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $newTls };try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF ERRORLEVEL 1 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
SET LIBNAME=
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO ( SET TEMPF=%%F
    SET TEMPF=!TEMPF:*name=!
    IF "!TEMPF:~1,3!"=="lib" ( SET LIBNAME=!TEMPF:~1! )
)
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "$currentMaxTls = [Math]::Max([Net.ServicePointManager]::SecurityProtocol.value__,[Net.SecurityProtocolType]::Tls.value__);$newTlsTypes = [enum]::GetValues('Net.SecurityProtocolType') | ?{ $_ -gt $currentMaxTls };ForEach ($newTls in $newTlsTypes) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $newTls };try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF ERRORLEVEL 1 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF ERRORLEVEL 1 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd "%CURRDIR%"
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

project: Update get_dependencies script to uses latest available TLS.


echo on

SET project_dir="%cd%"

echo Set up environment...
set PATH=%QT%\bin\;C:\Qt\Tools\QtCreator\bin\;C:\Qt\QtIFW2.0.1\bin\;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%

echo Building Dialogue...
qmake -spec win32-msvc2015 CONFIG+=x86_64 CONFIG-=debug CONFIG+=release
nmake

echo Packaging...
cd %project_dir%\build\windows\msvc\x86_64\release\
windeployqt Dialogue\Dialogue.exe

rd /s /q Dialogue\moc\
rd /s /q Dialogue\obj\
rd /s /q Dialogue\qrc\

echo Copying files for archival...
copy "%project_dir%\README.md" "Dialogue\README.md"
copy "%project_dir%\LICENSE" "Dialogue\LICENSE.txt"
copy "%project_dir%\Qt License" "Dialogue\Qt License.txt"

echo Copying files for installer...
mkdir %project_dir%\installer\windows\x86_64\packages\com.dialogueproject.dialogue\data\
robocopy Dialogue\ %project_dir%\installer\windows\x86_64\packages\com.dialogueproject.dialogue\data\ /E

echo Packaging portable archive...
7z a dialogue_%TAG_NAME%_windows_x86_64_portable.zip Dialogue

echo Creating installer...
cd %project_dir%\installer\windows\x86_64\
binarycreator.exe --offline-only -c config\config.xml -p packages dialogue_%TAG_NAME%_windows_x86_64_installer.exe

echo on

SET project_dir="%cd%"

echo Set up environment...
set PATH=%QT%\bin\;C:\Qt\Tools\QtCreator\bin\;C:\Qt\QtIFW2.0.1\bin\;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%

echo Building Dialogue...
qmake -spec win32-msvc2015 CONFIG+=x86_64 CONFIG-=debug CONFIG+=release
nmake

echo Packaging...
cd %project_dir%\build\windows\msvc\x86_64\release\
windeployqt Dialogue\Dialogue.exe

rd /s /q Dialogue\moc\
rd /s /q Dialogue\obj\
rd /s /q Dialogue\qrc\

echo Copying left out Qt files...
copy "%QT%\bin\Qt5QuickControls2.dll" "Dialogue\Qt5QuickControls2.dll"
copy "%QT%\bin\Qt5QuickTemplates2.dll" "Dialogue\Qt5QuickTemplates2.dll"
mkdir Dialogue\Qt\
mkdir Dialogue\Qt\labs\
robocopy "%QT%\qml\Qt\labs\settings\" "Dialogue\Qt\labs\" /E
robocopy "%QT%\qml\QtGraphicalEffects\" "Dialogue\" /E
robocopy "%QT%\qml\QtQuick\" "Dialogue\" /E
robocopy "%QT%\qml\QtQuick.2\" "Dialogue\" /E

echo Copying project files for archival...
copy "%project_dir%\README.md" "Dialogue\README.md"
copy "%project_dir%\LICENSE" "Dialogue\LICENSE.txt"
copy "%project_dir%\Qt License" "Dialogue\Qt License.txt"

echo Copying files for installer...
mkdir "%project_dir%\installer\windows\x86_64\packages\com.dialogueproject.dialogue\data\"
robocopy Dialogue\ %project_dir%\installer\windows\x86_64\packages\com.dialogueproject.dialogue\data\ /E

echo Packaging portable archive...
7z a dialogue_%TAG_NAME%_windows_x86_64_portable.zip Dialogue

echo Creating installer...
cd %project_dir%\installer\windows\x86_64\
binarycreator.exe --offline-only -c config\config.xml -p packages dialogue_%TAG_NAME%_windows_x86_64_installer.exe

Add Qt Quick dependency files missed by windeployqt


@if not defined _echo @echo off
setlocal EnableDelayedExpansion

set __ThisScriptShort=%0

if /i "%1" == "/?"    goto HelpVarCall
if /i "%1" == "-?"    goto HelpVarCall
if /i "%1" == "/h"    goto HelpVarCall
if /i "%1" == "-h"    goto HelpVarCall
if /i "%1" == "/help" goto HelpVarCall
if /i "%1" == "-help" goto HelpVarCall

if defined BUILDVARS_DONE goto :AfterVarSetup

goto :NormalVarCall

:HelpVarCall
call %~dp0buildvars-setup.cmd -help
exit /b 1

:NormalVarCall
call %~dp0buildvars-setup.cmd %*

IF NOT ERRORLEVEL 1 goto AfterVarSetup
echo Setting build variables failed.
exit /b %ERRORLEVEL%

:AfterVarSetup

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

:: Restore the Tools directory
call  "%__ProjectDir%\init-tools.cmd"

rem Tell nuget to always use repo-local nuget package cache. The "dotnet restore" invocations use the --packages
rem argument, but there are a few commands in publish and tests that do not.
set "NUGET_PACKAGES=%__PackagesDir%"

echo Using CLI tools version:
dir /b "%__DotNetCliPath%\sdk"

:: Set the environment for the managed build
:SetupManagedBuild
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of managed components for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
%_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "%__ProjectDir%\build.proj" %__MSBCleanBuildArgs% %__ExtraMsBuildParams% /p:RepoPath="%__ProjectDir%" /p:RepoLocalBuild="true" /p:RelativeProductBinDir="%__RelativeProductBinDir%" /p:NuPkgRid=win7-x64 /p:ToolchainMilestone=%__ToolchainMilestone% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%__BuildLog%"
IF NOT ERRORLEVEL 1 (
  findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%__BuildLog%"
  goto AfterILCompilerBuild
)
echo ILCompiler build failed with exit code %ERRORLEVEL%. Refer !__BuildLog! for details.
exit /b %ERRORLEVEL%

:AfterILCompilerBuild

:VsDevGenerateRespFiles
if defined __SkipVsDev goto :AfterVsDevGenerateRespFiles
set __GenRespFiles=0
if not exist "%__ObjDir%\ryujit.rsp" set __GenRespFiles=1
if not exist "%__ObjDir%\cpp.rsp" set __GenRespFiles=1
if "%__GenRespFiles%"=="1" (
    if exist "%__ReproProjectBinDir%" rd /s /q "%__ReproProjectBinDir%"
    if exist "%__ReproProjectObjDir%" rd /s /q "%__ReproProjectObjDir%"

    %_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%__BinDir%\packaging\publish1" /p:Configuration=%__BuildType% /t:IlcCompile "%__ReproProjectDir%\repro.csproj"
    call :CopyResponseFile "%__ReproProjectObjDir%\native\ilc.rsp" "%__ObjDir%\ryujit.rsp"

    if exist "%__ReproProjectBinDir%" rd /s /q "%__ReproProjectBinDir%"
    if exist "%__ReproProjectObjDir%" rd /s /q "%__ReproProjectObjDir%"

    set __ExtraArgs=/p:NativeCodeGen=cpp
    if /i "%__BuildType%"=="debug" (
        set __ExtraArgs=!__ExtraArgs! "/p:AdditionalCppCompilerFlags=/MTd"
    )
    %_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%__BinDir%\packaging\publish1" /p:Configuration=%__BuildType% /t:IlcCompile "%__ReproProjectDir%\repro.csproj" !__ExtraArgs!
    call :CopyResponseFile "%__ReproProjectObjDir%\native\ilc.rsp" "%__ObjDir%\cpp.rsp"
)
:AfterVsDevGenerateRespFiles
exit /b %ERRORLEVEL%
endlocal

rem Copies the dotnet generated response file while patching up references
rem to System.Private assemblies to the live built ones.
rem This is to make sure that making changes in a private library doesn't require
rem a full rebuild. It also helps with locating the symbols.
:CopyResponseFile
setlocal
> %~2 (
  for /f "tokens=*" %%l in (%~1) do (
    set line=%%l
    if "!line:publish1\sdk=!"=="!line!" (
        echo !line!
    ) ELSE (
        set assemblyPath=!line:~3!
        call :ExtractFileName !assemblyPath! assemblyFileName
        echo -r:%__BinDir%\!assemblyFileName!\!assemblyFileName!.dll
    )
  )
)
endlocal
goto:eof

rem Extracts a file name from a full path
rem %1 Full path to the file, %2 Variable to receive the file name
:ExtractFileName
setlocal
for %%i in ("%1") DO set fileName=%%~ni
endlocal & set "%2=%fileName%"
goto:eof

@if not defined _echo @echo off
setlocal EnableDelayedExpansion

set __ThisScriptShort=%0

if /i "%1" == "/?"    goto HelpVarCall
if /i "%1" == "-?"    goto HelpVarCall
if /i "%1" == "/h"    goto HelpVarCall
if /i "%1" == "-h"    goto HelpVarCall
if /i "%1" == "/help" goto HelpVarCall
if /i "%1" == "-help" goto HelpVarCall

if defined BUILDVARS_DONE goto :AfterVarSetup

goto :NormalVarCall

:HelpVarCall
call %~dp0buildvars-setup.cmd -help
exit /b 1

:NormalVarCall
call %~dp0buildvars-setup.cmd %*

IF NOT ERRORLEVEL 1 goto AfterVarSetup
echo Setting build variables failed.
exit /b %ERRORLEVEL%

:AfterVarSetup

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

:: Restore the Tools directory
call  "%__ProjectDir%\init-tools.cmd"

rem Tell nuget to always use repo-local nuget package cache. The "dotnet restore" invocations use the --packages
rem argument, but there are a few commands in publish and tests that do not.
set "NUGET_PACKAGES=%__PackagesDir%"

echo Using CLI tools version:
dir /b "%__DotNetCliPath%\sdk"

:: Set the environment for the managed build
:SetupManagedBuild
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of managed components for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
%_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "%__ProjectDir%\build.proj" %__MSBCleanBuildArgs% %__ExtraMsBuildParams% /p:RepoPath="%__ProjectDir%" /p:RepoLocalBuild="true" /p:RelativeProductBinDir="%__RelativeProductBinDir%" /p:NuPkgRid=win7-x64 /p:ToolchainMilestone=%__ToolchainMilestone% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=normal;LogFile="%__BuildLog%"
IF NOT ERRORLEVEL 1 (
  findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%__BuildLog%"
  goto AfterILCompilerBuild
)
echo ILCompiler build failed with exit code %ERRORLEVEL%. Refer !__BuildLog! for details.
exit /b %ERRORLEVEL%

:AfterILCompilerBuild

:VsDevGenerateRespFiles
if defined __SkipVsDev goto :AfterVsDevGenerateRespFiles
set __GenRespFiles=0
if not exist "%__ObjDir%\ryujit.rsp" set __GenRespFiles=1
if not exist "%__ObjDir%\cpp.rsp" set __GenRespFiles=1
if "%__GenRespFiles%"=="1" (
    if exist "%__ReproProjectBinDir%" rd /s /q "%__ReproProjectBinDir%"
    if exist "%__ReproProjectObjDir%" rd /s /q "%__ReproProjectObjDir%"

    %_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%__BinDir%\packaging\publish1" /p:Configuration=%__BuildType% /t:IlcCompile "%__ReproProjectDir%\repro.csproj"
    call :CopyResponseFile "%__ReproProjectObjDir%\native\repro.ilc.rsp" "%__ObjDir%\ryujit.rsp"

    if exist "%__ReproProjectBinDir%" rd /s /q "%__ReproProjectBinDir%"
    if exist "%__ReproProjectObjDir%" rd /s /q "%__ReproProjectObjDir%"

    set __ExtraArgs=/p:NativeCodeGen=cpp
    if /i "%__BuildType%"=="debug" (
        set __ExtraArgs=!__ExtraArgs! "/p:AdditionalCppCompilerFlags=/MTd"
    )
    %_msbuildexe% /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%__BinDir%\packaging\publish1" /p:Configuration=%__BuildType% /t:IlcCompile "%__ReproProjectDir%\repro.csproj" !__ExtraArgs!
    call :CopyResponseFile "%__ReproProjectObjDir%\native\repro.ilc.rsp" "%__ObjDir%\cpp.rsp"
)
:AfterVsDevGenerateRespFiles
exit /b %ERRORLEVEL%
endlocal

rem Copies the dotnet generated response file while patching up references
rem to System.Private assemblies to the live built ones.
rem This is to make sure that making changes in a private library doesn't require
rem a full rebuild. It also helps with locating the symbols.
:CopyResponseFile
setlocal
> %~2 (
  for /f "tokens=*" %%l in (%~1) do (
    set line=%%l
    if "!line:publish1\sdk=!"=="!line!" (
        echo !line!
    ) ELSE (
        set assemblyPath=!line:~3!
        call :ExtractFileName !assemblyPath! assemblyFileName
        echo -r:%__BinDir%\!assemblyFileName!\!assemblyFileName!.dll
    )
  )
)
endlocal
goto:eof

rem Extracts a file name from a full path
rem %1 Full path to the file, %2 Variable to receive the file name
:ExtractFileName
setlocal
for %%i in ("%1") DO set fileName=%%~ni
endlocal & set "%2=%fileName%"
goto:eof

Fix name of the RSP file for repro project (#2382)

RSP file got renamed in #2373 which broke the hackery to generate RSP
files for the repro projects.


SET bin_dir=%~dp0
SET TOP_DIR=%bin_dir%\..\..\
SET build_type=%1
SET build_dir=%~f2

IF "%build_type%" EQU "" SET build_type=Debug

IF "%build_dir%" EQU "" (
    CALL %bin_dir%\echoc.exe 4 please specify build_dir
    GOTO error
)

IF NOT EXIST %build_dir% (
    CALL %bin_dir%\echoc.exe 4 %build_dir% does not exist
    GOTO error
)

CALL %bin_dir%\echoc.exe 2 run the tests here ...

:: set the path of built binaries
SET DSN_TMP_BUILD_DIR_IN_PATH=
@FOR %%P in ("%Path:;=";"%") DO @IF /I %%P=="%build_dir%\bin\%build_type%" SET DSN_TMP_BUILD_DIR_IN_PATH=true
:: SET DSN_TMP_OLD_PATH=%Path%
IF NOT DEFINED DSN_TMP_BUILD_DIR_IN_PATH SET Path=%build_dir%\bin\%build_type%;%build_dir%\lib;%Path%
SET DSN_TMP_BUILD_DIR_IN_PATH=

:: run dll-embedded unit tests
SET DSN_TEST_HOST=%DSN_ROOT:/=\%\bin\dsn.svchost.exe
IF EXIST "%build_dir%\bin\dsn.svchost\%build_type%\dsn.svchost.exe"  SET DSN_TEST_HOST=%build_dir%\bin\dsn.svchost\%build_type%\dsn.svchost.exe

FOR /D %%A IN (%build_dir%\test\*) DO (
    IF EXIST %%A\gtests (
        pushd %%A
        FOR /F %%I IN (%%A\gtests) DO (
            IF EXIST %%A (
                ECHO =========== %DSN_TEST_HOST% %%I ======================
                CALL %DSN_TEST_HOST% %%I
                IF ERRORLEVEL 1 popd && echo test %%I failed && goto error
            )
        )
        popd
    )
)

:: run e-e tests
FOR /D %%A IN (%build_dir%\bin\*) DO (
    IF EXIST %%A\test.cmd (
        pushd %%A
        ECHO ================= %%A\test.cmd ================================
        CALL test.cmd %TOP_DIR% %build_type% %build_dir%
        IF ERRORLEVEL 1 popd && echo test %%A failed && goto error
        popd
    )
)

goto exit

:error
    CALL %bin_dir%\echoc.exe 4  "Usage: run.cmd test build_type(Debug|Release|RelWithDebInfo|MinSizeRel) build_dir"
    exit /B -1

:exit
    exit /B 0

SET bin_dir=%~dp0
SET TOP_DIR=%bin_dir%\..\..\
SET build_type=%1
SET build_dir=%~f2

IF "%build_type%" EQU "" SET build_type=Debug

IF "%build_dir%" EQU "" (
    CALL %bin_dir%\echoc.exe 4 please specify build_dir
    GOTO error
)

IF NOT EXIST %build_dir% (
    CALL %bin_dir%\echoc.exe 4 %build_dir% does not exist
    GOTO error
)

CALL %bin_dir%\echoc.exe 2 run the tests here ...

:: set the path of built binaries
SET DSN_TMP_BUILD_DIR_IN_PATH=
@FOR %%P in ("%Path:;=";"%") DO @IF /I %%P=="%build_dir%\bin\%build_type%" SET DSN_TMP_BUILD_DIR_IN_PATH=true
:: SET DSN_TMP_OLD_PATH=%Path%
IF NOT DEFINED DSN_TMP_BUILD_DIR_IN_PATH SET Path=%build_dir%\bin\%build_type%;%build_dir%\lib;%Path%
SET DSN_TMP_BUILD_DIR_IN_PATH=

:: run dll-embedded unit tests
SET DSN_TEST_HOST=%DSN_ROOT:/=\%\bin\dsn.svchost.exe
IF EXIST "%build_dir%\bin\dsn.svchost\%build_type%\dsn.svchost.exe"  SET DSN_TEST_HOST=%build_dir%\bin\dsn.svchost\%build_type%\dsn.svchost.exe

FOR /D %%A IN (%build_dir%\test\*) DO (
    IF EXIST %%A\gtests (
        pushd %%A
        FOR /F %%I IN (%%A\gtests) DO (
            IF EXIST %%A (
                ECHO =========== %DSN_TEST_HOST% %%I ======================
                CALL %DSN_TEST_HOST% %%I
                IF ERRORLEVEL 1 popd && echo test %%I failed && goto error
            )
        )
        popd
    )
)

:: run e-e tests
FOR /D %%A IN (%build_dir%\bin\*) DO (
    IF EXIST %%A\test.cmd (
        pushd %%A
        ECHO ================= %%A\test.cmd ================================
        CALL test.cmd %TOP_DIR% %build_type% %build_dir%
        IF ERRORLEVEL 1 popd && echo test %%A failed && goto error
        popd
    )
)

goto exit

:error
    CALL %bin_dir%\echoc.exe 4  "Usage: run.cmd test build_type(Debug|Release|RelWithDebInfo|MinSizeRel) build_dir"
    exit /B 1

:exit
    exit /B 0

Change the error code from -1 to 1.

Change the error code from -1 to 1.


@echo off
rem ----------------------------------------------------------------------------
rem
rem This variable should be set to the directory where is installed ProActive
rem

IF NOT DEFINED PA_SCHEDULER set PA_SCHEDULER=%CD%\..\..

rem ----------------------------------------------------------------------------

if NOT DEFINED JAVA_HOME goto javahome
if "%JAVA_HOME%" == "" goto javahome

rem ----
rem Set up the classpath using classes dir or jar files
rem ----

IF DEFINED CLASSPATHEXT (
	SET CLASSPATH=%CLASSPATHEXT%
) ELSE (
	SET CLASSPATH=.
)

rem Check if classes exists and is not empty
IF EXIST "%PA_SCHEDULER%\classes\scheduler" (
	SET CLASSPATH=%CLASSPATH%;%PA_SCHEDULER%\classes\common;%PA_SCHEDULER%\classes\resource-manager;%PA_SCHEDULER%\classes\scheduler
	SET JARS=
	rem ProActive.jar : Use jar index to avoid 'command too long'
	SET JARS=!JARS!;%PA_SCHEDULER%\lib\ProActive\ProActive.jar
	rem Scheduler libraries
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\script\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\node\sigar\*.jar") DO SET JARS=!JARS!;%%j
	rem hibernate libs
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\hibernate\annotation\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\hibernate\core\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\addons\*.jar") DO SET JARS=!JARS!;%%j
) ELSE (
	rem Script engines must be added to classpath to be found
	rem it must also placed before jars containing jar-index
	SET JARS=%PA_SCHEDULER%\dist\lib\script-js.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\jruby-engine.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\sigar\sigar.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\jython-engine.jar
	rem  Needed explicitly by VFS (file transfer in pre/post script
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\commons-logging-1.1.1.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\commons-httpclient-3.1.jar
	rem fill with ProActive.jar : use jar index for proActive dependencies
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive.jar
	rem fill with Scheduler jars : use jar index for Scheduler dependencies
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_SRM-common.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_ResourceManager.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_Scheduler-core.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_Scheduler-mapreduce.jar
	FOR %%j IN ("%PA_SCHEDULER%\addons\*.jar") DO SET JARS=!JARS!;%%j
)

SET CLASSPATH=%CLASSPATH%;%JARS%;%PA_SCHEDULER%\addons

rem log4j file
IF "%1"=="" (
	set LOG4J_FILE=file:%PA_SCHEDULER%/config/log4j/log4j-client
) ELSE (
	set LOG4J_FILE=file:%PA_SCHEDULER%/config/log4j/%1
)

rem if log4j file is server, use server security manager
rem otherwise, use standard ProActive java.security.policy file
IF "%1"=="scheduler-log4j-server" (
	GOTO sjps
)
IF "%1"=="rm-log4j-server" (
	:sjps
	set JAVA_POLICY=file:%PA_SCHEDULER%/config/security.java.policy-server
	GOTO sjps_
) ELSE (
	set JAVA_POLICY=file:%PA_SCHEDULER%/config/security.java.policy-client
)
:sjps_

set JAVA_CMD="%JAVA_HOME%\bin\java.exe" -Dproactive.home="%PA_SCHEDULER%" -Dproactive.configuration="file:%PA_SCHEDULER%\config\proactive\ProActiveConfiguration.xml" -Dpa.scheduler.home="%PA_SCHEDULER%" -Dpa.rm.home="%PA_SCHEDULER%" -Djava.security.manager -Djava.security.policy="%JAVA_POLICY%" -Dlog4j.configuration="%LOG4J_FILE%"

rem Adding java tools to the path
SET OK=1
FOR /F "delims=;" %%i IN ("%PATH%") DO (
IF /I "%%i" == "%JAVA_HOME%\bin" SET OK=0
)
IF /I %OK%==1 SET PATH=%JAVA_HOME%\bin;%PATH%

goto end

:javahome
echo.
echo The environment variable JAVA_HOME must be set the current jdk distribution
echo installed on your computer.
echo Use
echo    set JAVA_HOME=<the directory where is the JDK>
goto end

:end

@echo off
rem ----------------------------------------------------------------------------
rem
rem This variable should be set to the directory where is installed ProActive
rem

IF NOT DEFINED PA_SCHEDULER set PA_SCHEDULER=%CD%\..\..

rem ----------------------------------------------------------------------------

if NOT DEFINED JAVA_HOME goto javahome
if "%JAVA_HOME%" == "" goto javahome

rem ----
rem Set up the classpath using classes dir or jar files
rem ----

IF DEFINED CLASSPATHEXT (
	SET CLASSPATH=%CLASSPATHEXT%
) ELSE (
	SET CLASSPATH=.
)

rem Check if classes exists and is not empty
IF EXIST "%PA_SCHEDULER%\classes\scheduler" (
	SET CLASSPATH=%CLASSPATH%;%PA_SCHEDULER%\classes\common;%PA_SCHEDULER%\classes\resource-manager;%PA_SCHEDULER%\classes\scheduler
	SET JARS=
	rem ProActive.jar : Use jar index to avoid 'command too long'
	SET JARS=!JARS!;%PA_SCHEDULER%\lib\ProActive\ProActive.jar
	rem Scheduler libraries
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\script\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\lib\node\sigar\*.jar") DO SET JARS=!JARS!;%%j
	rem hibernate libs
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\hibernate\annotation\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\hibernate\core\*.jar") DO SET JARS=!JARS!;%%j
	FOR %%j IN ("%PA_SCHEDULER%\addons\*.jar") DO SET JARS=!JARS!;%%j
) ELSE (
	rem Script engines must be added to classpath to be found
	rem it must also placed before jars containing jar-index
	SET JARS=%PA_SCHEDULER%\dist\lib\script-js.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\jruby-engine.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\sigar\sigar.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\jython-engine.jar
	rem  Needed explicitly by VFS (file transfer in pre/post script
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\commons-logging-1.1.1.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\commons-httpclient-3.1.jar
	rem fill with ProActive.jar : use jar index for proActive dependencies
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive.jar
	rem fill with Scheduler jars : use jar index for Scheduler dependencies
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_SRM-common.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_ResourceManager.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_Scheduler-core.jar
	SET JARS=!JARS!;%PA_SCHEDULER%\dist\lib\ProActive_Scheduler-mapreduce.jar
	FOR %%j IN ("%PA_SCHEDULER%\addons\*.jar") DO SET JARS=!JARS!;%%j
)

SET CLASSPATH=%CLASSPATH%;%JARS%;%PA_SCHEDULER%\addons

rem log4j file
IF "%1"=="" (
	set LOG4J_FILE=file:%PA_SCHEDULER%/config/log4j/log4j-client
) ELSE (
	set LOG4J_FILE=file:%PA_SCHEDULER%/config/log4j/%1
)

rem if log4j file is server, use server security manager
rem otherwise, use standard ProActive java.security.policy file
IF "%1"=="scheduler-log4j-server" (
	GOTO sjps
)
IF "%1"=="rm-log4j-server" (
	:sjps
	set JAVA_POLICY=file:%PA_SCHEDULER%/config/security.java.policy-server
	GOTO sjps_
) ELSE (
	set JAVA_POLICY=file:%PA_SCHEDULER%/config/security.java.policy-client
)
:sjps_

set JAVA_CMD="%JAVA_HOME%\bin\java.exe" -Dproactive.home="%PA_SCHEDULER%" -Dproactive.configuration="file:%PA_SCHEDULER%\config\proactive\ProActiveConfiguration.xml" -Dpa.scheduler.home="%PA_SCHEDULER%" -Dpa.rm.home="%PA_SCHEDULER%" -Djava.security.manager -Djava.security.policy="%JAVA_POLICY%" -Dlog4j.configuration="%LOG4J_FILE%"

rem Adding java tools to the path
SET OK=1
FOR /F "delims=;" %%i IN ("%PATH%") DO (
IF /I "%%i" == "%JAVA_HOME%\bin" SET OK=0
)
IF /I %OK%==1 SET PATH=%JAVA_HOME%\bin;%PATH%

goto end

:javahome
echo.
echo The environment variable JAVA_HOME must be set the current jdk distribution
echo installed on your computer.
echo Use
echo    set JAVA_HOME=<the directory where is the JDK>
goto end

:end

fix SCHEDULING-1624: NoClassDefFoundError java.lang.NoClassDefFoundError: org/hyperic/sigar/jmx/SigarRegistry


:;# This is a cross-platform script
:;# Save this file with unix eol style
:;# See each operating system's "section"

:;# Call this script with one argument which will be the type
:;# static or dynamic

:<<BATCH
    @echo off
    :; # ########## WINDOWS SECTION #########################

    SET scriptPath=%~dp0
    SET basePath=%scriptPath%..\..
    SET linkOption=%1
    IF "%linkOption%"=="" (
        ECHO Linkage option not defined. Use static or dynamic.
    ) ELSE (
        Rem Creating archive of all win deployed applications
        echo "7z a %basePath%\mne-cpp-windows-%linkOption%-x86_64.zip %basePath%\bin"
    )
    :; # ########## WINDOWS SECTION ENDS ####################
    :; # ####################################################
    exit /b
BATCH

if [ "$(uname)" == "Darwin" ]; then

    # ############## MAC SECTION ###########################

    # Creating archive of all macos deployed applications
    echo tar cfvz mne-cpp-macos-${1}-x86_64.tar.gz bin/.

    # ############## MAC SECTION ENDS ######################
    # ######################################################

elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then

    # ############## LINUX SECTION #########################

    # Creating archive of everything in current directory
    echo tar cfvz ../mne-cpp-linux-${1}-x86_64.tar.gz ./*

    # ############## LINUX SECTION ENDS ####################
    # ######################################################

fi

exit 0

:;# This is a cross-platform script
:;# Save this file with unix eol style
:;# See each operating system's "section"

:;# Call this script with one argument which will be the type
:;# static or dynamic

:<<BATCH
    @echo off
    :; # ########## WINDOWS SECTION #########################

    SET SCRIPT_PATH=%~dp0
    SET BASE_PATH=%SCRIPT_PATH%..\..
    SET LINK_OPTION=%1
    IF "%LINK_OPTION%"=="" (
        ECHO Linkage option not defined. Use static or dynamic.
    ) ELSE (
        Rem Creating archive of all win deployed applications
        echo "7z a %BASE_PATH%\mne-cpp-windows-%LINK_OPTION%-x86_64.zip %BASE_PATH%\bin"
    )
    :; # ########## WINDOWS SECTION ENDS ####################
    :; # ####################################################
    exit /b
BATCH

if [ "$(uname)" == "Darwin" ]; then

    # ############## MAC SECTION ###########################

    # Creating archive of all macos deployed applications
    echo tar cfvz mne-cpp-macos-${1}-x86_64.tar.gz bin/.

    # ############## MAC SECTION ENDS ######################
    # ######################################################

elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then

    # ############## LINUX SECTION #########################

    LINK_OPTION=$1
    SCRIPT_PATH="$(
        cd "$(dirname "$0")" >/dev/null 2>&1
        pwd -P
    )"
    BASE_PATH=${SCRIPT_PATH}/../..
    if [ -z ${LINK_OPTION} ]; then
        echo "Variable ${LINK_OPTION} is not set."
        echo "Use: static or dynamic"
    else
        # Creating archive of everything in current directory
        tar cfvz ${BASE_PATH}/mne-cpp-linux-${LINK_OPTION}-x86_64.tar.gz ${BASE_PATH}/*
    fi

    # ############## LINUX SECTION ENDS ####################
    # ######################################################

fi

exit 0

update linux script

update linux script


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

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

Add quotes to parameters in YC.Core.bat

Add quotes to parameters in YC.Core.bat


@echo off

mkdir build
cd build

rem Need to handle Python 3.x case at some point (Visual Studio 2010)
if %ARCH%==32 (
  if %PY_VER% LSS 3 (
    set CMAKE_CONFIG="Release|Win32"
  )
)
if %ARCH%==64 (
  if %PY_VER% LSS 3 (
    set CMAKE_CONFIG="Release|x64"
  )
)

rem The Python lib has no period in the
rem version string, so we remove it here.
set PY_VER_NO_DOT=%PY_VER:.=%

cmake ..\tools\python ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DBUILD_SHARED_LIBS=1 ^
-DBoost_USE_STATIC_LIBS=0 ^
-DBoost_USE_STATIC_RUNTIME=0 ^
-DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
-DBOOST_LIBRARYDIR="%LIBRARY_LIB%" ^
-DPYTHON_LIBRARY="%PREFIX%\libs\python%PY_VER_NO_DOT%.lib" ^
-DPYTHON_INCLUDE_DIR="%PREFIX%\include" ^
-DJPEG_LIBRARY="%LIBRARY_LIB%\libjpeg.lib" ^
-DJPEG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DDLIB_NO_GUI_SUPPORT=1 ^
-DDLIB_USE_BLAS=0 ^
-DDLIB_USE_LAPACK=0

cmake --build . --config %CMAKE_CONFIG% --target ALL_BUILD
cmake --build . --config %CMAKE_CONFIG% --target INSTALL

rem Copy the dlib libraries and the dlls it depends upon
rem Unfortunately, they have to be put in the root.
move "..\python_examples\*.dll" "%SP_DIR%"
move "..\python_examples\dlib.lib" "%SP_DIR%"
move "..\python_examples\dlib.pyd" "%SP_DIR%"

@echo off

mkdir build
cd build

rem Need to handle Python 3.x case at some point (Visual Studio 2010)
if %ARCH%==32 (
  if %PY_VER% LSS 3 (
    set CMAKE_CONFIG="Release|Win32"
	set GENERATOR="Visual Studio 9 2008"
  )
)
if %ARCH%==64 (
  if %PY_VER% LSS 3 (
    set CMAKE_CONFIG="Release|x64"
	set GENERATOR="Visual Studio 9 2008 Win64"
  )
)

rem The Python lib has no period in the
rem version string, so we remove it here.
set PY_VER_NO_DOT=%PY_VER:.=%

cmake ..\tools\python -G%GENERATOR% ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DBUILD_SHARED_LIBS=1 ^
-DBoost_USE_STATIC_LIBS=0 ^
-DBoost_USE_STATIC_RUNTIME=0 ^
-DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
-DBOOST_LIBRARYDIR="%LIBRARY_LIB%" ^
-DPYTHON_LIBRARY="%PREFIX%\libs\python%PY_VER_NO_DOT%.lib" ^
-DPYTHON_INCLUDE_DIR="%PREFIX%\include" ^
-DJPEG_LIBRARY="%LIBRARY_LIB%\libjpeg.lib" ^
-DJPEG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DDLIB_NO_GUI_SUPPORT=1 ^
-DDLIB_USE_BLAS=0 ^
-DDLIB_USE_LAPACK=0

cmake --build . --config %CMAKE_CONFIG% --target ALL_BUILD
cmake --build . --config %CMAKE_CONFIG% --target INSTALL

rem Copy the dlib libraries and the dlls it depends upon
rem Unfortunately, they have to be put in the root.
move "..\python_examples\*.dll" "%SP_DIR%"
move "..\python_examples\dlib.lib" "%SP_DIR%"
move "..\python_examples\dlib.pyd" "%SP_DIR%"

Handle 64bit builds for dlib

Handle 64bit builds for dlib


:: Copyright 2014 by SyneArt <sa@syneart.com>
@echo off&cls&title Install&color 0F&mode con cols=38 lines=10
setlocal enableextensions enabledelayedexpansion
echo.&echo.&echo.&echo.&echo Install ConnectivityLab Theme Now ..
set str=!PATH: =/!&set str=!str:(x86)=[x86]!&set MiKTeXPath=nul
FOR %%b in (!str!) DO (
	set nowStr=%%b&set MiKTeXStr=x!nowStr:MiKTeX=!
	if not !MiKTeXStr!==x!nowStr! set MiKTeXPath=!nowStr!
)
if !MiKTeXPath!==nul (
	cls&echo.&echo.&echo.&echo.&echo Хw MiKTeX, A楻w
	color E3&set /p=&goto exit
)
set MiKTeXPath=!MiKTeXPath:miktsex\bin\=!&set MiKTeXPath=!MiKTeXPath:/= !&set MiKTeXPath=!MiKTeXPath:[x86]=(x86)!
if not exist "!MiKTeXPath!tex\latex\beamer\" (
	cls&echo.&echo.&echo.&echo.&echo Хw Beamer, A楻w
	color E3&set /p=&goto exit
)
call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
initexmf --update-fndb >nul
if !errorlevel!==1 (
	cls&echo.&echo.&echo.&echo.&echo ХsĶ MiKTeX M, A
	color 4C&set /p=&goto exit
)
cls&echo.&echo.&echo.&echo.&echo Install Theme Successful ^^!&color 2A&ping 127.0.0.1 -n 3 >nul&goto exit

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

:exit

:: Copyright 2014 by SyneArt <sa@syneart.com>
@echo off&cls&title Install&color 0F&mode con cols=38 lines=10
setlocal enableextensions enabledelayedexpansion
echo.&echo.&echo.&echo.&echo Install ConnectivityLab Theme Now ..
set str=!PATH: =/!&set str=!str:(x86)=[x86]!&set MiKTeXPath=nul
FOR %%b in (!str!) DO (
	set nowStr=%%b&set MiKTeXStr=x!nowStr:MiKTeX=!
	if not !MiKTeXStr!==x!nowStr! set MiKTeXPath=!nowStr!
)
if !MiKTeXPath!==nul (
	cls&echo.&echo.&echo.&echo.&echo �Х��w�� MiKTeX, �A���楻�w��
	color E3&set /p=&goto exit
)
set MiKTeXPath=!MiKTeXPath:miktex\bin\=!&set MiKTeXPath=!MiKTeXPath:/= !&set MiKTeXPath=!MiKTeXPath:[x86]=(x86)!
if not exist "!MiKTeXPath!tex\latex\beamer\" (
	cls&echo.&echo.&echo.&echo.&echo �Х��w�� Beamer, �A���楻�w��
	color E3&set /p=&goto exit
)
call:copyFile .\themes, *.sty&call:copyFile .\art, *.jpg
initexmf --update-fndb >nul
if !errorlevel!==1 (
	cls&echo.&echo.&echo.&echo.&echo �Х������sĶ MiKTeX �M��, �A����
	color 4C&set /p=&goto exit
)
cls&echo.&echo.&echo.&echo.&echo Install Theme Successful ^^!&color 2A&ping 127.0.0.1 -n 3 >nul&goto exit

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

:exit

Fix Encoded

Fix Encoded


:: https://github.com/Chaser324/unity-build/wiki/Command-Line-Interface
"C:\Program Files\Unity\Editor\Unity.exe" -quit -batchmode -nographics -executeMethod SuperSystems.UnityBuild.BuildCLI.PerformBuild

:: https://github.com/Chaser324/unity-build/wiki/Command-Line-Interface
"C:\Program Files\Unity\Editor\Unity.exe" -quit -batchmode -nographics -projectPath "%cd%" -executeMethod SuperSystems.UnityBuild.BuildCLI.PerformBuild

include projectpath in build.bat

include projectpath in build.bat


set /p versionNumber=

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

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

set /p versionNumber=

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

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

update build script to include Printf.fs


@echo off
setlocal enabledelayedexpansion
set SolutionDir=%~dp0
set SolutionFileFull=TaskParallelLibrary.sln
set SolutionFileCF=TaskParallelLibrary.vs2008.sln
set GLOBALERROR=0
echo building all projects in the solution (Release)

rmdir /s/q "%SolutionDir%Output" 2> nul
mkdir "%SolutionDir%Output"

REM ============================================================================
REM Compact .NET Framework
REM ============================================================================
set net35path="C:\Windows\Microsoft.NET\Framework\v3.5"
set msbuild="%net35path%\MSBuild.exe"
set targetscf="%net35path%\Microsoft.CompactFramework.CSharp.targets"
if not exist %msbuild% (
	echo Error trying to find MSBuild 3.5 executable
	exit /B 1
)
if not exist %targetscf% (
	echo Error trying to find Compact Framework targets
    echo.
	echo Install '.NET Compact Framework Redistributable'
	echo and 'Power Toys for .NET Compact Framework 3.5'
	exit /B 1
)
set SolutionFile=%SolutionFileCF%

CALL :Build TaskParallel_Compact Release v3.5 "" net35-cf "TRACE;WindowsCE"

REM ============================================================================
REM Full .NET Framework
REM ============================================================================
set msbuild="C:\Program Files (x86)\MSBuild\14.0\bin\msbuild"
if not exist %msbuild% (
	set msbuild="C:\Program Files (x86)\MSBuild\12.0\bin\msbuild"
)
if not exist %msbuild% (
	echo Error trying to find MSBuild executable
	exit /B 1
)
set SolutionFile=%SolutionFileFull%

CALL :Build TaskParallel_Full WINCE v3.5 Client net35-cf-test "TRACE;WindowsCE"
CALL :Build TaskParallel_Full Release v3.5 Client net35 "TRACE;NET35"
CALL :Build TaskParallel_Full Release v4.0 "" net40 "TRACE;NET35;NET40"
CALL :Build TaskParallel_Full Release v4.5 "" net45 "TRACE;NET35;NET40;NET45"
CALL :Build TaskParallel_Full Release v4.5.1 "" net451 "TRACE;NET35;NET40;NET45"
CALL :Build TaskParallel_Full Release v4.5.2 "" net452 "TRACE;NET35;NET40;NET45"
CALL :Build TaskParallel_Full Release v4.6 "" net46 "TRACE;NET35;NET40;NET45;NET46"
CALL :Build TaskParallel_Full Release v4.6.1 "" net461 "TRACE;NET35;NET40;NET45;NET46"
CALL :Build TaskParallel_Full Release v4.6.2 "" net462 "TRACE;NET35;NET40;NET45;NET46" optional
CALL :Build TaskParallel_PCL DIST40 v4.0 Profile136 portable-net40+sl5+win8+wp8+MonoAndroid+MonoTouch+XamariniOS "TRACE;NET35;NET40;PCL;Profile136"
CALL :Build TaskParallel_PCL Release v4.5 Profile7 portable-net45+win8+MonoAndroid+MonoTouch+XamariniOS "TRACE;NET35;NET40;NET45;PCL;Profile7" optional
CALL :Build TaskParallel_PCL Release v4.5 Profile111 portable-net45+win8+wpa81+MonoAndroid+MonoTouch+XamariniOS "TRACE;NET35;NET40;NET45;PCL;Profile111" optional
CALL :Build TaskParallel_PCL Release v4.5 Profile259 portable-net45+win8+wpa81+wp8+MonoAndroid+MonoTouch+XamariniOS "TRACE;NET35;NET40;NET45;PCL;Profile259"
CALL :Build TaskParallel_PCL Release v4.6 Profile44 portable-net451+win81+MonoAndroid+MonoTouch+XamariniOS "TRACE;NET35;NET40;NET45;PCL;Profile44"

echo build complete.

EXIT /B %GLOBALERROR%

:Build
set Project=%~1
set Configuration=%~2
set TargetFX=%~3
set Profile=%~4
set TargetDir=%~5
set Constants=%~6
set Optional=%~7
set Delim=%%3B

if %GLOBALERROR% == 1 (
	EXIT /B %ERRORLEVEL%
)

set OutputPath=%SolutionDir%Output\%TargetDir%
set ObjOutputPath=%SolutionDir%Output\obj
set Constants=%Constants:;=!Delim!%
<nul set /p ="building %TargetFX% %Profile% (%TargetDir%) "
rmdir /s/q "%OutputPath%" 2> nul
%msbuild% %SolutionDir%%SolutionFile% /target:%Project% /verbosity:minimal /property:Configuration=%Configuration%;TargetFrameworkVersion=%TargetFX%;TargetFrameworkProfile=%Profile%;OutputPath=%OutputPath%\;DefineConstants=%Constants%;BaseIntermediateOutputPath=%ObjOutputPath%\ > output_rel.log
rmdir /s/q "%ObjOutputPath%"

if %ERRORLEVEL% == 0 (
	echo [  OK  ]
) else (
    if "%Optional%" == "optional" (
        echo [ SKIP ]
    ) else (
        echo [ FAIL ]
        type output_rel.log
        set GLOBALERROR=1
    )
)

REM Clean variables
set Project=
set Configuration=
set TargetFX=
set Profile=
set TargetDir=
set Constants=
set Optional=
set OutputPath=
set ObjOutputPath=
EXIT /B %ERRORLEVEL%

Fix build script tabs

Fix build script tabs


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

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

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

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

mkdir Build
mkdir Build\lib
mkdir Build\lib\net40

%nuget% pack "DynamicProperty.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

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

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

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

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

mkdir Build
mkdir Build\lib
mkdir Build\lib\net40

%nuget% pack "DynamicProperty.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

Fix solution path

Fix solution path


@ECHO OFF

:: Note: We're not using parallel build (/m) because it doesn't seem to
::       work with Sandcastle Help File Builder.

"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" %~dp0\build.proj /nologo /v:m /flp:verbosity=detailed %1 %2 %3 %4 %5 %6 %7 %8 %9

@ECHO OFF

:: Note: We're not using parallel build (/m) because it doesn't seem to
::       work with Sandcastle Help File Builder.

"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" %~dp0\build.proj /nologo /v:m /flp:verbosity=detailed  %*

Replace individual parameters with wildcard

It's not that we ever want to pass more than ten arguments; it's about
the fact that we'd like to be able to pass arguments like this:

    .\build.cmd /p:OutDir='D:\test\'

Using individual arguments, MSBuild is called like this:

    MSBuild.exe /p:OutDir D:\test\

That's because the equal sign is considered a separator in batch files.


@ECHO off
SETLOCAL

SET REPO_FOLDER=%~dp0
CD %REPO_FOLDER%

SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=

SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe

IF NOT EXIST %BUILD_FOLDER% (
    md %BUILD_FOLDER%
)

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

    copy %CACHED_NUGET% %NUGET_PATH% > nul
)

SET KOREBUILD_DOWNLOAD_ARGS=
IF NOT "%KOREBUILD_VERSION%"=="" (
    SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
)
IF NOT EXIST %KOREBUILD_FOLDER% (
    %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)

"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

@ECHO off
SETLOCAL

SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"

SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=

SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe

IF NOT EXIST %BUILD_FOLDER% (
    md %BUILD_FOLDER%
)

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

    copy %CACHED_NUGET% %NUGET_PATH% > nul
)

SET KOREBUILD_DOWNLOAD_ARGS=
IF NOT "%KOREBUILD_VERSION%"=="" (
    SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
)
IF NOT EXIST %KOREBUILD_FOLDER% (
    %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)

"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*

Update `build.cmd` to match latest template - aspnet/Universe#347 - `%KOREBUILD_VERSION%` doesn't work without this fix


@echo off

echo "Update Git Submodules"
git submodule init > NUL
git submodule update > NUL

echo "Bootstrap Tools"
msbuild /clp:ErrorsOnly;ShowTimestamp /t:rebuild /p:Configuration=Release /p:Platform="x64" /m /nologo "./Submodules/JUCE/extras/Projucer/Builds/VisualStudio2015/Projucer.sln"

echo "Update Projects"
"./Submodules/JUCE/extras/Projucer/Builds/VisualStudio2015/x64/Release/Projucer.exe" --resave Projects/Plugin/Plugin.jucer

echo "Build Plugin 64bit"
msbuild /clp:ErrorsOnly;ShowTimestamp /t:rebuild /p:Configuration=Release /p:Platform="x64" /m /nologo "./Projects/Plugin/Builds/VisualStudio2015/Plugin.sln"

rem echo "Build Installer"
rem msbuild /clp:ErrorsOnly;ShowTimestamp /property:Configuration=Release /m /nologo "./Projects/Installer/Installer.wixproj"

add plugin-only build script

add plugin-only build script


@mkdir .shake 2> nul

@set ghcArgs=--make            ^
             -Wall             ^
             src/Main.hs       ^
             -isrc             ^
             -rtsopts          ^
             -with-rtsopts=-I0 ^
             -outputdir=.shake ^
             -j                ^
             -O                ^
             -o .shake/build

@set shakeArgs=--lint      ^
               --directory ^
               ".."        ^
               %*

@rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains
@if defined GHC_PACKAGE_PATH ( set GHC_PACKAGE_PATH )

@ghc %ghcArgs% && .shake\build %shakeArgs%

@mkdir .shake 2> nul

@set ghcArgs=--make            ^
             -Wall             ^
             src/Main.hs       ^
             -isrc             ^
             -rtsopts          ^
             -with-rtsopts=-I0 ^
             -outputdir=.shake ^
             -j                ^
             -O                ^
             -o .shake/build

@set shakeArgs=--lint      ^
               --directory ^
               ".."        ^
               %*

@rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains
@set GHC_PACKAGE_PATH=

@ghc %ghcArgs% && .shake\build %shakeArgs%

Reset GHC_PACKAGE_PATH varialbe (4th try).

See #110. [skip ci]


set /p versionNumber=

del builds\Unquote-%versionNumber%.zip
del builds\Unquote.%versionNumber%.nupkg

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

del staging\net40\Utils.dll

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

del staging\sl4\Utils.dll

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...

del /q /s staging
del /q /s nuget

pause

set /p versionNumber=

del builds\Unquote-%versionNumber%.zip
del builds\Unquote.%versionNumber%.nupkg

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

del staging\net40\Utils.dll

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

del staging\sl4\Utils.dll

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...

rd /q /s staging
rd /q /s nuget

pause

build script looks solid now....

build script looks solid now....


@echo off

echo Fop Build System
echo ----------------

if "%JAVA_HOME%" == "" goto error

set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\classes.zip;lib\ant.jar;lib\xml.jar;lib
set ANT_HOME=.\lib

echo Building with classpath %LOCALCLASSPATH%

echo Starting Ant...

%JAVA_HOME%\bin\java.exe -Dant.home=%ANT_HOME% -classpath %LOCALCLASSPATH% org.apache.tools.ant.Main %1 %2 %3 %4 %5

goto end

:error

echo ERROR: JAVA_HOME not found in your environment.
echo Please, set the JAVA_HOME variable in your environment to match the
echo location of the Java Virtual Machine you want to use.

:end

rem set LOCALCLASSPATH=

@echo off

echo Fop Build System
echo ----------------

if "%JAVA_HOME%" == "" goto error

set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\classes.zip;lib\ant.jar;lib\xml.jar;lib
set ANT_HOME=.\lib

echo Building with classpath %LOCALCLASSPATH%

echo Starting Ant...

%JAVA_HOME%\bin\java.exe -Dant.home=%ANT_HOME% -classpath %LOCALCLASSPATH%;%CLASSPATH% org.apache.tools.ant.Main %1 %2 %3 %4 %5

goto end

:error

echo ERROR: JAVA_HOME not found in your environment.
echo Please, set the JAVA_HOME variable in your environment to match the
echo location of the Java Virtual Machine you want to use.

:end

rem set LOCALCLASSPATH=

include standard classpath

fix: include standard classpath

git-svn-id: 102839466c3b40dd9c7e25c0a1a6d26afc40150a@193301 13f79535-47bb-0310-9956-ffa450edef68


@ECHO OFF
REM NOTE: This file was auto-generated with `IB.exe prepare` from `IntelliFactory.Build`.

setlocal
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;tools\NuGet
nuget install IntelliFactory.Build -nocache -pre -ExcludeVersion -o tools\packages
fsi.exe --exec build.fsx %*

@ECHO OFF
REM NOTE: This file was auto-generated with `IB.exe prepare` from `IntelliFactory.Build`.

setlocal
set PATH=%PATH%;tools\NuGet
nuget install IntelliFactory.Build -nocache -pre -ExcludeVersion -o tools\packages
nuget install FSharp.Compiler.Tools -nocache -version 4.0.1.21 -excludeVersion -o tools/packages
tools\packages\FSharp.Compiler.Tools\tools\fsi.exe --exec build.fsx %*

Use fsi from FSharp.Compiler.Tools

Use fsi from FSharp.Compiler.Tools

Avoids issues due to different compiler versions installed on the system.


REM This file should be executed from the command line prior to the first
REM build.  It will be necessary to refresh the Eclipse project once the
REM .bat file has been executed (normally just press F5 to refresh).

REM Copies all the required files from their location within the standard
REM FreeRTOS directory structure to under the Eclipse project directory.
REM This permits the Eclipse project to be used in 'managed' mode and without
REM having to setup any linked resources.

REM Have the files already been copied?
IF EXIST FreeRTOS Goto END

	REM Create the required directory structure.
	MD FreeRTOS
	MD FreeRTOS\include
	MD FreeRTOS\portable\GCC\AVR32_UC3
	MD FreeRTOS\portable\MemMang
	MD Common_Demo_Tasks
	MD Common_Demo_Tasks\Minimal
	MD Common_Demo_Tasks\include

	REM Copy the core kernel files.
	copy ..\..\Source\*.* FreeRTOS

	REM Copy the common header files
	copy ..\..\Source\include\*.* FreeRTOS\include

	REM Copy the portable layer files
	copy ..\..\Source\portable\GCC\AVR32_UC3\*.* FreeRTOS\portable\GCC\AVR32_UC3

	REM Copy the basic memory allocation files
	copy ..\..\Source\portable\MemMang\heap_3.c FreeRTOS\portable\MemMang

	REM Copy the files that define the common demo tasks.
	copy ..\common\Minimal\BlockQ.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\comtest.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\death.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\dynamic.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\flash.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\flop.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\integer.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\PollQ.c Common_Demo_Tasks\Minimal
	copy ..\common\Minimal\semtest.c Common_Demo_Tasks\Minimal

	REM Copy the common demo file headers.
	copy ..\common\include\*.* Common_Demo_Tasks\include

: END

Add batch file that generates the local directory structure to allow the new AVR32 UC3 demo to be build using an Eclipse managed make project.


del log.txt

..\..\Bin\Release\v40\YC.YaccConstructor.exe -i .\..\..\..\YC.Abstract.SQL\src\TSQL\mssqlNonAbstract.yrd -c Linearize -g "RNGLR.Generator -table LALR -o RNGLR.sql.yrd.fs"
..\..\Bin\Release\v40\YC.YaccConstructor.exe -i .\..\..\..\YC.Abstract.SQL\src\TSQL\mssqlNonAbstract.yrd -c Linearize -g "RNGLR.EBNFGenerator -table LALR -o RNGLREBNF.sql.yrd.fs"

del log.txt

..\..\Bin\Release\v40\YC.YaccConstructor.exe -i .\..\..\..\YC.Abstract.SQL\src\Grammars\TSQL\mssqlNonAbstract.yrd  -c Linearize -g "RNGLR.EBNFGenerator -table LALR -o RNGLREBNF.sql.yrd.fs"

Change script for gen pasrer

Change script for gen pasrer


@ECHO OFF
SET oldPath=%PATH%

git.exe 2> NUL
if %ERRORLEVEL%==9009 GOTO :trydefaultpath
GOTO :EOF

:trydefaultpath
path=C:\Program Files (x86)\Git\cmd;%PATH%
git.exe 2> NUL
if %ERRORLEVEL%==9009 GOTO :showerror
GOTO :EOF

:showerror
path=%oldPath%
ECHO Git is not in your path and could not be found in C:\Program Files (x86)\Git\bin
set /p install=" Do you want to install Git through Chocolatey [y/n]? " %=%
if %install%==y (
	GOTO :installgit
) else (
	GOTO :cantcontinue
)

:cantcontinue
ECHO Can't complete the build without Git being in the path. Please add it to be able to continue.
GOTO :EOF

:installgit
ECHO Installing Chocolatey first
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
ECHO Installing Git through Chocolatey
choco install git
path=C:\Program Files (x86)\Git\cmd;%path%

@ECHO OFF
SET oldPath=%PATH%

git.exe 2> NUL
if %ERRORLEVEL%==9009 GOTO :trydefaultpath
GOTO :EOF

:trydefaultpath
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
git.exe 2> NUL
if %ERRORLEVEL%==9009 GOTO :showerror
GOTO :EOF

:showerror
path=%oldPath%
ECHO Git is not in your path and could not be found in C:\Program Files (x86)\Git\cmd
set /p install=" Do you want to install Git through Chocolatey [y/n]? " %=%
if %install%==y (
	GOTO :installgit
) else (
	GOTO :cantcontinue
)

:cantcontinue
ECHO Can't complete the build without Git being in the path. Please add it to be able to continue.
GOTO :EOF

:installgit
ECHO Installing Chocolatey first
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
ECHO Installing Git through Chocolatey
choco install git
path=C:\Program Files (x86)\Git\cmd;%path%

Update in case people have 64bit git installed