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

setlocal

:parseargs
set REPO=
set PROXY=
set WORKDIR=
set GCLIENT=
set SMTP_SERVER=
set FROM=
set TO=
set MODE_LABEL=
set CONFIG=Debug
set ITERATIONS=1
set PADDING=32
set NO_REVERT=
set REORDER_BASIC_BLOCKS=
set URL_LIST=%~dp0url-list.txt

for %%A in (%*) do (
  for /F "tokens=1* delims=:" %%b in ("%%~A") do (
    if /I "%%b" == "/mode" set MODE=%%~c
    if /I "%%b" == "/repo" set REPO=%%~c
    if /I "%%b" == "/proxy" set PROXY=--repo-proxy=%%~c
    if /I "%%b" == "/build-id" set BUILD_ID_PATTERN=%%~c
    if /I "%%b" == "/gclient-dir" set GCLIENT=%%~c
    if /I "%%b" == "/work-dir" set WORKDIR=%%~c
    if /I "%%b" == "/url-list" set URL_LIST=%%~c
    if /I "%%b" == "/server" set SMTP_SERVER=%%~c
    if /I "%%b" == "/from" set FROM=%%~c
    if /I "%%b" == "/to" set TO=%%~c
    if /I "%%b" == "/config" set CONFIG=%%~c
    if /I "%%b" == "/iterations" set ITERATIONS=%%~c
    if /I "%%b" == "/padding" set PADDING=%%~c
    if /I "%%b" == "/no-revert" set NO_REVERT=--reorder-no-revert-binaries
    if /I "%%b" == "/reorder-basic-blocks" (
      set REORDER_BASIC_BLOCKS=--reorder-basic-blocks
    )
  )
)

:checkargs
if "%MODE%" == "ui" set MODE_LABEL=step4_ui_tests
if "%MODE%" == "reliability" set MODE_LABEL=step4_reliability_tests
if "%MODE_LABEL%" == "" echo Missing or invalid /mode & goto usage
if "%REPO%" == "" echo Missing parameter: /repo & goto usage
if "%GCLIENT%" == "" echo Missing parameter: /gclient-dir & goto usage
if "%WORKDIR%" == "" echo Missing parameter: /work-dir & goto usage
if "%SMTP_SERVER%" == "" echo Missing parameter: /server & goto usage
if "%FROM%" == "" echo Missing parameter: /from & goto usage
if "%TO%" == "" echo Missing parameter: /to & goto usage
if "%BUILD_ID_PATTERN%" == "" set BUILD_ID_PATTERN=\d+\.\d+\.\d+\.\d+

SET SYZYGY=%GCLIENT%\src\syzygy
set BUILD_DIR=%GCLIENT%\src\build
goto setup

:usage
echo:
echo:Usage: %0 [options]
echo:
echo:  /mode:MODE         The type of test to run: ui or reliability
echo:  /repo:URL          URL to the root of the Chrome Repository
echo:  /build-id:PATTERN  The regular expression to use when filtering build ids
echo:  /gclient-dir:PATH  Path to the root of the source tree (where .gclient lives)
echo:  /work-dir:PATH     Working directory in which to download Chrome builds
echo:  /server:HOST       SMTP server to use when generating reports
echo:  /from:EMAIL        E-Mail address from which to send reports
echo:  /to:EMAIL          E-Mail address to which reports should be sent
echo:  /config:CONFIG     The configuration of Syzygy test (default: Debug)
echo:  /iterations:NUM    The number of iterations of the test to run
echo:  /padding:NUM       The amount of block padding to add when reordering
echo:  /no-revert         Do not revert chrome DLL/PDB after running the tests
echo:  /reorder-basic-blocks
echo:                     Randomize at the basic block level (as opposed to the
echo:                     function and data block level).
echo:
goto done

:setup
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"

echo Initializing local variables ...
set THISDIR=%~dp0
set SOLUTION=%SYZYGY%\relink\relink.sln
set DOWNLOAD_PY=%THISDIR%chrome_repo.py
set REORDER_PY=%THISDIR%reorder.py
set SEND_MAIL_PY=%THISDIR%send_mail.py
set ACTIONS_XML=%THISDIR%actions.xml
set REORDER_EXE=%BUILD_DIR%\%CONFIG%\relink.exe
set BUILD_PTR=%WORKDIR%\chrome-build-dir.txt
set SYNC_LOG=%WORKDIR%\sync-log.txt
set BUILD_LOG=%WORKDIR%\build-log.txt
set DOWNLOAD_LOG=%WORKDIR%\downoad-log.txt
set REORDER_LOG=%WORKDIR%\reorder-log.txt
set TEST_REPORT=%WORKDIR%\report-{iter}-{seed}.xml
set SUMMARY=%WORKDIR%\reorder-summary.txt
set ERROR_MESSAGE=%WORKDIR%\error-message.txt

:step1
echo Cleaning up data from previous runs ...
del /F /Q ^
  "%BUILD_LOG%" ^
  "%DOWNLOAD_LOG%" ^
  "%REORDER_LOG%" ^
  "%WORKDIR%\report-*.xml" ^
  "%SUMMARY%" ^
  "%ERROR_MESSAGE%"

:step2
echo Building "%SOLUTION%" ...
call devenv.com "%SOLUTION%" /Rebuild "Release|Win32" > "%BUILD_LOG%" 2>&1
if %ERRORLEVEL% equ 0 goto step3
handle.exe >> "%BUILD_LOG%"
echo Trying again to build "%SOLUTION%" ...
call devenv.com "%SOLUTION%" /Build "Release|Win32" > "%BUILD_LOG%" 2>&1
if %ERRORLEVEL% equ 0 goto step3
handle.exe >> "%BUILD_LOG%"
copy "%BUILD_LOG%" "%ERROR_MESSAGE%"
goto error

:step3
echo Downloading latest chrome release ...
call python "%DOWNLOAD_PY%" ^
  --repo-url="%REPO%" %PROXY% ^
  --repo-work-dir="%WORKDIR%" ^
  --repo-build-id-pattern="%BUILD_ID_PATTERN%" ^
  --log-file="%DOWNLOAD_LOG%" ^
  --log-verbose ^
  GET ^
  > "%BUILD_PTR%"
if %ERRORLEVEL% equ 0 goto step4
copy %DOWNLOAD_LOG% %ERROR_MESSAGE%
goto error

:step4
set /p BUILD_DIR= < "%BUILD_PTR%"
set CHROME_DIR=%BUILD_DIR%\chrome-win32
set SYMBOL_DIR=%BUILD_DIR%\chrome-win32-syms
set CHROME_DLL=%CHROME_DIR%\chrome.dll
set CHROME_PDB=%SYMBOL_DIR%\chrome_dll.pdb
goto %MODE_LABEL%

:step4_ui_tests
echo Running randomized ui test ...
set UI_TESTS_EXE=%CHROME_DIR%\automated_ui_tests.exe
call python "%REORDER_PY%" ^
  --summary-title="Reordered UI Tests" ^
  --reorder-tool="%REORDER_EXE%" ^
  --reorder-input-bin="%CHROME_DLL%" ^
  --reorder-input-pdb="%CHROME_PDB%" ^
  --reorder-test-program="%UI_TESTS_EXE%" ^
  --reorder-num-iterations=%ITERATIONS% ^
  %NO_REVERT% %REORDER_BASIC_BLOCKS% ^
  --reorder-padding="%PADDING%" ^
  --log-file="%REORDER_LOG%" ^
  --log-verbose ^
  -- --input=%ACTIONS_XML% ^
    --output=%TEST_REPORT% ^
    --debug ^
  > "%SUMMARY%"
if %ERRORLEVEL% equ 0 goto step5
copy %SUMMARY%+%REORDER_LOG% %ERROR_MESSAGE%
goto error

:step4_reliability_tests
echo Running randomized reliability test ...
set RELIABILITY_TESTS_EXE=%CHROME_DIR%\reliability_tests.exe
call python "%REORDER_PY%" ^
  --summary-title="Reordered Reliability Tests" ^
  --reorder-tool="%REORDER_EXE%" ^
  --reorder-input-bin="%CHROME_DLL%" ^
  --reorder-input-pdb="%CHROME_PDB%" ^
  --reorder-test-program="%RELIABILITY_TESTS_EXE%" ^
  --reorder-num-iterations=%ITERATIONS% ^
  %NO_REVERT% %REORDER_BASIC_BLOCKS% ^
  --reorder-padding="%PADDING%" ^
  --log-file="%REORDER_LOG%" ^
  --log-verbose ^
  -- --list="%URL_LIST%" ^
     --logfile="%RELIABILITY_LOG%" ^
     --savedebuglog ^
     --js-flags="" ^
     --ui-test-timeout=240000 ^
     --ui-test-action-timeout=240000 ^
     --ui-test-action-max-timeout=240000 ^
     --ui-test-terminate-timeout=240000 ^
     --enable-logging ^
     --log-level=0 ^
     --enable-dcheck ^
     --extra-chrome-flags="--no-js-randomness --disable-background-networking" ^
     --full-memory-crash-report ^
  > "%SUMMARY%"
if %ERRORLEVEL% equ 0 goto step5
copy %SUMMARY%+%REORDER_LOG% %ERROR_MESSAGE%
goto error

:step5
echo Sending out summary mail ...
call python "%SEND_MAIL_PY%" ^
  --server="%SMTP_SERVER%" ^
  --from="%FROM%" ^
  --to="%TO%" ^
  --subject="@%SUMMARY%" ^
  --message="@%REORDER_LOG%" ^
  --attach="%REORDER_LOG%" ^
  --attach="%SYNC_LOG%" ^
  --attach="%BUILD_LOG%" ^
  --attach="%DOWNLOAD_LOG%" ^
  --attach="%WORKDIR%\report*.xml" ^
  --ignore-missing ^
  > "%ERROR_MESSAGE%"
if %ERRORLEVEL% equ 0 goto done

:error
echo Reporting error
call python %SEND_MAIL_PY% ^
  --server="%SMTP_SERVER%" ^
  --from="%FROM%" ^
  --to="%TO%" ^
  --subject="Syzygy %MODE% test bot failed!" ^
  --message="@%ERROR_MESSAGE%" ^
  --attach="%REORDER_LOG%" ^
  --attach="%SYNC_LOG%" ^
  --attach="%BUILD_LOG%" ^
  --attach="%DOWNLOAD_LOG%" ^
  --attach="%WORKDIR%\report*.xml" ^
  --ignore-missing

:done
rem Done

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

setlocal

:parseargs
set REPO=
set PROXY=
set WORKDIR=
set GCLIENT=
set SMTP_SERVER=
set FROM=
set TO=
set MODE_LABEL=
set CONFIG=Debug
set ITERATIONS=1
set PADDING=32
set NO_REVERT=
set REORDER_BASIC_BLOCKS=
set URL_LIST=%~dp0url-list.txt

for %%A in (%*) do (
  for /F "tokens=1* delims=:" %%b in ("%%~A") do (
    if /I "%%b" == "/mode" set MODE=%%~c
    if /I "%%b" == "/repo" set REPO=%%~c
    if /I "%%b" == "/proxy" set PROXY=--repo-proxy=%%~c
    if /I "%%b" == "/build-id" set BUILD_ID_PATTERN=%%~c
    if /I "%%b" == "/gclient-dir" set GCLIENT=%%~c
    if /I "%%b" == "/work-dir" set WORKDIR=%%~c
    if /I "%%b" == "/url-list" set URL_LIST=%%~c
    if /I "%%b" == "/server" set SMTP_SERVER=%%~c
    if /I "%%b" == "/from" set FROM=%%~c
    if /I "%%b" == "/to" set TO=%%~c
    if /I "%%b" == "/config" set CONFIG=%%~c
    if /I "%%b" == "/iterations" set ITERATIONS=%%~c
    if /I "%%b" == "/padding" set PADDING=%%~c
    if /I "%%b" == "/no-revert" set NO_REVERT=--reorder-no-revert-binaries
    if /I "%%b" == "/reorder-basic-blocks" (
      set REORDER_BASIC_BLOCKS=--reorder-basic-blocks
    )
  )
)

:checkargs
if "%MODE%" == "ui" set MODE_LABEL=step4_ui_tests
if "%MODE%" == "reliability" set MODE_LABEL=step4_reliability_tests
if "%MODE_LABEL%" == "" echo Missing or invalid /mode & goto usage
if "%REPO%" == "" echo Missing parameter: /repo & goto usage
if "%GCLIENT%" == "" echo Missing parameter: /gclient-dir & goto usage
if "%WORKDIR%" == "" echo Missing parameter: /work-dir & goto usage
if "%SMTP_SERVER%" == "" echo Missing parameter: /server & goto usage
if "%FROM%" == "" echo Missing parameter: /from & goto usage
if "%TO%" == "" echo Missing parameter: /to & goto usage
if "%BUILD_ID_PATTERN%" == "" set BUILD_ID_PATTERN=\d+\.\d+\.\d+\.\d+

SET SYZYGY=%GCLIENT%\src\syzygy
set BUILD_DIR=%GCLIENT%\src\build
goto setup

:usage
echo:
echo:Usage: %0 [options]
echo:
echo:  /mode:MODE         The type of test to run: ui or reliability
echo:  /repo:URL          URL to the root of the Chrome Repository
echo:  /build-id:PATTERN  The regular expression to use when filtering build ids
echo:  /gclient-dir:PATH  Path to the root of the source tree (where .gclient lives)
echo:  /work-dir:PATH     Working directory in which to download Chrome builds
echo:  /server:HOST       SMTP server to use when generating reports
echo:  /from:EMAIL        E-Mail address from which to send reports
echo:  /to:EMAIL          E-Mail address to which reports should be sent
echo:  /config:CONFIG     The configuration of Syzygy test (default: Debug)
echo:  /iterations:NUM    The number of iterations of the test to run
echo:  /padding:NUM       The amount of block padding to add when reordering
echo:  /no-revert         Do not revert chrome DLL/PDB after running the tests
echo:  /reorder-basic-blocks
echo:                     Randomize at the basic block level (as opposed to the
echo:                     function and data block level).
echo:
goto done

