:: setup variables which are used in Visual Studio project.
@echo off
set BOOST_DIR=c:\libraries\boost\boost_1_49_0
::set BOOST_DIR=c:\libraries\boost\boost_1_46_1
set FREEIMAGELIB_DIR=c:\libraries\FreeImage\3.15.3
::set ICULIB_DIR=c:\libraries\icu\icu4c-49_1_1\prebuilt
set ICULIB_DIR=c:\libraries\icu\icu4c-49_1_1\src
::set AIMP_PLUGINS_DIR=c:\AIMP2\Plugins
set AIMP_PLUGINS_DIR=c:\AIMP3\Plugins
::set AIMP_PLUGINS_DIR=c:\Program Files\AIMP3\Plugins

:: setup variables which are used in Visual Studio project.
@echo off
set BOOST_DIR=c:\libraries\boost\boost_1_52_0
::set BOOST_DIR=c:\libraries\boost\boost_1_46_1
set FREEIMAGELIB_DIR=c:\libraries\FreeImage\3.15.3
::set ICULIB_DIR=c:\libraries\icu\icu4c-49_1_1\prebuilt
set ICULIB_DIR=c:\libraries\icu\icu4c-49_1_1\src
::set AIMP_PLUGINS_DIR=c:\AIMP2\Plugins
set AIMP_PLUGINS_DIR=c:\AIMP3\Plugins
::set AIMP_PLUGINS_DIR=c:\Program Files\AIMP3\Plugins

use move to boost 1.52.0 instead 1.49.0

use move to boost 1.52.0 instead 1.49.0


@echo off

:: --------------------------------------------------------
::
:: Do not edit
::
:: --------------------------------------------------------

set PYBLISH_BASE=%~dp0\git\pyblish-base
set PYBLISH_MAYA=%~dp0\git\pyblish-maya
set PYBLISH_NUKE=%~dp0\git\pyblish-nuke
set PYBLISH_QML=%~dp0\git\pyblish-qml
set PYBLISH_LITE=%~dp0\git\pyblish-lite
set MINDBENDER_CORE=%~dp0\git\mindbender-core
set MINDBENDER_EXAMPLE=%dp0\git\mindbender-example
set MBBAT=%~dp0\mindbender-core\bin\_mb.bat

:: ---------------------------------------------------------
::
:: Edit here
::
:: ---------------------------------------------------------

:: Replace "%MINDBENDER_EXAMPLE%" with e.g. "m:\f03_projects"
call %MBBAT% %MINDBENDER_EXAMPLE% %*

Update mb.bat

Update mb.bat


@ECHO OFF
:: AGENT_HOME must be stored here, "%~dp0 works correctly only when called before @SETLOCAL" or SHIFT being invoked.
:: About ~dp0: Expand script being invoked variable (%0 ) to drive and path.
@SET AGENT_HOME=%~dp0
@SETLOCAL EnableDelayedExpansion

:: (Optional) Java and JVM runtime options
@SET JAVA_OPTS=%JAVA_OPTS%

:: the Agent port
@SET PORT=8089
:: the java executable
@SET JAVA_EXEC=java

:: folder containing the Agent actions
@SET COMPONENTS_FOLDER=ats-agent/actions
:: folder containing the Agent Template Actions
@SET TEMPLATE_ACTIONS_FOLDER=ats-agent/templateActions
:: set agent logging severity level
@SET LOGGING_SEVERITY=INFO
:: the amount of memory used by the service (in MB)
@SET MEMORY=256

:: allow remote connections for debug purposes
@SET DEBUG=1
@SET DEBUG_PORT=8000
rem @SET DEBUG_OPTIONS=
IF %DEBUG% EQU 1 (
    REM Enable remote debugging (all interfaces) for Java 9+. TODO: investigate for Java 8
    SET DEBUG_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,address=*:%DEBUG_PORT%,suspend=n
)

:: enable monitoring the number of pending log events (true/false)
@SET MONITOR_EVENTS_QUEUE=false

:: allow JMX connections (0/1)
@SET JMX=0
@SET JMX_PORT=1099
@SET JMX_OPTIONS=
@IF %JMX% EQU 1 (
    SET JMX_OPTIONS=-Dcom.sun.management.jmxremote.port=%JMX_PORT% -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
)

:: set logging pattern
@SET LOGGING_PATTERN=
:: keep first argument to the script - start stop or so
@SET COMMAND=%1%

:: Parse the input arguments
:args_loop
IF NOT "%1"=="" (
    IF "%1"=="-port" (
        REM set port
        SET PORT=%2
        SHIFT
    )
    IF "%1"=="-java_exec" (
        REM set java executable
        SET JAVA_EXEC=%2
        SHIFT
    )
    IF "%1"=="-memory" (
        REM set memory
        SET MEMORY=%2
        SHIFT
    )
    IF "%1"=="-logging_pattern" (
        REM set logging pattern
        SET LOGGING_PATTERN=%2
        SHIFT
    )
    IF "%1"=="-logging_severity" (
        REM set logging severity
        SET LOGGING_SEVERITY=%2
        SHIFT
    )
    IF "%1"=="-java_opts" (
        REM set java opts
        SET "JAVA_OPTS=%JAVA_OPTS% %2"
        SHIFT
    )
    SHIFT
    GOTO :args_loop
)

@SET TITLE=ATS Agent on %PORT% port

REM Do not change next line without sync-ing with Agent-with-Java POM parts
cd /d %AGENT_HOME%

REM *************
REM *** Uncomment this and set correct paths if you will start Agent as a service
REM cd /d <AGENT_HOME_ABSOLUTE_PATH>
REM @SET PATH=<JAVA_HOME_DIR\bin>;%PATH%
REM *************

if "%COMMAND%"==""          GOTO:agent_start
if "%COMMAND%"=="start"     GOTO:agent_start
if "%COMMAND%"=="stop"      GOTO:agent_stop
if "%COMMAND%"=="restart"   GOTO:agent_restart
if "%COMMAND%"=="status"    GOTO:agent_status
if "%COMMAND%"=="version"   GOTO:agent_version

:: TODO print [-java_opts JAVA_OPTS] as a known command in the future
ECHO Usage:
ECHO    %~n0.bat start^|stop^|restart^|status^|version [-port PORT] [-java_exec JAVA_EXE_PATH] [-logging_pattern day^|hour^|minute^|30KB^|20MB^|10GB] [-memory MEMORY_IN_MB] [-logging_severity DEBUG^|INFO^|WARN^|ERROR]
GOTO:EOF

:agent_version
!JAVA_EXEC! -cp ats-agent/ats-agent-standalone-containerstarter.jar com.axway.ats.agentapp.standalone.utils.AtsVersionExtractor
GOTO:EOF

:agent_start

call :getStatusText STATUS_TEXT
if "!STATUS_TEXT!"=="AtsAgent is running" (
    echo AtsAgent is already started on port !PORT!
    GOTO:EOF
)
:: this check is made second time in case there is a process
:: listening on this port, but there is no PID file or running agent
call :checkIsPortBusy isPortBusy
if "!isPortBusy!"=="YES" (
    echo Port %PORT% is used by already started agent or another process ^^!
    GOTO:EOF
)

TITLE %TITLE%

rem check java version
!JAVA_EXEC! -version > java.version 2>&1

for /f "delims=" %%l in (java.version) do (
    set line=%%l
    del java.version
    goto next_java_version_check
)

:next_java_version_check
echo %line% | FINDSTR /r 1\.[7-8]

IF %ERRORLEVEL%==0 (
    set JAVA_VERSION=8
) ELSE (
    set JAVA_VERSION=9
)

IF %JAVA_VERSION%==9 (
    REM Java 9 or newer detected

    REM Enable REMOTE debugging. By deault Java 9+ debugging is enabled only on localhost
    IF %DEBUG% EQU 1 (
        echo Enable remote debugging for Java 9+
        SET DEBUG_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,address=*:%DEBUG_PORT%,suspend=n
    )

    !JAVA_EXEC! -showversion ^
    -Dats.agent.default.port=!PORT! -Dats.agent.home="%AGENT_HOME:\=/%" ^
    %JMX_OPTIONS% ^
    -Dats.log.monitor.events.queue=%MONITOR_EVENTS_QUEUE% ^
    -Dats.agent.components.folder="%COMPONENTS_FOLDER%" -Dagent.template.actions.folder="%TEMPLATE_ACTIONS_FOLDER%" ^
    -Dlogging.severity="%LOGGING_SEVERITY%" ^
    -Xms!MEMORY!m -Xmx!MEMORY!m -Dlogging.pattern="!LOGGING_PATTERN!" ^
    %JAVA_OPTS% %DEBUG_OPTIONS% ^
    -jar ats-agent/ats-agent-standalone-containerstarter.jar

) ELSE (
    REM Java <= 8

    IF %DEBUG% EQU 1 (
        ECHO Enable remote debugging for Java 8
        SET DEBUG_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,address=%DEBUG_PORT%,suspend=n
    )

    !JAVA_EXEC! -showversion ^
    -Dats.agent.default.port=!PORT! -Dats.agent.home="%AGENT_HOME:\=/%" -Djava.endorsed.dirs=ats-agent/endorsed ^
    %JMX_OPTIONS% ^
    -Dats.log.monitor.events.queue=%MONITOR_EVENTS_QUEUE% ^
    -Dats.agent.components.folder="%COMPONENTS_FOLDER%" -Dagent.template.actions.folder="%TEMPLATE_ACTIONS_FOLDER%" ^
    -Dlogging.severity="%LOGGING_SEVERITY%" ^
    -Xms!MEMORY!m -Xmx!MEMORY!m -Dlogging.pattern="!LOGGING_PATTERN!" ^
    %JAVA_OPTS% %DEBUG_OPTIONS% ^
    -jar ats-agent/ats-agent-standalone-containerstarter.jar
)

GOTO:EOF

:agent_stop

:: get the agent PID from the .pid file
call :getPid PID
if !PID! neq "" (
    :: get the CMD PID as a parent of the agent PID
    call :getParentPid CMD_PID

    :: stop the agent
    taskkill /f /t /PID %PID%

    :: delete the .pid file
    DEL "logs\atsAgent_%PORT%.pid"
)
if !CMD_PID! neq "" (
   :: close the CMD window, if still opened
   taskkill /f /t /PID %CMD_PID% >nul 2>&1
)

GOTO:EOF

:agent_restart

call :agent_stop
call :agent_start
GOTO:EOF

:agent_status

call :getStatusText STATUS_TEXT
echo !STATUS_TEXT!
GOTO:EOF

:checkIsPortBusy

:: check if there is started process on this port and is listening
SETLOCAL ENABLEEXTENSIONS
for /f "tokens=*" %%i in ('netstat -ano ^| findstr %PORT% ^| findstr "LISTENING"') do (
    if [%%i] neq [] (
        endlocal&set %1=YES&goto :eof
    )
)
endlocal&set %1=NO&goto :eof

:checkIfStarted

SETLOCAL ENABLEEXTENSIONS
:: the line to process, something like "PID:   1234"
@set Line=%*
:: check if the value the line starts with "PID:"
@set Value=!Line:~0,4!
if "!Value!"=="PID:" (
    endlocal&set agentStartedResult="YES"&goto :eof
)
endlocal&set agentStartedResult="NO"&goto :eof

:getPid

:: the pid file is created by the java process on start
SETLOCAL ENABLEEXTENSIONS
if exist logs/atsAgent_%PORT%.pid (
    FOR /F "tokens=*" %%i IN (logs/atsAgent_%PORT%.pid) DO (

        @if NOT !ERRORLEVEL! == 1 (
            REM echo Found PID "%%i"
            endlocal&set %1=%%i&goto :eof
        )
    )
)
::echo PID not found
endlocal&set %1=""&goto :eof

:getParentPid

:: the parent pid of the java process - the CMD window PID
@SETLOCAL ENABLEEXTENSIONS
FOR /F "tokens=*" %%i IN ('"wmic process where(processId="!PID!") get ParentProcessId /value"') DO (

     @SET "line=%%i"
     if "!line:ParentProcessId=!" NEQ "!line!" (
         @endlocal
         REM we need to set the 'line' value again(out of LOCAL)
         @SET "line=%%i"
         REM echo Found Parent PID !line:~16!
         @set %1=!line:~16!&goto :eof
     )
)
::echo parent PID not found
endlocal&set %1=""&goto :eof

:getStatusText

call :getPid PID
:: check the process by its PID and return the status text
@SETLOCAL ENABLEEXTENSIONS
if !PID! neq "" (
    for /F "delims=" %%a in ('tasklist /fo list /fi "pid eq !PID!"') do (

        set agentStartedResult=""
        REM pass this line
        call :checkIfStarted %%a
        if !agentStartedResult!=="YES" (
            call :checkIsPortBusy isPortBusy
            if "!isPortBusy!"=="YES" (
                endlocal&set %1=AtsAgent is running&goto :eof
                GOTO:EOF
            )
        )
    )
)
endlocal&set %1=AtsAgent seems not running.&goto :eof

@ECHO OFF
:: AGENT_HOME must be stored here, "%~dp0 works correctly only when called before @SETLOCAL" or SHIFT being invoked.
:: About ~dp0: Expand script being invoked variable (%0 ) to drive and path.
@SET AGENT_HOME=%~dp0
@SETLOCAL EnableDelayedExpansion

