@echo off
rem Rime build script for msvc toolchain.
rem 2014-12-30  Chen Gong <chen.sst@gmail.com>

setlocal
set BACK=%CD%

if exist env.bat call env.bat

set OLD_PATH=%PATH%
if defined DEV_PATH set PATH=%OLD_PATH%;%DEV_PATH%
path
echo.

if not defined RIME_ROOT set RIME_ROOT=%CD%
echo RIME_ROOT=%RIME_ROOT%
echo.

echo BOOST_ROOT=%BOOST_ROOT%
echo.

set build=build
set build_boost=0
set build_thirdparty=0
set build_librime=0
set build_shared=ON
set build_test=OFF
set enable_logging=ON

if "%1" == "" set build_librime=1

:parse_cmdline_options
if "%1" == "" goto end_parsing_cmdline_options
if "%1" == "boost" set build_boost=1
if "%1" == "thirdparty" set build_thirdparty=1
if "%1" == "librime" set build_librime=1
if "%1" == "static" (
  set build=build-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=build
  set build_librime=1
  set build_shared=ON
)
if "%1" == "test" (
  set build_librime=1
  set build_test=ON
)
if "%1" == "nologging" (
  set build_librime=1
  set enable_logging=OFF
)
shift
goto parse_cmdline_options
:end_parsing_cmdline_options

rem set CURL=%RIME_ROOT%\thirdparty\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all

set LEVELDB_REPOSITORY=lotem/leveldb

if %build_boost% == 1 (
  cd %BOOST_ROOT%
  if not exist bjam.exe call bootstrap.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static stage --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  rem if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd "%RIME_ROOT%"\thirdparty\src\glog
  msbuild.exe google-glog-vc12.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y src\windows\glog "%RIME_ROOT%"\thirdparty\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building leveldb.
  cd "%RIME_ROOT%"\thirdparty\src\
  echo "checking out 'windows' branch from %LEVELDB_REPOSITORY%"
  git clone -b windows git@github.com:%LEVELDB_REPOSITORY%.git leveldb-windows
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd leveldb-windows
  echo BOOST_ROOT=%BOOST_ROOT%
  msbuild.exe leveldb.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y include\leveldb "%RIME_ROOT%"\thirdparty\include\leveldb\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\leveldb.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd "%RIME_ROOT%"\thirdparty\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  msbuild.exe YAML_CPP.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\yaml-cpp "%RIME_ROOT%"\thirdparty\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building gtest.
  cd "%RIME_ROOT%"\thirdparty\src\gtest
  if not exist build mkdir build
  cd build
  cmake ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  msbuild.exe gtest.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\gtest "%RIME_ROOT%"\thirdparty\include\gtest\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\gtest*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building marisa.
  cd "%RIME_ROOT%"\thirdparty\src\marisa-trie\vs2013
  msbuild.exe vs2013.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\lib\marisa "%RIME_ROOT%"\thirdparty\include\marisa\
  xcopy /Y ..\lib\marisa.h "%RIME_ROOT%"\thirdparty\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libmarisa.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\marisa-*.exe "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building opencc.
  cd "%RIME_ROOT%"\thirdparty\src\opencc
  if not exist build mkdir build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX="" -DBUILD_SHARED_LIBS=OFF
  echo patching src\libopencc.vcxproj for static linking runtime.
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\libopencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc_dict.vcxproj
  msbuild.exe opencc.sln /t:libopencc;opencc;opencc_dict /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  cd ..
  if not exist "%RIME_ROOT%"\thirdparty\include\opencc mkdir "%RIME_ROOT%"\thirdparty\include\opencc
  copy /Y src\*.h* "%RIME_ROOT%"\thirdparty\include\opencc\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\Release\opencc.lib "%RIME_ROOT%"\thirdparty\lib
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\tools\Release\opencc.exe "%RIME_ROOT%"\thirdparty\bin
  copy /Y build\src\tools\Release\opencc_dict.exe "%RIME_ROOT%"\thirdparty\bin
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

set CMAKE_GENERATOR="Visual Studio 12"

set BUILD_DIR=%RIME_ROOT%\%build%
if not exist %BUILD_DIR% mkdir %BUILD_DIR%

set RIME_CMAKE_FLAGS=-DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=%build_shared% -DBUILD_TEST=%build_test% -DENABLE_LOGGING=%enable_logging% -DBOOST_USE_CXX11=ON

cd %BUILD_DIR%
echo cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
call cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
if exist msbuild.log del msbuild.log
msbuild.exe rime.sln /p:Configuration=Release /fl
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo ready.
echo.
goto EXIT

:ERROR
echo.
echo error building la rime.
echo.

:EXIT
set PATH=%OLD_PATH%
cd %RIME_ROOT%
rem pause

@echo off
rem Rime build script for msvc toolchain.
rem 2014-12-30  Chen Gong <chen.sst@gmail.com>

setlocal
set BACK=%CD%

if exist env.bat call env.bat

set OLD_PATH=%PATH%
if defined DEV_PATH set PATH=%OLD_PATH%;%DEV_PATH%
path
echo.

if not defined RIME_ROOT set RIME_ROOT=%CD%
echo RIME_ROOT=%RIME_ROOT%
echo.

echo BOOST_ROOT=%BOOST_ROOT%
echo.

set build=build
set build_boost=0
set build_thirdparty=0
set build_librime=0
set build_shared=ON
set build_test=OFF
set enable_logging=ON

if "%1" == "" set build_librime=1

:parse_cmdline_options
if "%1" == "" goto end_parsing_cmdline_options
if "%1" == "boost" set build_boost=1
if "%1" == "thirdparty" set build_thirdparty=1
if "%1" == "librime" set build_librime=1
if "%1" == "static" (
  set build=build-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=build
  set build_librime=1
  set build_shared=ON
)
if "%1" == "test" (
  set build_librime=1
  set build_test=ON
)
if "%1" == "nologging" (
  set build_librime=1
  set enable_logging=OFF
)
shift
goto parse_cmdline_options
:end_parsing_cmdline_options

set THIRDPARTY="%RIME_ROOT%"\thirdparty

rem set CURL=%THIRDPARTY%\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all

set LEVELDB_REPOSITORY=lotem/leveldb

if %build_boost% == 1 (
  cd %BOOST_ROOT%
  if not exist bjam.exe call bootstrap.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static stage --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  rem if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd %THIRDPARTY%\src\glog
  msbuild.exe google-glog-vc12.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y src\windows\glog %THIRDPARTY%\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll %THIRDPARTY%\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building leveldb.
  cd %THIRDPARTY%\src\
  echo "checking out 'windows' branch from %LEVELDB_REPOSITORY%"
  git clone -b windows git@github.com:%LEVELDB_REPOSITORY%.git leveldb-windows
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd leveldb-windows
  echo BOOST_ROOT=%BOOST_ROOT%
  msbuild.exe leveldb.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y include\leveldb %THIRDPARTY%\include\leveldb\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\leveldb.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd %THIRDPARTY%\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  msbuild.exe YAML_CPP.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\yaml-cpp %THIRDPARTY%\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building gtest.
  cd %THIRDPARTY%\src\gtest
  if not exist build mkdir build
  cd build
  cmake ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  msbuild.exe gtest.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\gtest %THIRDPARTY%\include\gtest\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\gtest*.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building marisa.
  cd %THIRDPARTY%\src\marisa-trie\vs2013
  msbuild.exe vs2013.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\lib\marisa %THIRDPARTY%\include\marisa\
  xcopy /Y ..\lib\marisa.h %THIRDPARTY%\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libmarisa.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\marisa-*.exe %THIRDPARTY%\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building opencc.
  cd %THIRDPARTY%\src\opencc
  if not exist build mkdir build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX="" -DBUILD_SHARED_LIBS=OFF
  echo patching src\libopencc.vcxproj for static linking runtime.
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\libopencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc_dict.vcxproj
  msbuild.exe opencc.sln /t:libopencc;opencc;opencc_dict /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  cd ..
  if not exist %THIRDPARTY%\include\opencc mkdir %THIRDPARTY%\include\opencc
  copy /Y src\*.h* %THIRDPARTY%\include\opencc\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\Release\opencc.lib %THIRDPARTY%\lib
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\tools\Release\opencc.exe %THIRDPARTY%\bin
  copy /Y build\src\tools\Release\opencc_dict.exe %THIRDPARTY%\bin
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

set CMAKE_GENERATOR="Visual Studio 12"

set BUILD_DIR=%RIME_ROOT%\%build%
if not exist %BUILD_DIR% mkdir %BUILD_DIR%

set RIME_CMAKE_FLAGS=-DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=%build_shared% -DBUILD_TEST=%build_test% -DENABLE_LOGGING=%enable_logging% -DBOOST_USE_CXX11=ON

cd %BUILD_DIR%
echo cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
call cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
if exist msbuild.log del msbuild.log
msbuild.exe rime.sln /p:Configuration=Release /fl
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo ready.
echo.
goto EXIT

:ERROR
echo.
echo error building la rime.
echo.

:EXIT
set PATH=%OLD_PATH%
cd %RIME_ROOT%
rem pause

Refactor scripting code.

Refactor scripting code.


@echo off
rem couchapp script for windows

setlocal

%~dp0..\python "%~dp0bin\couchapp" %*
endlocal

@echo off
rem couchapp script for windows

setlocal

%~dp0..\python "%~dp0couchapp" %*
endlocal

Fix wrong couchapp path

Fix wrong couchapp path


@echo off
CLS
goto checkPrivileges

:: Unfortunately, Windows doesn't have a decent built-in way to append a string to the $PATH.
:: setx is convenient, but it 1) truncates paths longer than 1024 characters, and
:: 2) mucks up the user path with the machine-wide path.
:: This function takes care of these problems by calling Environment.Get/SetEnvironmentVariable
:: via PowerShell, which lacks these issues.
:appendToUserPath
set "RUNPS=powershell -NoProfile -ExecutionPolicy Bypass -Command" :: Command to start PowerShell.
set "OLDPATHPS=[Environment]::GetEnvironmentVariable('PATH', 'User')" :: PowerShell command to run to get the old $PATH for the current user.

:: Capture the output of %RUNPS% "%OLDPATHPS%" and set it to OLDPATH
for /f "delims=" %%i in ('%RUNPS% "%OLDPATHPS%"') do (
    set "OLDPATH=%%i"
)

set "NEWPATH=%OLDPATH%;%1"
%RUNPS% "[Environment]::SetEnvironmentVariable('PATH', '%NEWPATH%', 'User')" :: Set the new $PATH
goto :eof

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
echo.
echo **************************************
echo Installing GitHub CLI as Administrator
echo **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:gotPrivileges

setlocal & cd /d %~dp0

