@echo off

title Audit.NET Unit Tests Runner

echo Disabling GitHub nuget source to avoid conflicts
nuget sources disable -name GitHub
echo.

call start-services

cd ..
dotnet restore
cd test

cd Audit.Mvc.UnitTest
echo ---------------------------------------------- RUNNING MVC UNIT TESTS (1) ----------------------------------------------
TITLE RUNNING MVC UNIT TESTS (1)
dotnet test --logger:"console;verbosity=normal"

echo Running...

cd ..

cd Audit.UnitTest
echo ---------------------------------------------- RUNNING GENERAL UNIT TESTS (2) ----------------------------------------------
TITLE RUNNING GENERAL UNIT TESTS (2)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.WebApi.UnitTest
echo ---------------------------------------------- RUNNING WEB API UNIT TESTS (3) ----------------------------------------------
TITLE RUNNING WEB API UNIT TESTS (3)
dotnet test --logger:"console;verbosity=normal"

echo Running...

cd ..

cd Audit.Integration.AspNetCore
echo ---------------------------------------------- RUNNING ASP NET CORE UNIT TESTS (4) ----------------------------------------------
TITLE RUNNING ASP NET CORE UNIT TESTS (4)
dotnet run
cd ..

cd Audit.DynamicProxy.UnitTest
echo ---------------------------------------------- RUNNING DYNAMIC PROXY UNIT TESTS (5) ----------------------------------------------
TITLE RUNNING DYNAMIC PROXY UNIT TESTS (5)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.Core.UnitTest
echo ---------------------------------------------- RUNNING EF CORE UNIT TESTS (6) ----------------------------------------------
TITLE RUNNING EF CORE UNIT TESTS (6)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.Core.v3.UnitTest
echo ---------------------------------------------- RUNNING EF CORE UNIT TESTS V3 (7) ----------------------------------------------
TITLE RUNNING EF CORE UNIT TESTS V3 (6)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.UnitTest
echo ---------------------------------------------- RUNNING EF FULL UNIT TESTS (8) ----------------------------------------------
TITLE RUNNING EF FULL UNIT TESTS (7)
IF NOT EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe" (
	echo The file does not exist
        exit /B 1
)
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=LocalDb
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=Sql
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=Stress

echo Running...
cd ..

cd Audit.EntityFramework.Full.UnitTest
echo ---------------------------------------------- RUNNING EF FULL UNIT TESTS (9) ----------------------------------------------
TITLE RUNNING EF FULL UNIT TESTS (8)
dotnet test --logger:"console;verbosity=normal"
echo Running...
cd ..

cd Audit.Redis.UnitTest
echo ---------------------------------------------- RUNNING REDIS UNIT TESTS (10) ----------------------------------------------
TITLE RUNNING REDIS UNIT TESTS (9)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.IntegrationTest
echo ---------------------------------------------- RUNNING GENERAL INTEGRATION TEST (11) ----------------------------------------------
TITLE RUNNING GENERAL INTEGRATION TEST (10)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory!=AzureDocDb&TestCategory!=AzureBlob&TestCategory!=WCF&TestCategory!=Elasticsearch&TestCategory!=Dynamo&TestCategory!=PostgreSQL&TestCategory!=Kafka"
echo ---------------------------------------------- RUNNING Kafka INTEGRATION TEST (12) ----------------------------------------------
TITLE RUNNING Kafka INTEGRATION TEST (11)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Kafka"
echo ---------------------------------------------- RUNNING PostgreSQL INTEGRATION TEST (13) ----------------------------------------------
TITLE RUNNING PostgreSQL INTEGRATION TEST (12)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=PostgreSQL"
echo ---------------------------------------------- RUNNING Azure Cosmos DB INTEGRATION TEST (14) ----------------------------------------------
TITLE Azure Cosmos DB INTEGRATION TEST (13)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=AzureDocDb"
echo ---------------------------------------------- RUNNING Azure BLOB INTEGRATION TEST (15) ----------------------------------------------
TITLE RUNNING Azure BLOB INTEGRATION TEST (14)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=AzureBlob"
echo ---------------------------------------------- RUNNING WCF SYNC INTEGRATION TEST (16) ----------------------------------------------
TITLE RUNNING WCF SYNC INTEGRATION TEST (15)
dotnet test --logger:"console;verbosity=normal" -f net452 --filter "TestCategory=WCF&TestCategory!=Async"
echo ---------------------------------------------- RUNNING WCF ASYNC INTEGRATION TEST (17) ----------------------------------------------
TITLE RUNNING WCF ASYNC INTEGRATION TEST (16)
dotnet test --logger:"console;verbosity=normal" -f net452 --filter "TestCategory=WCF&TestCategory=Async"
echo ---------------------------------------------- RUNNING ELASTICSEARCH INTEGRATION TEST (18) ----------------------------------------------
TITLE RUNNING ELASTICSEARCH INTEGRATION TEST (17)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Elasticsearch"
echo ---------------------------------------------- RUNNING DYNAMO DB INTEGRATION TEST (19) ----------------------------------------------
TITLE RUNNING DYNAMO DB INTEGRATION TEST (18)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Dynamo"

cd ..

title Audit.NET Unit Tests Runner

ECHO.
ECHO --- PRESS ENTER TO STOP THE SERVICES (or CTRL+C to cancel)
pause>nul

call stop-services

echo Enabling GitHub nuget source
nuget sources enable -name GitHub
echo.

@echo off

title Audit.NET Unit Tests Runner

echo Disabling GitHub nuget source to avoid conflicts
nuget sources disable -name GitHub
echo.

call start-services

cd ..
dotnet restore
cd test

cd Audit.Mvc.UnitTest
echo ---------------------------------------------- RUNNING MVC UNIT TESTS (1) ----------------------------------------------
TITLE RUNNING MVC UNIT TESTS (1)
dotnet test --logger:"console;verbosity=normal"

echo Running...

cd ..

cd Audit.UnitTest
echo ---------------------------------------------- RUNNING GENERAL UNIT TESTS (2) ----------------------------------------------
TITLE RUNNING GENERAL UNIT TESTS (2)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.WebApi.UnitTest
echo ---------------------------------------------- RUNNING WEB API UNIT TESTS (3) ----------------------------------------------
TITLE RUNNING WEB API UNIT TESTS (3)
dotnet test --logger:"console;verbosity=normal"

echo Running...

cd ..

cd Audit.Integration.AspNetCore
echo ---------------------------------------------- RUNNING ASP NET CORE UNIT TESTS (4) ----------------------------------------------
TITLE RUNNING ASP NET CORE UNIT TESTS (4)
dotnet run
cd ..

cd Audit.DynamicProxy.UnitTest
echo ---------------------------------------------- RUNNING DYNAMIC PROXY UNIT TESTS (5) ----------------------------------------------
TITLE RUNNING DYNAMIC PROXY UNIT TESTS (5)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.Core.UnitTest
echo ---------------------------------------------- RUNNING EF CORE UNIT TESTS (6) ----------------------------------------------
TITLE RUNNING EF CORE UNIT TESTS (6)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.Core.v3.UnitTest
echo ---------------------------------------------- RUNNING EF CORE UNIT TESTS V3 (7) ----------------------------------------------
TITLE RUNNING EF CORE UNIT TESTS V3 (7)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.EntityFramework.UnitTest
echo ---------------------------------------------- RUNNING EF FULL UNIT TESTS (8) ----------------------------------------------
TITLE RUNNING EF FULL UNIT TESTS (8)
IF NOT EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe" (
	echo The file does not exist
        exit /B 1
)
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=LocalDb
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=Sql
..\..\packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe bin\Debug\Audit.EntityFramework.UnitTest.dll --noresult --where=cat=Stress

echo Running...
cd ..