:: (Optional) Java and JVM runtime options
@SET JAVA_OPTS=%JAVA_OPTS%

:: the Agent port
@SET PORT=8089
:: the java executable
@SET JAVA_EXEC=java

:: folder containing the Agent actions
@SET COMPONENTS_FOLDER=ats-agent/actions
:: folder containing the Agent Template Actions
@SET TEMPLATE_ACTIONS_FOLDER=ats-agent/templateActions
:: set agent logging severity level
@SET LOGGING_SEVERITY=INFO
:: the amount of memory used by the service (in MB)
@SET MEMORY=256

:: allow remote connections for debug purposes
@SET DEBUG=0
@SET DEBUG_PORT=8000
REM Full DEBUG_OPTIONS line is constructed right before JVM start since it is dependent on the JRE version

:: enable monitoring the number of pending log events (true/false)
@SET MONITOR_EVENTS_QUEUE=false

:: allow JMX connections (0/1)
@SET JMX=0
@SET JMX_PORT=1099
@SET JMX_OPTIONS=
@IF %JMX% EQU 1 (
    SET JMX_OPTIONS=-Dcom.sun.management.jmxremote.port=%JMX_PORT% -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
)

:: set logging pattern
@SET LOGGING_PATTERN=
:: keep first argument to the script - start stop or so
@SET COMMAND=%1%

:: Parse the input arguments
:args_loop
IF NOT "%1"=="" (
    IF "%1"=="-port" (
        REM set port
        SET PORT=%2
        SHIFT
    )
    IF "%1"=="-java_exec" (
        REM set java executable
        SET JAVA_EXEC=%2
        SHIFT
    )
    IF "%1"=="-memory" (
        REM set memory
        SET MEMORY=%2
        SHIFT
    )
    IF "%1"=="-logging_pattern" (
        REM set logging pattern
        SET LOGGING_PATTERN=%2
        SHIFT
    )
    IF "%1"=="-logging_severity" (
        REM set logging severity
        SET LOGGING_SEVERITY=%2
        SHIFT
    )
    IF "%1"=="-java_opts" (
        REM set java opts
        SET "JAVA_OPTS=%JAVA_OPTS% %2"
        SHIFT
    )
    SHIFT
    GOTO :args_loop
)

@SET TITLE=ATS Agent on %PORT% port

REM Do not change next line without sync-ing with Agent-with-Java POM parts
cd /d %AGENT_HOME%

REM *************
REM *** Uncomment this and set correct paths if you will start Agent as a service
REM cd /d <AGENT_HOME_ABSOLUTE_PATH>
REM @SET PATH=<JAVA_HOME_DIR\bin>;%PATH%
REM *************

if "%COMMAND%"==""          GOTO:agent_start
if "%COMMAND%"=="start"     GOTO:agent_start
if "%COMMAND%"=="stop"      GOTO:agent_stop
if "%COMMAND%"=="restart"   GOTO:agent_restart
if "%COMMAND%"=="status"    GOTO:agent_status
if "%COMMAND%"=="version"   GOTO:agent_version

:: TODO print [-java_opts JAVA_OPTS] as a known command in the future
ECHO Usage:
ECHO    %~n0.bat start^|stop^|restart^|status^|version [-port PORT] [-java_exec JAVA_EXE_PATH] [-logging_pattern day^|hour^|minute^|30KB^|20MB^|10GB] [-memory MEMORY_IN_MB] [-logging_severity DEBUG^|INFO^|WARN^|ERROR]
GOTO:EOF

:agent_version
!JAVA_EXEC! -cp ats-agent/ats-agent-standalone-containerstarter.jar com.axway.ats.agentapp.standalone.utils.AtsVersionExtractor
GOTO:EOF

:agent_start

call :getStatusText STATUS_TEXT
if "!STATUS_TEXT!"=="AtsAgent is running" (
    echo AtsAgent is already started on port !PORT!
    GOTO:EOF
)
:: this check is made second time in case there is a process
:: listening on this port, but there is no PID file or running agent
call :checkIsPortBusy isPortBusy
if "!isPortBusy!"=="YES" (
    echo Port %PORT% is used by already started agent or another process ^^!
    GOTO:EOF
)

TITLE %TITLE%

rem check java version
!JAVA_EXEC! -version > java.version 2>&1

for /f "delims=" %%l in (java.version) do (
    set line=%%l
    del java.version
    goto next_java_version_check
)

SETLOCAL ENABLEDELAYEDEXPANSION
:next_java_version_check
echo %line% | FINDSTR /r 1\.[7-8]

IF %ERRORLEVEL%==0 (
    set JAVA_VERSION=8
) ELSE (
    set JAVA_VERSION=9
)

IF %JAVA_VERSION%==9 (
    REM Java 9 or newer detected

    REM Enable REMOTE debugging. By deault Java 9+ debugging is enabled only on localhost
    IF %DEBUG% EQU 1 (
        ECHO Enable remote debugging for Java 9+
        SET DEBUG_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,address=*:%DEBUG_PORT%,suspend=n
    )

    !JAVA_EXEC! -showversion ^
    -Dats.agent.default.port=!PORT! -Dats.agent.home="%AGENT_HOME:\=/%" ^
    %JMX_OPTIONS% ^
    -Dats.log.monitor.events.queue=%MONITOR_EVENTS_QUEUE% ^
    -Dats.agent.components.folder="%COMPONENTS_FOLDER%" -Dagent.template.actions.folder="%TEMPLATE_ACTIONS_FOLDER%" ^
    -Dlogging.severity="%LOGGING_SEVERITY%" ^
    -Xms!MEMORY!m -Xmx!MEMORY!m -Dlogging.pattern="!LOGGING_PATTERN!" ^
    %JAVA_OPTS% !DEBUG_OPTIONS! ^
    -jar ats-agent/ats-agent-standalone-containerstarter.jar

) ELSE (
    REM Java <= 8

    IF %DEBUG% EQU 1 (
        ECHO Enable remote debugging for Java 8
        SET DEBUG_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,address=%DEBUG_PORT%,suspend=n
    )

    !JAVA_EXEC! -showversion ^
    -Dats.agent.default.port=!PORT! -Dats.agent.home="%AGENT_HOME:\=/%" -Djava.endorsed.dirs=ats-agent/endorsed ^
    %JMX_OPTIONS% ^
    -Dats.log.monitor.events.queue=%MONITOR_EVENTS_QUEUE% ^
    -Dats.agent.components.folder="%COMPONENTS_FOLDER%" -Dagent.template.actions.folder="%TEMPLATE_ACTIONS_FOLDER%" ^
    -Dlogging.severity="%LOGGING_SEVERITY%" ^
    -Xms!MEMORY!m -Xmx!MEMORY!m -Dlogging.pattern="!LOGGING_PATTERN!" ^
    %JAVA_OPTS% !DEBUG_OPTIONS! ^
    -jar ats-agent/ats-agent-standalone-containerstarter.jar
)

ENDLOCAL
GOTO:EOF

:agent_stop

:: get the agent PID from the .pid file
call :getPid PID
if !PID! neq "" (
    :: get the CMD PID as a parent of the agent PID
    call :getParentPid CMD_PID

    :: stop the agent
    taskkill /f /t /PID %PID%

    :: delete the .pid file
    DEL "logs\atsAgent_%PORT%.pid"
)
if !CMD_PID! neq "" (
   :: close the CMD window, if still opened
   taskkill /f /t /PID %CMD_PID% >nul 2>&1
)

GOTO:EOF

:agent_restart

call :agent_stop
call :agent_start
GOTO:EOF

:agent_status

call :getStatusText STATUS_TEXT
echo !STATUS_TEXT!
GOTO:EOF

:checkIsPortBusy

:: check if there is started process on this port and is listening
SETLOCAL ENABLEEXTENSIONS
for /f "tokens=*" %%i in ('netstat -ano ^| findstr %PORT% ^| findstr "LISTENING"') do (
    if [%%i] neq [] (
        endlocal&set %1=YES&goto :eof
    )
)
endlocal&set %1=NO&goto :eof

:checkIfStarted

SETLOCAL ENABLEEXTENSIONS
:: the line to process, something like "PID:   1234"
@set Line=%*
:: check if the value the line starts with "PID:"
@set Value=!Line:~0,4!
if "!Value!"=="PID:" (
    endlocal&set agentStartedResult="YES"&goto :eof
)
endlocal&set agentStartedResult="NO"&goto :eof

:getPid

:: the pid file is created by the java process on start
SETLOCAL ENABLEEXTENSIONS
if exist logs/atsAgent_%PORT%.pid (
    FOR /F "tokens=*" %%i IN (logs/atsAgent_%PORT%.pid) DO (

        @if NOT !ERRORLEVEL! == 1 (
            REM echo Found PID "%%i"
            endlocal&set %1=%%i&goto :eof
        )
    )
)
::echo PID not found
endlocal&set %1=""&goto :eof

:getParentPid

:: the parent pid of the java process - the CMD window PID
@SETLOCAL ENABLEEXTENSIONS
FOR /F "tokens=*" %%i IN ('"wmic process where(processId="!PID!") get ParentProcessId /value"') DO (

     @SET "line=%%i"
     if "!line:ParentProcessId=!" NEQ "!line!" (
         @endlocal
         REM we need to set the 'line' value again(out of LOCAL)
         @SET "line=%%i"
         REM echo Found Parent PID !line:~16!
         @set %1=!line:~16!&goto :eof
     )
)
::echo parent PID not found
endlocal&set %1=""&goto :eof

:getStatusText

call :getPid PID
:: check the process by its PID and return the status text
@SETLOCAL ENABLEEXTENSIONS
if !PID! neq "" (
    for /F "delims=" %%a in ('tasklist /fo list /fi "pid eq !PID!"') do (

        set agentStartedResult=""
        REM pass this line
        call :checkIfStarted %%a
        if !agentStartedResult!=="YES" (
            call :checkIsPortBusy isPortBusy
            if "!isPortBusy!"=="YES" (
                endlocal&set %1=AtsAgent is running&goto :eof
                GOTO:EOF
            )
        )
    )
)
endlocal&set %1=AtsAgent seems not running.&goto :eof

[Agent] Fix agent start script for Windows - JVM debug mode


Add a batch file for running the webkit tests. Similar to the .sh version, this makes it easier for people using cmd to run the webkit tests (and use the correct version of python).
Review URL: http://codereview.chromium.org/13605

git-svn-id: http://src.chromium.org/svn/trunk/src@6659 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 8a52beddc7a689461ce9717159dc63eb13e10062


REM
REM Copyright (C) 2011-13, DyND Developers
REM BSD 2-Clause License, see LICENSE.txt
REM
REM This is the master windows build + test script for building
REM the dynd python bindings on jenkins.
REM
REM Jenkins Requirements:
REM   - Anaconda should be installed in C:\Anaconda.
REM   - Use a jenkins build matrix for multiple
REM     platforms/python versions
REM   - Use the XShell plugin to launch this script
REM   - Call the script from the root workspace
REM     directory as buildscripts/jenkins-build
REM   - Use a user-defined axis to select python versions with PYTHON_VERSION
REM

REM If no MSVC version is selected, choose 2013
if "%MSVC_VERSION%" == "" set MSVC_VERSION=12.0
REM Require a version of Python to be selected
if "%PYTHON_VERSION%" == "" exit /b 1

REM Jenkins has '/' in its workspace. Fix it to '\' to simplify the DOS commands.
set WORKSPACE=%WORKSPACE:/=\%

REM Remove the build subdirectory from last time
rd /q /s build

REM Get libdynd into the libraries subdirectory
REM TODO: Build libdynd in a separate jenkins project,
REM       and use its build artifact here.
call .\buildscripts\checkout_libdynd.bat
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Make sure binstar is installed in the main environment
echo Updating binstar...
call C:\Anaconda\Scripts\conda install --yes binstar || exit 1
call C:\Anaconda\Scripts\binstar --version
echo on

REM Use conda to create a conda environment of the required
REM python version and containing the dependencies.
SET PYENV_PREFIX=%WORKSPACE%\build\pyenv
rd /s /q %PYENV_PREFIX%
REM NOTE: cython is forced to 0.20.2 temporarily because of a bug in anaconda
REM       https://github.com/ContinuumIO/anaconda-issues/issues/178
call C:\Anaconda\Scripts\conda create --yes -p %PYENV_PREFIX% python=%PYTHON_VERSION% cython=0.20.2 scipy nose
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on
set PYTHON_EXECUTABLE=%PYENV_PREFIX%\Python.exe
set PATH=%PYENV_PREFIX%;%PYENV_PREFIX%\Scripts;%PATH%

REM Select the correct compiler, by first getting whether
REM the Python is 32-bit or 64-bit.
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import ctypes;print(8*ctypes.sizeof(ctypes.c_void_p))"') DO set PYTHON_BITS=%%i
if "%PYTHON_BITS%" == "64" goto :python64
 set MSVC_VCVARS_PLATFORM=x86
 set MSVC_BUILD_PLATFORM=Win32
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12"
 oto :python32
:python64
 set MSVC_VCVARS_PLATFORM=amd64
 set MSVC_BUILD_PLATFORM=x64
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12 Win64"
:python32