set HUB_BIN_PATH="%LOCALAPPDATA%\GitHubCLI\bin"
IF EXIST %HUB_BIN_PATH% GOTO DIRECTORY_EXISTS
mkdir %HUB_BIN_PATH%
set "path=%PATH%;%HUB_BIN_PATH:"=%"
call :apppendToUserPath %HUB_BIN_PATH:"=%
:DIRECTORY_EXISTS

:: Delete any existing programs
2>NUL del /q %HUB_BIN_PATH%\hub*

1>NUL copy .\bin\hub.exe %HUB_BIN_PATH%\hub.exe

echo hub.exe installed successfully. Press any key to exit
pause > NUL

@echo off
CLS
goto checkPrivileges

:: Unfortunately, Windows doesn't have a decent built-in way to append a string to the $PATH.
:: setx is convenient, but it 1) truncates paths longer than 1024 characters, and
:: 2) mucks up the user path with the machine-wide path.
:: This function takes care of these problems by calling Environment.Get/SetEnvironmentVariable
:: via PowerShell, which lacks these issues.
:appendToUserPath
set "RUNPS=powershell -NoProfile -ExecutionPolicy Bypass -Command" :: Command to start PowerShell.
set "OLDPATHPS=[Environment]::GetEnvironmentVariable('PATH', 'User')" :: PowerShell command to run to get the old $PATH for the current user.

:: Capture the output of %RUNPS% "%OLDPATHPS%" and set it to OLDPATH
for /f "delims=" %%i in ('%RUNPS% "%OLDPATHPS%"') do (
    set "OLDPATH=%%i"
)

set "NEWPATH=%OLDPATH%;%1"
:: Set the new $PATH
%RUNPS% "[Environment]::SetEnvironmentVariable('PATH', '%NEWPATH%', 'User')"
goto :eof

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (shift & goto gotPrivileges)
echo.
echo **************************************
echo Installing GitHub CLI as Administrator
echo **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:gotPrivileges

setlocal & cd /d %~dp0

set HUB_BIN_PATH="%LOCALAPPDATA%\GitHubCLI\bin"
IF EXIST %HUB_BIN_PATH% GOTO DIRECTORY_EXISTS
mkdir %HUB_BIN_PATH%
set "path=%PATH%;%HUB_BIN_PATH:"=%"
call :appendToUserPath %HUB_BIN_PATH:"=%
:DIRECTORY_EXISTS

:: Delete any existing programs
2>NUL del /q %HUB_BIN_PATH%\hub*

1>NUL copy .\bin\hub.exe %HUB_BIN_PATH%\hub.exe

echo hub.exe installed successfully. Press any key to exit
pause > NUL

Fix a few syntactic errors after local testing


rd /s /q Client
rd /s /q NodeJS
rd /s /q Azure.NodeJS

..\..\packages\autorest.0.16.0\tools\AutoRest -namespace Microsoft.Bot.Connector -input swagger\ConnectorApi.json -outputDirectory ConnectorAPI -AddCredentials -ClientName ConnectorClient
..\..\packages\autorest.0.16.0\tools\AutoRest -namespace Microsoft.Bot.Connector -input swagger\StateAPI.json -outputDirectory StateApi -AddCredentials -ClientName StateClient

cd ConnectorAPI
..\..\..\rep -r -find:"Microsoft.Bot.Connector.Models" -replace:"Microsoft.Bot.Connector" *.cs
..\..\..\rep -r -find:"using Models;" -replace:"" *.cs
..\..\..\rep -r -find:FromProperty -replace:From *.cs
..\..\..\rep -r -find:fromProperty -replace:from *.cs
cd ..
cd StateAPI
..\..\..\rep -r -find:"Microsoft.Bot.Connector.Models" -replace:"Microsoft.Bot.Connector" *.cs
..\..\..\rep -r -find:"using Models;" -replace:"" *.cs
cd ..
@echo !!!!! Please review ConversationsExtensions.cs and BotStateExtensions.cs for custom throw code
pause

rd /s /q Client
call npm install replace@0.3.0

..\..\packages\autorest.0.16.0\tools\AutoRest -namespace Microsoft.Bot.Connector -input swagger\ConnectorApi.json -outputDirectory ConnectorAPI -AddCredentials -ClientName ConnectorClient
..\..\packages\autorest.0.16.0\tools\AutoRest -namespace Microsoft.Bot.Connector -input swagger\StateAPI.json -outputDirectory StateApi -AddCredentials -ClientName StateClient

cd ConnectorAPI
call ..\node_modules\.bin\replace "Microsoft.Bot.Connector.Models" "Microsoft.Bot.Connector" . -r --include="*.cs"
call ..\node_modules\.bin\replace "using Models;" ""  . -r --include="*.cs"
call ..\node_modules\.bin\replace "FromProperty" "From" . -r --include="*.cs"
call ..\node_modules\.bin\replace "fromProperty" "from" . -r --include="*.cs"
cd ..
cd StateAPI
call ..\node_modules\.bin\replace "Microsoft.Bot.Connector.Models" "Microsoft.Bot.Connector" . -r --include="*.cs"
call ..\node_modules\.bin\replace "using Models;" "" . -r --include="*.cs"
cd ..
@echo !!!!! Please review ConversationsExtensions.cs and BotStateExtensions.cs for custom throw code
pause

Use node.js replace instead of rep

Use node.js replace instead of rep


@ECHO OFF
rem ************* <auto-copyright.pl BEGIN do not edit this line> *************
rem
rem VR Juggler is (C) Copyright 1998-2003 by Iowa State University
rem
rem Original Authors:
rem   Allen Bierbaum, Christopher Just,
rem   Patrick Hartling, Kevin Meinert,
rem   Carolina Cruz-Neira, Albert Baker
rem
rem This library is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Library General Public
rem License as published by the Free Software Foundation; either
rem version 2 of the License, or (at your option) any later version.
rem
rem This library is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rem Library General Public License for more details.
rem
rem You should have received a copy of the GNU Library General Public
rem License along with this library; if not, write to the
rem Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rem Boston, MA 02111-1307, USA.
rem
rem -----------------------------------------------------------------
rem File:          $RCSfile$
rem Date modified: $Date$
rem Version:       $Revision$
rem -----------------------------------------------------------------
rem
rem ************** <auto-copyright.pl END do not edit this line> **************
IF NOT "%VJ_BASE_DIR%" == "" GOTO TEST_VJ_EXIST
ECHO [ERR] VJ_BASE_DIR unset; please set the environment variable VJ_BASE_DIR to
ECHO [ERR] point to your VR Juggler installation directory.  For more information,
ECHO [ERR] please see INSTALL.html
GOTO ERREXIT
:TEST_VJ_EXIST
IF EXIST "%VJ_BASE_DIR%" GOTO TEST_TWEEK_BASE
ECHO [ERR] The VJ_BASE_DIR %VJ_BASE_DIR% does not appear to exist.  Please
ECHO [ERR] check the path and try again.
GOTO ERREXIT
:TEST_TWEEK_BASE
IF NOT "%TWEEK_BASE_DIR%" == "" GOTO TEST_TWEEK_EXIST
ECHO  NOTE: Setting TWEEK_BASE_DIR to "%VJ_BASE_DIR%"
set TWEEK_BASE_DIR=%VJ_BASE_DIR%
:TEST_TWEEK_EXIST
IF EXIST "%TWEEK_BASE_DIR%" GOTO TEST_JCCL_BASE
ECHO [ERR] The TWEEK_BASE_DIR %TWEEK_BASE_DIR% does not appear to exist.  Please
ECHO [ERR] check the path and try again.
GOTO ERREXIT
:TEST_JCCL_BASE
IF NOT "%JCCL_BASE_DIR%" == "" GOTO TEST_JCCL_EXIST
ECHO  NOTE: Setting JCCL_BASE_DIR to "%VJ_BASE_DIR%"
set JCCL_BASE_DIR=%VJ_BASE_DIR%
:TEST_JCCL_EXIST
IF EXIST "%JCCL_BASE_DIR%" GOTO TEST_JCCL_DEF
ECHO [ERR] The JCCL_BASE_DIR %JCCL_BASE_DIR% does not appear to exist.  Please
ECHO [ERR] check the path and try again.
GOTO ERREXIT
:TEST_JCCL_DEF
IF NOT "%JCCL_DEFINITION_PATH%" == "" GOTO RUNJAVA
ECHO  NOTE: Setting JCCL_DEFINITION_PATH to "%VJ_BASE_DIR%\share\vrjuggler\data\definitions"
set JCCL_DEFINITION_PATH=%VJ_BASE_DIR%\share\vrjuggler\data\definitions
:RUNJAVA
java -DTWEEK_BASE_DIR="%TWEEK_BASE_DIR%" -DJCCL_BASE_DIR="%JCCL_BASE_DIR%" -DVJ_BASE_DIR="%VJ_BASE_DIR%" -DJCCL_DEFINITION_PATH="%JCCL_DEFINITION_PATH%" -Djava.security.policy="%TWEEK_BASE_DIR%\share\tweek\java\java.security.policy.txt" -cp "%TWEEK_BASE_DIR%\share\tweek\java\jaxen-core.jar;%TWEEK_BASE_DIR%\share\tweek\java\jaxen-jdom.jar;%TWEEK_BASE_DIR%\share\tweek\java\jdom.jar;%TWEEK_BASE_DIR%\share\tweek\java\saxpath.jar;%TWEEK_BASE_DIR%\share\tweek\java\xalan.jar;%TWEEK_BASE_DIR%\share\tweek\java\xerces.jar;%TWEEK_BASE_DIR%\share\tweek\java\xml-apis.jar;%TWEEK_BASE_DIR%\share\tweek\java\Tweek.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekBeans.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekEvents.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekNet.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekBeanDelivery.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekServices.jar;%TWEEK_BASE_DIR%\share\tweek\java\kunststoff-mod.jar;%TWEEK_BASE_DIR%\share\tweek\java\liquidlnf.jar;%TWEEK_BASE_DIR%\share\tweek\java\metouia.jar;%TWEEK_BASE_DIR%\share\tweek\java\looks.jar" org.vrjuggler.tweek.Tweek --beanpath="%JCCL_BASE_DIR%\share\jccl\beans" --beanpath="%VJ_BASE_DIR%\share\vrjuggler\beans" --defaultbean="Configuration Editor" %*
GOTO DONE
:ERREXIT
ECHO [ERR] VRJConfig exiting due to previous errors.
:DONE