cd Audit.EntityFramework.Full.UnitTest
echo ---------------------------------------------- RUNNING EF FULL UNIT TESTS (9) ----------------------------------------------
TITLE RUNNING EF FULL UNIT TESTS (9)
dotnet test --logger:"console;verbosity=normal"
echo Running...
cd ..

cd Audit.Redis.UnitTest
echo ---------------------------------------------- RUNNING REDIS UNIT TESTS (10) ----------------------------------------------
TITLE RUNNING REDIS UNIT TESTS (10)
dotnet test --logger:"console;verbosity=normal"

echo Running...
cd ..

cd Audit.IntegrationTest
echo ---------------------------------------------- RUNNING GENERAL INTEGRATION TEST (11) ----------------------------------------------
TITLE RUNNING GENERAL INTEGRATION TEST (11)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory!=AzureDocDb&TestCategory!=AzureBlob&TestCategory!=WCF&TestCategory!=Elasticsearch&TestCategory!=Dynamo&TestCategory!=PostgreSQL&TestCategory!=Kafka"
echo ---------------------------------------------- RUNNING Kafka INTEGRATION TEST (12) ----------------------------------------------
TITLE RUNNING Kafka INTEGRATION TEST (12)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Kafka"
echo ---------------------------------------------- RUNNING PostgreSQL INTEGRATION TEST (13) ----------------------------------------------
TITLE RUNNING PostgreSQL INTEGRATION TEST (13)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=PostgreSQL"
echo ---------------------------------------------- RUNNING Azure Cosmos DB INTEGRATION TEST (14) ----------------------------------------------
TITLE Azure Cosmos DB INTEGRATION TEST (14)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=AzureDocDb"
echo ---------------------------------------------- RUNNING Azure BLOB INTEGRATION TEST (15) ----------------------------------------------
TITLE RUNNING Azure BLOB INTEGRATION TEST (15)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=AzureBlob"
echo ---------------------------------------------- RUNNING WCF SYNC INTEGRATION TEST (16) ----------------------------------------------
TITLE RUNNING WCF SYNC INTEGRATION TEST (16)
dotnet test --logger:"console;verbosity=normal" -f net452 --filter "TestCategory=WCF&TestCategory!=Async"
echo ---------------------------------------------- RUNNING WCF ASYNC INTEGRATION TEST (17) ----------------------------------------------
TITLE RUNNING WCF ASYNC INTEGRATION TEST (17)
dotnet test --logger:"console;verbosity=normal" -f net452 --filter "TestCategory=WCF&TestCategory=Async"
echo ---------------------------------------------- RUNNING ELASTICSEARCH INTEGRATION TEST (18) ----------------------------------------------
TITLE RUNNING ELASTICSEARCH INTEGRATION TEST (18)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Elasticsearch"
echo ---------------------------------------------- RUNNING DYNAMO DB INTEGRATION TEST (19) ----------------------------------------------
TITLE RUNNING DYNAMO DB INTEGRATION TEST (19)
dotnet test --logger:"console;verbosity=normal" --filter "TestCategory=Dynamo"

cd ..

title Audit.NET Unit Tests Runner

ECHO.
ECHO --- PRESS ENTER TO STOP THE SERVICES (or CTRL+C to cancel)
pause>nul

call stop-services

echo Enabling GitHub nuget source
nuget sources enable -name GitHub
echo.

fix titles

fix titles


@ECHO OFF
setlocal
SET ALLYPATH=..\
SET ALLYCOM=%ALLYPATH%components\
set PYTHONPATH=%ALLYCOM%ally-api
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-authentication
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-authentication-core
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-authentication-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-plugin
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-sqlalchemy
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-asyncore-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-mongrel2-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-utilities
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%support-administration
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%support-cdm
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%support-development

SET ALLYPLUG=%ALLYPATH%plugins\
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-action
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-core
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%internationalization
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%introspection-request
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-sqlalchemy

SET FULLPATH=
SET SUPERPLUG=%FULLPATH%plugins\
REM set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%ffmpeg-binary
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk-embed
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-audio
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-image
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-video
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-address
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-article
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-authentication
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-collaborator
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-country
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-language
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-person
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-post
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-source
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-user

del distribution\workspace\superdesk.db
python distribution\application.py

@ECHO OFF
setlocal
SET ALLYPATH=..\
SET ALLYCOM=%ALLYPATH%components\
set PYTHONPATH=%ALLYCOM%ally-api
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-authentication
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-authentication-core
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-authentication-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-plugin
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-sqlalchemy
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-asyncore-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-mongrel2-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-utilities
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%support-administration
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%support-cdm
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%support-development

SET ALLYPLUG=%ALLYPATH%plugins\
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-action
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-core
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%internationalization
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%introspection-request
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-sqlalchemy

SET FULLPATH=
SET SUPERPLUG=%FULLPATH%plugins\
REM set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%ffmpeg-binary
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk-embed
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-audio
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-image
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-video
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-address
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-article
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-authentication
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-collaborator
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-country
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-language
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-person
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-post
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-source
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-user

if exist {distribution\workspace\shared\superdesk.db} (
	del distribution\workspace\shared\superdesk.db
)
if exist {distribution\application.properties} (
	python distribution\application.py
) else (
	python distribution\application.py -dump
	python distribution\application.py
)

NR-474: Refactor the collaborators setup in the blog configuration screen

Inteligent start-source.bat
runs with -dump if no application.properties was found and then runs the
application normal


@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET "PATH=%JAVA_HOME%\bin;%PATH%"

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET JAVA_OPTS=%%A !JAVA_OPTS!
)

rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

:args_loop
if "%~1" == "" goto args_end

if "%~1" == "-jvm-debug" (
  set JVM_DEBUG=true
  set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
  set /a JVM_DEBUG_PORT=%1 2>nul >nul
  if not "%~1" == "!JVM_DEBUG_PORT!" (
    set SBT_ARGS=!SBT_ARGS! %1
  )
) else (
  set SBT_ARGS=!SBT_ARGS! %1
)

shift
goto args_loop
:args_end

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

Change to Windows lineending

Change to Windows lineending


go get golang.org/x/sys/unix
set GOARCH=amd64
set GOOS=linux
go build .\arkgopool.go .\database.go .\helpers.go .\payouts.go

set GOOS=windows
go build .\arkgopool.go .\database.go .\helpers.go .\payouts.go

go get golang.org/x/sys/unix
set GOARCH=amd64
set GOOS=linux
go build

set GOOS=windows
go build

REM linux
if not exist "dist" mkdir dist
cd dist
mkdir linux
cd linux
move ..\..\arkgopool .
mkdir settings
copy ..\..\settings\banner.txt settings
copy ..\..\settings\sample.config.toml settings
cd ..

REM windows
if not exist "windows" mkdir windows
cd windows
move ..\..\arkgopool.exe .
mkdir settings
copy ..\..\settings\banner.txt settings
copy ..\..\settings\sample.config.toml settings
mkdir log

build script

build script


@echo off