:setup
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat"

echo Initializing local variables ...
set THISDIR=%~dp0
set SOLUTION=%SYZYGY%\relink\relink.sln
set DOWNLOAD_PY=%THISDIR%chrome_repo.py
set REORDER_PY=%THISDIR%reorder.py
set SEND_MAIL_PY=%THISDIR%send_mail.py
set ACTIONS_XML=%THISDIR%actions.xml
set REORDER_EXE=%BUILD_DIR%\%CONFIG%\relink.exe
set BUILD_PTR=%WORKDIR%\chrome-build-dir.txt
set SYNC_LOG=%WORKDIR%\sync-log.txt
set BUILD_LOG=%WORKDIR%\build-log.txt
set DOWNLOAD_LOG=%WORKDIR%\downoad-log.txt
set REORDER_LOG=%WORKDIR%\reorder-log.txt
set TEST_REPORT=%WORKDIR%\report-{iter}-{seed}.xml
set SUMMARY=%WORKDIR%\reorder-summary.txt
set ERROR_MESSAGE=%WORKDIR%\error-message.txt

:step1
echo Cleaning up data from previous runs ...
del /F /Q ^
  "%BUILD_LOG%" ^
  "%DOWNLOAD_LOG%" ^
  "%REORDER_LOG%" ^
  "%WORKDIR%\report-*.xml" ^
  "%SUMMARY%" ^
  "%ERROR_MESSAGE%"

:step2
echo Building "%SOLUTION%" ...
call devenv.com "%SOLUTION%" /Rebuild "Release|Win32" > "%BUILD_LOG%" 2>&1
if %ERRORLEVEL% equ 0 goto step3
handle.exe >> "%BUILD_LOG%"
echo Trying again to build "%SOLUTION%" ...
call devenv.com "%SOLUTION%" /Build "Release|Win32" > "%BUILD_LOG%" 2>&1
if %ERRORLEVEL% equ 0 goto step3
handle.exe >> "%BUILD_LOG%"
copy "%BUILD_LOG%" "%ERROR_MESSAGE%"
goto error

:step3
echo Downloading latest chrome release ...
call python "%DOWNLOAD_PY%" ^
  --repo-url="%REPO%" %PROXY% ^
  --repo-work-dir="%WORKDIR%" ^
  --repo-build-id-pattern="%BUILD_ID_PATTERN%" ^
  --log-file="%DOWNLOAD_LOG%" ^
  --log-verbose ^
  GET ^
  > "%BUILD_PTR%"
if %ERRORLEVEL% equ 0 goto step4
copy %DOWNLOAD_LOG% %ERROR_MESSAGE%
goto error

:step4
set /p BUILD_DIR= < "%BUILD_PTR%"
set CHROME_DIR=%BUILD_DIR%\chrome-win32
set SYMBOL_DIR=%BUILD_DIR%\chrome-win32-syms
set CHROME_DLL=%CHROME_DIR%\chrome.dll
set CHROME_PDB=%SYMBOL_DIR%\chrome_dll.pdb
goto %MODE_LABEL%

:step4_ui_tests
echo Running randomized ui test ...
set UI_TESTS_EXE=%CHROME_DIR%\automated_ui_tests.exe
call python "%REORDER_PY%" ^
  --summary-title="Reordered UI Tests" ^
  --reorder-tool="%REORDER_EXE%" ^
  --reorder-input-bin="%CHROME_DLL%" ^
  --reorder-input-pdb="%CHROME_PDB%" ^
  --reorder-test-program="%UI_TESTS_EXE%" ^
  --reorder-num-iterations=%ITERATIONS% ^
  %NO_REVERT% %REORDER_BASIC_BLOCKS% ^
  --reorder-padding="%PADDING%" ^
  --log-file="%REORDER_LOG%" ^
  --log-verbose ^
  -- --input=%ACTIONS_XML% ^
    --output=%TEST_REPORT% ^
    --debug ^
  > "%SUMMARY%"
if %ERRORLEVEL% equ 0 goto step5
copy %SUMMARY%+%REORDER_LOG% %ERROR_MESSAGE%
goto error

:step4_reliability_tests
echo Running randomized reliability test ...
set RELIABILITY_TESTS_EXE=%CHROME_DIR%\reliability_tests.exe
call python "%REORDER_PY%" ^
  --summary-title="Reordered Reliability Tests" ^
  --reorder-tool="%REORDER_EXE%" ^
  --reorder-input-bin="%CHROME_DLL%" ^
  --reorder-input-pdb="%CHROME_PDB%" ^
  --reorder-test-program="%RELIABILITY_TESTS_EXE%" ^
  --reorder-num-iterations=%ITERATIONS% ^
  %NO_REVERT% %REORDER_BASIC_BLOCKS% ^
  --reorder-padding="%PADDING%" ^
  --log-file="%REORDER_LOG%" ^
  --log-verbose ^
  -- --list="%URL_LIST%" ^
     --logfile="%RELIABILITY_LOG%" ^
     --savedebuglog ^
     --js-flags="" ^
     --ui-test-timeout=240000 ^
     --ui-test-action-timeout=240000 ^
     --ui-test-action-max-timeout=240000 ^
     --ui-test-terminate-timeout=240000 ^
     --enable-logging ^
     --log-level=0 ^
     --enable-dcheck ^
     --extra-chrome-flags="--no-js-randomness --disable-background-networking" ^
     --full-memory-crash-report ^
  > "%SUMMARY%"
if %ERRORLEVEL% equ 0 goto step5
copy %SUMMARY%+%REORDER_LOG% %ERROR_MESSAGE%
goto error

:step5
rmdir /S /Q "%BUILD_DIR%"
echo Sending out summary mail ...
call python "%SEND_MAIL_PY%" ^
  --server="%SMTP_SERVER%" ^
  --from="%FROM%" ^
  --to="%TO%" ^
  --subject="@%SUMMARY%" ^
  --message="@%REORDER_LOG%" ^
  --attach="%REORDER_LOG%" ^
  --attach="%SYNC_LOG%" ^
  --attach="%BUILD_LOG%" ^
  --attach="%DOWNLOAD_LOG%" ^
  --attach="%WORKDIR%\report*.xml" ^
  --ignore-missing ^
  > "%ERROR_MESSAGE%"
if %ERRORLEVEL% equ 0 goto done

:error
echo Reporting error
call python %SEND_MAIL_PY% ^
  --server="%SMTP_SERVER%" ^
  --from="%FROM%" ^
  --to="%TO%" ^
  --subject="Syzygy %MODE% test bot failed!" ^
  --message="@%ERROR_MESSAGE%" ^
  --attach="%REORDER_LOG%" ^
  --attach="%SYNC_LOG%" ^
  --attach="%BUILD_LOG%" ^
  --attach="%DOWNLOAD_LOG%" ^
  --attach="%WORKDIR%\report*.xml" ^
  --ignore-missing

:done
rem Done

Update the randomization test script to point to VS2010.

This also updates the script to clean up it's working files automatically.
We were keeping them around for forensic evidence post failure, but it
turns out that we don't end up using them (all of the tests are repeatable).

R= chrisha@chromium.org
Review URL: https://codereview.appspot.com/6819048

git-svn-id: db59699583a60be9a535cd09cdc9132301867226@1205 15e8cca8-e42c-11de-a347-f34a4f72eb7d


REM Setup (1)

REM Switch to branch 1700 (i.e. chromium beta)

REM   This part should only need to be done once, but it won't hurt to repeat it.  The first
REM   time might take a while because it fetches an extra 1/2 GB or so of branch commits.
call gclient sync --with_branch_heads
call git fetch

set BRANCH=1700
call git config --replace-all svn-remote.svn_$BRANCH.url http://src.chromium.org/chrome
REM only for committers call git config --replace-all svn-remote.svn_%BRANCH%.url svn://svn.chromium.org/chrome
call git config --replace-all svn-remote.svn_%BRANCH%.fetch branches/%BRANCH%/src:refs/remotes/origin/%BRANCH%
REM NEW for 2014: You also need to convince git-svn that the commits on http://src.chromium.org/chrome are the same as those on svn://svn.chromium.org/chrome
call git config --replace-all svn-remote.svn_$BRANCH.rewriteRoot "svn://svn.chromium.org/chrome"
call git config --replace-all svn-remote.svn_$BRANCH.rewriteUUID "0039d316-1c4b-4281-b951-d872f2087c98"

REM   This "initializes" the %BRANCH% refspec, to prevent 'git svn fetch' from scanning
REM   the whole svn repo history for the branch commits we already synced above.
echo ref: refs/remotes/branch-heads/%BRANCH% > .git/refs/remotes/origin/%BRANCH%

REM   This should finish quickly, just doing a bit of git-svn housekeeping.
REM   It might fetch a few recent revisions, if the git mirror is slightly out-of-date,
REM   but it shouldn't be behind by much, and most of the time it shouldn't need to
REM   fetch anything. If it's taking a long time or looks like it's fetching a bunch of
REM   stuff from svn, something is probably wrong.
call git svn fetch svn_%BRANCH%

REM   Checkout the branch 'src' tree.
call git checkout -b branch_%BRANCH% origin/%BRANCH%
REM   Make git-cl happy.
call git config branch.branch_%BRANCH%.merge refs/heads/%BRANCH%
call git config branch.branch_%BRANCH%.remote branch-heads
REM   Checkout all the submodules at their branch DEPS revisions.
call gclient sync
call gclient runhooks --force

REM Setup (2)
REM remove all .git and .gitmodules directories that came with the chromium clone

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S ".git"') DO RMDIR /Q /S "%%G"

REM Step (3) init AMD repository and pull

cd ..

call git init
call git remote rm origin 2> nul
call git remote add origin https://github.com/amd/Chromium-WebCL.git
call git fetch
call git reset --hard origin/master
call git branch --set-upstream-to=origin/master master

cd src

REM Setup (1)

REM Switch to branch 1700 (i.e. chromium beta)

REM   This part should only need to be done once, but it won't hurt to repeat it.  The first
REM   time might take a while because it fetches an extra 1/2 GB or so of branch commits.
call gclient sync --with_branch_heads
call git fetch

set BRANCH=1700
call git config --replace-all svn-remote.svn_$BRANCH.url http://src.chromium.org/chrome
REM only for committers call git config --replace-all svn-remote.svn_%BRANCH%.url svn://svn.chromium.org/chrome
call git config --replace-all svn-remote.svn_%BRANCH%.fetch branches/%BRANCH%/src:refs/remotes/origin/%BRANCH%
REM NEW for 2014: You also need to convince git-svn that the commits on http://src.chromium.org/chrome are the same as those on svn://svn.chromium.org/chrome
call git config --replace-all svn-remote.svn_$BRANCH.rewriteRoot "svn://svn.chromium.org/chrome"
call git config --replace-all svn-remote.svn_$BRANCH.rewriteUUID "0039d316-1c4b-4281-b951-d872f2087c98"

REM   This "initializes" the %BRANCH% refspec, to prevent 'git svn fetch' from scanning
REM   the whole svn repo history for the branch commits we already synced above.
echo ref: refs/remotes/branch-heads/%BRANCH% > .git/refs/remotes/origin/%BRANCH%

REM   This should finish quickly, just doing a bit of git-svn housekeeping.
REM   It might fetch a few recent revisions, if the git mirror is slightly out-of-date,
REM   but it shouldn't be behind by much, and most of the time it shouldn't need to
REM   fetch anything. If it's taking a long time or looks like it's fetching a bunch of
REM   stuff from svn, something is probably wrong.
call git svn fetch svn_%BRANCH%

REM   Checkout the branch 'src' tree.
call git checkout -b branch_%BRANCH% origin/%BRANCH%
REM   Make git-cl happy.
call git config branch.branch_%BRANCH%.merge refs/heads/%BRANCH%
call git config branch.branch_%BRANCH%.remote branch-heads
REM   Checkout all the submodules at their branch DEPS revisions.
call gclient sync
call gclient runhooks --force

REM Setup (2)
REM remove all .git directories that came with the chromium clone

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S ".git"') DO RMDIR /Q /S "%%G"

REM delete the Mesa CL include directory otherwise it shadows
REM the real CL

DEL /S /Q third_party\mesa\src\include\CL
RMDIR /S /Q third_party\mesa\src\include\CL

REM Step (3) init AMD repository and pull

cd ..

call git init
call git remote rm origin 2> nul
call git remote add origin https://github.com/amd/Chromium-WebCL.git
call git fetch
call git reset --hard origin/master
call git branch --set-upstream-to=origin/master master

cd src

Delete mesa's CL include dir

Delete mesa's CL include dir


@echo off
setlocal
for %%i in ("%~dp0.") do set file_dir=%%~dpnxi
for %%i in ("%file_dir%\..\src\.") do set src_dir=%%~dpnxi
for %%i in ("%file_dir%\..\bin\.") do set bin_dir=%%~dpnxi
set VbCodeLines="%bin_dir%\VbCodeLines.exe"
set Vb6="%ProgramFiles%\Microsoft Visual Studio\VB98\VB6.EXE"
if not exist %Vb6% set Vb6="%ProgramFiles(x86)%\Microsoft Visual Studio\VB98\VB6.EXE"
set log_file=%file_dir%\compile.out