@ECHO OFF
rem ************* <auto-copyright.pl BEGIN do not edit this line> *************
rem
rem VR Juggler is (C) Copyright 1998-2003 by Iowa State University
rem
rem Original Authors:
rem   Allen Bierbaum, Christopher Just,
rem   Patrick Hartling, Kevin Meinert,
rem   Carolina Cruz-Neira, Albert Baker
rem
rem This library is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Library General Public
rem License as published by the Free Software Foundation; either
rem version 2 of the License, or (at your option) any later version.
rem
rem This library is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rem Library General Public License for more details.
rem
rem You should have received a copy of the GNU Library General Public
rem License along with this library; if not, write to the
rem Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rem Boston, MA 02111-1307, USA.
rem
rem -----------------------------------------------------------------
rem File:          $RCSfile$
rem Date modified: $Date$
rem Version:       $Revision$
rem -----------------------------------------------------------------
rem
rem ************** <auto-copyright.pl END do not edit this line> **************
IF NOT "%VJ_BASE_DIR%" == "" GOTO TEST_VJ_EXIST
ECHO [ERR] VJ_BASE_DIR unset; please set the environment variable VJ_BASE_DIR to
ECHO [ERR] point to your VR Juggler installation directory.  For more information,
ECHO [ERR] please see INSTALL.html
GOTO ERREXIT
:TEST_VJ_EXIST
IF EXIST "%VJ_BASE_DIR%" GOTO TEST_TWEEK_BASE
ECHO [ERR] The VJ_BASE_DIR %VJ_BASE_DIR% does not appear to exist.  Please
ECHO [ERR] check the path and try again.
GOTO ERREXIT
:TEST_TWEEK_BASE
IF NOT "%TWEEK_BASE_DIR%" == "" GOTO TEST_TWEEK_EXIST
ECHO  NOTE: Setting TWEEK_BASE_DIR to "%VJ_BASE_DIR%"
set TWEEK_BASE_DIR=%VJ_BASE_DIR%
:TEST_TWEEK_EXIST
IF EXIST "%TWEEK_BASE_DIR%" GOTO TEST_JCCL_BASE
ECHO [ERR] The TWEEK_BASE_DIR %TWEEK_BASE_DIR% does not appear to exist.  Please
ECHO [ERR] check the path and try again.
GOTO ERREXIT
:TEST_JCCL_BASE
IF NOT "%JCCL_BASE_DIR%" == "" GOTO TEST_JCCL_EXIST
ECHO  NOTE: Setting JCCL_BASE_DIR to "%VJ_BASE_DIR%"
set JCCL_BASE_DIR=%VJ_BASE_DIR%
:TEST_JCCL_EXIST
IF EXIST "%JCCL_BASE_DIR%" GOTO TEST_JCCL_DEF
ECHO [ERR] The JCCL_BASE_DIR %JCCL_BASE_DIR% does not appear to exist.  Please
ECHO [ERR] check the path and try again.
GOTO ERREXIT
:TEST_JCCL_DEF
IF NOT "%JCCL_DEFINITION_PATH%" == "" GOTO RUNJAVA
ECHO  NOTE: Setting JCCL_DEFINITION_PATH to "%VJ_BASE_DIR%\share\vrjuggler\data\definitions"
set JCCL_DEFINITION_PATH=%VJ_BASE_DIR%\share\vrjuggler\data\definitions
:RUNJAVA
java -DTWEEK_BASE_DIR="%TWEEK_BASE_DIR%" -DJCCL_BASE_DIR="%JCCL_BASE_DIR%" -DVJ_BASE_DIR="%VJ_BASE_DIR%" -DJCCL_DEFINITION_PATH="%JCCL_DEFINITION_PATH%" -Djava.library.path="%TWEEK_BASE_DIR%\share\tweek\java" -Djava.security.policy="%TWEEK_BASE_DIR%\share\tweek\java\java.security.policy.txt" -cp "%TWEEK_BASE_DIR%\share\tweek\java\jaxen-core.jar;%TWEEK_BASE_DIR%\share\tweek\java\jaxen-jdom.jar;%TWEEK_BASE_DIR%\share\tweek\java\jdom.jar;%TWEEK_BASE_DIR%\share\tweek\java\saxpath.jar;%TWEEK_BASE_DIR%\share\tweek\java\xalan.jar;%TWEEK_BASE_DIR%\share\tweek\java\xerces.jar;%TWEEK_BASE_DIR%\share\tweek\java\xml-apis.jar;%TWEEK_BASE_DIR%\share\tweek\java\Tweek.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekBeans.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekEvents.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekNet.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekBeanDelivery.jar;%TWEEK_BASE_DIR%\share\tweek\java\TweekServices.jar;%TWEEK_BASE_DIR%\share\tweek\java\kunststoff-mod.jar;%TWEEK_BASE_DIR%\share\tweek\java\liquidlnf.jar;%TWEEK_BASE_DIR%\share\tweek\java\metouia.jar;%TWEEK_BASE_DIR%\share\tweek\java\looks.jar" org.vrjuggler.tweek.Tweek --beanpath="%JCCL_BASE_DIR%\share\jccl\beans" --beanpath="%VJ_BASE_DIR%\share\vrjuggler\beans" --defaultbean="Configuration Editor" %*
GOTO DONE
:ERREXIT
ECHO [ERR] VRJConfig exiting due to previous errors.
:DONE

Set java.library.path so that the tweek_jni extension code can be found.

git-svn-id: 769d22dfa2d22aad706b9a451492fb87c0735f19@16077 08b38cba-cd3b-11de-854e-f91c5b6e4272


@echo off

SETLOCAL enabledelayedexpansion

IF DEFINED JAVA_HOME (
  set JAVA=%JAVA_HOME%\bin\java.exe
) ELSE (
  FOR %%I IN (java.exe) DO set JAVA=%%~$PATH:I
)
IF NOT EXIST "%JAVA%" (
  ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
  EXIT /B 1
)

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

TITLE Elasticsearch Plugin Manager ${project.version}

SET path_props=-Des.path.home="%ES_HOME%"
IF DEFINED CONF_DIR (
  SET path_props=!path_props! -Des.path.conf="%CONF_DIR%"
)

SET args=%*
SET HOSTNAME=%COMPUTERNAME%

"%JAVA%" %ES_JAVA_OPTS% !path_props! -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args!

ENDLOCAL

@echo off

SETLOCAL enabledelayedexpansion

IF DEFINED JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) ELSE (
  FOR %%I IN (java.exe) DO set JAVA=%%~$PATH:I
)
IF NOT EXIST %JAVA% (
  ECHO Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME 1>&2
  EXIT /B 1
)

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

TITLE Elasticsearch Plugin Manager ${project.version}

SET path_props=-Des.path.home="%ES_HOME%"
IF DEFINED CONF_DIR (
  SET path_props=!path_props! -Des.path.conf="%CONF_DIR%"
)

SET args=%*
SET HOSTNAME=%COMPUTERNAME%

%JAVA% %ES_JAVA_OPTS% !path_props! -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args!

ENDLOCAL

Fix handling of spaces in plugin script on Windows

A previous fix for handling spaces in the Windows scripts should also be
applied to the plugin script. This commit does that.

Closes #24750


@echo off

:ARGUMENTS_VALIDATION

if /I "%1" == "/help"   (goto :USAGE)
if /I "%1" == "/h"      (goto :USAGE)
if /I "%1" == "/?"      (goto :USAGE)
goto :ARGUMENTS_OK

:USAGE

echo Build and run a subset of test suites
echo.
echo Usage:
echo.
echo appveyor-build.cmd ^<all^|net40^|portable47^|portable7^|portable78^|portable259^|vs^|cambridge_suite^|qa_suite^|smoke^|smoke_only^>
echo.
echo No arguments default to 'smoke' ( build all profiles, run all unit tests, cambridge Smoke, fsharpqa Smoke)
echo.
echo To specify multiple values, separate strings by comma
echo.
echo The example below run portable47, vs and qa:
echo.
echo appveyor-build.cmd portable47,vs,qa_suite
exit /b 1

:ARGUMENTS_OK

set DO_NET40=0
set DO_PORTABLE47=0
set DO_PORTABLE7=0
set DO_PORTABLE78=0
set DO_PORTABLE259=0
set DO_VS=0
set TEST_NET40=0
set TEST_PORTABLE47=0
set TEST_PORTABLE7=0
set TEST_PORTABLE78=0
set TEST_PORTABLE259=0
set TEST_VS=0
set TEST_CAMBRIDGE_SUITE=0
set CONF_CAMBRIDGE_SUITE=
set TEST_QA_SUITE=0
set CONF_QA_SUITE=

setlocal enableDelayedExpansion
set /a counter=0
for /l %%x in (1 1 9) do (
    set /a counter=!counter!+1
    call :SET_CONFIG %%!counter! "!counter!"
)
setlocal disableDelayedExpansion
echo.
echo.

goto :MAIN

:SET_CONFIG
set BUILD_PROFILE=%~1

if "%BUILD_PROFILE%" == "1" if "%2" == "" (
    set BUILD_PROFILE=smoke
)

if "%2" == "" if not "%BUILD_PROFILE%" == "smoke" goto :EOF

echo Parse argument %BUILD_PROFILE%

if /i '%BUILD_PROFILE%' == 'net40' (
    set DO_NET40=1
    set TEST_NET40=1
)

if /i '%BUILD_PROFILE%' == 'portable47' (
    set DO_PORTABLE47=1
    set TEST_PORTABLE47=1
)

if /i '%BUILD_PROFILE%' == 'portable7' (
    set DO_PORTABLE7=1
    set TEST_PORTABLE7=1
)

if /i '%BUILD_PROFILE%' == 'portable78' (
    set DO_PORTABLE78=1
    set TEST_PORTABLE78=1
)

if /i '%BUILD_PROFILE%' == 'portable259' (
    set DO_PORTABLE259=1
    set TEST_PORTABLE259=1
)

if /i '%BUILD_PROFILE%' == 'vs' (
    set DO_VS=1
    set TEST_VS=1
)

if /i '%BUILD_PROFILE%' == 'cambridge_suite' (
    set DO_NET40=1
    set TEST_CAMBRIDGE_SUITE=1
)

if /i '%BUILD_PROFILE%' == 'qa_suite' (
    set DO_NET40=1
    set TEST_QA_SUITE=1
)

if /i '%BUILD_PROFILE%' == 'all' (
    set DO_NET40=1
    set DO_PORTABLE47=1
    set DO_PORTABLE7=1
    set DO_PORTABLE78=1
    set DO_PORTABLE259=1
    set DO_VS=1
    set TEST_NET40=1
    set TEST_PORTABLE47=1
    set TEST_PORTABLE7=1
    set TEST_PORTABLE78=1
    set TEST_PORTABLE259=1
    set TEST_VS=1
    set TEST_CAMBRIDGE_SUITE=1
    set TEST_QA_SUITE=1
)

if /i '%BUILD_PROFILE%' == 'smoke' (
    set DO_NET40=1
    set DO_PORTABLE47=1
    set DO_PORTABLE7=1
    set DO_PORTABLE78=1
    set DO_PORTABLE259=1
    set DO_VS=1
    set TEST_NET40=1
    set TEST_PORTABLE47=1
    set TEST_PORTABLE7=1
    set TEST_PORTABLE78=1
    set TEST_PORTABLE259=1
    set TEST_VS=1
    set TEST_CAMBRIDGE_SUITE=1
    set CONF_CAMBRIDGE_SUITE=Smoke
    set TEST_QA_SUITE=1
    set CONF_QA_SUITE=Smoke
)