SETLOCAL
rem only if we are running from a checkout
IF EXIST "%~dp0\.git" (
  rem verify that we have 7zip in the path
  7z.exe --help > nul
  IF errorlevel 1 (
    REM For some reason, without quotes this line causes an error
    echo "Please install 7z.exe (7-Zip) and put it into your PATH"
    exit /b 1
  )

  rem if dev_bundle is not present, get it
  IF NOT EXIST "%~dp0\dev_bundle" (
    REM need `< con` so that we can run this file from Node
    REM (See http://stackoverflow.com/questions/9155289/calling-powershell-from-nodejs)
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
    IF errorlevel 1 (
      echo An error occurred while obtaining the dev_bundle.  Please try again.
      exit /b 1
    )
  )

  rem if dev_bundle is the wrong version, remove it and get a new one
  PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\check-dev-bundle.ps1" < con

  IF errorlevel 1 (
    rmdir /s /q "%~dp0\dev_bundle"
    IF EXIST "%~dp0\dev_bundle" (
      echo Couldn't delete old dependency kit. Please try again.
      exit /b 1
    )
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
    IF errorlevel 1 (
      echo An error occurred while obtaining the dev_bundle.  Please try again.
      exit /b 1
    )
  )

  rem Only set this when we're in a checkout. When running from a release,
  rem this is correctly set in the top-level `meteor.bat` file
  SET METEOR_INSTALLATION=%~dp0
)

SET NODE_PATH=%~dp0\dev_bundle\lib\node_modules
SET BABEL_CACHE_DIR=%~dp0\.babel-cache

"%~dp0\dev_bundle\bin\node.exe" ^
  --max-old-space-size=4096 ^
  %TOOL_NODE_FLAGS% ^
  "%~dp0\tools\index.js" %*

ENDLOCAL

EXIT /b %ERRORLEVEL%

@echo off

SETLOCAL
rem only if we are running from a checkout
IF EXIST "%~dp0\.git" (
  rem verify that we have 7zip in the path
  7z.exe --help > nul
  IF errorlevel 1 (
    REM For some reason, without quotes this line causes an error
    echo "Please install 7z.exe (7-Zip) and put it into your PATH"
    exit /b 1
  )

  rem if dev_bundle is not present, get it
  IF NOT EXIST "%~dp0\dev_bundle" (
    REM need `< con` so that we can run this file from Node
    REM (See http://stackoverflow.com/questions/9155289/calling-powershell-from-nodejs)
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
    IF errorlevel 1 (
      echo An error occurred while obtaining the dev_bundle.  Please try again.
      exit /b 1
    )
  )

  rem if dev_bundle is the wrong version, remove it and get a new one
  PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\check-dev-bundle.ps1" < con

  IF errorlevel 1 (
    rmdir /s /q "%~dp0\dev_bundle"
    IF EXIST "%~dp0\dev_bundle" (
      echo Couldn't delete old dependency kit. Please try again.
      exit /b 1
    )
    PowerShell.exe -executionpolicy ByPass -file "%~dp0\scripts\windows\download-dev-bundle.ps1" < con
    IF errorlevel 1 (
      echo An error occurred while obtaining the dev_bundle.  Please try again.
      exit /b 1
    )
  )

  rem Only set this when we're in a checkout. When running from a release,
  rem this is correctly set in the top-level `meteor.bat` file
  SET METEOR_INSTALLATION=%~dp0
)

SET NODE_PATH=%~dp0\dev_bundle\lib\node_modules
SET BABEL_CACHE_DIR=%~dp0\.babel-cache

"%~dp0\dev_bundle\bin\node.exe" ^
  %TOOL_NODE_FLAGS% ^
  "%~dp0\tools\index.js" %*

ENDLOCAL

EXIT /b %ERRORLEVEL%

Remove the --max-old-space-size option to node.exe in meteor.bat.

If the max size is too large (at least on windows_x86), the process
silently exits without doing anything, which is arguably worse than just
using the default max space (i.e., not passing the option).


@ECHO off
SETLOCAL
@REM Uncomment this line to update nuget.exe
@REM Doing so can break SLN build (which uses nuget.exe to
@REM create a nuget package for binskim) so must opt-in
@REM %~dp0.nuget\NuGet.exe update -self

set Platform=Any CPU
set Configuration=Release

:NextArg
if "%1" == "" goto :EndArgs
if "%1" == "/config" (
	if not "%2" == "Debug" if not "%2" == "Release" echo error: /config must be either Debug or Release && goto :ExitFailed
    set Configuration=%2&& shift && shift && goto :NextArg
)
echo Unrecognized option "%1" && goto :ExitFailed

:EndArgs

@REM Remove existing build data
rd /s /q bld
md bld\bin\nuget

call SetCurrentVersion.cmd

@REM Write VersionConstants files

set SDK_VERSION_CONSTANTS=src\Sarif\VersionConstants.cs
set DRV_VERSION_CONSTANTS=src\Sarif.Driver\VersionConstants.cs

@REM Rewrite VersionConstants.cs
echo // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT        >  %SDK_VERSION_CONSTANTS%
echo // license. See LICENSE file in the project root for full license information. >> %SDK_VERSION_CONSTANTS%
echo namespace Microsoft.CodeAnalysis.Sarif                                         >> %SDK_VERSION_CONSTANTS%
echo {                                                                              >> %SDK_VERSION_CONSTANTS%
echo     public static class VersionConstants                                       >> %SDK_VERSION_CONSTANTS%
echo     {                                                                          >> %SDK_VERSION_CONSTANTS%
echo         public const string Prerelease = "%PRERELEASE%";                       >> %SDK_VERSION_CONSTANTS%
echo         public const string AssemblyVersion = "%MAJOR%.%MINOR%.%PATCH%";       >> %SDK_VERSION_CONSTANTS%
echo         public const string FileVersion = "%MAJOR%.%MINOR%.%PATCH%" + ".0";    >> %SDK_VERSION_CONSTANTS%
echo         public const string Version = AssemblyVersion + Prerelease;            >> %SDK_VERSION_CONSTANTS%
echo     }                                                                          >> %SDK_VERSION_CONSTANTS%
echo  }                                                                             >> %SDK_VERSION_CONSTANTS%

@REM Rewrite VersionConstants.cs
echo // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT        >  %DRV_VERSION_CONSTANTS%
echo // license. See LICENSE file in the project root for full license information. >> %DRV_VERSION_CONSTANTS%
echo namespace Microsoft.CodeAnalysis.Sarif.Driver                                  >> %DRV_VERSION_CONSTANTS%
echo {                                                                              >> %DRV_VERSION_CONSTANTS%
echo     public static class VersionConstants                                       >> %DRV_VERSION_CONSTANTS%
echo     {                                                                          >> %DRV_VERSION_CONSTANTS%
echo         public const string Prerelease = "%PRERELEASE%";                       >> %DRV_VERSION_CONSTANTS%
echo         public const string AssemblyVersion = "%MAJOR%.%MINOR%.%PATCH%";       >> %DRV_VERSION_CONSTANTS%
echo         public const string FileVersion = AssemblyVersion + ".0";              >> %DRV_VERSION_CONSTANTS%
echo         public const string Version = AssemblyVersion + Prerelease;            >> %DRV_VERSION_CONSTANTS%
echo     }                                                                          >> %DRV_VERSION_CONSTANTS%
echo  }                                                                             >> %DRV_VERSION_CONSTANTS%

if NOT exist "GeneratedKey.snk" (
sn -k GeneratedKey.snk
)

@REM Build all code
%~dp0.nuget\NuGet.exe restore src\Everything.sln -ConfigFile .nuget\NuGet.Config

if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)

msbuild /verbosity:minimal /target:rebuild src\Everything.sln /p:"Configuration=%Configuration%" /p:"Platform=Any CPU" /filelogger /fileloggerparameters:Verbosity=detailed

if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)

@REM Build Nuget packages
.nuget\NuGet.exe pack .\src\Nuget\Sarif.Sdk.nuspec -Symbols -Properties id=Sarif.Sdk;major=%MAJOR%;minor=%MINOR%;patch=%PATCH%;prerelease=%PRERELEASE% -Verbosity Quiet -BasePath .\bld\bin\Sarif\AnyCPU_%Configuration% -OutputDirectory .\bld\bin\Nuget
.nuget\NuGet.exe pack .\src\Nuget\Sarif.Driver.nuspec -Symbols -Properties id=Sarif.Driver;major=%MAJOR%;minor=%MINOR%;patch=%PATCH%;prerelease=%PRERELEASE% -Verbosity Quiet -BasePath .\bld\bin\Sarif.Driver\AnyCPU_%Configuration%\ -OutputDirectory .\bld\bin\Nuget

if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)

@REM Run all tests
SET PASSED=true