REM Configure the appropriate visual studio command line environment
if "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES%\Microsoft Visual Studio %MSVC_VERSION%\VC
if NOT "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES(X86)%\Microsoft Visual Studio %MSVC_VERSION%\VC
call "%VCDIR%\vcvarsall.bat" %MSVC_VCVARS_PLATFORM%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Create a fresh visual studio solution with cmake, and do the build/install
cd build
cmake -DDYND_INSTALL_LIB=OFF -DCMAKE_INSTALL_PREFIX=install -G %CMAKE_BUILD_TARGET% -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% ..
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%"
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%" /Project INSTALL
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Run the tests and generate xml results
%PYTHON_EXECUTABLE% -c "import dynd;dynd.test(xunitfile='../test_results.xml', verbosity=2, exit=1)"
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Get the version number and process it into a suitable form
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import dynd;print(dynd.__version__)"') DO set PYDYND_VERSION=%%i
if "%PYDYND_VERSION%" == "" exit /b 1
set PYDYND_VERSION=%PYDYND_VERSION:-=_%

REM Put the conda package by itself in the directory pkgs/<anaconda-arch>
cd ..
rd /q /s pkgs
mkdir pkgs
cd pkgs
mkdir win-%PYTHON_BITS%
cd win-%PYTHON_BITS%

REM Create a conda package from the build
call C:\Anaconda\Scripts\conda package -p %PYENV_PREFIX% --pkg-name=dynd-python --pkg-version=%PYDYND_VERSION%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Upload the package to binstar
FOR /F "delims=" %%i IN ('dir /b dynd-python-*.tar.bz2') DO set PKG_FILE=%%i
call C:\Anaconda\Scripts\binstar -t %BINSTAR_MWIEBE_AUTH% upload --force %PKG_FILE% || exit 1
call C:\Anaconda\Scripts\binstar -t %BINSTAR_BLAZE_AUTH% upload --force %PKG_FILE% || exit 1

cd ..

exit /b 0

REM
REM Copyright (C) 2011-13, DyND Developers
REM BSD 2-Clause License, see LICENSE.txt
REM
REM This is the master windows build + test script for building
REM the dynd python bindings on jenkins.
REM
REM Jenkins Requirements:
REM   - Anaconda should be installed in C:\Anaconda.
REM   - Use a jenkins build matrix for multiple
REM     platforms/python versions
REM   - Use the XShell plugin to launch this script
REM   - Call the script from the root workspace
REM     directory as buildscripts/jenkins-build
REM   - Use a user-defined axis to select python versions with PYTHON_VERSION
REM

REM If no MSVC version is selected, choose 2013
if "%MSVC_VERSION%" == "" set MSVC_VERSION=12.0
REM Require a version of Python to be selected
if "%PYTHON_VERSION%" == "" exit /b 1

REM Jenkins has '/' in its workspace. Fix it to '\' to simplify the DOS commands.
set WORKSPACE=%WORKSPACE:/=\%

REM Remove the build subdirectory from last time
rd /q /s build

REM Get libdynd into the libraries subdirectory
REM TODO: Build libdynd in a separate jenkins project,
REM       and use its build artifact here.
call .\buildscripts\checkout_libdynd.bat
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Make sure binstar is installed in the main environment
echo Updating binstar...
call C:\Anaconda\Scripts\conda install --yes binstar || exit 1
call C:\Anaconda\Scripts\binstar --version
echo on

REM Use conda to create a conda environment of the required
REM python version and containing the dependencies.
SET PYENV_PREFIX=%WORKSPACE%\build\pyenv
rd /s /q %PYENV_PREFIX%
REM NOTE: cython is forced to 0.20.2 temporarily because of a bug in anaconda
REM       https://github.com/ContinuumIO/anaconda-issues/issues/178
call C:\Anaconda\Scripts\conda create --yes -p %PYENV_PREFIX% python=%PYTHON_VERSION% cython=0.20.2 scipy nose
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on
set PYTHON_EXECUTABLE=%PYENV_PREFIX%\Python.exe
set PATH=%PYENV_PREFIX%;%PYENV_PREFIX%\Scripts;%PATH%

REM Select the correct compiler, by first getting whether
REM the Python is 32-bit or 64-bit.
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import ctypes;print(8*ctypes.sizeof(ctypes.c_void_p))"') DO set PYTHON_BITS=%%i
if "%PYTHON_BITS%" == "64" goto :python64
 set MSVC_VCVARS_PLATFORM=x86
 set MSVC_BUILD_PLATFORM=Win32
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12"
goto :python32
:python64
 set MSVC_VCVARS_PLATFORM=amd64
 set MSVC_BUILD_PLATFORM=x64
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12 Win64"
:python32

REM Configure the appropriate visual studio command line environment
if "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES%\Microsoft Visual Studio %MSVC_VERSION%\VC
if NOT "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES(X86)%\Microsoft Visual Studio %MSVC_VERSION%\VC
call "%VCDIR%\vcvarsall.bat" %MSVC_VCVARS_PLATFORM%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Create a fresh visual studio solution with cmake, and do the build/install
cd build
cmake -DDYND_INSTALL_LIB=OFF -DCMAKE_INSTALL_PREFIX=install -G %CMAKE_BUILD_TARGET% -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% ..
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%"
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%" /Project INSTALL
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Run the tests and generate xml results
%PYTHON_EXECUTABLE% -c "import dynd;dynd.test(xunitfile='../test_results.xml', verbosity=2, exit=1)"
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Get the version number and process it into a suitable form
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import dynd;print(dynd.__version__)"') DO set PYDYND_VERSION=%%i
if "%PYDYND_VERSION%" == "" exit /b 1
set PYDYND_VERSION=%PYDYND_VERSION:-=_%

REM Put the conda package by itself in the directory pkgs/<anaconda-arch>
cd ..
rd /q /s pkgs
mkdir pkgs
cd pkgs
mkdir win-%PYTHON_BITS%
cd win-%PYTHON_BITS%

REM Create a conda package from the build
call C:\Anaconda\Scripts\conda package -p %PYENV_PREFIX% --pkg-name=dynd-python --pkg-version=%PYDYND_VERSION%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Upload the package to binstar
FOR /F "delims=" %%i IN ('dir /b dynd-python-*.tar.bz2') DO set PKG_FILE=%%i
call C:\Anaconda\Scripts\binstar -t %BINSTAR_MWIEBE_AUTH% upload --force %PKG_FILE% || exit 1
call C:\Anaconda\Scripts\binstar -t %BINSTAR_BLAZE_AUTH% upload --force %PKG_FILE% || exit 1

cd ..

exit /b 0

Fix typo in last commit

Fix typo in last commit


@echo off

cd %APPVEYOR_BUILD_FOLDER%

:: =========================================================
:: Set some defaults. Infer some variables.
::
:: These are set globally
if "%LUA_VER%" NEQ "" (
	set LUA=lua
	set LUA_SHORTV=%LUA_VER:~0,3%
) else (
	set LUA=luajit
	set LJ_SHORTV=%LJ_VER:~0,3%
	set LUA_SHORTV=5.1
)

:: defines LUA_DIR so Cmake can find this Lua install
if "%LUA%"=="luajit" (
	set LUA_DIR=c:\lua\%platform%\lj%LJ_SHORTV%
) else (
	set LUA_DIR=c:\lua\%platform%\%LUA_VER%
)

:: Now we declare a scope
Setlocal EnableDelayedExpansion EnableExtensions

if not defined LUAROCKS_URL set LUAROCKS_URL=https://keplerproject.github.io/luarocks/releases
if not defined LUAROCKS_REPO set LUAROCKS_REPO=https://luarocks.org
if not defined LUA_URL set LUA_URL=http://www.lua.org/ftp
if defined NOCOMPAT (
	set COMPATFLAG=--nocompat
) else (
	set COMPATFLAG=
)
if not defined LUAJIT_GIT_REPO set LUAJIT_GIT_REPO=https://github.com/LuaJIT/LuaJIT.git
if not defined LUAJIT_URL set LUAJIT_URL=https://github.com/LuaJIT/LuaJIT/archive

if not defined LR_EXTERNAL set LR_EXTERNAL=c:\external
if not defined LUAROCKS_INSTALL set LUAROCKS_INSTALL=%LUA_DIR%\LuaRocks

:: LuaRocks <= 2.2.2 used a versioned directory
:: HEAD and newer versions do not, so act accordingly.
if defined LR_ROOT goto :skiplrver

if "%LUAROCKS_VER%" EQU "HEAD" (
	set LR_ROOT=%LUAROCKS_INSTALL%
	goto :skiplrver
)
set LR_ROOT=%LUAROCKS_INSTALL%
if %LUAROCKS_VER:~0,1% LEQ 2 (
	if %LUAROCKS_VER:~2,1% LEQ 2 (
		if %LUAROCKS_VER:~4,1% LEQ 3 (
			set LR_ROOT=%LUAROCKS_INSTALL%\!LUAROCKS_VER:~0,3!
		)
	)
)
:skiplrver

if not defined LR_SYSTREE set LR_SYSTREE=%LUAROCKS_INSTALL%\systree

if not defined SEVENZIP set SEVENZIP=7z
::
:: =========================================================

:: first create some necessary directories:
mkdir downloads 2>NUL

:: Download and compile Lua (or LuaJIT)
if "%LUA%"=="luajit" (
	if not exist %LUA_DIR% (
		if "%LJ_SHORTV%"=="2.1" (
			:: Clone repository and checkout 2.1 branch
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Cloning git repo %LUAJIT_GIT_REPO% !lj_source_folder!
				git clone %LUAJIT_GIT_REPO% !lj_source_folder! || call :die "Failed to clone repository"
			) else (
				cd !lj_source_folder!
				git pull || call :die "Failed to update repository"
			)
			cd !lj_source_folder!\src
			git checkout v2.1 || call :die
		) else (
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Downloading... %LUAJIT_URL%/v%LJ_VER%.tar.gz
				curl --location --silent --fail --max-time 120 --connect-timeout 30 %LUAJIT_URL%/v%LJ_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
			)
			cd !lj_source_folder!\src
		)
		:: Compiles LuaJIT
		if "%Configuration%"=="MinGW" (
			call mingw32-make
		) else (
			call msvcbuild.bat
		)

		mkdir %LUA_DIR% 2> NUL
		for %%a in (bin bin\lua bin\lua\jit include lib) do ( mkdir "%LUA_DIR%\%%a" )

		for %%a in (luajit.exe lua51.dll) do ( move "!lj_source_folder!\src\%%a" "%LUA_DIR%\bin" )
		copy "%LUA_DIR%\bin\luajit.exe" "%LUA_DIR%\bin\lua.exe"

		move "!lj_source_folder!\src\lua51.lib" "%LUA_DIR%\lib"
		for %%a in (lauxlib.h lua.h lua.hpp luaconf.h lualib.h luajit.h) do (
			copy "!lj_source_folder!\src\%%a" "%LUA_DIR%\include"
		)

		copy "!lj_source_folder!\src\jit\*.lua" "%LUA_DIR%\bin\lua\jit"

	) else (
		echo LuaJIT %LJ_VER% already installed at %LUA_DIR%
	)
) else (
	if not exist %LUA_DIR% (
		:: Download and compile Lua
		if not exist downloads\lua-%LUA_VER% (
			curl --silent --fail --max-time 120 --connect-timeout 30 %LUA_URL%/lua-%LUA_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
		)

		mkdir downloads\lua-%LUA_VER%\etc 2> NUL
		copy %~dp0\winmake.bat downloads\lua-%LUA_VER%\etc\winmake.bat

		cd downloads\lua-%LUA_VER%
		call etc\winmake %COMPATFLAG%
		call etc\winmake install %LUA_DIR%
	) else (
		echo Lua %LUA_VER% already installed at %LUA_DIR%
	)
)

if not exist %LUA_DIR%\bin\%LUA%.exe call :die "Missing Lua interpreter at %LUA_DIR%\bin\%LUA%.exe"

set PATH=%LUA_DIR%\bin;%PATH%
call !LUA! -v

:: ==========================================================
:: LuaRocks
:: ==========================================================

if not exist "%LR_ROOT%" (
	:: Downloads and installs LuaRocks
	cd %APPVEYOR_BUILD_FOLDER%

	if %LUAROCKS_VER%==HEAD (
		set lr_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luarocks-%LUAROCKS_VER%-win32
		if not exist !lr_source_folder! (
			git clone https://github.com/keplerproject/luarocks.git --single-branch --depth 1 !lr_source_folder! || call :die "Failed to clone LuaRocks repository"
		) else (
			cd !lr_source_folder!
			git pull || call :die "Failed to update LuaRocks repository"
		)
	) else (
		if not exist downloads\luarocks-%LUAROCKS_VER%-win32.zip (
			echo Downloading LuaRocks...
			curl -L --silent --fail --max-time 120 --connect-timeout 30 --output downloads\luarocks-%LUAROCKS_VER%-win32.zip %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
			%SEVENZIP% x -aoa -odownloads downloads\luarocks-%LUAROCKS_VER%-win32.zip
		)
	)

	cd downloads\luarocks-%LUAROCKS_VER%-win32
	if "%Configuration%"=="MinGW" (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%" /MW
	) else (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%"
	)

	:: Configures LuaRocks to instruct CMake the correct generator to use. Else, CMake will pick the highest
	:: Visual Studio version installed
	if "%Configuration%"=="MinGW" (
		echo cmake_generator = "MinGW Makefiles" >> %LUAROCKS_INSTALL%\config-%LUA_SHORTV%.lua
	) else (
		set MSVS_GENERATORS[2008]=Visual Studio 9 2008
		set MSVS_GENERATORS[2010]=Visual Studio 10 2010
		set MSVS_GENERATORS[2012]=Visual Studio 11 2012
		set MSVS_GENERATORS[2013]=Visual Studio 12 2013
		set MSVS_GENERATORS[2015]=Visual Studio 14 2015

		set CMAKE_GENERATOR=!MSVS_GENERATORS[%Configuration%]!
		if "%platform%" EQU "x64" (set CMAKE_GENERATOR=!CMAKE_GENERATOR! Win64)

		echo cmake_generator = "!CMAKE_GENERATOR!" >> %LUAROCKS_INSTALL%\config-%LUA_SHORTV%.lua
	)
)