if /i '%BUILD_PROFILE%' == 'smoke_only' (
    set CONF_CAMBRIDGE_SUITE=Smoke
    set CONF_QA_SUITE=Smoke
)
goto :EOF

:MAIN

REM after this point, BUILD_PROFILE variable should not be used, use only DO_* or TEST_*

echo Build/Tests configuration:
echo.
echo DO_NET40=%DO_NET40%
echo DO_PORTABLE47=%DO_PORTABLE47%
echo DO_PORTABLE7=%DO_PORTABLE7%
echo DO_PORTABLE78=%DO_PORTABLE78%
echo DO_PORTABLE259=%DO_PORTABLE259%
echo DO_VS=%DO_VS%
echo.
echo TEST_NET40=%TEST_NET40%
echo TEST_PORTABLE47=%TEST_PORTABLE47%
echo TEST_PORTABLE7=%TEST_PORTABLE7%
echo TEST_PORTABLE78=%TEST_PORTABLE78%
echo TEST_PORTABLE259=%TEST_PORTABLE259%
echo TEST_VS=%TEST_VS%
echo TEST_CAMBRIDGE_SUITE=%TEST_CAMBRIDGE_SUITE%
echo CONF_CAMBRIDGE_SUITE=%CONF_CAMBRIDGE_SUITE%
echo TEST_QA_SUITE=%TEST_QA_SUITE%
echo CONF_QA_SUITE=%CONF_QA_SUITE%
echo.

@echo on

set APPVEYOR_CI=1

:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS140COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS120COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0

:vsversionset
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :failure

if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"      set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :failure

:: See <http://www.appveyor.com/docs/environment-variables>
if defined APPVEYOR (
    rem See <http://www.appveyor.com/docs/build-phase>
    if exist "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" (
	rem HACK HACK HACK
	set _msbuildexe=%_msbuildexe% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    )
)

set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure

.\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget\nuget.config
@if ERRORLEVEL 1 echo Error: Nuget restore failed  && goto :failure

:: Build
%_msbuildexe% src\fsharp-proto-build.proj
@if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure

%_ngenexe% install Proto\net40\bin\fsc-proto.exe
@if ERRORLEVEL 1 echo Error: NGen of proto failed  && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :failure

if '%DO_PORTABLE47%' == '1' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :failure
)

if '%DO_PORTABLE7%' == '1' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable7 build failed && goto :failure
)

if '%DO_PORTABLE78%' == '1' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable78 build failed && goto :failure
)

if '%DO_PORTABLE259%' == '' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable259 build failed && goto :failure
)

if '%TEST_NET40%' == '1' (
%_msbuildexe% src/fsharp-compiler-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed && goto :failure
)

if '%TEST_PORTABLE47%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable47 && goto :failure
)

if '%TEST_PORTABLE7%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable7 && goto :failure
)

if '%TEST_PORTABLE78%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable78 && goto :failure
)

if '%TEST_PORTABLE259%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable259 && goto :failure
)

if '%DO_VS%' == '1' (
%_msbuildexe% vsintegration\fsharp-vsintegration-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration build failed && goto :failure
)

if '%TEST_VS%' == '1' (
%_msbuildexe% vsintegration\fsharp-vsintegration-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration unit tests build failed && goto :failure
)

@echo on
call src\update.cmd release -ngen
pushd tests

@echo on
call BuildTestTools.cmd release
@if ERRORLEVEL 1 echo Error: 'BuildTestTools.cmd release' failed && goto :failure

@echo on
if '%TEST_CAMBRIDGE_SUITE%' == '1' (
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=true

%_msbuildexe% fsharp\fsharp.tests.fsproj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: fsharp cambridge tests for nunit failed && goto :failure

call RunTests.cmd release fsharp %CONF_CAMBRIDGE_SUITE%
@if ERRORLEVEL 1 type testresults\fsharp_failures.log && echo Error: 'RunTests.cmd release fsharp %CONF_CAMBRIDGE_SUITE%' failed && goto :failure
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=
)

if '%TEST_QA_SUITE%' == '1' (
call RunTests.cmd release fsharpqa %CONF_QA_SUITE%
@if ERRORLEVEL 1 type testresults\fsharpqa_failures.log && echo Error: 'RunTests.cmd release fsharpqa %CONF_QA_SUITE%' failed && goto :failure
)

if '%TEST_NET40%' == '1' (
call RunTests.cmd release compilerunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release compilerunit' failed && goto :failure

call RunTests.cmd release coreunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunit' failed && goto :failure
)

if '%TEST_PORTABLE47%' == '1' (
call RunTests.cmd release coreunitportable47
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable47' failed && goto :failure
)

if '%TEST_PORTABLE7%' == '1' (
call RunTests.cmd release coreunitportable7
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable7' failed && goto :failure
)

if '%TEST_PORTABLE78%' == '1' (
call RunTests.cmd release coreunitportable78
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable78' failed && goto :failure
)

if '%TEST_PORTABLE259%' == '1' (
call RunTests.cmd release coreunitportable259
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable259' failed && goto :failure
)

rem tests for TEST_VS are not executed

popd

goto :eof

:failure
exit /b 1

@echo off

:ARGUMENTS_VALIDATION

if /I "%1" == "/help"   (goto :USAGE)
if /I "%1" == "/h"      (goto :USAGE)
if /I "%1" == "/?"      (goto :USAGE)
goto :ARGUMENTS_OK

:USAGE

echo Build and run a subset of test suites
echo.
echo Usage:
echo.
echo appveyor-build.cmd ^<all^|net40^|portable47^|portable7^|portable78^|portable259^|vs^|cambridge_suite^|qa_suite^|smoke^|smoke_only^>
echo.
echo No arguments default to 'smoke' ( build all profiles, run all unit tests, cambridge Smoke, fsharpqa Smoke)
echo.
echo To specify multiple values, separate strings by comma
echo.
echo The example below run portable47, vs and qa:
echo.
echo appveyor-build.cmd portable47,vs,qa_suite
exit /b 1

:ARGUMENTS_OK

set DO_NET40=0
set DO_PORTABLE47=0
set DO_PORTABLE7=0
set DO_PORTABLE78=0
set DO_PORTABLE259=0
set DO_VS=0
set TEST_NET40=0
set TEST_PORTABLE47=0
set TEST_PORTABLE7=0
set TEST_PORTABLE78=0
set TEST_PORTABLE259=0
set TEST_VS=0
set TEST_CAMBRIDGE_SUITE=0
set CONF_CAMBRIDGE_SUITE=
set TEST_QA_SUITE=0
set CONF_QA_SUITE=

setlocal enableDelayedExpansion
set /a counter=0
for /l %%x in (1 1 9) do (
    set /a counter=!counter!+1
    call :SET_CONFIG %%!counter! "!counter!"
)
setlocal disableDelayedExpansion
echo.
echo.

goto :MAIN

:SET_CONFIG
set BUILD_PROFILE=%~1

if "%BUILD_PROFILE%" == "1" if "%2" == "" (
    set BUILD_PROFILE=smoke
)

if "%2" == "" if not "%BUILD_PROFILE%" == "smoke" goto :EOF

echo Parse argument %BUILD_PROFILE%

if /i '%BUILD_PROFILE%' == 'net40' (
    set DO_NET40=1
    set TEST_NET40=1
)

if /i '%BUILD_PROFILE%' == 'portable47' (
    set DO_PORTABLE47=1
    set TEST_PORTABLE47=1
)

if /i '%BUILD_PROFILE%' == 'portable7' (
    set DO_PORTABLE7=1
    set TEST_PORTABLE7=1
)

if /i '%BUILD_PROFILE%' == 'portable78' (
    set DO_PORTABLE78=1
    set TEST_PORTABLE78=1
)

if /i '%BUILD_PROFILE%' == 'portable259' (
    set DO_PORTABLE259=1
    set TEST_PORTABLE259=1
)

if /i '%BUILD_PROFILE%' == 'vs' (
    set DO_VS=1
    set TEST_VS=1
)

if /i '%BUILD_PROFILE%' == 'cambridge_suite' (
    set DO_NET40=1
    set TEST_CAMBRIDGE_SUITE=1
)

if /i '%BUILD_PROFILE%' == 'qa_suite' (
    set DO_NET40=1
    set TEST_QA_SUITE=1
)

if /i '%BUILD_PROFILE%' == 'all' (
    set DO_NET40=1
    set DO_PORTABLE47=1
    set DO_PORTABLE7=1
    set DO_PORTABLE78=1
    set DO_PORTABLE259=1
    set DO_VS=1
    set TEST_NET40=1
    set TEST_PORTABLE47=1
    set TEST_PORTABLE7=1
    set TEST_PORTABLE78=1
    set TEST_PORTABLE259=1
    set TEST_VS=1
    set TEST_CAMBRIDGE_SUITE=1
    set TEST_QA_SUITE=1
)

if /i '%BUILD_PROFILE%' == 'smoke' (
    set DO_NET40=1
    set DO_PORTABLE47=1
    set DO_PORTABLE7=1
    set DO_PORTABLE78=1
    set DO_PORTABLE259=1
    set DO_VS=1
    set TEST_NET40=1
    set TEST_PORTABLE47=1
    set TEST_PORTABLE7=1
    set TEST_PORTABLE78=1
    set TEST_PORTABLE259=1
    set TEST_VS=1
    set TEST_CAMBRIDGE_SUITE=1
    set CONF_CAMBRIDGE_SUITE=Smoke
    set TEST_QA_SUITE=1
    set CONF_QA_SUITE=Smoke
)

if /i '%BUILD_PROFILE%' == 'smoke_only' (
    set CONF_CAMBRIDGE_SUITE=Smoke
    set CONF_QA_SUITE=Smoke
)
goto :EOF

:MAIN

REM after this point, BUILD_PROFILE variable should not be used, use only DO_* or TEST_*

echo Build/Tests configuration:
echo.
echo DO_NET40=%DO_NET40%
echo DO_PORTABLE47=%DO_PORTABLE47%
echo DO_PORTABLE7=%DO_PORTABLE7%
echo DO_PORTABLE78=%DO_PORTABLE78%
echo DO_PORTABLE259=%DO_PORTABLE259%
echo DO_VS=%DO_VS%
echo.
echo TEST_NET40=%TEST_NET40%
echo TEST_PORTABLE47=%TEST_PORTABLE47%
echo TEST_PORTABLE7=%TEST_PORTABLE7%
echo TEST_PORTABLE78=%TEST_PORTABLE78%
echo TEST_PORTABLE259=%TEST_PORTABLE259%
echo TEST_VS=%TEST_VS%
echo TEST_CAMBRIDGE_SUITE=%TEST_CAMBRIDGE_SUITE%
echo CONF_CAMBRIDGE_SUITE=%CONF_CAMBRIDGE_SUITE%
echo TEST_QA_SUITE=%TEST_QA_SUITE%
echo CONF_QA_SUITE=%CONF_QA_SUITE%
echo.