mstest /testContainer:bld\bin\Sarif.UnitTests\AnyCPU_%Configuration%\Sarif.UnitTests.dll
if "%ERRORLEVEL%" NEQ "0" (
set PASSED=false
)

if "%PASSED%" NEQ "true" (
goto ExitFailed
)

src\packages\xunit.runner.console.2.1.0\tools\xunit.console.x86.exe bld\bin\Sarif.Driver.UnitTests\AnyCPU_%Configuration%\Sarif.Driver.UnitTests.dll

if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)

src\packages\xunit.runner.console.2.1.0\tools\xunit.console.x86.exe bld\bin\Sarif.FunctionalTests\AnyCPU_%Configuration%\Sarif.FunctionalTests.dll

if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)

src\packages\xunit.runner.console.2.1.0\tools\xunit.console.x86.exe bld\bin\Sarif.ValidationTests\AnyCPU_%Configuration%\Sarif.ValidationTests.dll

if "%ERRORLEVEL%" NEQ "0" (
goto ExitFailed
)

goto Exit

:ExitFailed
@echo.
@echo SCRIPT FAILED

:Exit

Fix white space in BuildAndTest.cmd

Fix white space in BuildAndTest.cmd


if exist atalan rmdir /S /Q atalan

mkdir atalan
cd atalan
mkdir bin
mkdir platform
mkdir processor
mkdir module
mkdir doc
mkdir tools
mkdir examples
cd ..

echo \svn\ > exclude.list

xcopy src\platform atalan\platform /E /I /Q /EXCLUDE:exclude.list
xcopy src\processor atalan\processor /E /I /Q /EXCLUDE:exclude.list
xcopy src\module atalan\module /E /I /Q /EXCLUDE:exclude.list

REM Bin

cd src
call build.bat release
cd ..

copy src\Release\atalan.exe atalan\bin
copy src\mads.exe atalan\bin

copy tools\Atalan.ini atalan\tools

REM Doc generating

if exist www rmdir /S /Q www
mkdir www
cd www
mkdir template
mkdir raster
mkdir examples
mkdir download
mkdir projects
cd ..
xcopy www_src\template www\template /E /I /Q /EXCLUDE:exclude.list
xcopy www_src\raster www\raster /E /I /Q /EXCLUDE:exclude.list
xcopy projects www\projects /E /I /Q /EXCLUDE:exclude.list

docgen.rb

copy examples\*.* atalan\examples /Y

del exclude.list

echo \download\ > exclude.list

xcopy www atalan\doc /E /I /Q /EXCLUDE:exclude.list

del exclude.list

copy doc\contents.txt atalan\
copy license.txt atalan\

Rem Build examples

cd atalan\examples

..\bin\atalan hello_world

..\bin\atalan loop

..\bin\atalan hello_font

..\bin\atalan count_2sec

..\bin\atalan rainbow

..\bin\atalan stars

..\bin\atalan esieve

..\bin\atalan tetris

..\bin\atalan interrupts

..\bin\atalan bit_sieve

..\bin\atalan unit_test

cd ..
cd ..

REM if exist www\download\atalan.zip del www\download\atalan.zip
REM if exist www\download\atalan_src.zip del www\download\atalan_src.zip

zip -q -r www\download\atalan.zip atalan\

cd src
call cleanup.bat
cd ..

zip -q -r www\download\atalan_src.zip src\

copy atalan\examples\*.* www\examples /Y

pause

if exist atalan rmdir /S /Q atalan

mkdir atalan
cd atalan
mkdir bin
mkdir platform
mkdir processor
mkdir module
mkdir doc
mkdir tools
mkdir examples
cd ..

echo \svn\ > exclude.list

xcopy src\platform atalan\platform /E /I /Q /EXCLUDE:exclude.list
xcopy src\processor atalan\processor /E /I /Q /EXCLUDE:exclude.list
xcopy src\module atalan\module /E /I /Q /EXCLUDE:exclude.list

REM Bin

cd src
call build.bat release
cd ..

copy src\Release\atalan.exe atalan\bin
copy src\mads.exe atalan\bin

copy tools\Atalan.ini atalan\tools

REM Doc generating

if exist www rmdir /S /Q www
mkdir www
cd www
mkdir template
mkdir raster
mkdir examples
mkdir download
mkdir projects
cd ..
xcopy www_src\template www\template /E /I /Q /EXCLUDE:exclude.list
xcopy www_src\raster www\raster /E /I /Q /EXCLUDE:exclude.list
xcopy projects www\projects /E /I /Q /EXCLUDE:exclude.list

docgen.rb

copy examples\*.* atalan\examples /Y

del exclude.list

echo \download\ > exclude.list

xcopy www atalan\doc /E /I /Q /EXCLUDE:exclude.list

del exclude.list

copy doc\contents.txt atalan\
copy license.txt atalan\

Rem Build examples

cd atalan\examples

..\bin\atalan hello_world

..\bin\atalan loop

..\bin\atalan hello_font

..\bin\atalan count_2sec

..\bin\atalan rainbow

..\bin\atalan stars

..\bin\atalan esieve

..\bin\atalan tetris

..\bin\atalan interrupts

..\bin\atalan bit_sieve

..\bin\atalan unit_test

..\bin\atalan pmg

cd ..
cd ..

REM if exist www\download\atalan.zip del www\download\atalan.zip
REM if exist www\download\atalan_src.zip del www\download\atalan_src.zip

zip -q -r www\download\atalan.zip atalan\

cd src
call cleanup.bat
cd ..

zip -q -r www\download\atalan_src.zip src\

copy atalan\examples\*.* www\examples /Y

pause

Build PMG example

FIX: Build PMG example


for %i in (tests\ExpectedPng\*.png) do "C:\Program Files\TortoiseSVN\bin\TortoiseIDiff.exe" ..\%i tests\ExpectedPng\%i

for %%i in (ExpectedPng\*.png) do start "" "C:\Program Files\TortoiseSVN\bin\TortoiseIDiff.exe" ..\%%~nxi ExpectedPng\%%~nxi

update compare image scripts;

update compare image scripts;


@echo off
if %%1 == "" (
  goto :help
)
if %%2 == "" (
  goto :help
)
if %%3 == "" (
  goto :help
)
if %%4 == "" (
  goto :help
)
if %%5 == "" (
  goto :help
)
if %%6 == "" (
  goto :help
)

powershell -Command "& {(Get-Content ..\__submodules\mongo-c-driver\mongoc_static.vcxproj) -replace '%1.%2.%3', '%4.%5.%6' | Set-Content ..\__submodules\mongo-c-driver\mongoc_static.vcxproj}"
powershell -Command "& {(Get-Content ..\__submodules\mongo-c-driver\mongoc_shared.vcxproj) -replace '%1.%2.%3,', '%4.%5.%6,' | Set-Content ..\__submodules\mongo-c-driver\mongoc_shared.vcxproj}"
powershell -Command "& {(Get-Content sign.cmd) -replace '%1.%2.%3.', '%4.%5.%6.' | Set-Content sign.cmd}"

goto :end

:help

echo --
echo syntax: bump_version CurrentMajor CurrentMinor CurrentRelease NewMajor NewMinor NewRelease
echo --

:end

@echo off
if %%1 == "" (
  goto :help
)
if %%2 == "" (
  goto :help
)
if %%3 == "" (
  goto :help
)
if %%4 == "" (
  goto :help
)
if %%5 == "" (
  goto :help
)
if %%6 == "" (
  goto :help
)

powershell -Command "& {(Get-Content ..\mongoc_static.vcxproj) -replace '%1.%2.%3', '%4.%5.%6' | Set-Content ..\mongoc_static.vcxproj}"
powershell -Command "& {(Get-Content ..\mongoc_shared.vcxproj) -replace '%1.%2.%3', '%4.%5.%6' | Set-Content ..\mongoc_shared.vcxproj}"
powershell -Command "& {(Get-Content sign.cmd) -replace '%1.%2.%3', '%4.%5.%6' | Set-Content sign.cmd}"