if not exist "%LR_ROOT%" call :die "LuaRocks not found at %LR_ROOT%"

set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH%

:: Lua will use just the system rocks
set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua
set LUA_PATH=%LUA_PATH%;.\?.lua;.\?\init.lua
set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll;.\?.dll

call luarocks --version || call :die "Error with LuaRocks installation"
call luarocks list

if not exist "%LR_EXTERNAL%" (
	mkdir "%LR_EXTERNAL%"
	mkdir "%LR_EXTERNAL%\lib"
	mkdir "%LR_EXTERNAL%\include"
)

set PATH=%LR_EXTERNAL%;%PATH%

:: Exports the following variables:
:: (beware of whitespace between & and ^ below)
endlocal & set PATH=%PATH%&^
set LR_SYSTREE=%LR_SYSTREE%&^
set LUA_PATH=%LUA_PATH%&^
set LUA_CPATH=%LUA_CPATH%&^
set LR_EXTERNAL=%LR_EXTERNAL%

echo.
echo ======================================================
if "%LUA%"=="luajit" (
	echo Installation of LuaJIT %LJ_VER% and LuaRocks %LUAROCKS_VER% done.
) else (
	echo Installation of Lua %LUA_VER% and LuaRocks %LUAROCKS_VER% done.
	if defined NOCOMPAT echo Lua was built with compatibility flags disabled.
)
echo Platform         - %platform%
echo LUA              - %LUA%
echo LUA_SHORTV       - %LUA_SHORTV%
echo LJ_SHORTV        - %LJ_SHORTV%
echo LUA_PATH         - %LUA_PATH%
echo LUA_CPATH        - %LUA_CPATH%
echo.
echo LR_EXTERNAL      - %LR_EXTERNAL%
echo ======================================================
echo.

goto :eof

:: This blank space is intentional. If you see errors like "The system cannot find the batch label specified 'foo'"
:: then try adding or removing blank lines lines above.
:: Yes, really.
:: http://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e

:: helper functions:

:: for bailing out when an error occurred
:die %1
echo %1
exit /B 1
goto :eof

@echo off

cd %APPVEYOR_BUILD_FOLDER%

:: =========================================================
:: Set some defaults. Infer some variables.
::
:: These are set globally
if "%LUA_VER%" NEQ "" (
	set LUA=lua
	set LUA_SHORTV=%LUA_VER:~0,3%
) else (
	set LUA=luajit
	set LJ_SHORTV=%LJ_VER:~0,3%
	set LUA_SHORTV=5.1
)

:: defines LUA_DIR so Cmake can find this Lua install
if "%LUA%"=="luajit" (
	set LUA_DIR=c:\lua\%platform%\lj%LJ_SHORTV%
) else (
	set LUA_DIR=c:\lua\%platform%\%LUA_VER%
)

:: Now we declare a scope
Setlocal EnableDelayedExpansion EnableExtensions

if not defined LUAROCKS_URL set LUAROCKS_URL=https://luarocks.github.io/luarocks/releases
if not defined LUAROCKS_REPO set LUAROCKS_REPO=https://luarocks.org
if not defined LUA_URL set LUA_URL=http://www.lua.org/ftp
if defined NOCOMPAT (
	set COMPATFLAG=--nocompat
) else (
	set COMPATFLAG=
)
if not defined LUAJIT_GIT_REPO set LUAJIT_GIT_REPO=https://github.com/LuaJIT/LuaJIT.git
if not defined LUAJIT_URL set LUAJIT_URL=https://github.com/LuaJIT/LuaJIT/archive

if not defined LR_EXTERNAL set LR_EXTERNAL=c:\external
if not defined LUAROCKS_INSTALL set LUAROCKS_INSTALL=%LUA_DIR%\LuaRocks

:: LuaRocks <= 2.2.2 used a versioned directory
:: HEAD and newer versions do not, so act accordingly.
if defined LR_ROOT goto :skiplrver

if "%LUAROCKS_VER%" EQU "HEAD" (
	set LR_ROOT=%LUAROCKS_INSTALL%
	goto :skiplrver
)
set LR_ROOT=%LUAROCKS_INSTALL%
if %LUAROCKS_VER:~0,1% LEQ 2 (
	if %LUAROCKS_VER:~2,1% LEQ 2 (
		if %LUAROCKS_VER:~4,1% LEQ 3 (
			set LR_ROOT=%LUAROCKS_INSTALL%\!LUAROCKS_VER:~0,3!
		)
	)
)
:skiplrver

if not defined LR_SYSTREE set LR_SYSTREE=%LUAROCKS_INSTALL%\systree

if not defined SEVENZIP set SEVENZIP=7z
::
:: =========================================================

:: first create some necessary directories:
mkdir downloads 2>NUL

:: Download and compile Lua (or LuaJIT)
if "%LUA%"=="luajit" (
	if not exist %LUA_DIR% (
		if "%LJ_SHORTV%"=="2.1" (
			:: Clone repository and checkout 2.1 branch
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Cloning git repo %LUAJIT_GIT_REPO% !lj_source_folder!
				git clone %LUAJIT_GIT_REPO% !lj_source_folder! || call :die "Failed to clone repository"
			) else (
				cd !lj_source_folder!
				git pull || call :die "Failed to update repository"
			)
			cd !lj_source_folder!\src
			git checkout v2.1 || call :die
		) else (
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Downloading... %LUAJIT_URL%/v%LJ_VER%.tar.gz
				curl --location --silent --fail --max-time 120 --connect-timeout 30 %LUAJIT_URL%/v%LJ_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
			)
			cd !lj_source_folder!\src
		)
		:: Compiles LuaJIT
		if "%Configuration%"=="MinGW" (
			call mingw32-make
		) else (
			call msvcbuild.bat
		)

		mkdir %LUA_DIR% 2> NUL
		for %%a in (bin bin\lua bin\lua\jit include lib) do ( mkdir "%LUA_DIR%\%%a" )

		for %%a in (luajit.exe lua51.dll) do ( move "!lj_source_folder!\src\%%a" "%LUA_DIR%\bin" )
		copy "%LUA_DIR%\bin\luajit.exe" "%LUA_DIR%\bin\lua.exe"

		move "!lj_source_folder!\src\lua51.lib" "%LUA_DIR%\lib"
		for %%a in (lauxlib.h lua.h lua.hpp luaconf.h lualib.h luajit.h) do (
			copy "!lj_source_folder!\src\%%a" "%LUA_DIR%\include"
		)

		copy "!lj_source_folder!\src\jit\*.lua" "%LUA_DIR%\bin\lua\jit"

	) else (
		echo LuaJIT %LJ_VER% already installed at %LUA_DIR%
	)
) else (
	if not exist %LUA_DIR% (
		:: Download and compile Lua
		if not exist downloads\lua-%LUA_VER% (
			curl --silent --fail --max-time 120 --connect-timeout 30 %LUA_URL%/lua-%LUA_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
		)

		mkdir downloads\lua-%LUA_VER%\etc 2> NUL
		copy %~dp0\winmake.bat downloads\lua-%LUA_VER%\etc\winmake.bat

		cd downloads\lua-%LUA_VER%
		call etc\winmake %COMPATFLAG%
		call etc\winmake install %LUA_DIR%
	) else (
		echo Lua %LUA_VER% already installed at %LUA_DIR%
	)
)

if not exist %LUA_DIR%\bin\%LUA%.exe call :die "Missing Lua interpreter at %LUA_DIR%\bin\%LUA%.exe"

set PATH=%LUA_DIR%\bin;%PATH%
call !LUA! -v

:: ==========================================================
:: LuaRocks
:: ==========================================================

if not exist "%LR_ROOT%" (
	:: Downloads and installs LuaRocks
	cd %APPVEYOR_BUILD_FOLDER%

	if %LUAROCKS_VER%==HEAD (
		set lr_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luarocks-%LUAROCKS_VER%-win32
		if not exist !lr_source_folder! (
			git clone https://github.com/keplerproject/luarocks.git --single-branch --depth 1 !lr_source_folder! || call :die "Failed to clone LuaRocks repository"
		) else (
			cd !lr_source_folder!
			git pull || call :die "Failed to update LuaRocks repository"
		)
	) else (
		if not exist downloads\luarocks-%LUAROCKS_VER%-win32.zip (
			echo Downloading LuaRocks...
			curl -L --silent --fail --max-time 120 --connect-timeout 30 --output downloads\luarocks-%LUAROCKS_VER%-win32.zip %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
			%SEVENZIP% x -aoa -odownloads downloads\luarocks-%LUAROCKS_VER%-win32.zip
		)
	)

	cd downloads\luarocks-%LUAROCKS_VER%-win32
	if "%Configuration%"=="MinGW" (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%" /MW
	) else (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%"
	)

	:: Configures LuaRocks to instruct CMake the correct generator to use. Else, CMake will pick the highest
	:: Visual Studio version installed
	if "%Configuration%"=="MinGW" (
		echo cmake_generator = "MinGW Makefiles" >> %LUAROCKS_INSTALL%\config-%LUA_SHORTV%.lua
	) else (
		set MSVS_GENERATORS[2008]=Visual Studio 9 2008
		set MSVS_GENERATORS[2010]=Visual Studio 10 2010
		set MSVS_GENERATORS[2012]=Visual Studio 11 2012
		set MSVS_GENERATORS[2013]=Visual Studio 12 2013
		set MSVS_GENERATORS[2015]=Visual Studio 14 2015

		set CMAKE_GENERATOR=!MSVS_GENERATORS[%Configuration%]!
		if "%platform%" EQU "x64" (set CMAKE_GENERATOR=!CMAKE_GENERATOR! Win64)

		echo cmake_generator = "!CMAKE_GENERATOR!" >> %LUAROCKS_INSTALL%\config-%LUA_SHORTV%.lua
	)
)

if not exist "%LR_ROOT%" call :die "LuaRocks not found at %LR_ROOT%"

set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH%

:: Lua will use just the system rocks
set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua
set LUA_PATH=%LUA_PATH%;.\?.lua;.\?\init.lua
set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll;.\?.dll

call luarocks --version || call :die "Error with LuaRocks installation"
call luarocks list

if not exist "%LR_EXTERNAL%" (
	mkdir "%LR_EXTERNAL%"
	mkdir "%LR_EXTERNAL%\lib"
	mkdir "%LR_EXTERNAL%\include"
)

set PATH=%LR_EXTERNAL%;%PATH%

:: Exports the following variables:
:: (beware of whitespace between & and ^ below)
endlocal & set PATH=%PATH%&^
set LR_SYSTREE=%LR_SYSTREE%&^
set LUA_PATH=%LUA_PATH%&^
set LUA_CPATH=%LUA_CPATH%&^
set LR_EXTERNAL=%LR_EXTERNAL%

echo.
echo ======================================================
if "%LUA%"=="luajit" (
	echo Installation of LuaJIT %LJ_VER% and LuaRocks %LUAROCKS_VER% done.
) else (
	echo Installation of Lua %LUA_VER% and LuaRocks %LUAROCKS_VER% done.
	if defined NOCOMPAT echo Lua was built with compatibility flags disabled.
)
echo Platform         - %platform%
echo LUA              - %LUA%
echo LUA_SHORTV       - %LUA_SHORTV%
echo LJ_SHORTV        - %LJ_SHORTV%
echo LUA_PATH         - %LUA_PATH%
echo LUA_CPATH        - %LUA_CPATH%
echo.
echo LR_EXTERNAL      - %LR_EXTERNAL%
echo ======================================================
echo.

goto :eof

:: This blank space is intentional. If you see errors like "The system cannot find the batch label specified 'foo'"
:: then try adding or removing blank lines lines above.
:: Yes, really.
:: http://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e

:: helper functions:

:: for bailing out when an error occurred
:die %1
echo %1
exit /B 1
goto :eof

fix LUAROCKS_URL [skip travis]

.ci/install.bat: fix LUAROCKS_URL  [skip travis]


@echo off
setlocal
set PATH=C:\Program Files (x86)\Git\bin\;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86
msbuild /tv:12.0 /p:BuildSignedSharpDX=false /t:RunCertificationTests /verbosity:quiet /clp:ErrorsOnly /fl /flp:Summary;Verbosity=minimal;logfile=BuildErrors.log;Append=true %* d:\Artiom\Projects\SharpDX\SharpDX.build

@echo off
setlocal
set PATH=C:\Program Files (x86)\Git\bin\;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86
msbuild /tv:12.0 /p:BuildSignedSharpDX=false /t:RunCertificationTests /verbosity:quiet /clp:ErrorsOnly /fl /flp:Summary;Verbosity=minimal;logfile=BuildErrors.log;Append=true %* SharpDX.build