echo Cleanup %file_dir%...
for %%i in (%file_dir%\*.*) do (if not "%%~nxi"=="build.bat" del %%i > nul)
rd /s /q %file_dir%\Connectors 2>&1
mkdir %file_dir%\Connectors
rd /s /q %file_dir%\Protocols 2>&1
mkdir %file_dir%\Protocols
rd /s /q %file_dir%\Shared 2>&1
mkdir %file_dir%\Shared
echo Copy sources from %src_dir%...
for %%i in (%src_dir%\*.bas;%src_dir%\*.cls;%src_dir%\*.frm;%src_dir%\*.frx;%src_dir%\*.vbp) do (copy %%i %file_dir% > nul)
echo Copy sources from %src_dir%\Connectors...
for %%i in (%src_dir%\Connectors\*.bas;%src_dir%\Connectors\*.cls) do (copy %%i %file_dir%\Connectors > nul)
echo Copy sources from %src_dir%\Protocols...
for %%i in (%src_dir%\Protocols\*.bas;%src_dir%\Protocols\*.cls) do (copy %%i %file_dir%\Protocols > nul)
echo Copy sources from %src_dir%\Shared...
for %%i in (%src_dir%\Shared\*.bas;%src_dir%\Shared\*.cls) do (copy %%i %file_dir%\Shared > nul)
echo Put lines to sources in %file_dir%...
for %%i in (%file_dir%\*.vbp) do (%VbCodeLines% %%i)
echo Compiling to %bin_dir%...
attrib -r "%bin_dir%\*.*"
for %%i in (%file_dir%\*.vbp) do (
    del %log_file% > nul 2>&1
    %Vb6% /make %%i /out %log_file%
    findstr /r /C:"Build of '.*' succeeded" %log_file% || (type %log_file% 1>&2 & exit /b 1)
)
echo Done.

@echo off
setlocal
for %%i in ("%~dp0.") do set file_dir=%%~dpnxi
for %%i in ("%file_dir%\..\src\.") do set src_dir=%%~dpnxi
for %%i in ("%file_dir%\..\bin\.") do set bin_dir=%%~dpnxi
set VbCodeLines=start /w "%bin_dir%\VbCodeLines.exe"
set Vb6="%ProgramFiles%\Microsoft Visual Studio\VB98\VB6.EXE"
if not exist %Vb6% set Vb6="%ProgramFiles(x86)%\Microsoft Visual Studio\VB98\VB6.EXE"
set log_file=%file_dir%\compile.out

echo Cleanup %file_dir%...
for %%i in (%file_dir%\*.*) do (if not "%%~nxi"=="build.bat" del %%i > nul)
rd /s /q %file_dir%\Connectors 2>&1
mkdir %file_dir%\Connectors
rd /s /q %file_dir%\Protocols 2>&1
mkdir %file_dir%\Protocols
rd /s /q %file_dir%\Shared 2>&1
mkdir %file_dir%\Shared
echo Copy sources from %src_dir%...
for %%i in (%src_dir%\*.bas;%src_dir%\*.cls;%src_dir%\*.frm;%src_dir%\*.frx;%src_dir%\*.vbp) do (copy %%i %file_dir% > nul)
echo Copy sources from %src_dir%\Connectors...
for %%i in (%src_dir%\Connectors\*.bas;%src_dir%\Connectors\*.cls) do (copy %%i %file_dir%\Connectors > nul)
echo Copy sources from %src_dir%\Protocols...
for %%i in (%src_dir%\Protocols\*.bas;%src_dir%\Protocols\*.cls) do (copy %%i %file_dir%\Protocols > nul)
echo Copy sources from %src_dir%\Shared...
for %%i in (%src_dir%\Shared\*.bas;%src_dir%\Shared\*.cls) do (copy %%i %file_dir%\Shared > nul)
echo Put lines to sources in %file_dir%...
for %%i in (%file_dir%\*.vbp) do (%VbCodeLines% %%i)
echo Compiling to %bin_dir%...
attrib -r "%bin_dir%\*.*"
for %%i in (%file_dir%\*.vbp) do (
    del %log_file% > nul 2>&1
    %Vb6% /make %%i /out %log_file%
    findstr /r /C:"Build of '.*' succeeded" %log_file% || (type %log_file% 1>&2 & exit /b 1)
)
echo Done.

Fix build script to wait for VbCodeLines completion


@if "%_echo%"=="" echo off
setlocal

if EXIST build.ok DEL /f /q build.ok

call %~d0%~p0..\..\..\config.bat

"%PEVERIFY%" "%FSCOREDLLPATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLL20PATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLLPORTABLEPATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCBinPath%\FSharp.Build.dll"
@if ERRORLEVEL 1 goto Error

REM Use /MD because this contains some P/Invoke code
"%PEVERIFY%" /MD "%FSCBinPath%\FSharp.Compiler.dll"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCBinPath%\fsi.exe"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCBinPath%\FSharp.Compiler.Interactive.Settings.dll"
@if ERRORLEVEL 1 goto Error

"%FSC%" %fsc_flags% -o:xmlverify.exe -g xmlverify.fs
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" xmlverify.exe
@if ERRORLEVEL 1 goto Error

REM == Calc correct path to FSharp.Core.dll no matter what arch we are on
call :SetFSCoreXMLPath "%FSCOREDLLPATH%"

%CLIX% xmlverify.exe "%FSHARPCOREXML%"
@if ERRORLEVEL 1 goto Error

:Ok
echo Passed fsharp %~f0 ok.
echo > build.ok
endlocal
exit /b 0

:Error
endlocal
exit /b %ERRORLEVEL%

:SetFSCoreXMLPath
set FSHARPCOREXML=%~dpn1.xml
goto :EOF

@if "%_echo%"=="" echo off
setlocal

if EXIST build.ok DEL /f /q build.ok

call %~d0%~p0..\..\..\config.bat

"%PEVERIFY%" "%FSCOREDLLPATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLL20PATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLLPORTABLEPATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLLNETCOREPATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLLNETCORE78PATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCOREDLLNETCORE259PATH%"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCBinPath%\FSharp.Build.dll"
@if ERRORLEVEL 1 goto Error

REM Use /MD because this contains some P/Invoke code
"%PEVERIFY%" /MD "%FSCBinPath%\FSharp.Compiler.dll"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCBinPath%\fsi.exe"
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" "%FSCBinPath%\FSharp.Compiler.Interactive.Settings.dll"
@if ERRORLEVEL 1 goto Error

"%FSC%" %fsc_flags% -o:xmlverify.exe -g xmlverify.fs
@if ERRORLEVEL 1 goto Error

"%PEVERIFY%" xmlverify.exe
@if ERRORLEVEL 1 goto Error

REM == Calc correct path to FSharp.Core.dll no matter what arch we are on
call :SetFSCoreXMLPath "%FSCOREDLLPATH%"

%CLIX% xmlverify.exe "%FSHARPCOREXML%"
@if ERRORLEVEL 1 goto Error

:Ok
echo Passed fsharp %~f0 ok.
echo > build.ok
endlocal
exit /b 0

:Error
endlocal
exit /b %ERRORLEVEL%

:SetFSCoreXMLPath
set FSHARPCOREXML=%~dpn1.xml
goto :EOF

Add newer portable libraries to 'verify' test area (changeset 1385182)


@echo off
REM https://ss64.com/nt/for_cmd.html

set _cmdstr=certutil -p [password] -dump cert.p12

for /f "tokens=2" %%a in (
 '%_cmdstr% ^|find "NotAfter:"'
) do (
 set RESULT=%%a
)

echo expration: %RESULT%

Create cert_file_expiration.bat

Create cert_file_expiration.bat


SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

if "%platform%" == "win_64" (
	SET URL=http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-Win64-msvc10.zip
) else (
	SET URL=http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-Win32-msvc10.zip
)

if exist "%SCRIPTPATH%%platform%\icu.zip" (
    echo "icu already downloaded"
) else (
    Powershell.exe Invoke-WebRequest -OutFile %platform%\icu.zip -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox "%URL%"
)

SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="C:\Program Files (x86)\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
	SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already extracted"
) else (
    call %UNSIP_PROGRAMM% x "%SCRIPTPATH%%platform%\icu.zip" -o"%SCRIPTPATH%%platform%\"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if defined TARGET (
	SET platform=%TARGET%
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

if "%platform%" == "win_64" (
	SET URL=http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-Win64-msvc10.zip
) else (
	SET URL=http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-Win32-msvc10.zip
)

if exist "%SCRIPTPATH%%platform%\icu.zip" (
    echo "icu already downloaded"
) else (
    Powershell.exe Invoke-WebRequest -OutFile %platform%\icu.zip -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox "%URL%"
)

SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="C:\Program Files (x86)\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
	SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already extracted"
) else (
    call %UNSIP_PROGRAMM% x "%SCRIPTPATH%%platform%\icu.zip" -o"%SCRIPTPATH%%platform%\"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

Fix for cross compilation

Fix for cross compilation


@echo off
setx PATH % cd %;% path %
echo Done. Press any key to end.
pause > nul

@echo off
setx PATH "%PATH%;%cd%" /M
echo Done. Press any key to end.
pause > nul

Update setup.bat

Update setup.bat

Fix setup


@ECHO OFF
IF NOT EXIST virtualenv GOTO DIRNOTEXISTS

:DIREXISTS
CALL virtualenv\scripts\activate

SET PYTHONPATH=%CD%\submodule\s3g;%CD%\src\main\python;%PYTHONPATH%

REM EXIT /B 0

easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\mock-1.0.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\lockfile-0.9.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\python_daemon-1.6-py2.7.egg
easy_install -q submodule\conveyor_bins\python\argparse-1.2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\unittest2-0.5.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg

GOTO DONE

:DIRNOTEXISTS

IF "%1" == "" GOTO DEFAULTPY
set PYTHON=%1
GOTO VIRTUALENV

:DEFAULTPY
set PYTHON=python

:VIRTUALENV
%PYTHON% virtualenv.py --extra-search-dir=submodule/conveyor_bins/python --never-download virtualenv
GOTO DIREXISTS

:DONE

@ECHO OFF
IF NOT EXIST virtualenv GOTO DIRNOTEXISTS

:DIREXISTS
CALL virtualenv\scripts\activate

SET PYTHONPATH=%CD%\submodule\s3g;%CD%\src\main\python;%PYTHONPATH%

REM EXIT /B 0

easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\mock-1.0.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\lockfile-0.9.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\python_daemon-1.6-py2.7.egg
easy_install -q submodule\conveyor_bins\python\argparse-1.2.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\unittest2-0.5.1-py2.7.egg
easy_install -q submodule\conveyor_bins\python\pyserial-2.7_mb2.1-py2.7.egg

GOTO DONE

:DIRNOTEXISTS

IF "%1" == "" GOTO DEFAULTPY
set PYTHON=%1
GOTO VIRTUALENV

:DEFAULTPY
set PYTHON=python

:VIRTUALENV
"%PYTHON%" virtualenv.py --extra-search-dir=submodule/conveyor_bins/python --never-download virtualenv
GOTO DIREXISTS

:DONE

Put quotes around PYTHONPATH to handle the case where there's a space in the name


:: See documentation in type-shell-output.bat

cd /d %~dp0
"C:\Program Files\Git\bin\bash.exe" release.sh

:: See documentation in type-shell-output.bat

cd /d %~dp0
"C:\Program Files\Git\bin\bash.exe" autorelease.sh

Fix autorelease reporting

Fix autorelease reporting

It didn't really matter whether autorelease.sh had any issues when we were never running it...

Doh.


"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sn.exe" -k keyPair.snk
set PATH_ILDASM="%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\ildasm.exe"
set PATH_ILASM=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ilasm.exe
call :runsn ..\lib\Markdown.Xaml.dll Markdown.Xaml
call :runsn ..\packages\Octokit.0.24.0\lib\net45\Octokit.dll octokit
call :runsn ..\packages\SharpRaven.2.2.0\lib\net45\SharpRaven.dll SharpRaven
call :runsn ..\packages\Syroot.Windows.IO.KnownFolders.1.0.2\lib\net40\Syroot.Windows.IO.KnownFolders.dll Syroot.Windows.IO.KnownFolders
EXIT /B %ERRORLEVEL%

:runsn
del %2%.*
%PATH_ILDASM% "%1"  /out=%2%.il
%PATH_ILASM% %2%.il /dll /key=keyPair.snk
del %2%.il
del %2%.res
EXIT /B 0

"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sn.exe" -k keyPair.snk
set PATH_ILDASM="%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\ildasm.exe"
set PATH_ILASM=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ilasm.exe
set PATH_AIE="%ProgramFiles(x86)%\Add-in Express\Add-in Express for .NET\Redistributables"
call :runsn ..\lib\Markdown.Xaml.dll Markdown.Xaml
call :runsn ..\packages\Octokit.0.24.0\lib\net45\Octokit.dll octokit
call :runsn ..\packages\SharpRaven.2.2.0\lib\net45\SharpRaven.dll SharpRaven
call :runsn ..\packages\Syroot.Windows.IO.KnownFolders.1.0.2\lib\net40\Syroot.Windows.IO.KnownFolders.dll Syroot.Windows.IO.KnownFolders
call :cpdll ..\Quandl.Excel.Addin\Loader
call :cpexe ..\Quandl.Excel.AddinSetup\4.0.0\Resources
EXIT /B %ERRORLEVEL%

:runsn
del %2%.*
%PATH_ILDASM% "%1"  /out=%2%.il
%PATH_ILASM% %2%.il /dll /key=keyPair.snk
del %2%.il
del %2%.res

:cpdll
copy %PATH_AIE%\adxloader64.dll %1%
copy %PATH_AIE%\adxloader.dll %1%
EXIT /B 0

:cpexe
copy %PATH_AIE%\vdwtool.exe %1%
EXIT /B 0

copy redistributables

3rdparty: copy redistributables

Update makesn.cmd to also copy needed files from Add-in redistributables
to simplify setup process.

Signed-off-by: Jamie Couture <b4dde37aa2aac745c0e6c43447507eaeace3e59f@quandl.com>


@echo off
set QMAKEBIN=qmake
set MSVCMODE=
echo QXT_stability += unknown > config.in

:top
if "%1" == "" goto finish
if "%1" == "-qmake-bin" goto qmakebin
if "%1" == "-nomake" goto nomake
if "%1" == "-prefix" goto prefix
if "%1" == "-libdir" goto libdir
if "%1" == "-docdir" goto docdir
if "%1" == "-headerdir" goto headerdir
if "%1" == "-bindir" goto bindir
if "%1" == "-ignore-stability" goto ignorestability
if "%1" == "-static" goto static
if "%1" == "-debug" goto debug
if "%1" == "-release" goto release
if "%1" == "-no-stability-unknown" goto nounknown
if "%1" == "-no-openssl" goto nossl
if "%1" == "-msvc" goto msvc
if "%1" == "-help" goto help
if "%1" == "--help" goto help
if "%1" == "/help" goto help
if "%1" == "/?" goto help

echo Unrecognized configure option: %1
del config.in
goto end

:bottom2
shift
:bottom
shift
goto top

:qmakebin
    set QMAKEBIN=%2
    goto bottom2

:nomake
    echo QXT_BUILD -= %2 >> config.in
    goto bottom2

:prefix
    echo QXTINSTALLDIR = %2 >> config.in
    goto bottom2

:libdir
    echo target.path = %2 >> config.in
    goto bottom2

:docdir
    echo docs.path = %2 >> config.in
    goto bottom2

:headerdir
    echo include.path = %2 >> config.in
    goto bottom2

:bindir
    echo bin.path = %2 >> config.in
    goto bottom2

:ignorestability
    echo QXT_ignore_stability += %2 >> config.in
    goto bottom2

:static
    echo CONFIG += static staticlib >> config.in
    goto bottom

:debug
    echo CONFIG += debug >> config.in
    goto bottom

:release
    echo CONFIG += release >> config.in
    goto bottom

:nounknown
    echo QXT_stability -= unknown >> config.in
    goto bottom

:nossl
    echo QXT_LIBS -= openssl >> config.in
    goto bottom

:msvc
<<<<<<< .mine
    set MSVCMODE=-tp vc
    echo TEMPLATE = vcsubdirs  >> config.in
=======
    echo TEMPLATE = vclib  >> config.in
>>>>>>> .r331
    goto bottom

:help
    echo Usage: configure [-prefix (dir)] [-libdir (dir)] [-docdir (dir)]
    echo        [-bindir (dir)] [-headerdir (dir)] [-qmake-bin (path)]
    echo        [-static] [-debug] [-release] [-no-stability-unknown]
    echo        [-no-openssl] [-nomake (module)] [-msvc]
    echo.
    echo Installation options:
    echo.
    echo -prefix (dir) ....... This will install everything relative to (dir)
    echo                       default: C:\libqxt
    echo -libdir (dir) ....... Libraries will be installed to (dir)
    echo                       default: PREFIX/lib
    echo -docdir (dir) ....... Documentation will be installed to (dir)
    echo                       default: PREFIX/share/doc
    echo -bindir (dir) ....... Executables will be installed to (dir)
    echo                       default: PREFIX/bin
    echo -headerdir (dir) .... Include files will be installed to (dir)
    echo                       default: PREFIX/include
    echo -qmake-bin (path) ... Specifies the path to the qmake executable
    echo                       default: search the system path
    echo -static ............. Compile Qxt as a static library
    echo -debug .............. Build Qxt with debugging symbols
    echo -release ............ Build Qxt without debugging support
    echo -no-stability-unknown Do not build untested classes
    echo -no-openssl ......... Do not link to OpenSSL
    echo -nomake (module) .... Do not compile the specified module
    echo                       options: kit network gui sql media curses web
    echo -msvc ............... Configure Qxt to use Microsoft Visual Studio

    del config.in
    goto end

:finish
copy config.pri config.pri.bak
copy config.in config.pri
del config.in

%QMAKEBIN% %MSVCMODE% -recursive

:end

@echo off
set QMAKEBIN=qmake
set MSVCMODE=
echo QXT_stability += unknown > config.in

:top
if "%1" == "" goto finish
if "%1" == "-qmake-bin" goto qmakebin
if "%1" == "-nomake" goto nomake
if "%1" == "-prefix" goto prefix
if "%1" == "-libdir" goto libdir
if "%1" == "-docdir" goto docdir
if "%1" == "-headerdir" goto headerdir
if "%1" == "-bindir" goto bindir
if "%1" == "-ignore-stability" goto ignorestability
if "%1" == "-static" goto static
if "%1" == "-debug" goto debug
if "%1" == "-release" goto release
if "%1" == "-no-stability-unknown" goto nounknown
if "%1" == "-no-openssl" goto nossl
if "%1" == "-msvc" goto msvc
if "%1" == "-help" goto help
if "%1" == "--help" goto help
if "%1" == "/help" goto help
if "%1" == "/?" goto help

echo Unrecognized configure option: %1
del config.in
goto end

:bottom2
shift
:bottom
shift
goto top

:qmakebin
    set QMAKEBIN=%2
    goto bottom2

:nomake
    echo QXT_BUILD -= %2 >> config.in
    goto bottom2

:prefix
    echo QXTINSTALLDIR = %2 >> config.in
    goto bottom2

:libdir
    echo target.path = %2 >> config.in
    goto bottom2

:docdir
    echo docs.path = %2 >> config.in
    goto bottom2

:headerdir
    echo include.path = %2 >> config.in
    goto bottom2

:bindir
    echo bin.path = %2 >> config.in
    goto bottom2

:ignorestability
    echo QXT_ignore_stability += %2 >> config.in
    goto bottom2

:static
    echo CONFIG += static staticlib >> config.in
    goto bottom

:debug
    echo CONFIG += debug >> config.in
    goto bottom

:release
    echo CONFIG += release >> config.in
    goto bottom

:nounknown
    echo QXT_stability -= unknown >> config.in
    goto bottom

:nossl
    echo QXT_LIBS -= openssl >> config.in
    goto bottom

:msvc
    set MSVCMODE=-tp vc
    goto bottom

:help
    echo Usage: configure [-prefix (dir)] [-libdir (dir)] [-docdir (dir)]
    echo        [-bindir (dir)] [-headerdir (dir)] [-qmake-bin (path)]
    echo        [-static] [-debug] [-release] [-no-stability-unknown]
    echo        [-no-openssl] [-nomake (module)] [-msvc]
    echo.
    echo Installation options:
    echo.
    echo -prefix (dir) ....... This will install everything relative to (dir)
    echo                       default: C:\libqxt
    echo -libdir (dir) ....... Libraries will be installed to (dir)
    echo                       default: PREFIX/lib
    echo -docdir (dir) ....... Documentation will be installed to (dir)
    echo                       default: PREFIX/share/doc
    echo -bindir (dir) ....... Executables will be installed to (dir)
    echo                       default: PREFIX/bin
    echo -headerdir (dir) .... Include files will be installed to (dir)
    echo                       default: PREFIX/include
    echo -qmake-bin (path) ... Specifies the path to the qmake executable
    echo                       default: search the system path
    echo -static ............. Compile Qxt as a static library
    echo -debug .............. Build Qxt with debugging symbols
    echo -release ............ Build Qxt without debugging support
    echo -no-stability-unknown Do not build untested classes
    echo -no-openssl ......... Do not link to OpenSSL
    echo -nomake (module) .... Do not compile the specified module
    echo                       options: kit network gui sql media curses web
    echo -msvc ............... Configure Qxt to use Microsoft Visual Studio

    del config.in
    goto end

:finish
copy config.pri config.pri.bak
copy config.in config.pri
del config.in

%QMAKEBIN% %MSVCMODE% -recursive

:end

clean up conflict

clean up conflict


set PROJ_LIB=C:\dev2\proj\nad
set GDAL_DATA=C:\dev2\gdal\data
del build.sln
rd /q /s Default
del lib\\_srs.node
python gyp/gyp build.gyp --depth=. -f msvs -G msvs_version=2010
msbuild build.sln
copy Default\\_srs.node lib\\_srs.node
rem test!
echo module.exports.static_osr = false; > lib\settings.js
set NODE_PATH=lib
node node_modules\expresso\bin\expresso
rem node -e "console.log(require('mapnik'))"

set PROJ_LIB=C:\dev2\proj\nad
set GDAL_DATA=C:\dev2\gdal\data
del build.sln
rd /q /s Default
del lib\\_srs.node
rd /q /s lib\\srs_data
python gyp/gyp build.gyp --depth=. -f msvs -G msvs_version=2010
msbuild build.sln
copy Default\\_srs.node lib\\_srs.node
rem test!
echo module.exports.static_osr = false; > lib\settings.js
set NODE_PATH=lib
node node_modules\expresso\bin\expresso
rem node -e "console.log(require('mapnik'))"

clear out bundled srs_data since we'll use GDAL's on windows


REM Test build
python setup.py sdist bdist_wheel
REM Upload to PyPi
REM python setup.py sdist bdist_wheel upload

Add bat to help packaging process

Add bat to help packaging process


@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SET PLATFORM=x64
SET CONFIGURATION=Release
::SET LOCAL_DEV=1

FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%

::SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.1.0-win32-x86\bin;%PATH%
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.4.0-win32-x86\bin;%PATH%
SET PATH=C:\Program Files\7-Zip;%PATH%

powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL appveyor-build.bat
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SET PLATFORM=x64
SET CONFIGURATION=Release
::SET LOCAL_DEV=1

FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%

SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.4.0-win32-x86\bin;%PATH%
SET PATH=C:\Program Files\7-Zip;%PATH%

powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL appveyor-build.bat
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

Remove commented out line in windows build script. History is what git is for.


### test_app.bat - 2013 - Carr Adrien 2.0.0 ###
version = "2.0.0"
build_hour = "11H00"

echo "Build ${build_hour}"
echo "version ${version}"

update major version

update major version


Add the Windows bat file (installed by PEAR)


@ECHO OFF
REM Amazon Discount Finder. All rights reserved.
REM Author: Cristian Gonzales

REM This script assumes you have Python3.6 and pip3 installed on your machine
REM pip install all required dependences
pip3 install bs4 && pip3 install gevent && pip3 install selenium && pip3 install python-amazon-simple-product-api && pip3 install pypiwin32

REM Go into the src folder and run the program
CD ..\amazondiscounts.src\main
python3 AMZNMain.py

@ECHO OFF
REM Amazon Discount Finder. All rights reserved.
REM Author: Cristian Gonzales

REM This script assumes you have Python3.6 and pip3 installed on your machine
REM pip install all required dependences
pip3 install bs4 && pip3 install gevent && pip3 install selenium && pip3 install python-amazon-simple-product-api && pip3 install pypiwin32

REM Go into the src folder and run the program
CD ..\amazondiscounts.src\main
python AMZNMain.py

Update AMZNRegular.bat

Update AMZNRegular.bat


:: This script assumes the standard setup on tensorflow Jenkins windows machines.
:: It is NOT guaranteed to work on any other machine. Use at your own risk!
::
:: REQUIREMENTS:
:: * All installed in standard locations:
::   - JDK8, and JAVA_HOME set.
::   - Microsoft Visual Studio 2015 Community Edition
::   - Msys2
::   - Anaconda3
::   - CMake
:: * Before running this script, you have to set BUILD_CC_TESTS and BUILD_PYTHON_TESTS
::   variables to either "ON" or "OFF".
:: * Either have the REPO_ROOT variable set, or run this from the repository root directory.

:: Check and set REPO_ROOT
IF [%REPO_ROOT%] == [] (
  SET REPO_ROOT=%cd%
)

:: Import all bunch of variables Visual Studio needs.
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
:: Turn echo back on, above script turns it off.
ECHO ON

:: Set environment variables to be shared between runs. Do not override if they
:: are set already.

IF DEFINED CMAKE_EXE (ECHO CMAKE_EXE is set to %CMAKE_EXE%) ELSE (SET CMAKE_EXE="C:\Program Files\cmake\bin\cmake.exe")
IF DEFINED SWIG_EXE (ECHO SWIG_EXE is set to %SWIG_EXE%) ELSE (SET SWIG_EXE="C:\swigwin-3.0.10\swig.exe")
IF DEFINED PY_EXE (ECHO PY_EXE is set to %PY_EXE%) ELSE (SET PY_EXE="C:\Program Files\Anaconda3\python.exe")
IF DEFINED PY_LIB (ECHO PY_LIB is set to %PY_LIB%) ELSE (SET PY_LIB="C:\Program Files\Anaconda3\libs\python35.lib")
IF DEFINED CUDNN_HOME (ECHO CUDNN_HOME is set to %CUDNN_HOME%) ELSE (SET CUDNN_HOME="c:\tools\cuda")
verbosity:quiet
IF DEFINED DISABLE_FORCEINLINE (ECHO DISABLE_FORCEINLINE is set to %DISABLE_FORCEINLINE%) ELSE (SET DISABLE_FORCEINLINE="OFF")

SET CMAKE_DIR=%REPO_ROOT%\tensorflow\contrib\cmake
SET MSBUILD_EXE="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"
SET PROTOBUF_VERSION="3.4.0"

:: Run cmake to create Visual Studio Project files.
%CMAKE_EXE% %CMAKE_DIR% -A x64 -DSWIG_EXECUTABLE=%SWIG_EXE% -DPYTHON_EXECUTABLE=%PY_EXE% -DCMAKE_BUILD_TYPE=Release -DPYTHON_LIBRARIES=%PY_LIB% -Dtensorflow_BUILD_PYTHON_TESTS=%BUILD_PYTHON_TESTS% -Dtensorflow_BUILD_CC_TESTS=%BUILD_CC_TESTS% -Dtensorflow_ENABLE_GPU=ON -DCUDNN_HOME=%CUDNN_HOME% -Dtensorflow_TF_NIGHTLY=%TF_NIGHTLY% -Dtensorflow_DISABLE_EIGEN_FORCEINLINE=%DISABLE_FORCEINLINE% -DPROTOBUF_VERSION=%PROTOBUF_VERSION%

:: Run msbuild in the resulting VS project files to build a pip package.
%MSBUILD_EXE% /p:Configuration=Release /maxcpucount:32 tf_python_build_pip_package.vcxproj

:: This script assumes the standard setup on tensorflow Jenkins windows machines.
:: It is NOT guaranteed to work on any other machine. Use at your own risk!
::
:: REQUIREMENTS:
:: * All installed in standard locations:
::   - JDK8, and JAVA_HOME set.
::   - Microsoft Visual Studio 2015 Community Edition
::   - Msys2
::   - Anaconda3
::   - CMake
:: * Before running this script, you have to set BUILD_CC_TESTS and BUILD_PYTHON_TESTS
::   variables to either "ON" or "OFF".
:: * Either have the REPO_ROOT variable set, or run this from the repository root directory.

:: Check and set REPO_ROOT
IF [%REPO_ROOT%] == [] (
  SET REPO_ROOT=%cd%
)

:: Import all bunch of variables Visual Studio needs.
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
:: Turn echo back on, above script turns it off.
ECHO ON

:: Set environment variables to be shared between runs. Do not override if they
:: are set already.

IF DEFINED CMAKE_EXE (ECHO CMAKE_EXE is set to %CMAKE_EXE%) ELSE (SET CMAKE_EXE="C:\Program Files\cmake\bin\cmake.exe")
IF DEFINED SWIG_EXE (ECHO SWIG_EXE is set to %SWIG_EXE%) ELSE (SET SWIG_EXE="C:\swigwin-3.0.10\swig.exe")
IF DEFINED PY_EXE (ECHO PY_EXE is set to %PY_EXE%) ELSE (SET PY_EXE="C:\Program Files\Anaconda3\python.exe")
IF DEFINED PY_LIB (ECHO PY_LIB is set to %PY_LIB%) ELSE (SET PY_LIB="C:\Program Files\Anaconda3\libs\python35.lib")
IF DEFINED CUDNN_HOME (ECHO CUDNN_HOME is set to %CUDNN_HOME%) ELSE (SET CUDNN_HOME="c:\tools\cuda")
verbosity:quiet
IF DEFINED DISABLE_FORCEINLINE (ECHO DISABLE_FORCEINLINE is set to %DISABLE_FORCEINLINE%) ELSE (SET DISABLE_FORCEINLINE="OFF")

SET CMAKE_DIR=%REPO_ROOT%\tensorflow\contrib\cmake
SET MSBUILD_EXE="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"

:: Run cmake to create Visual Studio Project files.
%CMAKE_EXE% %CMAKE_DIR% -A x64 -DSWIG_EXECUTABLE=%SWIG_EXE% -DPYTHON_EXECUTABLE=%PY_EXE% -DCMAKE_BUILD_TYPE=Release -DPYTHON_LIBRARIES=%PY_LIB% -Dtensorflow_BUILD_PYTHON_TESTS=%BUILD_PYTHON_TESTS% -Dtensorflow_BUILD_CC_TESTS=%BUILD_CC_TESTS% -Dtensorflow_ENABLE_GPU=ON -DCUDNN_HOME=%CUDNN_HOME% -Dtensorflow_TF_NIGHTLY=%TF_NIGHTLY% -Dtensorflow_DISABLE_EIGEN_FORCEINLINE=%DISABLE_FORCEINLINE%

:: Run msbuild in the resulting VS project files to build a pip package.
%MSBUILD_EXE% /p:Configuration=Release /maxcpucount:32 tf_python_build_pip_package.vcxproj

Update run_build.bat

Update run_build.bat


:: USAGE
::     cmdize name [...]
::
:: This tool converts a supported code into a batch file that can be
:: executed without explicit invoking the executable engine. The script
:: creates new file and places it under the same directory as the original
:: one with the same name, replacing the original extension with ".bat".
:: The content of the new file consists of the original file and the
:: special header that being the "polyglot" and having some tricks to be a
:: valid code in batch file and the wrapped code at the same time.
::
:: FEATURES
:: It does comment on "Option Explicit" in VBScript.
:: "<?xml?>" declaration for wsf-files is expected.
:: "Option Explicit" and "<?xml?>" in a single line only are supported.
:: BOM is not supported at all.
::
:: It is possible to select an engine for JavaScript, VBScript and WSF via
:: the command line options /E. If it is not pointed especially, CSCRIPT
:: is used as the default engine for all JavaScript, VBScript and WSF
:: files. Another valid engine is WSCRIPT. Additionally for JavaScript
:: files it is possible to set another engine such as NodeJS, Rhino etc.
:: The predefined option /E DEFAULT resets any previously set engines to
:: the default value.
::
:: SEE ALSO
:: Proceed the following links to learn more the origins
::
:: .js
:: http://forum.script-coding.com/viewtopic.php?pid=79210#p79210
:: http://www.dostips.com/forum/viewtopic.php?p=33879#p33879
:: https://gist.github.com/ildar-shaimordanov/88d7a5544c0eeacaa3bc
::
:: .vbs
:: http://www.dostips.com/forum/viewtopic.php?p=33882#p33882
:: http://www.dostips.com/forum/viewtopic.php?p=32485#p32485
::
:: .pl
:: For details and better support see "pl2bat.bat" from Perl distribution
::
:: .ps1
:: http://blogs.msdn.com/b/jaybaz_ms/archive/2007/04/26/powershell-polyglot.aspx
:: http://stackoverflow.com/a/2611487/3627676
::
:: .hta and .html?
:: http://forum.script-coding.com/viewtopic.php?pid=79322#p79322
::
:: .wsf
:: http://www.dostips.com/forum/viewtopic.php?p=33963#p33963
::
:: COPYRIGHTS
:: Copyright (c) 2014, 2015 Ildar Shaimordanov

@echo off

if "%~1" == "" (
	for %%p in ( powershell.exe ) do if not "%%~$PATH:p" == "" (
		"%%~$PATH:p" -NoProfile -NoLogo -Command "cat '%~f0' | where { $_ -match '^::' } | %% { $_ -replace '::', '' }"
		goto :EOF
	)
	for /f "usebackq tokens=* delims=:" %%s in ( "%~f0" ) do (
		if /i "%%s" == "@echo off" goto :EOF
		echo:%%s
	)
	goto :EOF
)

:cmdize.loop.begin
if "%~1" == "" goto :cmdize.loop.end

if /i "%~1" == "/e" (
	set "CMDIZE_ENGINE="
	if /i not "%~2" == "default" set "CMDIZE_ENGINE=%~2"
	shift
	goto :cmdize.loop.continue
)

if not exist "%~f1" (
	echo:%~n0: File not found: "%~1">&2
	goto :cmdize.loop.continue
)

for %%x in ( .js .vbs .pl .ps1 .hta .htm .html .wsf ) do (
	if /i "%~x1" == "%%~x" (
		call :cmdize%%~x "%~1" >"%~dpn1.bat"
		goto :cmdize.loop.continue
	)
)

echo:%~n0: Unsupported extension: "%~1">&2

:cmdize.loop.continue

shift

goto :cmdize.loop.begin
:cmdize.loop.end

goto :EOF

:: Convert the javascript file.
:: The environment variable %CMDIZE_ENGINE% allows to declare another
:: engine (cscript, wscript, node etc).
:: The default value is cscript.
:cmdize.js
if not defined CMDIZE_ENGINE set "CMDIZE_ENGINE=cscript"
set "CMDIZE_ENGINE_OPTS="
for %%e in ( "%CMDIZE_ENGINE%" ) do (
	if /i "%%~ne" == "cscript" set "CMDIZE_ENGINE_OPTS=//nologo //e:javascript"
	if /i "%%~ne" == "wscript" set "CMDIZE_ENGINE_OPTS=//nologo //e:javascript"
)

echo:0^</*! ::
echo:@echo off
echo:%CMDIZE_ENGINE% %CMDIZE_ENGINE_OPTS% "%%~f0" %%*
echo:goto :EOF */0;
type "%~f1"
goto :EOF

:: Convert the vbscript file.
:: The environment variable %CMDIZE_ENGINE% allows to declare another
:: engine (cscript or wscript).
:: The default value is cscript.
:cmdize.vbs.h
set /p "=::'" <nul
type "%TEMP%\%~n0.$$"
echo:%*
goto :EOF

:cmdize.vbs
if not defined CMDIZE_ENGINE set "CMDIZE_ENGINE=cscript"

copy /y nul + nul /a "%TEMP%\%~n0.$$" /a 1>nul

call :cmdize.vbs.h @echo off
call :cmdize.vbs.h %CMDIZE_ENGINE% //nologo //e:vbscript "%%%%~f0" %%%%*
call :cmdize.vbs.h goto :EOF

del /q "%TEMP%\%~n0.$$"
rem type "%~f1"
for /f "tokens=1,* delims=]" %%r in ( ' call "%windir%\System32\find.exe" /n /v "" ^<"%~f1" ' ) do (
	rem Filtering and commenting "Option Explicit".
	rem This ugly code tries as much as possible to recognize and
	rem comment this directive. It fails if "Option" and "Explicit"
	rem are located on two neighbor lines, consecutively, one by one.
	rem But it is too hard to imagine that there is someone who
	rem practices such a strange coding style.
	for /f "usebackq tokens=1,2" %%a in ( '%%s' ) do if /i "%%~a" == "Option" for /f "usebackq tokens=1,* delims=:'" %%i in ( 'x%%b' ) do if /i "%%~i" == "xExplicit" (
		echo:%~n0: Commenting Option Explicit in "%~1">&2
		echo:rem To prevent compilation error due to embedding into a batch file,
		echo:rem the following line was commented automatically.
		set /p "=rem " <nul
	)
	echo:%%s
)
goto :EOF

:: Convert the perl file.
:cmdize.pl
echo:@rem = '--*-Perl-*--
echo:@echo off
echo:perl -x -S "%%~f0" %%*
echo:goto :EOF
echo:@rem ';
echo:#!perl
type "%~f1"
goto :EOF

:: Convert the powershell file.
:cmdize.ps1
echo:^<# :
echo:@echo off
echo:setlocal
echo:set "POWERSHELL_BAT_ARGS=%%*"
echo:if defined POWERSHELL_BAT_ARGS set "POWERSHELL_BAT_ARGS=%%POWERSHELL_BAT_ARGS:"=\"%%"
echo:endlocal ^& powershell -NoLogo -NoProfile -Command "$_ = $input; Invoke-Expression $( '$input = $_; $_ = \"\"; $args = @( &{ $args } %%POWERSHELL_BAT_ARGS%% );' + [String]::Join( [char]10, $( Get-Content \"%%~f0\" ) ) )"
echo:rem endlocal ^& powershell -NoLogo -NoProfile -Command "$input | &{ [ScriptBlock]::Create( ( Get-Content \"%%~f0\" ) -join [char]10 ).Invoke( @( &{ $args } %%POWERSHELL_BAT_ARGS%% ) ) }"
echo:goto :EOF
echo:#^>
type "%~f1"
goto :EOF

:: Convert the html file.
:: Supportable file extensions are .hta, .htm and .html.
:cmdize.hta
:cmdize.htm
:cmdize.html
echo:^<!-- :
echo:@echo off
echo:start "" mshta "%%~f0" %%*
echo:goto :EOF
echo:--^>
type "%~f1"
goto :EOF

:: Convert the wsf file.
:: The environment variable %CMDIZE_ENGINE% allows to declare another
:: engine (cscript or wscript).
:: The default value is cscript.
:cmdize.wsf
if not defined CMDIZE_ENGINE set "CMDIZE_ENGINE=cscript"

for /f "usebackq tokens=1,2,* delims=?" %%a in ( "%~f1" ) do for /f "tokens=1,*" %%d in ( "%%b" ) do (
	rem We use this code to transform the "<?xml?>" declaration
	rem located at the very beginning of the file to the "polyglot"
	rem form to do it acceptable by the batch file.
	echo:%%a?%%d :
	echo:: %%e ?^>^<!--
	echo:@echo off
	echo:%CMDIZE_ENGINE% //nologo "%%~f0?.wsf" %%*
	echo:goto :EOF
	echo:: --%%c
	more +1 <"%~f1"
	goto :EOF
)
goto :EOF

rem EOF

:: USAGE
::     cmdize name [...]
::
:: This tool converts a supported code into a batch file that can be
:: executed without explicit invoking the executable engine. The script
:: creates new file and places it under the same directory as the original
:: one with the same name, replacing the original extension with ".bat".
:: The content of the new file consists of the original file and the
:: special header that being the "polyglot" and having some tricks to be a
:: valid code in batch file and the wrapped code at the same time.
::
:: FEATURES
:: It does comment on "Option Explicit" in VBScript.
:: "<?xml?>" declaration for wsf-files is expected.
:: "Option Explicit" and "<?xml?>" in a single line only are supported.
:: BOM is not supported at all.
::
:: It is possible to select an engine for JavaScript, VBScript and WSF via
:: the command line options /E. If it is not pointed especially, CSCRIPT
:: is used as the default engine for all JavaScript, VBScript and WSF
:: files. Another valid engine is WSCRIPT. Additionally for JavaScript
:: files it is possible to set another engine such as NodeJS, Rhino etc.
:: The predefined option /E DEFAULT resets any previously set engines to
:: the default value.
::
:: SEE ALSO
:: Proceed the following links to learn more the origins
::
:: .js
:: http://forum.script-coding.com/viewtopic.php?pid=79210#p79210
:: http://www.dostips.com/forum/viewtopic.php?p=33879#p33879
:: https://gist.github.com/ildar-shaimordanov/88d7a5544c0eeacaa3bc
::
:: .vbs
:: http://www.dostips.com/forum/viewtopic.php?p=33882#p33882
:: http://www.dostips.com/forum/viewtopic.php?p=32485#p32485
::
:: .pl
:: For details and better support see "pl2bat.bat" from Perl distribution
::
:: .ps1
:: http://blogs.msdn.com/b/jaybaz_ms/archive/2007/04/26/powershell-polyglot.aspx
:: http://stackoverflow.com/a/2611487/3627676
::
:: .hta and .html?
:: http://forum.script-coding.com/viewtopic.php?pid=79322#p79322
::
:: .wsf
:: http://www.dostips.com/forum/viewtopic.php?p=33963#p33963
::
:: COPYRIGHTS
:: Copyright (c) 2014, 2015 Ildar Shaimordanov

@echo off

if "%~1" == "" (
	for %%p in ( powershell.exe ) do if not "%%~$PATH:p" == "" (
		"%%~$PATH:p" -NoProfile -NoLogo -Command "cat '%~f0' | where { $_ -match '^::' } | %% { $_ -replace '::', '' }"
		goto :EOF
	)
	for /f "usebackq tokens=* delims=:" %%s in ( "%~f0" ) do (
		if /i "%%s" == "@echo off" goto :EOF
		echo:%%s
	)
	goto :EOF
)

:cmdize.loop.begin
if "%~1" == "" goto :cmdize.loop.end

if /i "%~1" == "/e" (
	set "CMDIZE_ENGINE="
	if /i not "%~2" == "default" set "CMDIZE_ENGINE=%~2"
	shift
	goto :cmdize.loop.continue
)

if not exist "%~f1" (
	echo:%~n0: File not found: "%~1">&2
	goto :cmdize.loop.continue
)

for %%x in ( .js .vbs .pl .ps1 .hta .htm .html .wsf ) do (
	if /i "%~x1" == "%%~x" (
		call :cmdize%%~x "%~1" >"%~dpn1.bat"
		goto :cmdize.loop.continue
	)
)

echo:%~n0: Unsupported extension: "%~1">&2

:cmdize.loop.continue

shift

goto :cmdize.loop.begin
:cmdize.loop.end

goto :EOF

:: Convert the javascript file.
:: The environment variable %CMDIZE_ENGINE% allows to declare another
:: engine (cscript, wscript, node etc).
:: The default value is cscript.
:cmdize.js
if not defined CMDIZE_ENGINE set "CMDIZE_ENGINE=cscript"
set "CMDIZE_ENGINE_OPTS="
for %%e in ( "%CMDIZE_ENGINE%" ) do (
	if /i "%%~ne" == "cscript" set "CMDIZE_ENGINE_OPTS=//nologo //e:javascript"
	if /i "%%~ne" == "wscript" set "CMDIZE_ENGINE_OPTS=//nologo //e:javascript"
)

echo:0^</*! ::
echo:@echo off
echo:%CMDIZE_ENGINE% %CMDIZE_ENGINE_OPTS% "%%~f0" %%*
echo:goto :EOF */0;
type "%~f1"
goto :EOF

:: Convert the vbscript file.
:: The environment variable %CMDIZE_ENGINE% allows to declare another
:: engine (cscript or wscript).
:: The default value is cscript.
:cmdize.vbs.h
set /p "=::'" <nul
type "%TEMP%\%~n0.$$"
echo:%*
goto :EOF

:cmdize.vbs
if not defined CMDIZE_ENGINE set "CMDIZE_ENGINE=cscript"

copy /y nul + nul /a "%TEMP%\%~n0.$$" /a 1>nul

call :cmdize.vbs.h @echo off
call :cmdize.vbs.h %CMDIZE_ENGINE% //nologo //e:vbscript "%%%%~f0" %%%%*
call :cmdize.vbs.h goto :EOF

del /q "%TEMP%\%~n0.$$"
rem type "%~f1"
for /f "tokens=1,* delims=]" %%r in ( ' call "%windir%\System32\find.exe" /n /v "" ^<"%~f1" ' ) do (
	rem Filtering and commenting "Option Explicit".
	rem This ugly code tries as much as possible to recognize and
	rem comment this directive. It fails if "Option" and "Explicit"
	rem are located on two neighbor lines, consecutively, one by one.
	rem But it is too hard to imagine that there is someone who
	rem practices such a strange coding style.
	for /f "usebackq tokens=1,2" %%a in ( '%%s' ) do if /i "%%~a" == "Option" for /f "usebackq tokens=1,* delims=:'" %%i in ( 'x%%b' ) do if /i "%%~i" == "xExplicit" (
		echo:%~n0: Commenting Option Explicit in "%~1">&2
		echo:rem To prevent compilation error due to embedding into a batch file,
		echo:rem the following line was commented automatically.
		set /p "=rem " <nul
	)
	echo:%%s
)
goto :EOF

:: Convert the perl file.
:cmdize.pl
if /i "%CMDIZE_ENGINE%" == "cmd" (
	echo:@echo off
	echo:perl -x -S "%%~dpn0.pl" %%*
	goto :EOF
)

echo:@rem = '--*-Perl-*--
echo:@echo off
echo:perl -x -S "%%~f0" %%*
echo:goto :EOF
echo:@rem ';
echo:#!perl
type "%~f1"
goto :EOF

:: Convert the powershell file.
:cmdize.ps1
echo:^<# :
echo:@echo off
echo:setlocal
echo:set "POWERSHELL_BAT_ARGS=%%*"
echo:if defined POWERSHELL_BAT_ARGS set "POWERSHELL_BAT_ARGS=%%POWERSHELL_BAT_ARGS:"=\"%%"
echo:endlocal ^& powershell -NoLogo -NoProfile -Command "$_ = $input; Invoke-Expression $( '$input = $_; $_ = \"\"; $args = @( &{ $args } %%POWERSHELL_BAT_ARGS%% );' + [String]::Join( [char]10, $( Get-Content \"%%~f0\" ) ) )"
echo:rem endlocal ^& powershell -NoLogo -NoProfile -Command "$input | &{ [ScriptBlock]::Create( ( Get-Content \"%%~f0\" ) -join [char]10 ).Invoke( @( &{ $args } %%POWERSHELL_BAT_ARGS%% ) ) }"
echo:goto :EOF
echo:#^>
type "%~f1"
goto :EOF

:: Convert the html file.
:: Supportable file extensions are .hta, .htm and .html.
:cmdize.hta
:cmdize.htm
:cmdize.html
echo:^<!-- :
echo:@echo off
echo:start "" mshta "%%~f0" %%*
echo:goto :EOF
echo:--^>
type "%~f1"
goto :EOF

:: Convert the wsf file.
:: The environment variable %CMDIZE_ENGINE% allows to declare another
:: engine (cscript or wscript).
:: The default value is cscript.
:cmdize.wsf
if not defined CMDIZE_ENGINE set "CMDIZE_ENGINE=cscript"

for /f "usebackq tokens=1,2,* delims=?" %%a in ( "%~f1" ) do for /f "tokens=1,*" %%d in ( "%%b" ) do (
	rem We use this code to transform the "<?xml?>" declaration
	rem located at the very beginning of the file to the "polyglot"
	rem form to do it acceptable by the batch file.
	echo:%%a?%%d :
	echo:: %%e ?^>^<!--
	echo:@echo off
	echo:%CMDIZE_ENGINE% //nologo "%%~f0?.wsf" %%*
	echo:goto :EOF
	echo:: --%%c
	more +1 <"%~f1"
	goto :EOF
)
goto :EOF

rem EOF

enable cmdize to create the batch wrapper over perl script


REM Change back to current directory
pushd %~dp0

SET PRO_DIR=C:\Program Files\ArcGIS\Pro
IF NOT EXIST "%PRO_DIR%" SET PRO_DIR=%LOCALAPPDATA%\Programs\ArcGIS\Pro

IF EXIST "%PRO_DIR%" goto pro_exists_ok

echo Can't find Pro install at: %PRO_DIR% - can't continue
pause
goto :EOF

:pro_exists_ok

SET DictionaryRenderer=mil2525b2
IF NOT EXIST %DictionaryRenderer% goto folder_error
xcopy /v /y /s %DictionaryRenderer% "%PRO_DIR%\Resources\Dictionaries"

echo off
echo ********************************
echo * ArcGIS Pro Dictionary Added: %DictionaryRenderer%
echo ********************************
pause
goto :EOF

:folder_error

echo off
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo ! FAILED:
echo ! Could not find Folder: %DictionaryRenderer%
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
pause

REM Change back to current directory
pushd %~dp0

SET PRO_DIR=C:\Program Files\ArcGIS\Pro
IF NOT EXIST "%PRO_DIR%" SET PRO_DIR=%LOCALAPPDATA%\Programs\ArcGIS\Pro

IF EXIST "%PRO_DIR%" goto pro_exists_ok

echo Can't find Pro install at: %PRO_DIR% - can't continue
pause
goto :EOF

:pro_exists_ok

SET DictionaryRenderer=mil2525b2
IF NOT EXIST %DictionaryRenderer% goto folder_error

REM Copy to Pro Install
mkdir "%PRO_DIR%\Resources\Dictionaries\%DictionaryRenderer%"
xcopy /v /y /s %DictionaryRenderer% "%PRO_DIR%\Resources\Dictionaries\%DictionaryRenderer%"

echo off
echo ********************************
echo * ArcGIS Pro Dictionary Added: %DictionaryRenderer%
echo ********************************
pause
goto :EOF

:folder_error

echo off
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo ! FAILED:
echo ! Could not find Folder: %DictionaryRenderer%
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
pause

Fix script

Fix script


ECHO OFF

ECHO.
ECHO ----------------------------------------
ECHO copy file to converter
ECHO ----------------------------------------

mkdir "%~dp0\App_Data"
mkdir "%~dp0\FileConverter\Bin"
mkdir "%~dp0\FileConverter\Bin\HtmlFileInternal"

cd /D "%~dp0\FileConverter\Bin" || goto ERROR
copy "..\..\..\core\build\bin\windows\icudt.dll" "."
copy "..\..\..\core\build\bin\icu\win_32\icudt55.dll" "."
copy "..\..\..\core\build\bin\icu\win_32\icuuc55.dll" "."
copy "..\..\..\core\build\lib\DoctRenderer.config" "."
copy "..\..\..\core\build\lib\win_32\doctrenderer.dll" "."
copy "..\..\..\core\build\lib\win_32\HtmlRenderer.dll" "."
copy "..\..\..\core\build\lib\win_32\DjVuFile.dll" "."
copy "..\..\..\core\build\lib\win_32\XpsFile.dll" "."
copy "..\..\..\core\build\lib\win_32\PdfReader.dll" "."
copy "..\..\..\core\build\lib\win_32\PdfWriter.dll" "."
copy "..\..\..\core\build\lib\win_32\HtmlFile.dll" "."
copy "..\..\..\core\build\lib\win_32\UnicodeConverter.dll" "."
copy "..\..\..\core\build\lib\win_32\HtmlFileInternal.exe" ".\HtmlFileInternal"
xcopy /s/h/e/k/c/y/q "..\..\..\core\build\cef\win_32" ".\HtmlFileInternal"
copy "..\..\..\core\build\bin\windows\x2t32.exe" "."

"..\..\..\core\build\bin\AllFontsGen\windows_32.exe" "%windir%\Fonts" "%~dp0\..\sdkjs\common\AllFonts.js" "%~dp0\..\sdkjs\common\Images" "%~dp0\FileConverter\Bin\font_selection.bin"

ECHO.
ECHO ----------------------------------------
ECHO Start build skd-all.js
ECHO ----------------------------------------
CD /D %~dp0\..\sdkjs\build
call npm install -g grunt-cli
call npm install
call grunt --src="./configs" --level=WHITESPACE_ONLY --nomap=true --formatting=PRETTY_PRINT

ECHO.
ECHO ----------------------------------------
ECHO Install node.js modules
ECHO ----------------------------------------

CD /D %~dp0\DocService || goto ERROR
call npm install

cd /D ..\Common || goto ERROR
call npm install

cd /D ..\FileConverter || goto ERROR
call npm install

cd /D ..\SpellChecker || goto ERROR
call npm install

SET RUN_DIR=%~dp0
SET NODE_ENV=development-windows
SET NODE_CONFIG_DIR=%RUN_DIR%\Common\config

cd "%RUN_DIR%\DocService\sources"
start /min /b node server.js
start /min /b node gc.js

cd "%RUN_DIR%\FileConverter\sources"
start /min /b node convertermaster.js

:ERROR
:SUCCESS
pause

ECHO OFF

ECHO.
ECHO ----------------------------------------
ECHO copy file to converter
ECHO ----------------------------------------

mkdir "%~dp0\App_Data"
mkdir "%~dp0\FileConverter\Bin"
mkdir "%~dp0\FileConverter\Bin\HtmlFileInternal"

cd /D "%~dp0\FileConverter\Bin" || goto ERROR
copy "..\..\..\core\build\bin\windows\icudt.dll" "."
copy "..\..\..\core\build\bin\icu\win_32\icudt55.dll" "."
copy "..\..\..\core\build\bin\icu\win_32\icuuc55.dll" "."
copy "..\..\..\core\build\lib\DoctRenderer.config" "."
copy "..\..\..\core\build\lib\win_32\doctrenderer.dll" "."
copy "..\..\..\core\build\lib\win_32\HtmlRenderer.dll" "."
copy "..\..\..\core\build\lib\win_32\DjVuFile.dll" "."
copy "..\..\..\core\build\lib\win_32\XpsFile.dll" "."
copy "..\..\..\core\build\lib\win_32\PdfReader.dll" "."
copy "..\..\..\core\build\lib\win_32\PdfWriter.dll" "."
copy "..\..\..\core\build\lib\win_32\HtmlFile.dll" "."
copy "..\..\..\core\build\lib\win_32\UnicodeConverter.dll" "."
copy "..\..\..\core\build\lib\win_32\HtmlFileInternal.exe" ".\HtmlFileInternal"
xcopy /s/h/e/k/c/y/q "..\..\..\core\build\cef\win_32" ".\HtmlFileInternal"
copy "..\..\..\core\build\bin\windows\x2t32.exe" "."

"..\..\..\core\build\bin\AllFontsGen\windows_32.exe" "%windir%\Fonts" "%~dp0\..\sdkjs\common\AllFonts.js" "%~dp0\..\sdkjs\common\Images" "%~dp0\FileConverter\Bin\font_selection.bin"

ECHO.
ECHO ----------------------------------------
ECHO Start build skd-all.js
ECHO ----------------------------------------
CD /D %~dp0\..\sdkjs\build
call npm install -g grunt-cli
call npm install
call grunt --src="./configs" --level=WHITESPACE_ONLY --formatting=PRETTY_PRINT

ECHO.
ECHO ----------------------------------------
ECHO Install node.js modules
ECHO ----------------------------------------

CD /D %~dp0\DocService || goto ERROR
call npm install

cd /D ..\Common || goto ERROR
call npm install

cd /D ..\FileConverter || goto ERROR
call npm install

cd /D ..\SpellChecker || goto ERROR
call npm install

SET RUN_DIR=%~dp0
SET NODE_ENV=development-windows
SET NODE_CONFIG_DIR=%RUN_DIR%\Common\config

cd "%RUN_DIR%\DocService\sources"
start /min /b node server.js
start /min /b node gc.js

cd "%RUN_DIR%\FileConverter\sources"
start /min /b node convertermaster.js

:ERROR
:SUCCESS
pause

delete nomap

delete nomap


@echo off
FOR /F %%A IN (app.env) DO set %%A
if not exist data mkdir data
start cmd /k mongod --dbpath "data"
IF /I "%1"=="" GOTO DEFAULT
IF /I "%1"=="-p" GOTO PROD
IF /I "%1"=="-d" GOTO DEV
@echo on
:DEFAULT
GOTO DEV
:PROD
echo "Production mode"
SET NODE_ENV=production
start cmd /k mongo ds037508.mongolab.com:37508/heroku_app23982462 -u %DbUser% -p %DbPass%
nodemon app.js
:DEV
SET NODE_ENV=development
start cmd /k mongo cache
nodemon app.js

@echo off
FOR /F %%A IN (app.env) DO set %%A
if not exist data mkdir data
start cmd /k mongod --dbpath "data"
IF /I "%1"=="" GOTO DEFAULT
IF /I "%1"=="-p" GOTO PROD
IF /I "%1"=="-d" GOTO DEV
@echo on
:DEFAULT
GOTO DEV
:PROD
echo "Production mode"
SET NODE_ENV=production
start cmd /k mongo ds037508.mongolab.com:37508/heroku_app23982462 -u %DbUser% -p %DbPass%
nodemon server.js
:DEV
SET NODE_ENV=development
start cmd /k mongo cache
nodemon server.js

make run.bat run server.js instead of app.js


@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

sphinx-apidoc -e -o modules ../cea

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=CityEnergyAnalyst

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd

@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=CityEnergyAnalyst

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd

Revert "1263 change to docs make.bat"

Revert "1263 change to docs make.bat"

This reverts commit 6a463d78657b73c14436738eb32a330fac9ddfc3.


"%PYTHON%" setup.py install
if errorlevel 1 exit 1

:: Add more build steps here, if they are necessary.

:: See
:: http://docs.continuum.io/conda/build.html
:: for a list of environment variables that are set during the build process.

Update bld.bat

Update bld.bat


Add buildbot test script.

Add buildbot test script.


@echo on

:: Remove entry with sh.exe from PATH to fix error with MinGW toolchain
:: (For MinGW make to work correctly sh.exe must NOT be in your path)
:: http://stackoverflow.com/a/3870338/2288008
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%

IF "%PLATFORM%"=="x86" (
    set MINGW_PATH=C:\MinGW\bin
) ELSE (
    set MINGW_PATH=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin
)
set PATH=%MINGW_PATH%;%PATH%

:: Activate test environment anaconda

IF "%PLATFORM%"=="x86" (
	set MINICONDA_PATH=%MINICONDA%
) ELSE (
	set MINICONDA_PATH=%MINICONDA%-%PLATFORM%
)
set PATH=%MINICONDA_PATH%;%MINICONDA_PATH%\\Scripts;%PATH%

conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
conda install conda-build anaconda-client
conda create -q -n test-environment python=%PYTHON_VERSION% numpy scipy pytest future
conda install -c conda-forge twine
:: N.B. Need to run with call otherwise the script hangs
call activate test-environment

@echo off

@echo on

:: Remove entry with sh.exe from PATH to fix error with MinGW toolchain
:: (For MinGW make to work correctly sh.exe must NOT be in your path)
:: http://stackoverflow.com/a/3870338/2288008
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%

IF "%PLATFORM%"=="x86" (
    set MINGW_PATH=C:\MinGW\bin
) ELSE (
    :: Install 64bit MinGW from chocolatey
    choco install -y mingw
    set MINGW_PATH=C:\Tools\mingw64\bin
)
set PATH=%MINGW_PATH%;%PATH%

:: Activate test environment anaconda

IF "%PLATFORM%"=="x86" (
	set MINICONDA_PATH=%MINICONDA%
) ELSE (
	set MINICONDA_PATH=%MINICONDA%-%PLATFORM%
)
set PATH=%MINICONDA_PATH%;%MINICONDA_PATH%\\Scripts;%PATH%

conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
conda install conda-build anaconda-client
conda create -q -n test-environment python=%PYTHON_VERSION% numpy scipy pytest future
conda install -c conda-forge twine
:: N.B. Need to run with call otherwise the script hangs
call activate test-environment

@echo off

Install mingw-w64 from chocolatey

Install mingw-w64 from chocolatey


@REM This script is run automaticaly by the MSBuild framework specified by Local.testsettings
@ECHO on

SET CMDHOME=%~dp0.
SET DEFAULT_FILE="%CMDHOME%\..\..\..\Test\OrleansTestStorageKey.txt"

@echo ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH is %ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH% >> SetupTestScriptOutput.txt
@echo CMDHOME is %CMDHOME% >> SetupTestScriptOutput.txt
@echo DEFAULT_FILE is %DEFAULT_FILE% >> SetupTestScriptOutput.txt

if not exist %DEFAULT_FILE% (
@echo DEFAULT_FILE %DEFAULT_FILE% does not exist!!
) else (
@echo DEFAULT_FILE %DEFAULT_FILE% does exist!!
)

echo "-----------------------------------------------" >> SetupTestScriptOutput.txt
echo "-----------------------------------------------" >> SetupTestScriptOutput.txt

if "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%" == "" (

@echo ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH env var is not set. Taking %DEFAULT_FILE%. >> SetupTestScriptOutput.txt
copy /y %DEFAULT_FILE% .

) else if not exist "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt" (

@echo %ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt does not exist. Taking %DEFAULT_FILE%. >> SetupTestScriptOutput.txt
copy /y %DEFAULT_FILE% .

) else (

@echo Found "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt" and taking it.
copy /y "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt"  . >> SetupTestScriptOutput.txt

)

echo "-----------------------------------------------" >> SetupTestScriptOutput.txt
echo "-----------------------------------------------" >> SetupTestScriptOutput.txt

set >> SetupTestScriptOutput.txt

@REM This script is run automaticaly by the MSBuild framework specified by Local.testsettings
@ECHO on

SET CMDHOME=%~dp0.

if exist "%CMDHOME%\..\..\..\Test" (
  SET DEFAULT_FILE="%CMDHOME%\..\..\..\Test\OrleansTestStorageKey.txt"
) else (
  SET DEFAULT_FILE="%CMDHOME%\..\..\src\Test\OrleansTestStorageKey.txt"
)

@echo ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH is %ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH% >> SetupTestScriptOutput.txt
@echo CMDHOME is %CMDHOME% >> SetupTestScriptOutput.txt
@echo DEFAULT_FILE is %DEFAULT_FILE% >> SetupTestScriptOutput.txt

if not exist %DEFAULT_FILE% (
@echo DEFAULT_FILE %DEFAULT_FILE% does not exist!!
) else (
@echo DEFAULT_FILE %DEFAULT_FILE% does exist!!
)

echo "-----------------------------------------------" >> SetupTestScriptOutput.txt
echo "-----------------------------------------------" >> SetupTestScriptOutput.txt

if "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%" == "" (

@echo ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH env var is not set. Taking %DEFAULT_FILE%. >> SetupTestScriptOutput.txt
copy /y %DEFAULT_FILE% .

) else if not exist "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt" (

@echo %ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt does not exist. Taking %DEFAULT_FILE%. >> SetupTestScriptOutput.txt
copy /y %DEFAULT_FILE% .

) else (

@echo Found "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt" and taking it.
copy /y "%ORLEANS_TEST_STORAGE_KEY_FOLDER_PATH%\OrleansTestStorageKey.txt"  . >> SetupTestScriptOutput.txt

)

echo "-----------------------------------------------" >> SetupTestScriptOutput.txt
echo "-----------------------------------------------" >> SetupTestScriptOutput.txt

set >> SetupTestScriptOutput.txt

Check two paths for storage key file to support tests execution from within VS and from VSO.


:: Start with bootstrap
cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
:: IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
CALL .\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

:: Start with bootstrap
ECHO gcc --version
CALL gcc --version
ECHO g++ --version
CALL g++ --version
cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
:: IF errorlevel 1 exit 1
ECHO .\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
CALL .\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


@echo off

goto entry

:usage
  echo usage: bolt build [-c^|--config CONFIG_JS] [-o^|--output OUTPUT_DIR] [-s^|--src-dir SRC_DIR]
  echo                   [-i^|--inline] [-n^|--invoke-main MAIN_MODULE] [-r^|--register]
  echo                   [-m^|--modules] [-e^|--entry-points FILE ...] [-g^|--entry-group NAME FILE ...]
  echo.
  echo options:
  echo   -c^|--config CONFIG_JS         override bolt configuration file
  echo                                    default: config/bolt/prod.js
  echo   -o^|--output OUTPUT_DIR         override output directory, note this is different
  echo                                  to the jsc compile directory, the compiled output,
  echo                                  will be located at $OUTPUT_DIR/compile
  echo                                    default: scratch/main/js
  echo   -s^|--src-dir SRC_DIR           override source directory
  echo                                    default: src/main/js
  echo   -i^|--inline                    enable generation of inline scripts (only produces output
  echo                                  in conjunction with -e or -g).
  echo   -n^|--invoke-main MAIN_MODULE   specify main module of inline scripts.
  echo   -r^|--register                  register modules in global namespace for inline scripts,
  echo                                  this will default to true unless -n is specified.
  echo   -m^|--modules                   enable generation of flat module files.
  echo   -e^|--entry-points FILE ...     specify a set of entry points, a compiled output
  echo                                  will be generated for each entry point. Multiple
  echo                                  -e flags may be specified.
  echo   -g^|--entry-group NAME FILE ... specify an entry group, a single compiled output
  echo                                  will be generated with NAME for each entry-group.
  echo                                  Multiple -g flags may be specified.
  echo.
  echo example:
  echo   Produce a bolt build for a top level application. A compiled file will be
  echo   generated for each Main module in this example.
  echo.
  echo     bolt build -e src/main/js/**/*Main.js
  echo.
  echo.
  echo   Produce a bolt build for a top level library. A self contained script registering
  echo   all modules in their namespace will be produced.
  echo.
  echo     bolt build -i -g example src/main/js/**/api/*.js
  echo.
  echo.
  echo   Produce a bolt build for a general purpose library, in this build we only want
  echo   modules to be produced, no compiled output.
  echo.
  echo     bolt build -m src/main/js

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:is_dir
  setlocal
  set olddir=%CD%
  cd /D "%~1" 2>NUL
  set err=%errorlevel%
  cd /D "%olddir%"
  exit /b %err%

:entry

if "%help_mode%"=="true" call :usage && exit /b 0

set count_targets=0
set count_entry_point=0
set count_entry_group_name=0

:parse_flags
  set flag=%~1
  if not "%flag:~0,1%"=="-" goto done_parse_flags
  shift

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="-o" goto parse_output
  if "%flag%"=="--output" goto parse_output
  if "%flag%"=="-s" goto parse_src
  if "%flag%"=="--src-dir" goto parse_src
  if "%flag%"=="-n" goto parse_invoke
  if "%flag%"=="--invoke-main" goto parse_invoke
  if "%flag%"=="-r" goto parse_register
  if "%flag%"=="--register" goto parse_register
  if "%flag%"=="-i" goto parse_inline
  if "%flag%"=="--inline" goto parse_inline
  if "%flag%"=="-m" goto parse_modules
  if "%flag%"=="--modules" goto parse_modules
  if "%flag%"=="-e" goto parse_points
  if "%flag%"=="--entry-points" goto parse_points
  if "%flag%"=="-g" goto parse_group
  if "%flag%"=="--entry-group" goto parse_group
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

  :parse_config
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set config_js=%~1
    shift
  goto parse_flags

  :parse_output
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set output_dir=%~1
    shift
  goto parse_flags

  :parse_src
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set src_dir=%~1
    shift
  goto parse_flags

  :parse_invoke
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set invoke_main_flag=-n "%~1"
    shift
  goto parse_flags

  :parse_register
    set register_modules_flag=-r
  goto parse_flags

  :parse_inline
    set generate_inline=true
  goto parse_flags

  :parse_modules
    set generate_modules=true
  goto parse_flags

  :parse_points
    :point_loop
      set entry=%~1
      if "%entry%"=="" goto end_point_loop
      if "%entry:~0,1%"=="-" goto end_point_loop
      shift

      if not exist "%entry%" echo specified file for entry point not found [%entry%] && goto fail
      call :is_dir "%entry%"
      if %errorlevel%==0 echo specified file for entry point not found [%entry%] && goto fail

      set entry_point_%count_entry_point%=%entry%
      set /a count_entry_point=%count_entry_point% + 1
    goto point_loop
    :end_point_loop
  goto parse_flags

  :parse_group
    if "%~2"=="" echo %flag% requires two arguments to be specified && goto fail_usage
    set name=%~1
    shift

    echo.%name%| findstr /C:"/" >NUL 2>&1 && echo entry group name must not contain special characters >&2 && goto fail

    set entry_group_name_%count_entry_group_name%=%name%
    set /a count_entry_group_name=%count_entry_group_name% + 1

    set safe_name=%name:-=_%
    set /a count_entry_groups_%safe_name%=0

    :group_loop
      set file=%~1
      if "%file%"=="" goto end_group_loop
      if "%file:~0,1%"=="-" goto end_group_loop
      shift

      if not exist "%file%" echo specified file for entry group not found [%file%] && goto fail
      call :is_dir "%file%"
      if %errorlevel%==0 echo specified file for entry group not found [%file%] && goto fail

      set count=!count_entry_groups_%safe_name%!
      set entry_groups_%safe_name%_%count%=%file%
      set /a count_entry_groups_%safe_name%=%count% + 1
    goto group_loop
    :end_group_loop
  goto parse_flags

:done_parse_flags

if "%config_js%"=="" set config_js=config/bolt/prod.js
if "%output_dir%"=="" set output_dir=scratch/main/js
if "%src_dir%"=="" set src_dir=src/main/js
if "%generate_inline%"=="" set generate_inline=false
if "%generate_modules%"=="" set generate_modules=false

goto dispatch

:bolt_inline
  echo bolt_inline unimplemented.
  exit /b 0

:bolt_point
  mkdir "%output_dir%/compile" 2>NUL

  set /a num=%count_entry_point% - 1
  for /L %%i in (0,1,%num%) do (
    rem iterate through the array
    set file=!entry_point_%%i!
    for /F "usebackq delims=" %%j in (`""%base%jsc" identify "!file!""`) do set name=%%j
    set target=!output_dir!\compile\!name!.js

    rem push onto the targets array so things can be linked later
    set targets_!count_targets!=!target!
    set /a count_targets=!count_targets! + 1

    call "!base!jsc.bat" compile -c "%config_js%" "!file!" "!target!" || exit /b !errorlevel!

    if "%generate_inline%"=="true" call :bolt_inline "!target!" "!name!"
  )
  exit /b 0

:bolt_group
  echo bolt_group unimplemented.
  exit /b 0

:bolt_link
  echo bolt_link unimplemented.
  exit /b 0

:bolt_modules
  mkdir "%output_dir%/module" 2>NUL
  set olddir=%CD%
  cd /D "%output_dir%/module"
  for /F "usebackq delims=" %%i in (`cd`) do set module_dir=%%i
  cd /D "%olddir%"
  cd /D "%src_dir%"
  for /F "usebackq delims=" %%m in (`glob **\*.js`) do (set module=%%m) && copy "%%m" "%module_dir%\!module:\=.!" >NUL
  cd /D "%olddir%"
  exit /b 0

:dispatch

if %count_entry_point% GTR 0 call :bolt_point || exit /b %errorlevel%
if %count_entry_group_name% GTR 0 call :bolt_group || exit /b %errorlevel%
if %count_targets% GTR 0 call :bolt_link || exit /b %errorlevel%
if "%generate_modules%"=="true" call :bolt_modules || exit /b %errorlevel%

exit /b 0

@echo off

goto entry

:usage
  echo usage: bolt build [-c^|--config CONFIG_JS] [-o^|--output OUTPUT_DIR] [-s^|--src-dir SRC_DIR]
  echo                   [-i^|--inline] [-n^|--invoke-main MAIN_MODULE] [-r^|--register]
  echo                   [-m^|--modules] [-e^|--entry-points FILE ...] [-g^|--entry-group NAME FILE ...]
  echo.
  echo options:
  echo   -c^|--config CONFIG_JS         override bolt configuration file
  echo                                    default: config/bolt/prod.js
  echo   -o^|--output OUTPUT_DIR         override output directory, note this is different
  echo                                  to the jsc compile directory, the compiled output,
  echo                                  will be located at $OUTPUT_DIR/compile
  echo                                    default: scratch/main/js
  echo   -s^|--src-dir SRC_DIR           override source directory
  echo                                    default: src/main/js
  echo   -i^|--inline                    enable generation of inline scripts (only produces output
  echo                                  in conjunction with -e or -g).
  echo   -n^|--invoke-main MAIN_MODULE   specify main module of inline scripts.
  echo   -r^|--register                  register modules in global namespace for inline scripts,
  echo                                  this will default to true unless -n is specified.
  echo   -m^|--modules                   enable generation of flat module files.
  echo   -e^|--entry-points FILE ...     specify a set of entry points, a compiled output
  echo                                  will be generated for each entry point. Multiple
  echo                                  -e flags may be specified.
  echo   -g^|--entry-group NAME FILE ... specify an entry group, a single compiled output
  echo                                  will be generated with NAME for each entry-group.
  echo                                  Multiple -g flags may be specified.
  echo.
  echo example:
  echo   Produce a bolt build for a top level application. A compiled file will be
  echo   generated for each Main module in this example.
  echo.
  echo     bolt build -e src/main/js/**/*Main.js
  echo.
  echo.
  echo   Produce a bolt build for a top level library. A self contained script registering
  echo   all modules in their namespace will be produced.
  echo.
  echo     bolt build -i -g example src/main/js/**/api/*.js
  echo.
  echo.
  echo   Produce a bolt build for a general purpose library, in this build we only want
  echo   modules to be produced, no compiled output.
  echo.
  echo     bolt build -m src/main/js

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:is_dir
  setlocal
  set olddir=%CD%
  cd /D "%~1" 2>NUL
  set err=%errorlevel%
  cd /D "%olddir%"
  exit /b %err%

:entry

if "%help_mode%"=="true" call :usage && exit /b 0

set count_targets=0
set count_entry_point=0
set count_entry_group_name=0

:parse_flags
  set flag=%~1
  if not "%flag:~0,1%"=="-" goto done_parse_flags
  shift

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="-o" goto parse_output
  if "%flag%"=="--output" goto parse_output
  if "%flag%"=="-s" goto parse_src
  if "%flag%"=="--src-dir" goto parse_src
  if "%flag%"=="-n" goto parse_invoke
  if "%flag%"=="--invoke-main" goto parse_invoke
  if "%flag%"=="-r" goto parse_register
  if "%flag%"=="--register" goto parse_register
  if "%flag%"=="-i" goto parse_inline
  if "%flag%"=="--inline" goto parse_inline
  if "%flag%"=="-m" goto parse_modules
  if "%flag%"=="--modules" goto parse_modules
  if "%flag%"=="-e" goto parse_points
  if "%flag%"=="--entry-points" goto parse_points
  if "%flag%"=="-g" goto parse_group
  if "%flag%"=="--entry-group" goto parse_group
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

  :parse_config
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set config_js=%~1
    shift
  goto parse_flags

  :parse_output
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set output_dir=%~1
    shift
  goto parse_flags

  :parse_src
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set src_dir=%~1
    shift
  goto parse_flags

  :parse_invoke
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set invoke_main_flag=-n "%~1"
    shift
  goto parse_flags

  :parse_register
    set register_modules_flag=-r
  goto parse_flags

  :parse_inline
    set generate_inline=true
  goto parse_flags

  :parse_modules
    set generate_modules=true
  goto parse_flags

  :parse_points
    :point_loop
      set entry=%~1
      if "%entry%"=="" goto end_point_loop
      if "%entry:~0,1%"=="-" goto end_point_loop
      shift

      if not exist "%entry%" echo specified file for entry point not found [%entry%] && goto fail
      call :is_dir "%entry%"
      if %errorlevel%==0 echo specified file for entry point not found [%entry%] && goto fail

      set entry_point_%count_entry_point%=%entry%
      set /a count_entry_point=%count_entry_point% + 1
    goto point_loop
    :end_point_loop
  goto parse_flags

  :parse_group
    if "%~2"=="" echo %flag% requires two arguments to be specified && goto fail_usage
    set name=%~1
    shift

    echo.%name%| findstr /C:"/" >NUL 2>&1 && echo entry group name must not contain special characters >&2 && goto fail

    set entry_group_name_%count_entry_group_name%=%name%
    set /a count_entry_group_name=%count_entry_group_name% + 1

    set safe_name=%name:-=_%
    set /a count_entry_groups_%safe_name%=0

    :group_loop
      set file=%~1
      if "%file%"=="" goto end_group_loop
      if "%file:~0,1%"=="-" goto end_group_loop
      shift

      if not exist "%file%" echo specified file for entry group not found [%file%] && goto fail
      call :is_dir "%file%"
      if %errorlevel%==0 echo specified file for entry group not found [%file%] && goto fail

      set count=!count_entry_groups_%safe_name%!
      set entry_groups_%safe_name%_%count%=%file%
      set /a count_entry_groups_%safe_name%=%count% + 1
    goto group_loop
    :end_group_loop
  goto parse_flags

:done_parse_flags

if "%config_js%"=="" set config_js=config/bolt/prod.js
if "%output_dir%"=="" set output_dir=scratch/main/js
if "%src_dir%"=="" set src_dir=src/main/js
if "%generate_inline%"=="" set generate_inline=false
if "%generate_modules%"=="" set generate_modules=false

goto dispatch

:bolt_inline
  set target=%~1
  set name=%~2
  mkdir "%output_dir%/inline" 2> NUL
  call "%base%jsc.bat" inline -c "%config_js%" %invoke_main_flag% %register_modules_flag% "%target%" "%output_dir%/inline/%name%.js" || exit /b %errorlevel%
  exit /b 0

:bolt_point
  mkdir "%output_dir%/compile" 2>NUL

  set /a num=%count_entry_point% - 1
  for /L %%i in (0,1,%num%) do (
    rem iterate through the array
    set file=!entry_point_%%i!
    for /F "usebackq delims=" %%j in (`""%base%jsc" identify "!file!""`) do set name=%%j
    set target=!output_dir!\compile\!name!.js

    rem push onto the targets array so things can be linked later
    set targets_!count_targets!=!target!
    set /a count_targets=!count_targets! + 1

    call "!base!jsc.bat" compile -c "%config_js%" "!file!" "!target!" || exit /b !errorlevel!

    if "%generate_inline%"=="true" call :bolt_inline "!target!" "!name!"
  )
  exit /b 0

:bolt_group
  echo bolt_group unimplemented.
  exit /b 0

:bolt_link
  echo bolt_link unimplemented.
  exit /b 0

:bolt_modules
  mkdir "%output_dir%/module" 2>NUL
  set olddir=%CD%
  cd /D "%output_dir%/module"
  for /F "usebackq delims=" %%i in (`cd`) do set module_dir=%%i
  cd /D "%olddir%"
  cd /D "%src_dir%"
  for /F "usebackq delims=" %%m in (`glob **\*.js`) do (set module=%%m) && copy "%%m" "%module_dir%\!module:\=.!" >NUL
  cd /D "%olddir%"
  exit /b 0

:dispatch

if %count_entry_point% GTR 0 call :bolt_point || exit /b %errorlevel%
if %count_entry_group_name% GTR 0 call :bolt_group || exit /b %errorlevel%
if %count_targets% GTR 0 call :bolt_link || exit /b %errorlevel%
if "%generate_modules%"=="true" call :bolt_modules || exit /b %errorlevel%

exit /b 0

Implement bolt build inline

Implement bolt build inline


@echo building dot net core packages
dotnet build ../../DotVVM.CommandLine
dotnet build ../../DotVVM.Core
dotnet build ../../DotVVM.Framework
dotnet build ../../DotVVM.Framework.Hosting.AspNetCore
dotnet build ../../DotVVM.Framework.Tests.AspCore
dotnet build ../../DotVVM.Framework.Tools.SeleniumGenerator
dotnet build ../../DotVVM.Samples.BasicSamples.AspNetCore
dotnet build ../../DotVVM.Samples.Common

@echo building dot net core packages
dotnet restore ../../DotVVM.CommandLine
dotnet build ../../DotVVM.CommandLine

dotnet restore ../../DotVVM.Core
dotnet build ../../DotVVM.Core

dotnet restore ../../DotVVM.Framework
dotnet build ../../DotVVM.Framework

dotnet restore ../../DotVVM.Framework.Hosting.AspNetCore
dotnet build ../../DotVVM.Framework.Hosting.AspNetCore

dotnet restore ../../DotVVM.Framework.Tests.AspCore
dotnet build ../../DotVVM.Framework.Tests.AspCore

dotnet restore ../../DotVVM.Framework.Tools.SeleniumGenerator
dotnet build ../../DotVVM.Framework.Tools.SeleniumGenerator

dotnet restore ../../DotVVM.Samples.BasicSamples.AspNetCore
dotnet build ../../DotVVM.Samples.BasicSamples.AspNetCore

dotnet restore ../../DotVVM.Samples.Common
dotnet build ../../DotVVM.Samples.Common

build script

build script