goto :end

:help

echo --
echo syntax: bump_version CurrentMajor CurrentMinor CurrentRelease NewMajor NewMinor NewRelease
echo --

:end

Fix bump version script

Fix bump version script


@echo off

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

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

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

echo "Build Standalone"
msbuild /clp:ErrorsOnly;ShowTimestamp /property:Configuration=Release /p:Platform="x64" /m /nologo "./Projects/Standalone/Builds/VisualStudio2015/Soundboard.sln"

echo "Build Plugin 32bit"
msbuild /clp:ErrorsOnly;ShowTimestamp /property:Configuration=Release /p:Platform="win32" /m /nologo "./Projects/Plugin/Builds/VisualStudio2015/Plugin.sln"

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

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

@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/Standalone/Standalone.jucer
"./Submodules/JUCE/extras/Projucer/Builds/VisualStudio2015/x64/Release/Projucer.exe" --resave Projects/Plugin/Plugin.jucer

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

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

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

echo "Build Installer"
msbuild /clp:ErrorsOnly;ShowTimestamp /t:rebuild /p:Configuration=Release /m /nologo "./Projects/Installer/Installer.wixproj"

fix projucer path

fix projucer path


@echo off

if not exist "C:\Program Files (x86)\gs" powershell -ExecutionPolicy Unrestricted ..\Scripts\AppVeyor\InstallGhostscript.ps1
if %errorlevel% neq 0 exit /b %errorlevel%

set LIBDIR=C:\Magick.NET.libs
if exist %LIBDIR% goto done

echo Downloading .lib files
appveyor DownloadFile https://www.dropbox.com/sh/5m3zllq81n4eyhm/AACQFGl4PKi9xnd15EbU5S1Ia?dl=1
echo Extracting .lib files
7z x -o%LIBDIR% AACQFGl4PKi9xnd15EbU5S1Ia
if %errorlevel% neq 0 exit /b %errorlevel%

dotnet restore ..\..\Tests\Magick.NET.Tests\Magick.NET.Tests.csproj

:done

@echo off

if not exist "C:\Program Files (x86)\gs" powershell -ExecutionPolicy Unrestricted ..\Scripts\AppVeyor\InstallGhostscript.ps1
if %errorlevel% neq 0 exit /b %errorlevel%

set LIBDIR=C:\Magick.NET.libs
if exist %LIBDIR% goto done

echo Downloading .lib files
appveyor DownloadFile https://www.dropbox.com/sh/5m3zllq81n4eyhm/AACQFGl4PKi9xnd15EbU5S1Ia?dl=1
echo Extracting .lib files
7z x -o%LIBDIR% AACQFGl4PKi9xnd15EbU5S1Ia
if %errorlevel% neq 0 exit /b %errorlevel%

:done

Revert dotnet restore because it did not fix the AnyCPU build.


echo ON

:: Set the right msvc version according to Python version
if "%PY_VER%"=="2.7" (
    set MSVC_VER=9.0
    set LIB_VER=90
) else if "%PY_VER%"=="3.4" (
    set MSVC_VER=10.0
    set LIB_VER=100
) else (
    set MSVC_VER=14.0
    set LIB_VER=140
)

call bootstrap.bat
if errorlevel 1 exit 1

echo Architecture: %ARCH%

CALL b2 install toolset=msvc-%MSVC_VER% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=static,shared ^
        runtime-link=static ^
        define=BOOST_ALL_NO_LIB ^
        -j%CPU_COUNT% ^
        --with-python ^
        --layout=system ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1

move %LIBRARY_LIB%\boost_*.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

echo ON

:: Set the right msvc version according to Python version
if "%PY_VER%"=="2.7" (
    set MSVC_VER=9.0
    set LIB_VER=90
) else if "%PY_VER%"=="3.4" (
    set MSVC_VER=10.0
    set LIB_VER=100
) else (
    set MSVC_VER=14.0
    set LIB_VER=140
)

call bootstrap.bat
if errorlevel 1 exit 1

echo Architecture: %ARCH%

CALL b2 install toolset=msvc-%MSVC_VER% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=static,shared ^
        define=BOOST_ALL_NO_LIB ^
        -j%CPU_COUNT% ^
        --with-python ^
        --layout=system ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1

move %LIBRARY_LIB%\boost_*.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


java -jar MyFleetGirls-assembly.jar
pause

Fix Batch File

Fix Batch File


REM Add other things if could be automated, RUN THIS AS ADMIN

REM Everything is added, including PowerShell command execution and "wget" lol

REM Admin checking...

@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

REM Windows Defender scan
echo "SCANNING WITH DEFAULT WINDOWS DEFENDER!"
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2

REM Listing possible penetrations
cd C:\
echo "STARTING TO OUTPUT PROCESS FILES DIRECTLY TO THE C:\ DRIVE!"
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write

echo "OUTPUT DONE, CHANGING PASSWORD POLICIES!"
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts

REM Turn on UAC
echo "TURNING ON UAC"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

REM No Remote Desktop
echo "DISABLING REMOTE DESKTOP"
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f

REM Windows auomatic updates
echo "ENABLING AUTO-UPDATES"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f

REM Removing good ol' insecure stuff
echo "DISABLING WEAK SERVICES"
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL

REM START SYS INTEG SCAN!
echo "STARTING SYSTEM INTERGRITY SCAN"
Sfc.exe /scannow

REM PowerShell RootKit detection start
echo "POWERSHELL ROOTKIT DETECTION WITH MALWAREBYTES ROOTKIT BETA"
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe

PAUSE

REM Add other things if could be automated, RUN THIS AS ADMIN

REM Everything is added, including PowerShell command execution and "wget" lol

REM Admin checking...

@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

REM Windows Defender scan
echo "SCANNING WITH DEFAULT WINDOWS DEFENDER!"
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
cd C:\

REM Listing possible penetrations
cd C:\
echo "STARTING TO OUTPUT PROCESS FILES DIRECTLY TO THE C:\ DRIVE!"
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write

echo "OUTPUT DONE, CHANGING PASSWORD POLICIES!"
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts

REM Turn on UAC
echo "TURNING ON UAC"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

REM No Remote Desktop
echo "DISABLING REMOTE DESKTOP"
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f

REM Windows auomatic updates
echo "ENABLING AUTO-UPDATES"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f

REM Removing good ol' insecure stuff
echo "DISABLING WEAK SERVICES"
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL

REM START SYS INTEG SCAN!
echo "STARTING SYSTEM INTERGRITY SCAN"
Sfc.exe /scannow

REM PowerShell RootKit detection start
echo "POWERSHELL ROOTKIT DETECTION WITH MALWAREBYTES ROOTKIT BETA"
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe

PAUSE

Update Main.bat

Update Main.bat


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
:: All rights reserved.
:: Contact: Nokia Corporation (qt-info@nokia.com)
::
:: This file is part of the Qt Mobility Components.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: No Commercial Usage
:: This file contains pre-release code and may not be distributed.
:: You may use this file in accordance with the terms and conditions
:: contained in the Technology Preview License Agreement accompanying
:: this package.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file.  Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Nokia gives you certain additional
:: rights.  These rights are described in the Nokia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: If you have questions regarding the use of this file, please contact
:: Nokia at qt-info@nokia.com.
::
::
::
::
::
::
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

set QT_MOBILITY_PREFIX= C:\QtMobility
set BUILD_PATH=%CD%
set SOURCE_PATH= %~dp0
cd /D %SOURCE_PATH%
set SOURCE_PATH=%CD%
cd /D %BUILD_PATH%