[Build] Fix path to SharpDX.build for certification tests.


@ECHO OFF

PATH="%~dp0\node_modules\.bin:%PATH%"

@IF EXIST "%~dp0\.node\lib\node" (
  NODE_PATH="%~dp0\.node\lib\node"
)

@IF EXIST "%~dp0\.node\bin\node.exe" (
  PATH="%~dp0\.node\bin:%PATH%"
  "%~dp0\.node\bin\node.exe" %*
) ELSE (
  node %*
)

@ECHO OFF

SETLOCAL ENABLEDELAYEDEXPANSION
PATH="%~dp0\node_modules\.bin:%PATH%"

@IF EXIST "%~dp0\.node\lib\node" (
  NODE_PATH="%~dp0\.node\lib\node"
)
ENDLOCAL

SETLOCAL ENABLEDELAYEDEXPANSION
@IF EXIST "%~dp0\.node\bin\node.exe" (
  echo Using embedded node.exe
  PATH="%~dp0\.node\bin:%PATH%"
  "%~dp0\.node\bin\node.exe" %*
) ELSE (
  echo Using system node
  node %*
)
ENDLOCAL

Fix for Issue 144

Fix for Issue 144


@ECHO off
REM This suite requires https://github.com/inkarkat/runVimTests to run

if %1.==clean. goto Clean
if %1.==run. goto Run

echo "usage: runall.bat clean|run"
goto End

:Clean
echo Cleaning
del /Q *.out 2> nul
del /Q *.msgout 2> nul
goto End

:Run
echo Running
../../runVimTests/bin/runVimTests.cmd --pure vimgrep.suite
goto End

:End

@ECHO off
REM This suite requires https://github.com/inkarkat/runVimTests to run

if %1.==clean. goto Clean
if %1.==run. goto Run
if %1.==runall. goto RunAll

echo "usage: runall.bat clean|run|runall"
goto End

:Clean
echo Cleaning
del /Q *.out 2> nul
del /Q *.msgout 2> nul
goto End

:Run
shift
echo Running %1 %2 %3 %4 %5 %6 %7 %8 %9
../../runVimTests/bin/runVimTests.cmd --pure %1 %2 %3 %4 %5 %6 %7 %8 %9
goto End

:RunAll
echo Running all
../../runVimTests/bin/runVimTests.cmd --pure vimgrep.suite
goto End

:End

Add an argument to run only certain tests


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.13
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 4. Run Webpack
IF EXIST "%DEPLOYMENT_TARGET%\webpack.config.js" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! run production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.13
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 4. Run Webpack
IF EXIST "%DEPLOYMENT_TARGET%\webpack.config.js" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! run production
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

remove --production flag from npm installl to run webpack on azure


@echo off

REM Download Mingw 64 on Windows from http://win-builds.org/download.html

set GOARCH=%1
IF "%1" == "" (set GOARCH=amd64)
set ORG_PATH=github.com\hashicorp
set REPO_PATH=%ORG_PATH%\consul

set GOPATH=%cd%\gopath

rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul
mkdir %GOPATH%\src\%ORG_PATH% 2>nul
go get -u .\...
mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul

%GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH%

@echo off

REM Download Mingw 64 on Windows from http://win-builds.org/download.html

set GOARCH=%2
IF "%2" == "" (set GOARCH=amd64)
set MODULENAME=%1
set ORG_PATH=github.com\hashicorp
set REPO_PATH=%ORG_PATH%\%MODULENAME%

set GOPATH=%cd%\gopath

rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul
mkdir %GOPATH%\src\%ORG_PATH% 2>nul
go get .\...
mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul

%GOROOT%\bin\go build -o bin\%GOARCH%\%MODULENAME%.exe %REPO_PATH%

Make modulename param so build.bat can be generalized and used for any go project


rmdir /q /s gam
rmdir /q /s gam-64
rmdir /q /s python-src-%1
rmdir /q /s build
rmdir /q /s dist
del /q /f gam-%1-python-src.zip
del /q /f gam-%1-windows.zip
del /q /f gam-%1-windows-x64.zip

\python27-32\python.exe setup.py py2exe
xcopy LICENSE.txt gam\
xcopy whatsnew.txt gam\
xcopy cacert.pem gam\
xcopy adminsettings-v1.json gam\
del gam\w9xpopen.exe
"%ProgramFiles%\7-Zip\7z.exe" a -tzip gam-%1-windows.zip gam\ -xr!.svn

\python27\python.exe setup-64.py py2exe
xcopy LICENSE.txt gam-64\
xcopy whatsnew.txt gam-64\
xcopy cacert.pem gam-64\
xcopy adminsettings-v1.json gam-64\
"%ProgramFiles%\7-Zip\7z.exe" a -tzip gam-%1-windows-x64.zip gam-64\ -xr!.svn

mkdir python-src-%1
mkdir python-src-%1\gdata
mkdir python-src-%1\atom
mkdir python-src-%1\apiclient
mkdir python-src-%1\httplib2
mkdir python-src-%1\oauth2client
mkdir python-src-%1\simplejson
mkdir python-src-%1\uritemplate
xcopy gam.py python-src-%1\
xcopy LICENSE.txt python-src-%1\
xcopy whatsnew.txt python-src-%1\
xcopy /e gdata\*.* python-src-%1\gdata
xcopy /e atom\*.* python-src-%1\atom
xcopy /e apiclient\*.* python-src-%1\apiclient
xcopy /e httplib2\*.* python-src-%1\httplib2
xcopy /e oauth2client\*.* python-src-%1\oauth2client
xcopy /e simplejson\*.* python-src-%1\simplejson
xcopy /e uritemplate\*.* python-src-%1\uritemplate
xcopy cacert.pem python-src-%1\
xcopy adminsettings-v1.json python-src-%1\

cd python-src-%1
"%ProgramFiles%\7-Zip\7z.exe" a -tzip ..\gam-%1-python-src.zip * -xr!.svn
cd ..

\python27\python.exe googlecode_upload.py --project google-apps-manager --summary "GAM %1 Windows" --user %2 --password %3 --labels "ALPHA,Type-Archive,OpSys-Windows" gam-%1-windows.zip
\python27\python.exe googlecode_upload.py --project google-apps-manager --summary "GAM %1 Windows x64" --user %2 --password %3 --labels "ALPHA,Type-Archive,OpSys-Windows" gam-%1-windows-x64.zip
\python27\python.exe googlecode_upload.py --project google-apps-manager --summary "GAM %1 Python Source" --user %2 --password %3 --labels "ALPHA,Type-Archive,OpSys-All" gam-%1-python-src.zip

rmdir /q /s gam
rmdir /q /s gam-64
rmdir /q /s python-src-%1
rmdir /q /s build
rmdir /q /s dist
del /q /f gam-%1-python-src.zip
del /q /f gam-%1-windows.zip
del /q /f gam-%1-windows-x64.zip

\python27-32\python.exe setup.py py2exe
xcopy LICENSE gam\
xcopy whatsnew.txt gam\
xcopy cacert.pem gam\
xcopy adminsettings-v1.json gam\
del gam\w9xpopen.exe
"%ProgramFiles%\7-Zip\7z.exe" a -tzip gam-%1-windows.zip gam\ -xr!.svn

\python27\python.exe setup-64.py py2exe
xcopy LICENSE gam-64\
xcopy whatsnew.txt gam-64\
xcopy cacert.pem gam-64\
xcopy adminsettings-v1.json gam-64\
"%ProgramFiles%\7-Zip\7z.exe" a -tzip gam-%1-windows-x64.zip gam-64\ -xr!.svn

mkdir python-src-%1
mkdir python-src-%1\gdata
mkdir python-src-%1\atom
mkdir python-src-%1\apiclient
mkdir python-src-%1\httplib2
mkdir python-src-%1\oauth2client
mkdir python-src-%1\simplejson
mkdir python-src-%1\uritemplate
xcopy gam.py python-src-%1\
xcopy LICENSE python-src-%1\
xcopy whatsnew.txt python-src-%1\
xcopy /e gdata\*.* python-src-%1\gdata
xcopy /e atom\*.* python-src-%1\atom
xcopy /e apiclient\*.* python-src-%1\apiclient
xcopy /e httplib2\*.* python-src-%1\httplib2
xcopy /e oauth2client\*.* python-src-%1\oauth2client
xcopy /e simplejson\*.* python-src-%1\simplejson
xcopy /e uritemplate\*.* python-src-%1\uritemplate
xcopy cacert.pem python-src-%1\
xcopy adminsettings-v1.json python-src-%1\

cd python-src-%1
"%ProgramFiles%\7-Zip\7z.exe" a -tzip ..\gam-%1-python-src.zip * -xr!.svn
cd ..

\python27\python.exe googlecode_upload.py --project google-apps-manager --summary "GAM %1 Windows" --user %2 --password %3 --labels "ALPHA,Type-Archive,OpSys-Windows" gam-%1-windows.zip
\python27\python.exe googlecode_upload.py --project google-apps-manager --summary "GAM %1 Windows x64" --user %2 --password %3 --labels "ALPHA,Type-Archive,OpSys-Windows" gam-%1-windows-x64.zip
\python27\python.exe googlecode_upload.py --project google-apps-manager --summary "GAM %1 Python Source" --user %2 --password %3 --labels "ALPHA,Type-Archive,OpSys-All" gam-%1-python-src.zip

copy LICENSE instead of LICENSE.txt

copy LICENSE instead of LICENSE.txt


@echo off
setlocal

if "%_CRDEVROOT%" == "" goto NoRoot

set _CONFIG="Debug"
set _OPTION=build
set _DOSETUP=
if "%1" == "" goto DoBuild

:NextArg
if "%1" == "debug" set _CONFIG="Debug"&&goto ShiftArg
if "%1" == "release" set _CONFIG="Release"&&goto ShiftArg
if "%1" == "clean" set _OPTION=rebuild&&goto ShiftArg
if "%1" == "" goto DoBuild
echo Error: Unknown parameter %1
goto Exit

:ShiftArg
shift
goto NextArg

:MissingVS
echo Error: Microsoft Visual Studio not found.
echo        Cannot locate %_VSVARS%
goto Exit

:DoBuild
set _VSVARS="%ProgramFiles%\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
if not exist %_VSVARS% set _VSVARS="%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
if not exist %_VSVARS% goto MissingVS
call %_VSVARS%
devenv cixreader.sln /%_OPTION% %_CONFIG% /projectconfig %_CONFIG%
goto Exit

:NoRoot
echo Error: _CRDEVROOT must be set to the root folder of the CIXReader enlistment.

:Exit
endlocal

Add command line build scripts

Add command line build scripts


@echo off
cd %~dp0

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

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

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

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

@echo off
cd %~dp0

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

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

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

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

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


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

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

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

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

Use fsi from FSharp.Compiler.Tools

Use fsi from FSharp.Compiler.Tools

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


@echo off

"tools\nuget\nuget.exe" "install" "xunit.runner.console" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "2.0.0"
"tools\nuget\nuget.exe" "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "3.12.2"
"tools\nuget\nuget.exe" "install" "SourceLink.Fake" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "1.0.0"

:Build
cls

SET TARGET="Default"

IF NOT [%1]==[] (set TARGET="%1")

SET BUILDMODE="Release"
IF NOT [%2]==[] (set BUILDMODE="%2")

:: because we want to run specific steps inline on qed
:: we need to break the dependency chain
:: this ensures we do a build before running any tests

if %TARGET%=="Default" (SET RunBuild=1)
if %TARGET%=="RunUnitTests" (SET RunBuild=1)
if %TARGET%=="RunIntegrationTests" (SET RunBuild=1)
if %TARGET%=="CreatePackages" (SET RunBuild=1)

if NOT "%RunBuild%"=="" (
"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=BuildApp" "buildMode=%BUILDMODE%"
)

"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" "buildMode=%BUILDMODE%"

rem Bail if we're running a TeamCity build.
if defined TEAMCITY_PROJECT_NAME goto Quit

rem Bail if we're running a MyGet build.
if /i "%BuildRunner%"=="MyGet" goto Quit

:Quit
exit /b %errorlevel%

@echo off

"tools\nuget\nuget.exe" "install" "xunit.runner.console" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "2.0.0"
"tools\nuget\nuget.exe" "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "3.37.1"
"tools\nuget\nuget.exe" "install" "SourceLink.Fake" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "1.0.0"

:Build
cls

SET TARGET="Default"

IF NOT [%1]==[] (set TARGET="%1")

SET BUILDMODE="Release"
IF NOT [%2]==[] (set BUILDMODE="%2")

:: because we want to run specific steps inline on qed
:: we need to break the dependency chain
:: this ensures we do a build before running any tests

if %TARGET%=="Default" (SET RunBuild=1)
if %TARGET%=="RunUnitTests" (SET RunBuild=1)
if %TARGET%=="RunIntegrationTests" (SET RunBuild=1)
if %TARGET%=="CreatePackages" (SET RunBuild=1)

if NOT "%RunBuild%"=="" (
"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=BuildApp" "buildMode=%BUILDMODE%"
)

"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" "buildMode=%BUILDMODE%"

rem Bail if we're running a TeamCity build.
if defined TEAMCITY_PROJECT_NAME goto Quit