@echo on

set APPVEYOR_CI=1

:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS140COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%VS120COMNTOOLS%..\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0

:vsversionset
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :failure

if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"      set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :failure

:: See <http://www.appveyor.com/docs/environment-variables>
if defined APPVEYOR (
    rem See <http://www.appveyor.com/docs/build-phase>
    if exist "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" (
	rem HACK HACK HACK
	set _msbuildexe=%_msbuildexe% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    )
)

set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure

.\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget\nuget.config
@if ERRORLEVEL 1 echo Error: Nuget restore failed  && goto :failure

:: Build
%_msbuildexe% src\fsharp-proto-build.proj
@if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure

%_ngenexe% install Proto\net40\bin\fsc-proto.exe
@if ERRORLEVEL 1 echo Error: NGen of proto failed  && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :failure

if '%DO_PORTABLE47%' == '1' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :failure
)

if '%DO_PORTABLE7%' == '1' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable7 build failed && goto :failure
)

if '%DO_PORTABLE78%' == '1' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable78 build failed && goto :failure
)

if '%DO_PORTABLE259%' == '' (
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable259 build failed && goto :failure
)

if '%TEST_NET40%' == '1' (
%_msbuildexe% src/fsharp-compiler-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed && goto :failure
)

if '%TEST_PORTABLE47%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable47 && goto :failure
)

if '%TEST_PORTABLE7%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable7 && goto :failure
)

if '%TEST_PORTABLE78%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable78 && goto :failure
)

if '%TEST_PORTABLE259%' == '1' (
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable259 && goto :failure
)

if '%DO_VS%' == '1' (
%_msbuildexe% vsintegration\fsharp-vsintegration-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration build failed && goto :failure
)

if '%TEST_VS%' == '1' (
%_msbuildexe% vsintegration\fsharp-vsintegration-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration unit tests build failed && goto :failure
)

@echo on
call src\update.cmd release -ngen
call vsintegration\update-vsintegration.cmd release
pushd tests

@echo on
call BuildTestTools.cmd release
@if ERRORLEVEL 1 echo Error: 'BuildTestTools.cmd release' failed && goto :failure

@echo on
if '%TEST_CAMBRIDGE_SUITE%' == '1' (
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=true

%_msbuildexe% fsharp\fsharp.tests.fsproj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: fsharp cambridge tests for nunit failed && goto :failure

call RunTests.cmd release fsharp %CONF_CAMBRIDGE_SUITE%
@if ERRORLEVEL 1 type testresults\fsharp_failures.log && echo Error: 'RunTests.cmd release fsharp %CONF_CAMBRIDGE_SUITE%' failed && goto :failure
set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=
)

if '%TEST_QA_SUITE%' == '1' (
call RunTests.cmd release fsharpqa %CONF_QA_SUITE%
@if ERRORLEVEL 1 type testresults\fsharpqa_failures.log && echo Error: 'RunTests.cmd release fsharpqa %CONF_QA_SUITE%' failed && goto :failure
)

if '%TEST_NET40%' == '1' (
call RunTests.cmd release compilerunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release compilerunit' failed && goto :failure

call RunTests.cmd release coreunit
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunit' failed && goto :failure
)

if '%TEST_PORTABLE47%' == '1' (
call RunTests.cmd release coreunitportable47
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable47' failed && goto :failure
)

if '%TEST_PORTABLE7%' == '1' (
call RunTests.cmd release coreunitportable7
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable7' failed && goto :failure
)

if '%TEST_PORTABLE78%' == '1' (
call RunTests.cmd release coreunitportable78
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable78' failed && goto :failure
)

if '%TEST_PORTABLE259%' == '1' (
call RunTests.cmd release coreunitportable259
@if ERRORLEVEL 1 echo Error: 'RunTests.cmd release coreunitportable259' failed && goto :failure
)

rem tests for TEST_VS are not executed

popd

goto :eof

:failure
exit /b 1

Add update-vsintegration for plib tests

Add update-vsintegration for plib tests


set GO_ROOT=%~dp0\..\..\..\..\
set JRUBY_BASE=%GO_ROOT\tools\jruby-1.7.11
set SERVER_ROOT=%GO_ROOT%\server
set RAILS_ROOT=%SERVER_ROOT%\webapp\WEB-INF\rails.new
set GEM_HOME=%RAILS_ROOT%\vendor\bundle\jruby\1.9
set GEM_PATH=%JRUBY_BASE%\lib\ruby\gems\shared:%GEM_HOME%
set PATH=%JRUBY_BASE\bin:%PATH%

%JRUBY_BASE%\bin\jruby.bat %*

set GO_ROOT=%~dp0\..\..\..
set JRUBY_BASE=%GO_ROOT%\tools\jruby-1.7.11
set SERVER_ROOT=%GO_ROOT%\server
set RAILS_ROOT=%SERVER_ROOT%\webapp\WEB-INF\rails.new
set GEM_HOME=%RAILS_ROOT%\vendor\bundle\jruby\1.9
set GEM_PATH=%JRUBY_BASE%\lib\ruby\gems\shared;%GEM_HOME%
set PATH=%JRUBY_BASE%\bin;%PATH%

%JRUBY_BASE%\bin\jruby.bat %*

Fix bad windows batch file

Fix bad windows batch file

...originally writen by yours truly, on something that was not a windows machine...


:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

setlocal

set GOBUILDFAIL=0

go tool dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

if exist %GOTOOLDIR%\dist.exe goto distok
echo cannot find %GOTOOLDIR%\dist; nothing to clean
goto fail
:distok

"%GOBIN%\go" clean -i std
%GOTOOLDIR%\dist clean

goto end

:fail
set GOBUILDFAIL=1

:end
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%

implement clean.bat

build: implement clean.bat

Fixes issue 2893.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/5685047


python setup.py build
python setup.py install --prefix=$PREFIX --single-version-externally-managed --record=record.txt

%PYTHON% setup.py build
%PYTHON% setup.py install --prefix=$PREFIX --single-version-externally-managed --record=record.txt

Use the available python bin

Use the available python bin


@rem See notes.md for more information about all of this.

@rem Compile the launcher

@rem XXX: Should we build Rgui with -DGUI=1 -mwindows?  The only difference is
@rem that that it doesn't block the terminal, but we also can't get the return
@rem value for the conda build tests.

gcc -DGUI=0 -O -s -o launcher.exe "%RECIPE_DIR%\launcher.c"
if errorlevel 1 exit 1

@rem Install the launcher

if not exist "%PREFIX%\Scripts" mkdir "%PREFIX%\Scripts"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\R.exe"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\Rcmd.exe"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\RSetReg.exe"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\Rfe.exe"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\Rgui.exe"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\Rscript.exe"
if errorlevel 1 exit 1

copy launcher.exe "%PREFIX%\Scripts\Rterm.exe"
if errorlevel 1 exit 1

@rem XXX: Should we skip this one?
copy launcher.exe "%PREFIX%\Scripts\open.exe"
if errorlevel 1 exit 1

copy "%RECIPE_DIR%\build.sh" .
set PREFIX=%PREFIX:\=/%
set SRC_DIR=%SRC_DIR:\=/%
set MSYSTEM=MINGW%ARCH%
set MSYS2_PATH_TYPE=inherit
set CHERE_INVOKING=1
bash -lc "./build.sh"
if errorlevel 1 exit 1
exit 0

fix r bad stage

fix r bad stage


@echo off
rem fake submodule (exists only for appveyor tests)

cd ..\

git clone --depth=10 --branch=vs2015 https://bitbucket.org/ribtoks/xpiks-deps.git

cd xpiks-deps

git checkout 6b48bf0

@echo off
rem fake submodule (exists only for appveyor tests)

cd ..\

git clone --depth=10 --branch=vs2015 https://bitbucket.org/ribtoks/xpiks-deps.git

cd xpiks-deps

git checkout e78792f

Update libxpks link

Update libxpks link


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

@echo off
set JAVA_HOME=%CD%\jre1.8.0_45
build\install\core\bin\core %*

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

@echo off
set JAVA_HOME=%CD%\jre1.8.0_65
build\install\core\bin\core %*

update jre version, close issue #3361

update jre version, close issue #3361


@echo off

rem  Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
rem
rem  WSO2 Inc. licenses this file to you under the Apache License,
rem  Version 2.0 (the "License"); you may not use this file except
rem  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,
rem  software distributed under the License is distributed on an
rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
rem  KIND, either express or implied.  See the License for the
rem  specific language governing permissions and limitations
rem  under the License.

rem ---------------------------------------------------------------------------
rem Main Script for WSO2 Carbon
rem
rem Environment Variable Prequisites
rem
rem   CARBON_HOME   Home of CARBON installation. If not set I will  try
rem                   to figure it out.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------
:checkJava

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto checkServer

:noJavaHome
echo "You must set the JAVA_HOME variable before running CARBON."
goto end

rem ----- Only set CARBON_HOME if not already set ----------------------------
:checkServer
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
SET curDrive=%cd:~0,1%
SET wsasDrive=%CARBON_HOME:~0,1%
if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:

rem find CARBON_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if not exist "%CARBON_HOME%\bin\version.txt" goto noServerHome

goto updateClasspath

:noServerHome
echo CARBON_HOME is set incorrectly or CARBON could not be located. Please set CARBON_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath

setlocal EnableDelayedExpansion
cd %CARBON_HOME%
set CARBON_CLASSPATH=
FOR %%C in ("%CARBON_HOME%\bin\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\%%~nC%%~xC"

set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;

set CARBON_CLASSPATH="%CARBON_HOME%\..\components\plugins\*";%CARBON_CLASSPATH%;
set CARBON_CLASSPATH="%CARBON_HOME%\..\lib\endorsed\*";%CARBON_CLASSPATH%;

FOR %%D in ("%CARBON_HOME%\lib\commons-lang*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nD%%~xD"
rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:doneStart
if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

rem ---------- Handle the SSL Issue with proper JDK version --------------------
rem find the version of the jdk
:findJdk

set CMD=RUN %*

:checkJdk17
"%JAVA_HOME%\bin\java" -version 2>&1 | findstr /r "1.[7|8]" >NUL
IF ERRORLEVEL 1 goto unknownJdk
goto jdk17

:unknownJdk
echo Starting WSO2 Carbon (in unsupported JDK)
echo [ERROR] CARBON is supported only on JDK 1.7 and 1.8
goto jdk17

:jdk17
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer
cd %CARBON_HOME%

rem ---------- Add jars to classpath ----------------

set JAVA_ENDORSED=".\..\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"

set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof" %JAVA_OPTS% -classpath %CARBON_CLASSPATH% -Dcarbon.home="%CARBON_HOME%"  -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dfile.encoding=UTF8 -Dwso2_custom_conf_dir="%CARBON_HOME%\conf"

:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.wso2.carbon.analytics.tools.backup.AnalyticsDataBackupTool %CMD%
if "%ERRORLEVEL%"=="121" goto runJava
:end
goto endlocal

:endlocal

:END

@echo off

rem  Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
rem
rem  WSO2 Inc. licenses this file to you under the Apache License,
rem  Version 2.0 (the "License"); you may not use this file except
rem  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,
rem  software distributed under the License is distributed on an
rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
rem  KIND, either express or implied.  See the License for the
rem  specific language governing permissions and limitations
rem  under the License.

rem ---------------------------------------------------------------------------
rem Main Script for WSO2 Carbon
rem
rem Environment Variable Prequisites
rem
rem   CARBON_HOME   Home of CARBON installation. If not set I will  try
rem                   to figure it out.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------
:checkJava

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto checkServer

:noJavaHome
echo "You must set the JAVA_HOME variable before running CARBON."
goto end

rem ----- Only set CARBON_HOME if not already set ----------------------------
:checkServer
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
SET curDrive=%cd:~0,1%
SET wsasDrive=%CARBON_HOME:~0,1%
if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:

rem find CARBON_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if not exist "%CARBON_HOME%\bin\version.txt" goto noServerHome

goto updateClasspath

:noServerHome
echo CARBON_HOME is set incorrectly or CARBON could not be located. Please set CARBON_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath

setlocal EnableDelayedExpansion
cd %CARBON_HOME%
set CARBON_CLASSPATH=
FOR %%C in ("%CARBON_HOME%\bin\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\%%~nC%%~xC"

set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;

set CARBON_CLASSPATH="%CARBON_HOME%\..\components\plugins\*";%CARBON_CLASSPATH%;
set CARBON_CLASSPATH="%CARBON_HOME%\..\lib\endorsed\*";%CARBON_CLASSPATH%;

FOR %%D in ("%CARBON_HOME%\lib\commons-lang*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nD%%~xD"
rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:doneStart
if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

rem ---------- Handle the SSL Issue with proper JDK version --------------------
rem find the version of the jdk
:findJdk

set CMD=RUN %*

:checkJdk17
"%JAVA_HOME%\bin\java" -version 2>&1 | findstr /r "1.[7|8]" >NUL
IF ERRORLEVEL 1 goto unknownJdk
goto jdk17

:unknownJdk
echo Starting WSO2 Carbon (in unsupported JDK)
echo [ERROR] CARBON is supported only on JDK 1.7 and 1.8
goto jdk17

:jdk17
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer
cd %CARBON_HOME%

rem ---------- Add jars to classpath ----------------

set JAVA_ENDORSED=".\..\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"

set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof" %JAVA_OPTS% -classpath %CARBON_CLASSPATH% -Dcarbon.home="%CARBON_HOME%"  -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dfile.encoding=UTF8 -Dwso2_custom_conf_dir="%CARBON_HOME%\conf"

:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.wso2.carbon.analytics.tools.backup.AnalyticsDataBackupTool %CMD%
if "%ERRORLEVEL%"=="121" goto runJava
:end
goto endlocal

:endlocal

:END

fix review changes

fix review changes


测试版本打包~

测试版本打包~


cmake -DCMAKE_INSTALL_PREFIX=%PREFIX% -G "Ninja" -DCMAKE_PREFIX_PATH=%PREFIX%

ninja
ninja install

Add build script for windows

Add build script for windows


@echo off
SETLOCAL

rem Author: Gregory Charles, JBoss Community Member
rem Date: January 24, 2012

set DIRNAME="%~dp0"
call :DeQuote DIRNAME
set PROGNAME=%0

rem Setup JBOSS_HOME
set JBOSS_HOME=%DIRNAME%\..

rem Setup the JVM
IF NOT DEFINED JAVA (
    IF DEFINED JAVA_HOME (
        set JAVA="%JAVA_HOME%\bin\java"
    ) ELSE (
        JAVA=java
    )

)

IF NOT DEFINED MODULEPATH (
    set MODULEPATH="%JBOSS_HOME%\modules"
	call :DeQuote MODULEPATH
)

rem
rem Setup the JBoss Vault Tool classpath
rem

rem Shared libs
set JBOSS_VAULT_CLASSPATH="%MODULEPATH%\org\picketbox\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\jboss\logging\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\jboss\common-core\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\jboss\as\security\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\apache\commons\cli\main\*"

rem Display our environment
echo =========================================================================
echo.
echo   JBoss Vault
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   VAULT Classpath: %JBOSS_VAULT_CLASSPATH%
echo =========================================================================
echo.

%JAVA% -classpath %JBOSS_VAULT_CLASSPATH% org.jboss.as.security.vault.VaultTool %*

ENDLOCAL

:END
goto :EOF

:DeQuote
for /f "delims=" %%A in ('echo %%%1%%') do set %1=%%~A
goto :EOF

:EOF

@echo off
SETLOCAL

rem Author: Gregory Charles, JBoss Community Member
rem Date: January 24, 2012

set DIRNAME="%~dp0"
call :DeQuote DIRNAME
set PROGNAME=%0

rem Setup JBOSS_HOME
set JBOSS_HOME=%DIRNAME%\..

rem Setup the JVM
IF NOT DEFINED JAVA (
    IF DEFINED JAVA_HOME (
        set JAVA="%JAVA_HOME%\bin\java"
    ) ELSE (
        set JAVA=java
    )

)

IF NOT DEFINED MODULEPATH (
    set MODULEPATH="%JBOSS_HOME%\modules"
	call :DeQuote MODULEPATH
)

rem
rem Setup the JBoss Vault Tool classpath
rem

rem Shared libs
set JBOSS_VAULT_CLASSPATH="%MODULEPATH%\org\picketbox\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\jboss\logging\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\jboss\common-core\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\jboss\as\security\main\*"
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;"%MODULEPATH%\org\apache\commons\cli\main\*"

rem Display our environment
echo =========================================================================
echo.
echo   JBoss Vault
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   VAULT Classpath: %JBOSS_VAULT_CLASSPATH%
echo =========================================================================
echo.

%JAVA% -classpath %JBOSS_VAULT_CLASSPATH% org.jboss.as.security.vault.VaultTool %*

ENDLOCAL

:END
goto :EOF

:DeQuote
for /f "delims=" %%A in ('echo %%%1%%') do set %1=%%~A
goto :EOF

:EOF

AS7-5898: fix syntax error while assigning default java


@echo off
setlocal
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
if not exist "%MSBUILDEXE%" (
    echo The .NET Framework 4.0 does not appear to be installed on this
    echo machine, which is required to build the solution.
    exit /b 1
)
if "%1"=="docs" call :docs %2 %3 %4 %5 %6 %7 %8 %9 & goto :EOF
call :base %*
goto :EOF

:base
for %%i in (debug release) do "%MSBUILDEXE%" "MoreLinq.sln" /v:m /p:Configuration=%%i %*
goto :EOF

:docs
call :base %*
"%MSBUILDEXE%" MoreLinq.shfbproj %*
goto :EOF

@echo off
setlocal
cd "%~dp0"
set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
if not exist "%MSBUILDEXE%" (
    echo The .NET Framework 4.0 does not appear to be installed on this
    echo machine, which is required to build the solution.
    exit /b 1
)
if "%1"=="docs" call :docs %2 %3 %4 %5 %6 %7 %8 %9 & goto :EOF

:base
for %%i in (debug release) do "%MSBUILDEXE%" "MoreLinq.sln" /v:m /p:Configuration=%%i %*
goto :EOF

:docs
call :base
"%MSBUILDEXE%" MoreLinq.shfbproj %*
goto :EOF

Build script simplification

Build script simplification


inject.exe --name origin.exe --inject --export Load --add-path --path-resolution --module cerberus.dll

Add Origin injection script.

[Scripts] Add Origin injection script.


:: Nasty hack to force the newer MSBuild from .NET is still used for the older
:: Visual Studio build. Without this an older MSBuild will be picked up by accident on
:: AppVeyor after running `vcvars32.bat`, which fails to process our solution files.
::
:: ref: https://github.com/conda-forge/staged-recipes/pull/194#issuecomment-203577297
:: ref: https://github.com/conda-forge/libsodium-feedstock/commit/b411740e0f439d5a5d257f74f74945f86585684a#diff-d04c86b6bb20341f5f7c53165501a393R12
:: ref: https://stackoverflow.com/q/2709279
::
:: Also there is some bug using MSBuild from .NET to build with VS 2008 64-bit, which
:: we workaround as well.
::
:: ref: https://social.msdn.microsoft.com/Forums/vstudio/en-US/19bb86ab-258a-40a9-b9fc-3bf36cac46bc/team-build-error-msb4018-the-quotresolvevcprojectoutputquot-task-failed-unexpectedly?forum=tfsbuild
if %VS_MAJOR% == 9 (
    set "PATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319;%PATH%"
    set VC_PROJECT_ENGINE_NOT_USING_REGISTRY_FOR_INIT=1
)

%PYTHON% -m pip install . -vv

Remove hack to see if compiler definition on windows changes something on appveyor


rem @ECHO OFF

REM Copyright (C) 2012 Akiban Technologies Inc.
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU Affero General Public License, version 3,
REM as published by the Free Software Foundation.

REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU Affero General Public License for more details.
REM
REM You should have received a copy of the GNU Affero General Public License
REM along with this program.  If not, see http://www.gnu.org/licenses.

SETLOCAL

REM Defaults
FOR %%P IN ("%~dp0..") DO SET AKIBAN_HOME=%%~fP
SET JAR_NAME=akiban-server-1.1.0-SNAPSHOT-jar-with-dependencies.jar
REM target is when building locally; sibling of windows "home".
FOR %%P IN ("%AKIBAN_HOME%\..\target\%JAR_NAME%") DO SET JAR_FILE=%%~fP
IF NOT EXIST "%JAR_FILE%" SET JAR_FILE=%AKIBAN_HOME%\lib\%JAR_NAME%
SET AKIBAN_CONF=%AKIBAN_HOME%
REM will need to be changed by installer
SET AKIBAN_LOG=\akiban\log

SET SERVICE_NAME=akserver
SET SERVICE_DNAME=Akiban Server
SET SERVICE_DESC=Akiban Database Server

FOR %%P IN (prunsrv.exe) DO SET PROCRUN=%%~$PATH:P
REM Not in path, assume installed with program.
IF "%PROCRUN%"=="" (
  IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
    SET PROCRUN=%AKIBAN_HOME%\bin\prunsrv
  ) ELSE (
    SET PROCRUN=%AKIBAN_HOME%\bin\%PROCESSOR_ARCHITECTURE%\prunsrv
) )

IF NOT DEFINED JVM_OPTS SET JVM_OPTS=-Dummy=

SET VERB=%1
SHIFT

:NEXT_OPT

IF "%1"=="" GOTO END_OPT

IF "%1"=="-j" (
  SET JAR_FILE=%3
  SHIFT
  SHIFT
) ELSE IF "%1"=="-c" (
  SET AKIBAN_CONF=%3
  SHIFT
  SHIFT
) ELSE IF "%1"=="-g" (
  SET JVM_OPTS=%JVM_OPTS% -Dcom.persistit.showgui=true
  SHIFT
) ELSE (
  GOTO USAGE
)

GOTO NEXT_OPT
:END_OPT

IF "%VERB%"=="version" (
  FOR /F "usebackq" %%V IN (`java -cp "%JAR_FILE%" com.akiban.server.GetVersion`) DO ECHO server   : %%V
  FOR /F "usebackq" %%V IN (`java -cp "%JAR_FILE%" com.persistit.GetVersion`) DO ECHO persistit: %%V
  "%PROCRUN%" //VS
  GOTO EOF
)

IF "%VERB%"=="start" (
  "%PROCRUN%" //ES//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="stop" (
  "%PROCRUN%" //SS//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="uninstall" (
  "%PROCRUN%" //DS//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="console" (
  "%PROCRUN%" //TS//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="monitor" (
  "%PROCRUN:srv=mgr%" //MR//%SERVICE_NAME%
  GOTO EOF
)

IF EXIST "%AKIBAN_CONF%\config\jvm-options.cmd" CALL "%AKIBAN_CONF%\config\jvm-options.cmd"

IF "%VERB%"=="run" GOTO RUN_CMD

SET PROCRUN_ARGS=--StartMode=jvm --StartClass com.akiban.server.AkServer --StartMethod=procrunStart --StopMode=jvm --StopClass=com.akiban.server.AkServer --StopMethod=procrunStop --StdOutput="%AKIBAN_LOG%\stdout.log" --DisplayName="%SERVICE_DNAME%" --Description="%SERVICE_DESC%" --Startup=manual --Classpath="%JAR_FILE%"
REM Each value that might have a space needs a separate ++JvmOptions.
SET PROCRUN_ARGS=%PROCRUN_ARGS% --JvmOptions="%JVM_OPTS: =#%" ++JvmOptions="-Dakiban.admin=%AKIBAN_CONF%" ++JvmOptions="-Dservices.config=%AKIBAN_CONF%\config\services-config.yaml" ++JvmOptions="-Dlog4j.configuration=file:%AKIBAN_CONF%\config\log4j.properties"
IF DEFINED MAX_HEAP_SIZE SET PROCRUN_ARGS=%PROCRUN_ARGS% --JvmMs=%MAX_HEAP_SIZE% --JvmMx=%MAX_HEAP_SIZE%

IF "%VERB%"=="install" (
  "%PROCRUN%" //IS//%SERVICE_NAME% %PROCRUN_ARGS%
  GOTO EOF
)

:USAGE
ECHO Usage: {install,uninstall,start,stop,run,monitor,version} [-j jarfile] [-c confdir] [-g]
GOTO EOF

:RUN_CMD
SET JVM_OPTS=%JVM_OPTS% -Dakiban.admin="%AKIBAN_CONF%"
SET JVM_OPTS=%JVM_OPTS% -Dservices.config="%AKIBAN_CONF%\config\services-config.yaml"
SET JVM_OPTS=%JVM_OPTS% -ea
IF DEFINED MAX_HEAP_SIZE SET JVM_OPTS=%JVM_OPTS% -Xms%MAX_HEAP_SIZE%-Xmx%MAX_HEAP_SIZE%
java %JVM_OPTS% -jar "%JAR_FILE%"
GOTO EOF

:EOF
ENDLOCAL

rem @ECHO OFF

REM Copyright (C) 2012 Akiban Technologies Inc.
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU Affero General Public License, version 3,
REM as published by the Free Software Foundation.

REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU Affero General Public License for more details.
REM
REM You should have received a copy of the GNU Affero General Public License
REM along with this program.  If not, see http://www.gnu.org/licenses.

SETLOCAL

SET SERVER_JAR=akiban-server-1.1.0-SNAPSHOT-jar-with-dependencies.jar
SET SERVICE_NAME=akserver
SET SERVICE_DNAME=Akiban Server
SET SERVICE_DESC=Akiban Database Server

IF EXIST "%~dp0..\..\pom.xml" GOTO FROM_BUILD

REM Installation Configuration

FOR %%P IN ("%~dp0..") DO SET AKIBAN_HOME=%%~fP

SET JAR_FILE=%AKIBAN_HOME%\lib\%SERVER_JAR%
SET AKIBAN_CONF=%AKIBAN_HOME%
SET AKIBAN_LOGDIR=%AKIBAN_HOME%\log

FOR %%P IN (prunsrv.exe) DO SET PROCRUN=%%~$PATH:P
REM Not in path, assume installed with program.
IF "%PROCRUN%"=="" (
  IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
    SET PROCRUN=%AKIBAN_HOME%\procrun\prunsrv
  ) ELSE (
    SET PROCRUN=%AKIBAN_HOME%\procrun\%PROCESSOR_ARCHITECTURE%\prunsrv
) )

GOTO PARSE_CMD

:FROM_BUILD

REM Build Configuration

FOR %%P IN ("%~dp0..\..") DO SET BUILD_HOME=%%~fP

SET JAR_FILE=%BUILD_HOME%\target\%SERVER_JAR%
SET AKIBAN_CONF=%BUILD_HOME%\windows
SET AKIBAN_LOGDIR=%~d0\akiban\log
SET PROCRUN=prunsrv

:PARSE_CMD

IF NOT DEFINED JVM_OPTS SET JVM_OPTS=-Dummy=

IF "%1"=="" GOTO USAGE

SET VERB=%1
SHIFT

:NEXT_OPT

IF "%1"=="" GOTO END_OPT

IF "%1"=="-j" (
  SET JAR_FILE=%3
  SHIFT
  SHIFT
) ELSE IF "%1"=="-c" (
  SET AKIBAN_CONF=%3
  SHIFT
  SHIFT
) ELSE IF "%1"=="-l" (
  SET AKIBAN_LOGCONF=%3
  SHIFT
  SHIFT
) ELSE IF "%1"=="-g" (
  SET JVM_OPTS=%JVM_OPTS% -Dcom.persistit.showgui=true
  SHIFT
) ELSE (
  GOTO USAGE
)

GOTO NEXT_OPT
:END_OPT

IF "%VERB%"=="version" (
  FOR /F "usebackq" %%V IN (`java -cp "%JAR_FILE%" com.akiban.server.GetVersion`) DO ECHO server   : %%V
  FOR /F "usebackq" %%V IN (`java -cp "%JAR_FILE%" com.persistit.GetVersion`) DO ECHO persistit: %%V
  "%PROCRUN%" //VS
  GOTO EOF
)

IF "%VERB%"=="start" (
  "%PROCRUN%" //ES//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="stop" (
  "%PROCRUN%" //SS//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="uninstall" (
  "%PROCRUN%" //DS//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="console" (
  "%PROCRUN%" //TS//%SERVICE_NAME%
  GOTO EOF
) ELSE IF "%VERB%"=="monitor" (
  "%PROCRUN:srv=mgr%" //MR//%SERVICE_NAME%
  GOTO EOF
)

IF NOT EXIST "%JAR_FILE%" (
  ECHO JAR file does not exist; try -j
  GOTO EOF
)
IF NOT EXIST "%AKIBAN_CONF%\config\services-config.yaml" (
  ECHO Wrong configuration directory; try -c
  GOTO EOF
)

IF NOT DEFINED AKIBAN_LOGCONF SET AKIBAN_LOGCONF=%AKIBAN_CONF%\config\log4j.properties

IF EXIST "%AKIBAN_CONF%\config\jvm-options.cmd" CALL "%AKIBAN_CONF%\config\jvm-options.cmd"

IF "%VERB%"=="run" GOTO RUN_CMD

SET PROCRUN_ARGS=--StartMode=jvm --StartClass com.akiban.server.AkServer --StartMethod=procrunStart --StopMode=jvm --StopClass=com.akiban.server.AkServer --StopMethod=procrunStop --StdOutput="%AKIBAN_LOGDIR%\stdout.log" --DisplayName="%SERVICE_DNAME%" --Description="%SERVICE_DESC%" --Startup=manual --Classpath="%JAR_FILE%"
REM Each value that might have a space needs a separate ++JvmOptions.
SET PROCRUN_ARGS=%PROCRUN_ARGS% --JvmOptions="%JVM_OPTS: =#%" ++JvmOptions="-Dakiban.admin=%AKIBAN_CONF%" ++JvmOptions="-Dservices.config=%AKIBAN_CONF%\config\services-config.yaml" ++JvmOptions="-Dlog4j.configuration=file:%AKIBAN_LOGCONF%"
IF DEFINED MAX_HEAP_SIZE SET PROCRUN_ARGS=%PROCRUN_ARGS% --JvmMs=%MAX_HEAP_SIZE% --JvmMx=%MAX_HEAP_SIZE%

IF "%VERB%"=="install" (
  "%PROCRUN%" //IS//%SERVICE_NAME% %PROCRUN_ARGS%
  GOTO EOF
)

:USAGE
ECHO Usage: {install,uninstall,start,stop,run,monitor,version} [-j jarfile] [-c confdir] [-l log4j.properties] [-g]
GOTO EOF

:RUN_CMD
SET JVM_OPTS=%JVM_OPTS% -Dakiban.admin="%AKIBAN_CONF%"
SET JVM_OPTS=%JVM_OPTS% -Dservices.config="%AKIBAN_CONF%\config\services-config.yaml"
SET JVM_OPTS=%JVM_OPTS% -Dlog4j.configuration="file:%AKIBAN_LOGCONF%"
SET JVM_OPTS=%JVM_OPTS% -ea
IF DEFINED MAX_HEAP_SIZE SET JVM_OPTS=%JVM_OPTS% -Xms%MAX_HEAP_SIZE%-Xmx%MAX_HEAP_SIZE%
java %JVM_OPTS% -jar "%JAR_FILE%"
GOTO EOF

:EOF
ENDLOCAL

Split out development and non-development configs.


mkdir %PREFIX%/fonts
for %%f in (*.ttf) do (
    copy %%~nf %PREFIX%/fonts/%%~nf
)

mkdir %PREFIX%/fonts
for %%f in (*.ttf) do (
    copy %f %PREFIX%/fonts/%f
)

Update bld.bat

Update bld.bat


@echo off
setlocal

IF [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
IF [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
IF [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%bin\dotnet.exe
IF [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://www.myget.org/F/dotnet-buildtools/
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

IF EXIST "%BUILD_TOOLS_SEMAPHORE%" goto :EOF
IF EXIST %TOOLRUNTIME_DIR% RMDIR /S /Q %TOOLRUNTIME_DIR%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo **Installing dotnet cli at %DOTNET_PATH%
mkdir "%DOTNET_PATH%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-win-x64.latest.zip', '%DOTNET_PATH%' + '\dotnet-win-x64.latest.zip')"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_PATH%' + 'dotnet-win-x64.latest.zip').Items(),16)"

:afterdotnetrestore

echo **Creating semaphore file: %PROJECT_JSON_FILE%
mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo **Finished creating semaphore file.

IF EXIST "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo **Installing build tools at %BUILD_TOOLS_PATH%
echo Running: %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
call %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
IF NOT EXIST "%BUILD_TOOLS_PATH%init-tools.cmd" goto :errordownloadingbuildtools
echo **Finished Installing build tools

:afterbuildtoolsrestore
echo **Calling %BUILD_TOOLS_PATH%init-tools.cmd
echo Running: %BUILD_TOOLS_PATH%init-tools.cmd %~dp0 %DOTNET_CMD% %TOOLRUNTIME_DIR%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%"
echo **Finished calling %BUILD_TOOLS_PATH%init-tools.cmd

echo Init-Tools.cmd completed> "%BUILD_TOOLS_SEMAPHORE%"
goto :EOF

:errordownloadingbuildtools
echo ERROR: Could not restore build tools correctly
goto :EOF

@echo off
setlocal

IF [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
IF [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
IF [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%bin\dotnet.exe
IF [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://www.myget.org/F/dotnet-buildtools/
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

IF EXIST "%BUILD_TOOLS_SEMAPHORE%" goto :EOF
IF EXIST %TOOLRUNTIME_DIR% RMDIR /S /Q "%TOOLRUNTIME_DIR%"

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo **Installing dotnet cli at %DOTNET_PATH%
mkdir "%DOTNET_PATH%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-win-x64.latest.zip', '%DOTNET_PATH%' + '\dotnet-win-x64.latest.zip')"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_PATH%' + 'dotnet-win-x64.latest.zip').Items(),16)"

:afterdotnetrestore

echo **Creating semaphore file: %PROJECT_JSON_FILE%
mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo **Finished creating semaphore file.

IF EXIST "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo **Installing build tools at %BUILD_TOOLS_PATH%
echo Running: %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
call %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
IF NOT EXIST "%BUILD_TOOLS_PATH%init-tools.cmd" goto :errordownloadingbuildtools
echo **Finished Installing build tools

:afterbuildtoolsrestore
echo **Calling %BUILD_TOOLS_PATH%init-tools.cmd
echo Running: %BUILD_TOOLS_PATH%init-tools.cmd %~dp0 %DOTNET_CMD% %TOOLRUNTIME_DIR%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%"
echo **Finished calling %BUILD_TOOLS_PATH%init-tools.cmd

echo Init-Tools.cmd completed> "%BUILD_TOOLS_SEMAPHORE%"
goto :EOF

:errordownloadingbuildtools
echo ERROR: Could not restore build tools correctly
goto :EOF

Add quotes around the rmdir arguments as it ends with a "/" in some cases which causes some invalid arg error.

[tfs-changeset: 1564938]


haxelib run dox -i xml/bin/flash/types.xml -o .. -theme ./theme --title "HaxeFlixel API" -D source-path https://github.com/HaxeFlixel/flixel/tree/master -D version 3.3.9 --exclude "(__ASSET__|ApplicationMain|DocumentClass|DefaultAssetLibrary|Main|NMEPreloader)"

haxelib run dox -i xml/bin/flash/types.xml -o .. -theme ./theme --title "HaxeFlixel API" -D version 3.3.9 --exclude "(__ASSET__|ApplicationMain|DocumentClass|DefaultAssetLibrary|Main|NMEPreloader)"

remove now unnecessary -D source-path

gendocs.bat: remove now unnecessary -D source-path


#!/usr/bin/env bash

set OMP_NUM_THREADS=1

set num_args=0

if numargs LSS 1 (
    echo "Please specify an argument"
)
else (
    set command=%1
    echo "Running " %1
    if  %1 == "clean"  (
       rd /s cmake_install.cmake
       rd /s cubinbuild
       rd /s ptxbuild
       rd /s CMakeFiles
       rm -f CMakeCache.txt
       rd /s testbuild
       rd /s eclipse/CMakeFiles

       echo "Deleted build"
       )
    else (
      if  %1 ==  "eclipse"  (
            cd eclipse
            cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE ..
            python ./nsight-err-parse-patch.py ./project
            move eclipse/.cproject .
            move eclipse/.project .
        )
    )
     else  (
     if %1 ==  "lib"  (
        rd /s library  build
         mkdir librarybuild
         cd librarybuild
         cmake -DLIBRARY=TRUE ..
         make && cd ..
         )
     )

     else (
       if %1 ==  "test"  (
           if  num_args GTR 1  (
                rd /s testbuild
                mkdir testbuild
                cd testbuild
                cmake -DRUN_TEST=TRUE ..
                make && cd ..
                move testbuild/test/libnd4jtests .
               ./libnd4jtests -n %2
               )
           else (
               rd /s testbuild
               mkdir testbuild
               cd testbuild
               cmake -DRUN_TEST=TRUE ..
               make && cd ..
               move testbuild/test/libnd4jtests .
               ./libnd4jtests
           )

           echo "FINISHING BUILD"
           )
      )
     else (
       if %1 == "cubin"  (
            rd /s cubinbuild
           mkdir cubinbuild
           cd cubinbuild
           cmake -DCUBIN=TRUE ..
           make && cd ..
           echo "FINISHING BUILD"
           move cubinbuild/cubin/cuda_compile_cubin_generated_all.cu.cubin all.cubin
    )
 )

      else (
      if %1 == "buffer" (
            rd /s bufferbuild
           mkdir bufferbuild
           cd bufferbuild
           cmake -DBUFFER=TRUE ..
           make && cd ..
           echo "FINISHING BUILD"
        )
        )
     else (
     if %1 == "blas" (
            rd /s blasbuild
           mkdir blasbuild
           cd blasbuild
           if  %num_args% GTR 1 (
              if %2 == "cuda"  (
                   cmake -DCUDA_BLAS=true -DBLAS=TRUE ..
                   make && cd ..
                  echo "FINISHING BUILD"
                  )
              else (
                 if %2 == "cpu"  (
                   cmake -DCPU_BLAS=true -DBLAS=TRUE ..
                   make && cd ..
                   echo "FINISHING BUILD"
                )
               )
              else (
                   echo "Please specify cpu or gpu"
                )
              )

            else (
                cmake  -DCPU_BLAS=true -DBLAS=TRUE ..
                  make && cd ..
                  echo "FINISHING BUILD"
            )

   )

      else (
      if %1 == "ptx"  (
           rd /s ptxbuild
           mkdir ptxbuild
           cd ptxbuild
           cmake -DPTX=TRUE ..
           make && cd ..
           echo "FINISHING BUILD"
           move ptxbuild/ptx/cuda_compile_ptx_generated_all.cu.ptx all.ptx
       )
    )
     else (
      if  %1 == "fatbin" (
           rd /s fatbuild
           mkdir fatbuild
           cd fatbuild
           cmake -DFATBIN=TRUE ..
           make && cd ..
           echo "FINISHING BUILD"
           move fatbuild/fatbin/cuda_compile_fatbin_generated_all.cu.fatbin all.fatbin
)
)

)

#!/usr/bin/env bash

set OMP_NUM_THREADS=1

set num_args=0

if numargs LSS 1 (
    echo Please specify an argument
)
else (
    set command=%1
    echo Running  %1
    if  %1 == clean  (
       rd /s cmake_install.cmake
       rd /s cubinbuild
       rd /s ptxbuild
       rd /s CMakeFiles
       rm -f CMakeCache.txt
       rd /s testbuild
       rd /s eclipse/CMakeFiles

       echo Deleted build
       )
    else (
      if  %1 ==  eclipse  (
            cd eclipse
            cmake -GEclipse CDT4 - Unix Makefiles -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE ..
            python ./nsight-err-parse-patch.py ./project
            move eclipse/.cproject .
            move eclipse/.project .
        )
    )
     else  (
     if %1 ==  lib (
        rd /s library  build
         mkdir librarybuild
         cd librarybuild
         cmake -DLIBRARY=TRUE ..
         make && cd ..
         )
     )

     else (
       if %1 ==  test (
           if  num_args GTR 1  (
                rd /s testbuild
                mkdir testbuild
                cd testbuild
                cmake -DRUN_TEST=TRUE ..
                make && cd ..
                move testbuild/test/libnd4jtests .
               ./libnd4jtests -n %2
               )
           else (
               rd /s testbuild
               mkdir testbuild
               cd testbuild
               cmake -DRUN_TEST=TRUE ..
               make && cd ..
               move testbuild/test/libnd4jtests .
               ./libnd4jtests
           )

           echo FINISHING BUILD
           )
      )
     else (
       if %1 == cubin  (
            rd /s cubinbuild
           mkdir cubinbuild
           cd cubinbuild
           cmake -DCUBIN=TRUE ..
           make && cd ..
           echo FINISHING BUILD
           move cubinbuild/cubin/cuda_compile_cubin_generated_all.cu.cubin all.cubin
    )
 )

      else (
      if %1 == buffer (
            rd /s bufferbuild
           mkdir bufferbuild
           cd bufferbuild
           cmake -DBUFFER=TRUE ..
           make && cd ..
           echo FINISHING BUILD
        )
        )
     else (
     if %1 == blas (
            rd /s blasbuild
           mkdir blasbuild
           cd blasbuild
           if  %num_args% GTR 1 (
              if %2 == cuda  (
                   cmake -DCUDA_BLAS=true -DBLAS=TRUE ..
                   make && cd ..
                  echo FINISHING BUILD
                  )
              else (
                 if %2 == cpu  (
                   cmake -DCPU_BLAS=true -DBLAS=TRUE ..
                   make && cd ..
                   echo FINISHING BUILD
                )
               )
              else (
                   echo Please specify cpu or gpu
                )
              )

            else (
                cmake  -DCPU_BLAS=true -DBLAS=TRUE ..
                  make && cd ..
                  echo FINISHING BUILD
            )

   )

      else (
      if %1 == ptx  (
           rd /s ptxbuild
           mkdir ptxbuild
           cd ptxbuild
           cmake -DPTX=TRUE ..
           make && cd ..
           echo FINISHING BUILD
           move ptxbuild/ptx/cuda_compile_ptx_generated_all.cu.ptx all.ptx
       )
    )
     else (
      if  %1 == fatbin (
           rd /s fatbuild
           mkdir fatbuild
           cd fatbuild
           cmake -DFATBIN=TRUE ..
           make && cd ..
           echo FINISHING BUILD
           move fatbuild/fatbin/cuda_compile_fatbin_generated_all.cu.fatbin all.fatbin
)
)

)

set var

set var