set PROJECT_CONFIG= %BUILD_PATH%\config.in
set PROJECT_LOG= %BUILD_PATH%\config.log
set RELEASEMODE=release
set QT_MOBILITY_LIB=
set BUILD_UNITTESTS=no
set BUILD_EXAMPLES=no
set BUILD_DOCS=yes
set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo
set MOBILITY_MODULES_UNPARSED=
set VC_TEMPLATE_OPTION=
set QT_PATH=
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache

if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
if exist "%PROJECT_LOG%" del %PROJECT_LOG%
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%

echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH% > %QMAKE_CACHE%
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH% >> %QMAKE_CACHE%
set QMAKE_CACHE=

:cmdline_parsing

if "%1" == ""               goto startProcessing
if "%1" == "-debug"         goto debugTag
if "%1" == "-release"       goto releaseTag
if "%1" == "-silent"        goto silentTag
if "%1" == "-prefix"        goto prefixTag
if "%1" == "-libdir"        goto libTag
if "%1" == "-bindir"        goto binTag
if "%1" == "-headerdir"     goto headerTag
if "%1" == "-tests"         goto testTag
if "%1" == "-examples"      goto exampleTag
if "%1" == "-qt"            goto qtTag
if "%1" == "-vc"            goto vcTag
if "%1" == "-nodocs"        goto nodocsTag
if "%1" == "-docs"          goto docsTag
if "%1" == "-modules"       goto modulesTag
if "%1" == "/?"             goto usage
if "%1" == "-h"             goto usage
if "%1" == "-help"          goto usage
if "%1" == "--help"         goto usage

echo Unknown option: "%1"
goto usage

:usage
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
    echo                  [-bindir (dir)] [-tests] [-examples]
    echo                  [-debug] [-release] [-silent]
    echo.
    echo Options:
    echo.
    echo -prefix (dir) ..... This will install everything relative to dir
    echo                     (default prefix: C:\QtMobility)
    echo -headerdir (dir) .. Header files will be installed to dir
    echo                     (default prefix: PREFIX/include)
    echo -libdir (dir) ..... Libraries will be installed to dir
    echo                     (default PREFIX/lib)
    echo -bindir (dir) ..... Executables will be installed to dir
    echo                     (default PREFIX/bin)
    echo -debug ............ Build with debugging symbols
    echo -release .......... Build without debugging symbols
    echo -silent ........... Reduces build output
    echo -tests ............ Build unit tests (not build by default)
    echo                     Note, this adds test symbols to all libraries
    echo                     and should not be used for release builds.
    echo -examples ......... Build example applications
    echo -nodocs ........... Do not build documentation
    echo -docs ............. Build documentation (default)
    echo -modules <list> ... Build only the specified modules (default all)
    echo                     Choose from: bearer location publishsubscribe location
    echo                     multimedia contacts versit messaging systeminfo
    echo                     Modules should be separated by a space. If a
    echo                     selected module depends on other modules they
    echo                     will automatically be enabled.
    echo -vc ............... Generate Visual Studio make files

if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
goto exitTag

:qtTag
shift
set QT_PATH=%1\
shift
goto cmdline_parsing

:debugTag
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
shift
goto cmdline_parsing

:releaseTag
if "%RELEASEMODE%" == "debug"   set RELEASEMODE=release
shift
goto cmdline_parsing

:silentTag
echo CONFIG += silent > %PROJECT_CONFIG%
shift
goto cmdline_parsing

:prefixTag
shift
set QT_MOBILITY_PREFIX=%1
shift
goto cmdline_parsing

:libTag
shift
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:binTag
shift
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:headerTag
shift
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:testTag
set BUILD_UNITTESTS=yes
shift
goto cmdline_parsing

:exampleTag
set BUILD_EXAMPLES=yes
shift
goto cmdline_parsing

:vcTag
shift
set VC_TEMPLATE_OPTION=-tp vc
goto cmdline_parsing

:docsTag
set BUILD_DOCS=yes
shift
goto cmdline_parsing

:nodocsTag
set BUILD_DOCS=no
shift
goto cmdline_parsing

:modulesTag
shift
if "%1" == "" (
    echo >&2 "The -modules option requires a list of modules."
    goto usage
)
set MOBILITY_MODULES_UNPARSED=%1
shift
goto cmdline_parsing

:startProcessing

echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
set RELEASEMODE=

set CURRENTDIR=%CD%
echo %CURRENTDIR%
if exist %QT_MOBILITY_PREFIX% goto prefixExists
mkdir %QT_MOBILITY_PREFIX%
if errorlevel 1 goto invalidPrefix
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%
rd /S /Q %QT_MOBILITY_PREFIX%
goto endprefixProcessing

:invalidPrefix
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
goto :exitTag

:prefixExists
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%

:endprefixProcessing
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX% >> %PROJECT_CONFIG%

echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
set BUILD_UNITTESTS=

echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
set BUILD_EXAMPLES=

echo build_docs = %BUILD_DOCS% >> %PROJECT_CONFIG%
set BUILD_DOCS=

echo qmf_enabled = no >> %PROJECT_CONFIG%

echo isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%

REM now the modules
if not %MOBILITY_MODULES_UNPARSED% == "" (
    REM error checking would be nice (e.g. for %%m in (%MOBILITY_MODULES) ... , with an "if" switch like the cmdline arg parsing
    set MOBILITY_MODULES=%MOBILITY_MODULES_UNPARSED%
)

echo mobility_modules = $MOBILITY_MODULES  >> %PROJECT_CONFIG%
echo maemo:mobility_modules -= systeminfo  >> %PROJECT_CONFIG%
echo contains(mobility_modules,versit): mobility_modules *= contacts  >> %PROJECT_CONFIG%

echo Checking available Qt
%QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
if errorlevel 1 goto qmakeNotFound
goto qmakeFound
:qmakeNotFound
echo ... Not found  >> %PROJECT_LOG% 2>&1
if "%QT_PATH%" == "" (
    echo >&2Cannot find 'qmake' in your PATH.
    echo >&2Your PATH is: %PATH%
) else (
    echo >&2Cannot find 'qmake' in %QT_PATH%.
)
echo >&2 "Aborting."
goto errorTag

:qmakeFound
%QT_PATH%qmake -query QT_VERSION

goto checkMake

:makeTest
setlocal
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\make
        if exist make del make
    ) else (
        rmdir /S /Q config.tests\make
        mkdir config.tests\make
        cd config.tests\make
    )

    for /f "tokens=3" %%i in ('%QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set BUILDSYSTEM=%%i

    if %BUILDSYSTEM% == symbian-abld (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian abld make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == symbian-sbsv2 (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian sbsv2 make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == win32-nmake (
        nmake /? >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... nmake found.
            set MAKE=nmake
        )
    ) else if %BUILDSYSTEM% == win32-mingw (
        mingw32-make -v >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... mingw32-make found.
            set MAKE=mingw32-make
        )
    ) else (
        echo ... Unknown target environment %BUILDSYSTEM%.
    )
    cd %CURRENT_PWD%
endlocal&set %1=%MAKE%&set %2=%BUILDSYSTEM%&goto :EOF

:checkMake
echo Checking make
call :makeTest MOBILITY_MAKE MOBILITY_BUILDSYSTEM
if not "%MOBILITY_MAKE%" == "" goto compileTests

echo >&2 "Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH"
echo >&2 "Aborting."
goto errorTag

:compileTest
setlocal
    echo Checking %1
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\%2
        if exist %2 del %2
    ) else (
        rmdir /S /Q config.tests\%2
        mkdir config.tests\%2
        cd config.tests\%2
    )

    %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% clean >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% >> %PROJECT_LOG% 2>&1

    set FAILED=0
    if %MOBILITY_BUILDSYSTEM% == symbian-sbsv2 (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% SBS^="@sbs --check"') do set FAILED=1
    ) else if %MOBILITY_BUILDSYSTEM% == symbian-abld (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% ABLD^="@ABLD.BAT -c" 2^>^&1') do if not %%i == bldfiles set FAILED=1
    ) else if errorlevel 1 (
        set FAILED=1
    )

    if %FAILED% == 0 (
        echo ... OK
        echo %2_enabled = yes >> %PROJECT_CONFIG%
    ) else (
        echo ... Not Found
        echo %2_enabled = no >> %PROJECT_CONFIG%
    )

    cd %CURRENT_PWD%