rem Bail if we're running a MyGet build.
if /i "%BuildRunner%"=="MyGet" goto Quit

:Quit
exit /b %errorlevel%

bump fake.core

bump fake.core


@ECHO OFF
setlocal enableDelayedExpansion

:: the deploy target folder
SET FOLDER=deploy

:: the deploy target suffix, i.e. <projectName>[suffix]
SET SUFFIX= - %date% - %time%

:: remove spaces, convert / : to _, convert . to ~
set SUFFIX=%SUFFIX: =%
set SUFFIX=%SUFFIX:/=-%
set SUFFIX=%SUFFIX::=-%
set SUFFIX=%SUFFIX:.=~%

:: enyo location
SET ENYO=..\enyo

:: the grandparent folder for this batch file
SET SOURCE=%~dp0..\

:: extract project folder name
FOR /D %%I IN ("%SOURCE%\.") DO SET NAME=%%~nxI

:: prepare target name
SET DEPLOY=%NAME%%SUFFIX%

:: make sure (deploy) FOLDER exists
SET TARGETROOT="%SOURCE%%FOLDER%"
IF NOT EXIST %TARGETROOT% mkdir %TARGETROOT%

:: pull path for this deploy
IF NOT DEFINED TARGET SET TARGET="%SOURCE%%FOLDER%\%DEPLOY%"

:: quotes around path that might have spaces
SET SOURCE="%SOURCE%"

IF NOT EXIST %TARGET% GOTO deploy

ECHO "%TARGET%" folder already exists, please rename or remove it and try again.
ECHO.

PAUSE
GOTO end

:DEPLOY

SET USAGE="Usage: deploy.bat [-h] [-c] [-o output_dir]"

:: Parse options
:: Thanks to http://stackoverflow.com/questions/3973824/windows-bat-file-optional-argument-parsing
set "options=-o:"" -h: -c:"
for %%O in (%options%) do for /f "tokens=1,* delims=:" %%A in ("%%O") do set "%%A=%%~B"
:parseloop
if not "%~1"=="" (
  set "test=!options:*%~1:=! "
  if "!test!"=="!options! " (
  	echo %USAGE%
  	goto end
  ) else if "!test:~0,1!"==" " (
    set "%~1=1"
  ) else (
    set "%~1=%~2"
    shift
  )
  shift
  goto :parseloop
)

:: Handle options
IF DEFINED -h (
	ECHO %USAGE%
	GOTO end
)
IF DEFINED -c (
	SET NO_LESS="-no-less"
) else (
	SET NO_LESS=""
)
IF DEFINED -o (
	SET TARGET=%-o%
)
IF DEFINED -o (
	RMDIR /S /Q %TARGET%
)

ECHO This script can create a deployment in %TARGET%
ECHO.

ECHO ==========
ECHO build step
ECHO ==========
ECHO.

REM build enyo
CALL %ENYO%\minify\minify.bat

REM build app
CALL %ENYO%\tools\minify.bat package.js -output ..\build\app

ECHO =========
ECHO copy step
ECHO =========
ECHO.

:: make deploy folder
MKDIR %TARGET%

:: copy root folder files
COPY %SOURCE%index.html %TARGET% >NUL
COPY %SOURCE%icon.png %TARGET% >NUL

:: copy assets and build
XCOPY %SOURCE%assets\*.* %TARGET%\assets\ /Q /E >NUL
XCOPY %SOURCE%build\*.* %TARGET%\build\ /Q /E >NUL

:: copy library items
MKDIR %TARGET%\lib

FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" ECHO deploying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" CALL "%%G\deploy.bat" %TARGET%\lib\"%%~nxG"

FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" ECHO copying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" XCOPY "%%G" %TARGET%\lib\"%%~nxG"\ /Q /E >NUL

ECHO.

PAUSE
:end

@ECHO OFF
setlocal enableDelayedExpansion

:: the deploy target folder
SET FOLDER=deploy

:: the deploy target suffix, i.e. <projectName>[suffix]
SET SUFFIX= - %date% - %time%

:: remove spaces, convert / : to _, convert . to ~
set SUFFIX=%SUFFIX: =%
set SUFFIX=%SUFFIX:/=-%
set SUFFIX=%SUFFIX::=-%
set SUFFIX=%SUFFIX:.=~%

:: enyo location
SET ENYO=..\enyo

:: the grandparent folder for this batch file
SET SOURCE=%~dp0..\

:: extract project folder name
FOR /D %%I IN ("%SOURCE%\.") DO SET NAME=%%~nxI

:: prepare target name
SET DEPLOY=%NAME%%SUFFIX%

:: make sure (deploy) FOLDER exists
SET TARGETROOT="%SOURCE%%FOLDER%"
IF NOT EXIST %TARGETROOT% mkdir %TARGETROOT%

:: pull path for this deploy
IF NOT DEFINED TARGET SET TARGET="%SOURCE%%FOLDER%\%DEPLOY%"

:: quotes around path that might have spaces
SET SOURCE="%SOURCE%"

IF NOT EXIST %TARGET% GOTO deploy

ECHO "%TARGET%" folder already exists, please rename or remove it and try again.
ECHO.

PAUSE
GOTO end

:DEPLOY

SET USAGE="Usage: deploy.bat [-h] [-c] [-o output_dir]"

:: Parse options
:: Thanks to http://stackoverflow.com/questions/3973824/windows-bat-file-optional-argument-parsing
set "options=-o:"" -h: -c:"
for %%O in (%options%) do for /f "tokens=1,* delims=:" %%A in ("%%O") do set "%%A=%%~B"
:parseloop
if not "%~1"=="" (
  set "test=!options:*%~1:=! "
  if "!test!"=="!options! " (
  	echo %USAGE%
  	goto end
  ) else if "!test:~0,1!"==" " (
    set "%~1=1"
  ) else (
    set "%~1=%~2"
    shift
  )
  shift
  goto :parseloop
)

:: Handle options
IF DEFINED -h (
	ECHO %USAGE%
	GOTO end
)
IF DEFINED -c (
	SET NO_LESS="-no-less"
) else (
	SET NO_LESS=""
)
IF DEFINED -o (
	SET TARGET=%-o%
)
IF DEFINED -o (
	RMDIR /S /Q %TARGET%
)

ECHO This script can create a deployment in %TARGET%
ECHO.

ECHO ==========
ECHO build step
ECHO ==========
ECHO.

REM build enyo
CALL %ENYO%\minify\minify.bat --beautify

REM build app
CALL %ENYO%\tools\minify.bat package.js -output ..\build\app --beautify

ECHO =========
ECHO copy step
ECHO =========
ECHO.

:: make deploy folder
MKDIR %TARGET%

:: copy root folder files
COPY %SOURCE%index.html %TARGET% >NUL
COPY %SOURCE%icon.png %TARGET% >NUL

:: copy assets and build
XCOPY %SOURCE%assets\*.* %TARGET%\assets\ /Q /E >NUL
XCOPY %SOURCE%build\*.* %TARGET%\build\ /Q /E >NUL

:: copy library items
MKDIR %TARGET%\lib

FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" ECHO deploying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" CALL "%%G\deploy.bat" %TARGET%\lib\"%%~nxG"

FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" ECHO copying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" XCOPY "%%G" %TARGET%\lib\"%%~nxG"\ /Q /E >NUL

ECHO.

PAUSE
:end

Deploy sampler using --beautify switch that make the minifier version larger, but also easier to debug

Enyo-DCO-1.1-Signed-Off-By: Ben Combee (ben.combee@lge.com)


@echo on
setlocal EnableDelayedExpansion
set SHORT_VERSION=%PKG_VERSION:~0,-2%

:: You may not always want this when doing dirty builds (debugging late stage
:: problems, but if debugging configure time issues you probably do want this).
if exist config.cache del config.cache

:: if "%DXSDK_DIR%" == "" (
::   echo You do not appear to have the DirectX SDK installed.  Please get it from
::   echo    https://www.microsoft.com/en-us/download/details.aspx?id=6812
::   echo and try this build again.  If you have installed it, and are still seeing
::   echo this message, please open a new console to refresh your environment variables.
::   exit /b 1
:: )

:: Webengine requires either working OpenGL drivers or
:: Angle (therefore DirectX >= 11). This works on some
:: VMs and not others.  Windows 7 VirtualBox instantly
:: aborts when loading Spyder sSo we've had to disable
:: it globally.
:: Using Mesa from MSYS2 is mentioned as a workaround:
::  http://wiki.qt.io/Cross-compiling-Mesa-for-Windows
:: `set QT_OPENGL=software` forces Qt5 to use that but
:: but when I tried it it was too buggy; Spyder crashed a
:: little bit later, though it worked for Carlos.
set WEBBACKEND=qtwebengine
set QT_LIBINFIX=_conda

where perl.exe
if %ERRORLEVEL% neq 0 (
  echo Could not find perl.exe
  exit /b 1
)

:: make sure we can find ICU and openssl:
set "INCLUDE=%LIBRARY_INC%;%INCLUDE%"
set "LIB=%LIBRARY_LIB%;%LIB%"

:: Support systems with neither capable OpenGL (desktop mode) nor DirectX 11 (ANGLE mode) drivers
:: https://github.com/ContinuumIO/anaconda-issues/issues/9142
if not exist "%LIBRARY_BIN%" mkdir "%LIBRARY_BIN%"
copy opengl32sw\opengl32sw.dll  %LIBRARY_BIN%\opengl32sw.dll
if errorlevel 1 exit /b 1
if not exist %LIBRARY_BIN%\opengl32sw.dll exit /b 1

:: WebEngine (Chromium) specific definitions.  Only build this with VS 2015 (no support for python < 3.5)
if "%WEBBACKEND%" == "qtwebengine" (
  set "WSDK8=C:\\Program\ Files\ (x86)\\Windows\ Kits\\8.1"
  set "WDK=C:\\WinDDK\\7600.16385.1"
  set "INCLUDE=%WSDK8%\Include;%WDK%\inc;%INCLUDE%"
  if "%ARCH%"=="32" (
    set "PATH=%WSDK8%\bin\x86;%WDK$%\bin\x86;%PATH%"
    set "LIB=%LIB%;%WSDK8%\Lib\winv6.3\um\x86"
  ) else (
    set "PATH=%WSDK8%\bin\x64;%WDK$%\bin\amd64;%PATH%"
    set "LIB=%LIB%;%WSDK8%\Lib\winv6.3\um\x64"
  )
  set "GYP_DEFINES=windows_sdk_path='%WSDK8%'"
  set GYP_MSVS_VERSION=2015
  set GYP_GENERATORS=ninja
  set GYP_PARALLEL=1
  set "WDK_DIR=%WDK%"
  set "WindowsSDKDir=%WSDK8%"
) else (
  rmdir /s /q qtwebengine
)

set OPENGLVER=dynamic

:: Patch does not apply cleanly.  Copy file.
:: https://codereview.qt-project.org/#/c/141019/
copy %RECIPE_DIR%\tst_compiler.cpp qtbase\tests\auto\other\compiler\

:: Cannot skip this if we want QT_LIBINFIX to work.
:: TODO: should we always be rebuilding configure.exe anyway
:: Mentioned patch no longer applied
:: goto SKIP_REBUILD_CONFIGURE_EXE
:: If applying 0009-Win32-Re-permit-fontconfig-and-qt-freetype.patch (or
:: any patch that changes configureapp.cpp or any of the bootstrap files
:: in any way that alters the configure result) then configure.exe needs
:: to be rebuilt. Here I duplicate logic from configure.bat because that
:: file conflates needing to rebuild configure.exe with using a git repo
:: clone (OK, we should really remove that conflation instead and always
:: just rebuild configure.exe).
pushd qtbase
del /q configure.exe
set QTSRC=%CD%\
pushd tools\configure
set make=jom
set QTVERSION=%PKG_VERSION%
for /f "tokens=1,2,3,4 delims=.= " %%i in ('echo Qt.%QTVERSION%') do (
    set QTVERMAJ=%%j
    set QTVERMIN=%%k
    set QTVERPAT=%%l
)
:: .. end of specifically this bit is untested
echo #### Generated by bld.bat - DO NOT EDIT! ####> Makefile
echo/>> Makefile
set
echo QMAKESPEC = win32-msvc>> Makefile
echo QT_VERSION = %QTVERSION%>> Makefile
rem These must have trailing spaces to avoid misinterpretation as 5>>, etc.
echo QT_MAJOR_VERSION = %QTVERMAJ% >> Makefile
echo QT_MINOR_VERSION = %QTVERMIN% >> Makefile
echo QT_PATCH_VERSION = %QTVERPAT% >> Makefile
echo CXX = cl>>Makefile
:: This is a hack, CFLAGS_CRT becomes part of CFLAGS_EXTRA, overwriting it.
echo CFLAGS_CRT = -DQT_LIBINFIX=\"%QT_LIBINFIX%\" >> Makefile
echo EXTRA_CXXFLAGS =>>Makefile
rem This must have a trailing space.
echo QTSRC = %QTSRC% >> Makefile
echo SOURCE_PATH = %QTSRC% >> Makefile
echo INC_PATH = %QTSRC%\include >> Makefile
set tmpl=win32
echo/>> Makefile
type %QTSRC%\qmake\Makefile.%tmpl% >> Makefile
%make%
:: Attempt to avoid:
:: warning C4651: '/DQT_LIBINFIX="_conda"' specified for precompiled header but not for current compile
:: del qmake_pch.h
del qmake_pch.obj
del qmake_pch.pch
popd
popd
:SKIP_REBUILD_CONFIGURE_EXE

:: See http://doc-snapshot.qt-project.org/qt5-5.4/windows-requirements.html
:: this needs to be CALLed due to an exit statement at the end of configure:
:: optimized-tools is necessary for qtlibinfix, otherwise:
:: qtbase/lib/Qt5Bootstrap.prl
:: ends up containing:
:: QMAKE_PRL_TARGET = Qt5Bootstrap.condad.lib
:: for some odd reason.
call configure ^
     -prefix %LIBRARY_PREFIX% ^
     -libdir %LIBRARY_LIB% ^
     -bindir %LIBRARY_BIN% ^
     -headerdir %LIBRARY_INC%\qt ^
     -archdatadir %LIBRARY_PREFIX% ^
     -datadir %LIBRARY_PREFIX% ^
     -optimized-tools ^
     -L %LIBRARY_LIB% ^
     -I %LIBRARY_INC% ^
     -confirm-license ^
     -no-fontconfig ^
     -icu ^
     -no-separate-debug-info ^
     -no-warnings-are-errors ^
     -nomake examples ^
     -nomake tests ^
     -no-warnings-are-errors ^
     -opengl %OPENGLVER% ^
     -opensource ^
     -openssl ^
     -openssl-runtime ^
     -platform win32-msvc ^
     -release ^
     -shared ^
     -qt-freetype ^
     -system-libjpeg ^
     -system-libpng ^
     -system-sqlite ^
     -system-zlib ^
     -plugin-sql-sqlite ^
     -qtlibinfix %QT_LIBINFIX% ^
     -verbose

if %errorlevel% neq 0 exit /b %errorlevel%

:: re-enable echoing which is disabled by configure
echo on

:: To get a much quicker turnaround you can add this: (remember also to add the hat symbol after -plugin-sql-sqlite)
::     -skip %WEBBACKEND% -skip qtwebsockets -skip qtwebchannel -skip qtwayland -skip qtwinextras -skip qtsvg -skip qtsensors ^
::     -skip qtcanvas3d -skip qtconnectivity -skip declarative -skip multimedia -skip qttools

type qtbase\Makefile
echo "qtbase\qmake\Makefile"
type qtbase\qmake\Makefile
echo "qtbase\qmake\Makefile.win32"
type qtbase\qmake\Makefile.win32
jom -U release
:: Hooray for racey build systems. You may get a failure about a QtWebengine .stamp file being missing. You may not. Who knows?
jom -U release
if %errorlevel% neq 0 exit /b %errorlevel%
echo Finished `jom -U release`
jom -U install
:: I expect raciness here too:
jom -U install
if %errorlevel% neq 0 exit /b %errorlevel%
echo Finished `jom -U install`
pushd qtbase
  jom -U install_mkspecs
  if %errorlevel% neq 0 exit /b %errorlevel%
  echo Finished `jom -U install_mkspecs`
popd

if exist %LIBRARY_BIN%\qmake.exe goto ok_qmake_exists
echo Warning %LIBRARY_BIN%\qmake.exe does not exist jom -U install failed, very strange. Copying it from qtbase\bin\qmake.exe
copy qtbase\bin\qmake.exe %LIBRARY_BIN%\qmake.exe
:ok_qmake_exists

:: To rewrite qt.conf contents per conda environment
copy "%RECIPE_DIR%\write_qtconf.bat" "%PREFIX%\Scripts\.qt-post-link.bat"
if %errorlevel% neq 0 exit /b %errorlevel%

@echo on
setlocal EnableDelayedExpansion
set SHORT_VERSION=%PKG_VERSION:~0,-2%

:: You may not always want this when doing dirty builds (debugging late stage
:: problems, but if debugging configure time issues you probably do want this).
if exist config.cache del config.cache

:: if "%DXSDK_DIR%" == "" (
::   echo You do not appear to have the DirectX SDK installed.  Please get it from
::   echo    https://www.microsoft.com/en-us/download/details.aspx?id=6812
::   echo and try this build again.  If you have installed it, and are still seeing
::   echo this message, please open a new console to refresh your environment variables.
::   exit /b 1
:: )

:: Webengine requires either working OpenGL drivers or
:: Angle (therefore DirectX >= 11). This works on some
:: VMs and not others.  Windows 7 VirtualBox instantly
:: aborts when loading Spyder sSo we've had to disable
:: it globally.
:: Using Mesa from MSYS2 is mentioned as a workaround:
::  http://wiki.qt.io/Cross-compiling-Mesa-for-Windows
:: `set QT_OPENGL=software` forces Qt5 to use that but
:: but when I tried it it was too buggy; Spyder crashed a
:: little bit later, though it worked for Carlos.
set WEBBACKEND=qtwebengine
set QT_LIBINFIX=_conda

where perl.exe
if %ERRORLEVEL% neq 0 (
  echo Could not find perl.exe
  exit /b 1
)

:: make sure we can find ICU and openssl:
set "INCLUDE=%LIBRARY_INC%;%INCLUDE%"
set "LIB=%LIBRARY_LIB%;%LIB%"

:: Support systems with neither capable OpenGL (desktop mode) nor DirectX 11 (ANGLE mode) drivers
:: https://github.com/ContinuumIO/anaconda-issues/issues/9142
if not exist "%LIBRARY_BIN%" mkdir "%LIBRARY_BIN%"
copy opengl32sw\opengl32sw.dll  %LIBRARY_BIN%\opengl32sw.dll
if errorlevel 1 exit /b 1
if not exist %LIBRARY_BIN%\opengl32sw.dll exit /b 1

:: WebEngine (Chromium) specific definitions.  Only build this with VS 2015 (no support for python < 3.5)
if "%WEBBACKEND%" == "qtwebengine" (
  set "WSDK8=C:\\Program\ Files\ (x86)\\Windows\ Kits\\8.1"
  set "WDK=C:\\WinDDK\\7600.16385.1"
  set "INCLUDE=%WSDK8%\Include;%WDK%\inc;%INCLUDE%"
  if "%ARCH%"=="32" (
    set "PATH=%WSDK8%\bin\x86;%WDK$%\bin\x86;%PATH%"
    set "LIB=%LIB%;%WSDK8%\Lib\winv6.3\um\x86"
  ) else (
    set "PATH=%WSDK8%\bin\x64;%WDK$%\bin\amd64;%PATH%"
    set "LIB=%LIB%;%WSDK8%\Lib\winv6.3\um\x64"
  )
  set "GYP_DEFINES=windows_sdk_path='%WSDK8%'"
  set GYP_MSVS_VERSION=2015
  set GYP_GENERATORS=ninja
  set GYP_PARALLEL=1
  set "WDK_DIR=%WDK%"
  set "WindowsSDKDir=%WSDK8%"
) else (
  rmdir /s /q qtwebengine
)

set OPENGLVER=dynamic

:: Patch does not apply cleanly.  Copy file.
:: https://codereview.qt-project.org/#/c/141019/
copy %RECIPE_DIR%\tst_compiler.cpp qtbase\tests\auto\other\compiler\

:: Cannot skip this if we want QT_LIBINFIX to work.
:: TODO: should we always be rebuilding configure.exe anyway
:: Mentioned patch no longer applied
:: goto SKIP_REBUILD_CONFIGURE_EXE
:: If applying 0009-Win32-Re-permit-fontconfig-and-qt-freetype.patch (or
:: any patch that changes configureapp.cpp or any of the bootstrap files
:: in any way that alters the configure result) then configure.exe needs
:: to be rebuilt. Here I duplicate logic from configure.bat because that
:: file conflates needing to rebuild configure.exe with using a git repo
:: clone (OK, we should really remove that conflation instead and always
:: just rebuild configure.exe).
pushd qtbase
del /q configure.exe
set QTSRC=%CD%\
pushd qmake
set make=jom
set QTVERSION=%PKG_VERSION%
for /f "tokens=1,2,3,4 delims=.= " %%i in ('echo Qt.%QTVERSION%') do (
    set QTVERMAJ=%%j
    set QTVERMIN=%%k
    set QTVERPAT=%%l
)
:: .. end of specifically this bit is untested
echo #### Generated by bld.bat - DO NOT EDIT! ####> Makefile
echo/>> Makefile
set
echo QMAKESPEC = win32-msvc>> Makefile
echo QT_VERSION = %QTVERSION%>> Makefile
rem These must have trailing spaces to avoid misinterpretation as 5>>, etc.
echo QT_MAJOR_VERSION = %QTVERMAJ% >> Makefile
echo QT_MINOR_VERSION = %QTVERMIN% >> Makefile
echo QT_PATCH_VERSION = %QTVERPAT% >> Makefile
echo CXX = cl>>Makefile
:: This is a hack, CFLAGS_CRT becomes part of CFLAGS_EXTRA, overwriting it.
echo CFLAGS_CRT = -DQT_LIBINFIX=\"%QT_LIBINFIX%\" >> Makefile
echo EXTRA_CXXFLAGS =>>Makefile
rem This must have a trailing space.
echo QTSRC = %QTSRC% >> Makefile
echo SOURCE_PATH = %QTSRC% >> Makefile
echo INC_PATH = %QTSRC%\include >> Makefile
set tmpl=win32
echo/>> Makefile
type Makefile.%tmpl% >> Makefile
%make%
:: Attempt to avoid:
:: warning C4651: '/DQT_LIBINFIX="_conda"' specified for precompiled header but not for current compile
:: del qmake_pch.h
del qmake_pch.obj
del qmake_pch.pch
popd
popd
:SKIP_REBUILD_CONFIGURE_EXE

:: See http://doc-snapshot.qt-project.org/qt5-5.4/windows-requirements.html
:: this needs to be CALLed due to an exit statement at the end of configure:
:: optimized-tools is necessary for qtlibinfix, otherwise:
:: qtbase/lib/Qt5Bootstrap.prl
:: ends up containing:
:: QMAKE_PRL_TARGET = Qt5Bootstrap.condad.lib
:: for some odd reason.
call configure ^
     -prefix %LIBRARY_PREFIX% ^
     -libdir %LIBRARY_LIB% ^
     -bindir %LIBRARY_BIN% ^
     -headerdir %LIBRARY_INC%\qt ^
     -archdatadir %LIBRARY_PREFIX% ^
     -datadir %LIBRARY_PREFIX% ^
     -optimized-tools ^
     -L %LIBRARY_LIB% ^
     -I %LIBRARY_INC% ^
     -confirm-license ^
     -no-fontconfig ^
     -icu ^
     -no-separate-debug-info ^
     -no-warnings-are-errors ^
     -nomake examples ^
     -nomake tests ^
     -no-warnings-are-errors ^
     -opengl %OPENGLVER% ^
     -opensource ^
     -openssl ^
     -openssl-runtime ^
     -platform win32-msvc ^
     -release ^
     -shared ^
     -qt-freetype ^
     -system-libjpeg ^
     -system-libpng ^
     -system-sqlite ^
     -system-zlib ^
     -plugin-sql-sqlite ^
     -qtlibinfix %QT_LIBINFIX% ^
     -verbose

if %errorlevel% neq 0 exit /b %errorlevel%

:: re-enable echoing which is disabled by configure
echo on

:: To get a much quicker turnaround you can add this: (remember also to add the hat symbol after -plugin-sql-sqlite)
::     -skip %WEBBACKEND% -skip qtwebsockets -skip qtwebchannel -skip qtwayland -skip qtwinextras -skip qtsvg -skip qtsensors ^
::     -skip qtcanvas3d -skip qtconnectivity -skip declarative -skip multimedia -skip qttools

type qtbase\Makefile
echo "qtbase\qmake\Makefile"
type qtbase\qmake\Makefile
echo "qtbase\qmake\Makefile.win32"
type qtbase\qmake\Makefile.win32
jom -U release
:: Hooray for racey build systems. You may get a failure about a QtWebengine .stamp file being missing. You may not. Who knows?
jom -U release
if %errorlevel% neq 0 exit /b %errorlevel%
echo Finished `jom -U release`
jom -U install
:: I expect raciness here too:
jom -U install
if %errorlevel% neq 0 exit /b %errorlevel%
echo Finished `jom -U install`
pushd qtbase
  jom -U install_mkspecs
  if %errorlevel% neq 0 exit /b %errorlevel%
  echo Finished `jom -U install_mkspecs`
popd

if exist %LIBRARY_BIN%\qmake.exe goto ok_qmake_exists
echo Warning %LIBRARY_BIN%\qmake.exe does not exist jom -U install failed, very strange. Copying it from qtbase\bin\qmake.exe
copy qtbase\bin\qmake.exe %LIBRARY_BIN%\qmake.exe
:ok_qmake_exists

:: To rewrite qt.conf contents per conda environment
copy "%RECIPE_DIR%\write_qtconf.bat" "%PREFIX%\Scripts\.qt-post-link.bat"
if %errorlevel% neq 0 exit /b %errorlevel%

Update bld.bat

Update bld.bat


rem Run all tests

call runXBRL21Tests.bat
call runXDTTests.bat
call runFormulaTests.bat
call runFunctionTests.bat
call runEFMTests.bat

add script to run all tests

add script to run all tests


@echo off

setlocal EnableDelayedExpansion