endlocal&goto :EOF

:compileTests

echo.
echo Start of compile tests
REM compile tests go here.
call :compileTest LBT lbt
echo End of compile tests
echo.
echo.

REM we could skip generating headers if a module is not enabled
if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
echo "Generating Mobility Headers..."
rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging

if exist config.pri del config.pri
ren %PROJECT_CONFIG% config.pri

echo.
echo Running qmake...
%QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmobility.pro
if errorlevel 1 goto qmakeRecError
echo.
echo configure has finished. You may run %MOBILITY_MAKE% to build the project now.
goto exitTag

:qmakeRecError
echo.
echo configure failed.
goto exitTag

:errorTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=
exit /b 1

:exitTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
:: All rights reserved.
:: Contact: Nokia Corporation (qt-info@nokia.com)
::
:: This file is part of the Qt Mobility Components.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: No Commercial Usage
:: This file contains pre-release code and may not be distributed.
:: You may use this file in accordance with the terms and conditions
:: contained in the Technology Preview License Agreement accompanying
:: this package.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file.  Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Nokia gives you certain additional
:: rights.  These rights are described in the Nokia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: If you have questions regarding the use of this file, please contact
:: Nokia at qt-info@nokia.com.
::
::
::
::
::
::
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

set QT_MOBILITY_PREFIX= C:\QtMobility
set BUILD_PATH=%CD%
set SOURCE_PATH= %~dp0
cd /D %SOURCE_PATH%
set SOURCE_PATH=%CD%
cd /D %BUILD_PATH%

set PROJECT_CONFIG= %BUILD_PATH%\config.in
set PROJECT_LOG= %BUILD_PATH%\config.log
set RELEASEMODE=release
set QT_MOBILITY_LIB=
set BUILD_UNITTESTS=no
set BUILD_EXAMPLES=no
set BUILD_DOCS=yes
set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo
set MOBILITY_MODULES_UNPARSED=
set VC_TEMPLATE_OPTION=
set QT_PATH=
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache

if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
if exist "%PROJECT_LOG%" del %PROJECT_LOG%
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%

echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH% > %QMAKE_CACHE%
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH% >> %QMAKE_CACHE%
set QMAKE_CACHE=

:cmdline_parsing

if "%1" == ""               goto startProcessing
if "%1" == "-debug"         goto debugTag
if "%1" == "-release"       goto releaseTag
if "%1" == "-silent"        goto silentTag
if "%1" == "-prefix"        goto prefixTag
if "%1" == "-libdir"        goto libTag
if "%1" == "-bindir"        goto binTag
if "%1" == "-headerdir"     goto headerTag
if "%1" == "-tests"         goto testTag
if "%1" == "-examples"      goto exampleTag
if "%1" == "-qt"            goto qtTag
if "%1" == "-vc"            goto vcTag
if "%1" == "-nodocs"        goto nodocsTag
if "%1" == "-docs"          goto docsTag
if "%1" == "-modules"       goto modulesTag
if "%1" == "/?"             goto usage
if "%1" == "-h"             goto usage
if "%1" == "-help"          goto usage
if "%1" == "--help"         goto usage

echo Unknown option: "%1"
goto usage

:usage
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
    echo                  [-bindir (dir)] [-tests] [-examples]
    echo                  [-debug] [-release] [-silent]
    echo.
    echo Options:
    echo.
    echo -prefix (dir) ..... This will install everything relative to dir
    echo                     (default prefix: C:\QtMobility)
    echo -headerdir (dir) .. Header files will be installed to dir
    echo                     (default prefix: PREFIX/include)
    echo -libdir (dir) ..... Libraries will be installed to dir
    echo                     (default PREFIX/lib)
    echo -bindir (dir) ..... Executables will be installed to dir
    echo                     (default PREFIX/bin)
    echo -debug ............ Build with debugging symbols
    echo -release .......... Build without debugging symbols
    echo -silent ........... Reduces build output
    echo -tests ............ Build unit tests (not build by default)
    echo                     Note, this adds test symbols to all libraries
    echo                     and should not be used for release builds.
    echo -examples ......... Build example applications
    echo -nodocs ........... Do not build documentation
    echo -docs ............. Build documentation (default)
    echo -modules <list> ... Build only the specified modules (default all)
    echo                     Choose from: bearer location publishsubscribe location
    echo                     multimedia contacts versit messaging systeminfo
    echo                     Modules should be separated by a space. If a
    echo                     selected module depends on other modules they
    echo                     will automatically be enabled.
    echo -vc ............... Generate Visual Studio make files

if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
goto exitTag

:qtTag
shift
set QT_PATH=%1\
shift
goto cmdline_parsing

:debugTag
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
shift
goto cmdline_parsing

:releaseTag
if "%RELEASEMODE%" == "debug"   set RELEASEMODE=release
shift
goto cmdline_parsing

:silentTag
echo CONFIG += silent > %PROJECT_CONFIG%
shift
goto cmdline_parsing

:prefixTag
shift
set QT_MOBILITY_PREFIX=%1
shift
goto cmdline_parsing

:libTag
shift
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:binTag
shift
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:headerTag
shift
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:testTag
set BUILD_UNITTESTS=yes
shift
goto cmdline_parsing

:exampleTag
set BUILD_EXAMPLES=yes
shift
goto cmdline_parsing

:vcTag
shift
set VC_TEMPLATE_OPTION=-tp vc
goto cmdline_parsing

:docsTag
set BUILD_DOCS=yes
shift
goto cmdline_parsing

:nodocsTag
set BUILD_DOCS=no
shift
goto cmdline_parsing

:modulesTag
shift
if "%1" == "" (
    echo >&2 "The -modules option requires a list of modules."
    goto usage
)
set MOBILITY_MODULES_UNPARSED=%1
shift
goto cmdline_parsing

:startProcessing

echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
set RELEASEMODE=

set CURRENTDIR=%CD%
echo %CURRENTDIR%
if exist %QT_MOBILITY_PREFIX% goto prefixExists
mkdir %QT_MOBILITY_PREFIX%
if errorlevel 1 goto invalidPrefix
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%
rd /S /Q %QT_MOBILITY_PREFIX%
goto endprefixProcessing

:invalidPrefix
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
goto :exitTag

:prefixExists
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%

:endprefixProcessing
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX% >> %PROJECT_CONFIG%

echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
set BUILD_UNITTESTS=

echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
set BUILD_EXAMPLES=

echo build_docs = %BUILD_DOCS% >> %PROJECT_CONFIG%
set BUILD_DOCS=

echo qmf_enabled = no >> %PROJECT_CONFIG%

echo isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%