set registryRoot=HKCU\Software\Classes
set key=TortoiseGit

reg add "%registryRoot%\*\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\Directory\Background\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\Directory\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\Drive\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\Folder\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\InternetShortcut\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\LibraryFolder\background\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\LibraryLocation\shellex\ContextMenuHandlers\%key%" /d "---" /f
reg add "%registryRoot%\lnkfile\shellex\ContextMenuHandlers\%key%" /d "---" /f

Disable tortoise git context menu on more types


@echo off

setlocal
rem -----------------------------------------------
rem is batch executing with adiMistrator privileges
rem
rem -----------------------------------------------
set filename=%windir%\$%random%$
(@echo Hello, this is the administrator >%filename% ) 2> nul && (del %filename% & set elevated=1) || (set elevated=0)
if %elevated% == 0 (
    echo This script requires an elevated command shell to run.
    echo finished
    goto :eof
    )

if "%targetVS%"=="" set targetVS=12.0
if "%targetHive%"=="" set targetHive=Roslyn

set PreviewVersion=0.6.40308.1
set unconfigure=false
set verification=-Vr
set label=Disable

echo Prepare for Roslyn Open Source development
echo.

echo Create or clean the RoslynDev addin hive
echo.

if "%VSSDK120Install%" == "" (
    echo ERROR!   To build and debug the .Net compilers Open source projects requires the latest Visual Studio SDK.
    echo.
    set errorlevel=1
    goto :eof
    )

if /I "%1"=="u" (
    set unconfigure=true
    set verification=-Vu
    set label=Enable
    )

if not "%unconfigure%" == "true" (
    set unconfigure=false
    set verification=-Vr
    set label=Disable
    )

if not "%unconfigure%" == "true" (
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul

    call :EnableRoslynPackage Roslyn.VisualStudio.Components.pkgdef  0b5e8ddb-f12d-4131-a71d-77acc26a798f
    call :EnableRoslynPackage Roslyn.VisualStudio.Setup.pkgdef   28354cb8-c808-4138-bfce-33aa846bbd51
    call :EnableRoslynPackage Roslyn.PreviewPackage.pkgdef  8e2de189-1d7a-4bdb-9a15-fa0cb80e9450
    call :EnableRoslynPackage CompilerPackage.pkgdef  fc8d0600-8f16-4a89-a49c-a4f6c38b216a
    )

call :DisableVerificationFor Microsoft.CodeAnalysis.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll
call :DisableVerificationFor CompilerPackage.dll
call :DisableVerificationFor Roslyn.Compilers.BuildTasks.dll
call :DisableVerificationFor rcsc.exe
call :DisableVerificationFor rvbc.exe
call :DisableVerificationFor VBCSCompiler.exe

rem List skip verification entries
echo.
sn -q -Vl

if "%unconfigure%" == "true" (
    rem Reset the RoslynDev hive from the main hive,
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Clean /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive% /F > nul 2>&1
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive%_Config /F > nul 2>&1
    )

goto :eof

:DisableVerificationFor %1
@echo %label% verification for %1
for /F %%f in ('dir /s /b "%LOCALAPPDATA%\Microsoft\VisualStudio\%targetVS%%TargetHive%\%1"') do sn -q %verification% "%%f" && goto :eof
goto :eof

:EnableRoslynPackage %1 %2
@echo %label% EnableRoslynPackage for %1
for /F %%f in ('dir /s /b "%LOCALAPPDATA%\Microsoft\VisualStudio\%targetVS%%TargetHive%\%1"') do reg add "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive%\ExtensionManager\EnabledExtensions" /v %2 /d %%~dpf /F  > nul 2>&1 && goto :eof
goto :eof

@echo off

setlocal
rem -----------------------------------------------
rem is batch executing with adiMistrator privileges
rem
rem -----------------------------------------------
set filename=%windir%\$%random%$
(@echo Hello, this is the administrator >%filename% ) 2> nul && (del %filename% & set elevated=1) || (set elevated=0)
if %elevated% == 0 (
    echo This script requires an elevated command shell to run.
    echo finished
    goto :eof
    )

if "%targetVS%"=="" set targetVS=12.0
if "%targetHive%"=="" set targetHive=Roslyn

set PreviewVersion=0.6.40308.1
set unconfigure=false
set verification=-Vr
set label=Disable

echo Prepare for Roslyn Open Source development
echo.

echo Create or clean the RoslynDev addin hive
echo.

if "%VSSDK120Install%" == "" (
    echo ERROR!   To build and debug the .Net compilers Open source projects requires the latest Visual Studio SDK.
    echo.
    set errorlevel=1
    goto :eof
    )

if /I "%1"=="u" (
    set unconfigure=true
    set verification=-Vu
    set label=Enable
    )

if not "%unconfigure%" == "true" (
    set unconfigure=false
    set verification=-Vr
    set label=Disable
    )

if not "%unconfigure%" == "true" (
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul

    call :EnableRoslynPackage Roslyn.VisualStudio.Components.pkgdef  0b5e8ddb-f12d-4131-a71d-77acc26a798f
    call :EnableRoslynPackage Roslyn.VisualStudio.Setup.pkgdef   28354cb8-c808-4138-bfce-33aa846bbd51
    call :EnableRoslynPackage Roslyn.PreviewPackage.pkgdef  8e2de189-1d7a-4bdb-9a15-fa0cb80e9450
    call :EnableRoslynPackage CompilerPackage.pkgdef  fc8d0600-8f16-4a89-a49c-a4f6c38b216a
    )

call :DisableVerificationFor Microsoft.CodeAnalysis.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.CSharp.Workspaces.dll
call :DisableVerificationFor Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll
call :DisableVerificationFor CompilerPackage.dll
call :DisableVerificationFor Roslyn.Compilers.BuildTasks.dll
call :DisableVerificationFor rcsc.exe
call :DisableVerificationFor rvbc.exe
call :DisableVerificationFor VBCSCompiler.exe

rem List skip verification entries
echo.
sn -q -Vl

if "%unconfigure%" == "true" (
    rem Reset the RoslynDev hive from the main hive,
    "%VSSDK120Install%\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Clean /VSInstance=%targetVS% /RootSuffix=%TargetHive%  2> nul
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive% /F > nul 2>&1
    reg delete HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive%_Config /F > nul 2>&1
    )

goto :eof

:DisableVerificationFor %1
@echo %label% verification for %1
for /F %%f in ('dir /s /b "%LOCALAPPDATA%\Microsoft\VisualStudio\%targetVS%%TargetHive%\%1"') do sn -q %verification% "%%f" && goto :eof
goto :eof

:EnableRoslynPackage %1 %2
rem disable until we have a more complete mechanism
rem @echo %label% EnableRoslynPackage for %1
rem for /F %%f in ('dir /s /b "%LOCALAPPDATA%\Microsoft\VisualStudio\%targetVS%%TargetHive%\%1"') do reg add "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\%targetVS%%TargetHive%\ExtensionManager\EnabledExtensions" /v %2 /d %%~dpf /F  > nul 2>&1 && goto :eof
goto :eof

Disable automatic component registration in prepare.bat until we have a better mechanism

 (changeset 1213897)


call sbt assembly
del greedy.zip
java -jar out/proguard5.0/lib/proguard.jar @proguard.config
"C:\Program Files\7-Zip\7za.exe" a -tzip greedy.zip greedy.jar
PAUSE

call sbt assembly
del greedy.zip
java -jar out/proguard5.0/lib/proguard.jar @proguard.config
"C:\Program Files\7-Zip\7za.exe" a -tzip greedy.zip greedy.jar
del greedy.jar
PAUSE

Delete jar after packaging in zip

Delete jar after packaging in zip


@setlocal enableextensions enabledelayedexpansion
@echo off

mkdir c:\projects\pksav\test-env\build

cd c:\projects\pksav\test-env\build
if not !ERRORLEVEL!==0 goto fail

cmake -G "%GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release ..\..
if not !ERRORLEVEL!==0 goto fail

:: Generator-specific build command
if "x%GENERATOR_NAME%"=="xMinGW Makefiles" (
    make
) else (
    msbuild /p:configuration=Release ALL_BUILD.vcxproj
)
if not !ERRORLEVEL!==0 goto fail

:: Don't run anything when cross-compiling
if "x%GENERATOR_NAME:ARM=%"=="x%GENERATOR_NAME%" (
    ctest --output-on-failure
    if not !ERRORLEVEL!==0 goto fail
)

goto pass

endlocal

:fail
exit /b 1

:pass
exit /b 0

@setlocal enableextensions enabledelayedexpansion
@echo off

mkdir c:\projects\pksav\test-env\build

cd c:\projects\pksav\test-env\build
if not !ERRORLEVEL!==0 goto fail

:: MinGW builds can't have sh.exe in the PATH, which is the case by default

if not !ERRORLEVEL!==0 goto fail
if "x%GENERATOR_NAME%"=="xMinGW Makefiles" (
    set PATH="C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;C:\Program Files (x86)\CMake\bin"
)

cmake -G "%GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release ..\..

:: Generator-specific build command
if "x%GENERATOR_NAME%"=="xMinGW Makefiles" (
    mingw32-make
) else (
    msbuild /p:configuration=Release ALL_BUILD.vcxproj
)
if not !ERRORLEVEL!==0 goto fail

:: Don't run anything when cross-compiling
if "x%GENERATOR_NAME:ARM=%"=="x%GENERATOR_NAME%" (
    ctest --output-on-failure
    if not !ERRORLEVEL!==0 goto fail
)

goto pass

endlocal

:fail
exit /b 1

:pass
exit /b 0

set path for MinGW

appveyor: set path for MinGW


rem ba.bat - download and build all of scintilla and scite
rd /s/q scintilla scite
cvs co scintilla scite
cd scintilla
call delbin
del/q bin\*.a
call delcvs
call zipsrc
cd win32
nmake -f scintilla.mak
cd ..
cd ..
cd scite
del/q bin\*.properties
del/q bin\SciTE
call delbin
call delcvs
call zipsrc
cd win32
nmake -f scite.mak
cd ..
call upxsc1
call zipwscite
call delbin
cd ..
cd scintilla
call delbin
cd ..

rem ba.bat - download and build all of scintilla and scite
rd /s/q scintilla scite
cvs co scintilla scite
cd scintilla
call delbin
del/q bin\*.a
call delcvs
call zipsrc
cd win32
nmake -f scintilla.mak
cd ..
del/q bin\*.pdb
cd ..
cd scite
del/q bin\*.properties
del/q bin\SciTE
call delbin
call delcvs
call zipsrc
cd win32
nmake -f scite.mak
cd ..
call upxsc1
call zipwscite
call delbin
cd ..
cd scintilla
call delbin
cd ..

Delete pdb files so they are not included in source zips.


cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_libsdl.c -I"..\..\libdepwin\sdl2vc\include" -I"..\..\libdepwin\sdl2_image\include" -I"..\..\libdepwin\sdl2_ttf\include" -I"..\..\libdepwin\sdl2_mixer\include" -I"..\..\libdepwin\sdl2_net\include" -I"sdl2_gfx" -I"..\..\include"
link /DEBUG ring_libsdl.obj  ..\..\lib\ring.lib ..\..\libdepwin\sdl2vc\lib\x86\sdl2.lib ..\..\libdepwin\sdl2_image\lib\x86\sdl2_image.lib ..\..\libdepwin\sdl2_ttf\lib\x86\sdl2_ttf.lib ..\..\libdepwin\sdl2_mixer\lib\x86\sdl_mixer.lib ..\..\libdepwin\sdl2_net\lib\x86\sdl2_net.lib ..\..\libdepwin\sdl2vc\lib\x86\sdl2main.lib /DLL /OUT:..\..\bin\ring_sdl.dll /SUBSYSTEM:WINDOWS,"5.01" /NODEFAULTLIB:msvcrt.lib
del ring_libsdl.obj
copy libsdl.ring ..\..\bin
copy sdl.rh ..\..\bin
copy ring_libsdl.rh ..\..\bin

cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_libsdl.c -I"..\..\libdepwin\libsdl\sdl2_vc\include" -I"..\..\libdepwin\libsdl\sdl2_image\include" -I"..\..\libdepwin\libsdl\sdl2_ttf\include" -I"..\..\libdepwin\libsdl\sdl2_mixer\include" -I"..\..\libdepwin\libsdl\sdl2_net\include" -I"sdl2_gfx" -I"..\..\include"
link /DEBUG ring_libsdl.obj  ..\..\lib\ring.lib ..\..\libdepwin\libsdl\sdl2_vc\lib\x86\sdl2.lib ..\..\libdepwin\libsdl\sdl2_image\lib\x86\sdl2_image.lib ..\..\libdepwin\libsdl\sdl2_ttf\lib\x86\sdl2_ttf.lib ..\..\libdepwin\libsdl\sdl2_mixer\lib\x86\sdl2_mixer.lib ..\..\libdepwin\libsdl\sdl2_net\lib\x86\sdl2_net.lib ..\..\libdepwin\libsdl\sdl2_vc\lib\x86\sdl2main.lib /DLL /OUT:..\..\bin\ring_sdl.dll /SUBSYSTEM:WINDOWS,"5.01" /NODEFAULTLIB:msvcrt.lib
del ring_libsdl.obj

Update buildvc.bat

Update buildvc.bat


fix typo (related to #3670?)

fix typo (related to #3670?)