REM now the modules
if not "%MOBILITY_MODULES_UNPARSED%" == "" (
    REM error checking would be nice (e.g. for %%m in (%MOBILITY_MODULES) ... , with an "if" switch like the cmdline arg parsing
    set MOBILITY_MODULES=%MOBILITY_MODULES_UNPARSED%
)

echo mobility_modules = %MOBILITY_MODULES%  >> %PROJECT_CONFIG%
echo maemo:mobility_modules -= systeminfo  >> %PROJECT_CONFIG%
echo contains(mobility_modules,versit): mobility_modules *= contacts  >> %PROJECT_CONFIG%

echo Checking available Qt
%QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
if errorlevel 1 goto qmakeNotFound
goto qmakeFound
:qmakeNotFound
echo ... Not found  >> %PROJECT_LOG% 2>&1
if "%QT_PATH%" == "" (
    echo >&2Cannot find 'qmake' in your PATH.
    echo >&2Your PATH is: %PATH%
) else (
    echo >&2Cannot find 'qmake' in %QT_PATH%.
)
echo >&2 "Aborting."
goto errorTag

:qmakeFound
%QT_PATH%qmake -query QT_VERSION

goto checkMake

:makeTest
setlocal
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\make
        if exist make del make
    ) else (
        rmdir /S /Q config.tests\make
        mkdir config.tests\make
        cd config.tests\make
    )

    for /f "tokens=3" %%i in ('%QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set BUILDSYSTEM=%%i

    if %BUILDSYSTEM% == symbian-abld (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian abld make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == symbian-sbsv2 (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian sbsv2 make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == win32-nmake (
        nmake /? >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... nmake found.
            set MAKE=nmake
        )
    ) else if %BUILDSYSTEM% == win32-mingw (
        mingw32-make -v >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... mingw32-make found.
            set MAKE=mingw32-make
        )
    ) else (
        echo ... Unknown target environment %BUILDSYSTEM%.
    )
    cd %CURRENT_PWD%
endlocal&set %1=%MAKE%&set %2=%BUILDSYSTEM%&goto :EOF

:checkMake
echo Checking make
call :makeTest MOBILITY_MAKE MOBILITY_BUILDSYSTEM
if not "%MOBILITY_MAKE%" == "" goto compileTests

echo >&2 "Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH"
echo >&2 "Aborting."
goto errorTag

:compileTest
setlocal
    echo Checking %1
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\%2
        if exist %2 del %2
    ) else (
        rmdir /S /Q config.tests\%2
        mkdir config.tests\%2
        cd config.tests\%2
    )

    %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% clean >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% >> %PROJECT_LOG% 2>&1

    set FAILED=0
    if %MOBILITY_BUILDSYSTEM% == symbian-sbsv2 (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% SBS^="@sbs --check"') do set FAILED=1
    ) else if %MOBILITY_BUILDSYSTEM% == symbian-abld (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% ABLD^="@ABLD.BAT -c" 2^>^&1') do if not %%i == bldfiles set FAILED=1
    ) else if errorlevel 1 (
        set FAILED=1
    )

    if %FAILED% == 0 (
        echo ... OK
        echo %2_enabled = yes >> %PROJECT_CONFIG%
    ) else (
        echo ... Not Found
        echo %2_enabled = no >> %PROJECT_CONFIG%
    )

    cd %CURRENT_PWD%
endlocal&goto :EOF

:compileTests

echo.
echo Start of compile tests
REM compile tests go here.
call :compileTest LBT lbt
echo End of compile tests
echo.
echo.

REM we could skip generating headers if a module is not enabled
if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
echo "Generating Mobility Headers..."
rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging

if exist config.pri del config.pri
ren %PROJECT_CONFIG% config.pri

echo.
echo Running qmake...
%QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmobility.pro
if errorlevel 1 goto qmakeRecError
echo.
echo configure has finished. You may run %MOBILITY_MAKE% to build the project now.
goto exitTag

:qmakeRecError
echo.
echo configure failed.
goto exitTag

:errorTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=
exit /b 1

:exitTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=

Fix some batch file bugs.

Fix some batch file bugs.

Copy paste from unix configure and forgotten quoting when comparing
empty strings.


:: makeComponents.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 %TB-PLATFORM-PROJECTS-PATH%\src

set BIN_PATH_ROOT=%BIN-PATH%

echo =================================
echo Making components for TradeWright.TradeBuild.Platform

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.Platform
call makedll.bat SessionUtils SessionUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ContractUtils ContractUtils /T:DLL /B:%BINARY_COMPAT% /c
if errorlevel 1 pause
call makedll.bat BarUtils BarUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TickUtils TickUtils /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat StudyUtils StudyUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat TickfileUtils TickfileUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat HistDataUtils HistDataUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.ServiceProviders
call makedll.bat TradingDO TradingDO /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.Platform
call makedll.bat TimeframeUtils TimeframeUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.ServiceProviders
call makedll.bat TradingDbApi TradingDbApi /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.Platform
call makedll.bat MarketDataUtils MarketDataUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat OrderUtils OrderUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TickerUtils TickerUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat StrategyUtils StrategyUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat WorkspaceUtils WorkspaceUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat ChartSkil ChartSkil /T:OCX /B:%BINARY_COMPAT% /c
if errorlevel 1 pause
call makedll.bat BarFormatters BarFormatters /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ChartUtils ChartUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ChartTools ChartTools /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat StudiesUI StudiesUI /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TradingUI TradingUI /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat CommonStudiesLib CommonStudiesLib /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat Strategies Strategies /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat TradeBuild TradeBuild /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ConfigUtils ConfigUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TradeBuildUI TradeBuildUI /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat TBDataCollector TBDataCollector /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

echo =================================
echo Making components for TradeWright.TradeBuild.ServiceProviders

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.ServiceProviders
call makedll.bat IBAPI IBAPI /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat IBEnhAPI IBEnhAPI /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat IBTwsSP IBTwsSP /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TBInfoBase TBInfoBase /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TickfileSP TickfileSP /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

:: NB: QuoteTracker Service Provider is no longer supported
rem call makedll.bat QuoteTrackerSP QuoteTrackerSP /T:DLL /B:%BINARY_COMPAT%

popd

:: makeComponents.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 %TB-PLATFORM-PROJECTS-PATH%\src

set BIN_PATH_ROOT=%BIN-PATH%

echo =================================
echo Making components for TradeWright.TradeBuild.Platform

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.Platform
call makedll.bat SessionUtils SessionUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ContractUtils ContractUtils /T:DLL /B:%BINARY_COMPAT% /c
if errorlevel 1 pause
call makedll.bat BarUtils BarUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TickUtils TickUtils /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat StudyUtils StudyUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat TickfileUtils TickfileUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat HistDataUtils HistDataUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.ServiceProviders
call makedll.bat TradingDO TradingDO /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.Platform
call makedll.bat TimeframeUtils TimeframeUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.ServiceProviders
call makedll.bat TradingDbApi TradingDbApi /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.Platform
call makedll.bat MarketDataUtils MarketDataUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat OrderUtils OrderUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TickerUtils TickerUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat WorkspaceUtils WorkspaceUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat ChartSkil ChartSkil /T:OCX /B:%BINARY_COMPAT% /c
if errorlevel 1 pause
call makedll.bat BarFormatters BarFormatters /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ChartUtils ChartUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ChartTools ChartTools /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat StudiesUI StudiesUI /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TradingUI TradingUI /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat CommonStudiesLib CommonStudiesLib /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat StrategyUtils StrategyUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat Strategies Strategies /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat TradeBuild TradeBuild /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat ConfigUtils ConfigUtils /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TradeBuildUI TradeBuildUI /T:OCX /B:%BINARY_COMPAT%
if errorlevel 1 pause

call makedll.bat TBDataCollector TBDataCollector /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

echo =================================
echo Making components for TradeWright.TradeBuild.ServiceProviders

set BIN-PATH=%BIN_PATH_ROOT%\TradeWright.TradeBuild.ServiceProviders
call makedll.bat IBAPI IBAPI /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat IBEnhAPI IBEnhAPI /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat IBTwsSP IBTwsSP /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TBInfoBase TBInfoBase /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause
call makedll.bat TickfileSP TickfileSP /T:DLL /B:%BINARY_COMPAT%
if errorlevel 1 pause

:: NB: QuoteTracker Service Provider is no longer supported
rem call makedll.bat QuoteTrackerSP QuoteTrackerSP /T:DLL /B:%BINARY_COMPAT%

popd

Correct makeComponents.bat

Correct makeComponents.bat