echo on

set PATH=C:\Windows\system32;C:\Windows;%PYTHON3_PATH%;%PYTHON3_PATH%\Scripts;%CMAKE_PATH%;

if not "%VCVARSALL_DIR%" == "" CALL "%VCVARSALL_DIR%\vcvarsall.bat" amd64

if not "%MINGW_PATH%" == "" SET PATH=%PATH%%MINGW_PATH%;

setx PATH "%PATH%"

mkdir C:\Fruit\build-%CONFIGURATION%
cd C:\Fruit\build-%CONFIGURATION%

cmake.exe -G "%CMAKE_GENERATOR%" .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_TESTS_IN_RELEASE_MODE=True %ADDITIONAL_CMAKE_ARGS% || exit /b 1

IF "%CMAKE_GENERATOR%"=="MinGW Makefiles" (
  mingw32-make -j12 || exit /b 1
) ELSE (
  msbuild ALL_BUILD.vcxproj || exit /b 1
)

pip3 install nose2

ctest.exe -j 1 --output-on-failure -C %CONFIGURATION% || exit /b 1

echo on

set PATH=C:\Windows\system32;C:\Windows;%PYTHON3_PATH%;%PYTHON3_PATH%\Scripts;%CMAKE_PATH%;

if not "%VCVARSALL_DIR%" == "" CALL "%VCVARSALL_DIR%\vcvarsall.bat" amd64

if not "%MINGW_PATH%" == "" SET PATH=%PATH%%MINGW_PATH%;

setx PATH "%PATH%"

mkdir C:\Fruit\build-%CONFIGURATION%
cd C:\Fruit\build-%CONFIGURATION%

rem These are just for debugging.
where cmake.exe
cmake.exe

cmake.exe -G "%CMAKE_GENERATOR%" .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_TESTS_IN_RELEASE_MODE=True %ADDITIONAL_CMAKE_ARGS% || exit /b 1

IF "%CMAKE_GENERATOR%"=="MinGW Makefiles" (
  mingw32-make -j12 || exit /b 1
) ELSE (
  msbuild ALL_BUILD.vcxproj || exit /b 1
)

pip3 install nose2

ctest.exe -j 1 --output-on-failure -C %CONFIGURATION% || exit /b 1

Add a couple debugging prints to postsubmit.bat, to investigate build failures with MinGW on the MSVC 2017 AppVeyor image.


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

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

REM Standard paths
SET FREERTOS_SOURCE=..\..\Source
SET COMMON_SOURCE=..\Common\minimal
SET COMMON_INCLUDE=..\Common\include

REM Have the files already been copied?
IF EXIST src\FreeRTOS_Source Goto END

    REM Create the required directory structure.
    MD src\FreeRTOS_Source
    MD src\FreeRTOS_Source\include
    MD src\FreeRTOS_Source\portable\GCC
    MD src\FreeRTOS_Source\portable\GCC\ARM_CM4F
    MD src\FreeRTOS_Source\portable\MemMang
    MD src\Common_Demo_Source
    MD src\Common_Demo_Source\include

    REM Copy the core kernel files into the SDK projects directory
    copy %FREERTOS_SOURCE%\tasks.c src\FreeRTOS_Source
    copy %FREERTOS_SOURCE%\queue.c src\FreeRTOS_Source
    copy %FREERTOS_SOURCE%\list.c src\FreeRTOS_Source
    copy %FREERTOS_SOURCE%\timers.c src\FreeRTOS_Source

    REM Copy the common header files into the SDK projects directory
    copy %FREERTOS_SOURCE%\include\*.* src\FreeRTOS_Source\include

    REM Copy the portable layer files into the projects directory
    copy %FREERTOS_SOURCE%\portable\GCC\ARM_CM4F\*.* src\FreeRTOS_Source\portable\GCC\ARM_CM4F

    REM Copy the basic memory allocation files into the SDK projects directory
    copy %FREERTOS_SOURCE%\portable\MemMang\heap_2.c src\FreeRTOS_Source\portable\MemMang

    REM Copy the files that define the common demo tasks.
    copy %COMMON_SOURCE%\dynamic.c         src\Common_Demo_Source
    copy %COMMON_SOURCE%\BlockQ.c          src\Common_Demo_Source
    copy %COMMON_SOURCE%\death.c           src\Common_Demo_Source
    copy %COMMON_SOURCE%\blocktim.c        src\Common_Demo_Source
    copy %COMMON_SOURCE%\semtest.c         src\Common_Demo_Source
    copy %COMMON_SOURCE%\PollQ.c           src\Common_Demo_Source
    copy %COMMON_SOURCE%\GenQTest.c        src\Common_Demo_Source
    copy %COMMON_SOURCE%\recmutex.c        src\Common_Demo_Source
    copy %COMMON_SOURCE%\sp_flop.c         src\Common_Demo_Source
    copy %COMMON_SOURCE%\countsem.c        src\Common_Demo_Source
    copy %COMMON_SOURCE%\integer.c         src\Common_Demo_Source

    REM Copy the common demo file headers.
    copy %COMMON_INCLUDE%\*.h              src\Common_Demo_Source\include

: END

Add batch file that creates the directory structure required by the XMC4500 GCC port.


@REM Copyright (c) Microsoft. All rights reserved.
@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.

setlocal

set build-root=%~dp0..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi

REM -- C# --
cd %build-root%\csharp\device\build
call build_mf.cmd
if errorlevel 1 goto :eof
cd %build-root%

Enable .netmf in the gated build.

Enable .netmf in the gated build.


@echo off
for %%i in (nim.exe) do (set NIM_BIN=%%~dp$PATH:i)

for %%i in ("%NIM_BIN%\..\") do (set NIM_ROOT=%%~fi)

set @GDB_PYTHON_MODULE_PATH=%NIM_ROOT%\tools\nim-gdb.py
set @NIM_GDB=gdb.exe

%@NIM_GDB% -eval-command="source  %@GDB_PYTHON_MODULE_PATH%" %*

EXIT /B %ERRORLEVEL%
@echo on

@echo off
for %%i in (nim.exe) do (set NIM_BIN=%%~dp$PATH:i)

for %%i in ("%NIM_BIN%\..\") do (set NIM_ROOT=%%~fi)

set @GDB_PYTHON_MODULE_PATH=%NIM_ROOT%\tools\nim-gdb.py
set @NIM_GDB=gdb.exe

@echo source %@GDB_PYTHON_MODULE_PATH%> wingdbcommand.txt
%@NIM_GDB% --command="wingdbcommand.txt" %*
del wingdbcommand.txt /f /q

EXIT /B %ERRORLEVEL%
@echo on

Revert #13658 for nim-gdb.bat. Fixes #13705 (#13707)


Add build time

Add build time


### Application.bat - L3 CDPN - 2015 ###
version = "2"
build_hour = "11H00"

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

### Application.bat - L3 CDPN - 2015 Mathieu Templier - Charlotte Rosel-Navarro ###
version = "2"
build_hour = "11H00"

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

update header for new member

update header for new member


@ECHO OFF
@REM ----- INIT SCREEN -----
TITLE Using command line to create new job !!!
COLOR 0f
CLS

@REM ----- SET DEFAULT DIRECTORY -----
SET DIRNAME=%~dp0
IF "%DIRNAME%" == "" SET DIRNAME=.\

@REM ----- GET INFORMATION FOR JOB FROM CONSOLE -----
ECHO --------------- CREATE JOB: %2 ---------------
ECHO.

SET inputResult=%*
IF "%1"=="-n" (
	"%DIRNAME%\groovy.bat" "%DIRNAME%\genjob.groovy" %inputResult%
) ELSE (
	ECHO "Incorrect format !!!"
	ECHO "Correct format of command: "
	ECHO "genjob -n <jobName> [-f <strFetchAction>] [-q <strQuery>] [-c <strCommand>] [-d <strDbExec>] [-fp <pathToFile>]"
)

@ECHO OFF
setlocal
@REM ----- INIT SCREEN -----
TITLE Using command line to create new job !!!
COLOR 0f
CLS

@REM ----- SET WIPERDOG HOME DIRECTORY -----
set WIPERDOGHOME=%~dp0..
for %%i in ("%WIPERDOGHOME%") do set WIPERDOGHOME=%%~fsi
cd "%WIPERDOGHOME%\bin"

@REM ----- GET INFORMATION FOR JOB FROM CONSOLE -----
ECHO --------------- CREATE JOB: %2 ---------------
ECHO.

SET inputResult=%*
IF "%1"=="-n" (
	"%WIPERDOGHOME%\bin\groovy.bat" "%WIPERDOGHOME%\bin\genjob.groovy" %inputResult%
) ELSE (
	ECHO "Incorrect format !!!"
	ECHO "Correct format of command: "
	ECHO "genjob -n <jobName> [-f <strFetchAction>] [-q <strQuery>] [-c <strCommand>] [-d <strDbExec>] [-fp <pathToFile>]"
)
endlocal

Fix bug: directory contains space character


@echo off

rem   Licensed to the Apache Software Foundation (ASF) under one or more
rem   contributor license agreements.  See the NOTICE file distributed with
rem   this work for additional information regarding copyright ownership.
rem   The ASF licenses this file to You under the Apache License, Version 2.0
rem   (the "License"); you may not use this file except in compliance with
rem   the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem   Unless required by applicable law or agreed to in writing, software
rem   distributed under the License is distributed on an "AS IS" BASIS,
rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem   See the License for the specific language governing permissions and
rem   limitations under the License.

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
rem   JM_START    - set this to "start" to launch JMeter in a separate window
rem                 this is used by the jmeterw.cmd script.
rem
rem   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
set "JMETER_HOME=%~dp0\.."
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined JMETER_BIN (
    set JMETER_BIN=%~dp0
)

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
)

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

if not defined DDRAW (
    set DDRAW=
    rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
    rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

    rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

    rem Setting this flag to true enables hardware-accelerated scaling.
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true
)

rem Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

%JM_START% "%JM_LAUNCH%" %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

@echo off

rem   Licensed to the Apache Software Foundation (ASF) under one or more
rem   contributor license agreements.  See the NOTICE file distributed with
rem   this work for additional information regarding copyright ownership.
rem   The ASF licenses this file to You under the Apache License, Version 2.0
rem   (the "License"); you may not use this file except in compliance with
rem   the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem   Unless required by applicable law or agreed to in writing, software
rem   distributed under the License is distributed on an "AS IS" BASIS,
rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem   See the License for the specific language governing permissions and
rem   limitations under the License.

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
rem   JM_START    - set this to 'start ""' to launch JMeter in a separate window
rem                 this is used by the jmeterw.cmd script.
rem
rem   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
set "JMETER_HOME=%~dp0\.."
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined JMETER_BIN (
    set JMETER_BIN=%~dp0
)

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
)

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

if not defined DDRAW (
    set DDRAW=
    rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
    rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

    rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

    rem Setting this flag to true enables hardware-accelerated scaling.
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true
)

rem Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

if "%JM_START%" == "start" (
    set JM_START=start "Apache JMeter"
)

%JM_START% "%JM_LAUNCH%" %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

Enable starting of jmeter.bat with JM_START set to "start"

Correct documentation for usage of JM_START to start JMeter.
Add a title to 'start' when none was given, which can happen,
when following old documentation.

Bugzilla Id: 62107

git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1825804 13f79535-47bb-0310-9956-ffa450edef68


@echo off

rem   Licensed to the Apache Software Foundation (ASF) under one or more
rem   contributor license agreements.  See the NOTICE file distributed with
rem   this work for additional information regarding copyright ownership.
rem   The ASF licenses this file to You under the Apache License, Version 2.0
rem   (the "License"); you may not use this file except in compliance with
rem   the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem   Unless required by applicable law or agreed to in writing, software
rem   distributed under the License is distributed on an "AS IS" BASIS,
rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem   See the License for the specific language governing permissions and
rem   limitations under the License.

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
rem   JM_START    - set this to "start" to launch JMeter in a separate window
rem                 this is used by the jmeterw.cmd script.
rem
rem   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined JMETER_BIN (
    set JMETER_BIN=%~dp0
)

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
)

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

if not defined DDRAW (
    set DDRAW=
    rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
    rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

    rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

    rem Setting this flag to true enables hardware-accelerated scaling.
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true
)

rem Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

%JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

@echo off

rem   Licensed to the Apache Software Foundation (ASF) under one or more
rem   contributor license agreements.  See the NOTICE file distributed with
rem   this work for additional information regarding copyright ownership.
rem   The ASF licenses this file to You under the Apache License, Version 2.0
rem   (the "License"); you may not use this file except in compliance with
rem   the License.  You may obtain a copy of the License at
rem
rem       http://www.apache.org/licenses/LICENSE-2.0
rem
rem   Unless required by applicable law or agreed to in writing, software
rem   distributed under the License is distributed on an "AS IS" BASIS,
rem   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem   See the License for the specific language governing permissions and
rem   limitations under the License.

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
rem   JM_START    - set this to "start" to launch JMeter in a separate window
rem                 this is used by the jmeterw.cmd script.
rem
rem   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined JMETER_BIN (
    set JMETER_BIN=%~dp0
)

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
)

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

if not defined DDRAW (
    set DDRAW=
    rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
    rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

    rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

    rem Setting this flag to true enables hardware-accelerated scaling.
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true
)

rem Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

if defined JM_START (
    set "_JM_START=%JM_START% %JM_LAUNCH%"
) else (
    set "_JM_START=%JM_LAUNCH%"
)

%_JM_START% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

Put JM_LAUNCH in front, if no JM_START is defined.

Hopefully this fill fix the space problem.

Bugzilla Id: 62107

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1824588 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: d0c5a27acf67d2efc0f705cb418dbd44d62f47bf


@echo off

:: hook `nodist use <version>`
if "%1"=="use" (
  call %0 + %2
  if ERRORLEVEL 0 (
    :: get path to version and add it to PATH
    FOR /F "tokens=1 delims=" %%A in ('"%0" path %2') do @set "Path=%%A;%Path%"
  )
  goto end
)

:: hook `nodist update`
if "%1"=="update" (
  :: rescue our hacked npm.cmd from `npm update`'s fangs
  copy /Y "%~dp0\npm.cmd" "%~dp0\npm.copy.cmd"
  cmd /C npm update npm -g
  del /F "%~dp0\npm.cmd"
  move /Y "%~dp0\npm.copy.cmd" "%~dp0\npm.cmd"

  pushd .
  cd /D "%~dp0"
  cd ..
  npm update
  popd
)

:main
"%~dp0\..\node.exe" "%~dp0\..\cli" %*
goto end

:end

@echo off

:: hook `nodist use <version>`
if "%1"=="use" (
  call %0 + %2
  if ERRORLEVEL 0 (
    :: get path to version and add it to PATH
    FOR /F "tokens=1 delims=" %%A in ('"%0" path %2') do @set "Path=%%A;%Path%"
  )
  goto end
)

:: hook `nodist update`
if "%1"=="update" (
  :: rescue our hacked npm.cmd from `npm update`'s fangs
  copy /Y "%~dp0\npm.cmd" "%~dp0\npm.copy.cmd"
  cmd /C npm update npm -g
  del /F "%~dp0\npm.cmd"
  move /Y "%~dp0\npm.copy.cmd" "%~dp0\npm.cmd"

  pushd .
  cd /D "%~dp0"
  cd ..
  npm update
  popd
)

:main
"%~dp0..\node.exe" "%~dp0..\cli" %*
goto end

:end

Fix batch file

Fix batch file


@echo on
rem Tycho 1.0.0 does not support Java 9
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_152"

rem To speed up build, download and unpack an M2 repo cache.
pushd %USERPROFILE%
call gsutil -q cp "gs://ct4e-m2-repositories/m2-oxygen.tar" .
echo on
tar xf m2-oxygen.tar && del m2-oxygen.tar
popd

cd github\google-cloud-eclipse

rem Pre-download all dependency JARs that test projects from the integration
rem test require to avoid the concurrent download issue:
rem https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/2284
pushd plugins\com.google.cloud.tools.eclipse.integration.appengine\test-projects
mkdir tmp-unzip-area
cd tmp-unzip-area
for %%i in (..\*.zip) do jar xf %%i
for /f %%i in ('dir /b /s pom.xml') do mvn -B -q -f "%%i" package
cd ..
rmdir /s /q tmp-unzip-area
popd

set CLOUDSDK_CORE_DISABLE_USAGE_REPORTING=true
call gcloud.cmd components update --quiet
@echo on
call gcloud.cmd components install app-engine-java --quiet
@echo on

mvn -V -B --settings kokoro\windows\m2-settings.xml ^
    -N io.takari:maven:wrapper -Dmaven=3.5.0
mvnw.cmd -V -B --settings kokoro\windows\m2-settings.xml ^
         --fail-at-end -Ptravis verify

exit /b %ERRORLEVEL%

@echo on
rem Tycho 1.0.0 does not support Java 9
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_152"

rem To speed up build, download and unpack an M2 repo cache.
pushd %USERPROFILE%
call gsutil -q cp "gs://ct4e-m2-repositories/m2-oxygen.tar" .
echo on
tar xf m2-oxygen.tar && del m2-oxygen.tar
popd

cd github\google-cloud-eclipse

rem Pre-download all dependency JARs of the test projects from the integration
rem test. A workaround to avoid the concurrent download issue:
rem https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/2284
pushd plugins\com.google.cloud.tools.eclipse.integration.appengine\test-projects
mkdir tmp-unzip-area
cd tmp-unzip-area
for %%i in (..\*.zip) do jar xf %%i
for /f %%i in ('dir /b /s pom.xml') do mvn -B -q -f "%%i" package
cd ..
rmdir /s /q tmp-unzip-area
popd

set CLOUDSDK_CORE_DISABLE_USAGE_REPORTING=true
call gcloud.cmd components update --quiet
@echo on
call gcloud.cmd components install app-engine-java --quiet
@echo on

mvn -V -B --settings kokoro\windows\m2-settings.xml ^
    -N io.takari:maven:wrapper -Dmaven=3.5.0
mvnw.cmd -V -B --settings kokoro\windows\m2-settings.xml ^
         --fail-at-end -Ptravis verify

exit /b %ERRORLEVEL%

Update continuous.bat (#2875)

Update continuous.bat (#2875)


@rem #!/dos/rocks!
@setlocal EnableDelayedExpansion
@echo off

rem Script for easily accessing gitignore boilerplates from
rem https://github.com/github/gitignore
rem
rem Change log
rem v1.0    1-May-2012  First public release
rem v1.0.01 16-Aug-2014 Added batch file for DOS by Kody Brown ^<thewizard@wasatchwizard.com^>
rem v2.0.00 11-Jun-2018 Updated to v2; subcommand model by Simon Whitaker ^<sw@netcetera.org^>
rem v2.0.01 13-Jun-2018 Added optional parameter for list subcommand, added search subcommand, added support for GIBO_BOILERPLATES by Kody Brown ^<thewizard@wasatchwizard.com^>

goto :setup

:version
    echo %basename% 2.1.2 by Simon Whitaker ^<sw@netcetera.org^>
    echo https://github.com/simonwhitaker/gitignore-boilerplates
    goto :eof

:usage
    call :version
    echo.
    echo Fetches gitignore boilerplates from github.com/github/gitignore
    echo.
    echo Usage:
    echo     %basename% [options]
    echo     %basename% [boilerplate boilerplate...]
    echo.
    echo Example:
    echo     %basename% Python TextMate ^>^> .gitignore
    echo.
    echo Options:
    echo     list [expr]   List available boilerplates
    echo     search expr   Search inside boilerplates for expr
    echo     update        Update list of available boilerplates
    echo     help          Display this help text
    echo     version       Display current script version

    goto :eof

:setup
    set "basename=%~n0"
    set "baseext=%~x0"
    set "basepath=%~dp0"

    set "__cloned="

    set "dumping="

    set "remote_repo=https://github.com/github/gitignore.git"

    rem Allow using the `GIBO_BOILERPLATES` system envar
    rem for specifying the boilerplates directory.
    if defined GIBO_BOILERPLATES set "local_repo=%GIBO_BOILERPLATES%"
    if not defined GIBO_BOILERPLATES set "local_repo=%AppData%\.gitignore-boilerplates"

    rem No args passed in, so show usage.
    if "%~1"=="" call :usage && goto :end

:parse
    rem Parse comand-line options.

    if "%~1"=="" goto :end

    set a=%~1

    rem The batch file's equivalent 'Sanity check' is that any
    rem options (-, --, and / for Windows) are executed then
    rem the batch file exits, ignoring any other commands, such
    rem as Python, etc.

    if /i "%a%"=="help"     call :usage         & goto :end
    if /i "%a%"=="/?"       call :usage         & goto :end
    if /i "%a%"=="version"  call :version       & goto :end
    if /i "%a%"=="/v"       call :version       & goto :end
    if /i "%a%"=="list"     call :list "%~2"    & goto :end
    if /i "%a%"=="search"   call :search "%~2"  & goto :end
    if /i "%a%"=="update"   call :update        & goto :end

    if /i "%a%"=="dump"     set "dumping=1"     & shift & goto :parse

    if defined dumping      call :dump "%a%"    & shift & goto :parse

    goto :invalid_argument "%a%"

:end
    @endlocal && exit /B 0

:invalid_argument "arg"
    echo Invalid argument: %~1
    echo Did you mean:

    rem Is there a .gitignore file?
    set "_foundfile="
    if exist "%local_repo%\%~1.gitignore" set "_foundfile=yes"
    if exist "%local_repo%\Global\%~1.gitignore" set "_foundfile=yes"
    if defined _foundfile (
        echo     `%basename% dump %*`
        echo     `%basename% list %*`
    )

    rem Did the user mean to search within .gitignore files?
    echo     `%basename% search %*`

    endlocal && exit /B 1

:clone [--silently]
    if "%~1"=="--silently" ( set "opt=-q" ) else ( set "opt=" )
    git clone %opt% "%remote_repo%" "%local_repo%"
    goto :eof

:init [--silently]
    if not exist "%local_repo%\.git" set "__cloned=yes" && call :clone "%~1"
    goto :eof

:list
    call :init

    echo === Languages ===
    echo.
    for /f %%G in ('dir /b /on "%local_repo%\*%~1*.gitignore"') do (
        echo %%~nG
    )

    echo.
    echo === Global ===
    echo.
    for /f %%G in ('dir /b /on "%local_repo%\Global\*%~1*.gitignore"') do (
        echo %%~nG
    )

    goto :eof

:search
    if "%~1"=="" echo %basename%: missing search expr.. && goto :eof

    call :init

    rem `findstr` options:
    rem   /R         Uses search strings as regular expressions.
    rem   /S         Searches for matching files in the current directory and all
    rem              subdirectories.
    rem   /I         Specifies that the search is not to be case-sensitive.
    rem   /N         Prints the line number before each line that matches.
    rem   /P         Skip files with non-printable characters.
    rem   /A:attr    Specifies color attribute with two hex digits. See "color /?"
    rem   strings    Text to be searched for.
    rem   [drive:][path]filename
    rem              Specifies a file or files to search.

    pushd "%local_repo%"
    findstr /S /R /I /N /P /A:03 "%~1" *.gitignore
    popd

    goto :eof

:update
    call :init

    rem If the repo was just cloned, don't perform a `pull`
    if not defined __cloned (
        echo updating..
        pushd "%local_repo%"
        git pull -q --ff origin master
        popd
    )

    goto :eof

:dump
    call :init --silently

    set "language_file=%local_repo%\%~1.gitignore"
    set "global_file=%local_repo%\Global\%~1.gitignore"

    if exist "%language_file%" (
        echo ### %~1
        echo.
        type "%language_file%"
        echo.
        echo.
    ) else if exist "%global_file%" (
        echo ### %~1
        echo.
        type "%global_file%"
        echo.
        echo.
    ) else (
        echo Unknown argument: %~1
    )

    goto :eof

@rem #!/dos/rocks!
@setlocal EnableDelayedExpansion
@echo off

rem Script for easily accessing gitignore boilerplates from
rem https://github.com/github/gitignore
rem
rem Change log
rem v1.0    1-May-2012  First public release
rem v1.0.01 16-Aug-2014 Added batch file for DOS by Kody Brown ^<thewizard@wasatchwizard.com^>
rem v2.0.00 11-Jun-2018 Updated to v2; subcommand model by Simon Whitaker ^<sw@netcetera.org^>
rem v2.0.01 13-Jun-2018 Added optional parameter for list subcommand, added search subcommand, added support for GIBO_BOILERPLATES by Kody Brown ^<thewizard@wasatchwizard.com^>

goto :setup

:version
    echo %basename% 2.1.2 by Simon Whitaker ^<sw@netcetera.org^>
    echo https://github.com/simonwhitaker/gitignore-boilerplates
    goto :eof

:usage
    call :version
    echo.
    echo Fetches gitignore boilerplates from github.com/github/gitignore
    echo.
    echo Usage:
    echo     %basename% [command]
    echo.
    echo Example:
    echo     %basename% dump Python NotepadPP ^>^> .gitignore
    echo.
    echo Options:
    echo     dump expr...  Dump boilerplate(s) to stdout
    echo     help          Display this help text
    echo     list          List available boilerplates
    echo     search expr   Search inside boilerplates for expr
    echo     update        Update list of available boilerplates
    echo     version       Display current script version

    goto :eof

:setup
    set "basename=%~n0"
    set "baseext=%~x0"
    set "basepath=%~dp0"

    set "__cloned="

    set "dumping="

    set "remote_repo=https://github.com/github/gitignore.git"

    rem Allow using the `GIBO_BOILERPLATES` system envar
    rem for specifying the boilerplates directory.
    if defined GIBO_BOILERPLATES set "local_repo=%GIBO_BOILERPLATES%"
    if not defined GIBO_BOILERPLATES set "local_repo=%AppData%\.gitignore-boilerplates"

    rem No args passed in, so show usage.
    if "%~1"=="" call :usage && goto :end

:parse
    rem Parse comand-line options.

    if "%~1"=="" goto :end

    set a=%~1

    rem The batch file's equivalent 'Sanity check' is that any
    rem options (-, --, and / for Windows) are executed then
    rem the batch file exits, ignoring any other commands, such
    rem as Python, etc.

    if /i "%a%"=="help"     call :usage         & goto :end
    if /i "%a%"=="/?"       call :usage         & goto :end
    if /i "%a%"=="version"  call :version       & goto :end
    if /i "%a%"=="/v"       call :version       & goto :end
    if /i "%a%"=="list"     call :list "%~2"    & goto :end
    if /i "%a%"=="search"   call :search "%~2"  & goto :end
    if /i "%a%"=="update"   call :update        & goto :end

    if /i "%a%"=="dump"     set "dumping=1"     & shift & goto :parse

    if defined dumping      call :dump "%a%"    & shift & goto :parse

    goto :invalid_argument "%a%"

:end
    @endlocal && exit /B 0

:invalid_argument "arg"
    echo Invalid argument: %~1
    echo Did you mean:

    rem Is there a .gitignore file?
    set "_foundfile="
    if exist "%local_repo%\%~1.gitignore" set "_foundfile=yes"
    if exist "%local_repo%\Global\%~1.gitignore" set "_foundfile=yes"
    if defined _foundfile (
        echo     `%basename% dump %*`
        echo     `%basename% list %*`
    )

    rem Did the user mean to search within .gitignore files?
    echo     `%basename% search %*`

    endlocal && exit /B 1

:clone [--silently]
    if "%~1"=="--silently" ( set "opt=-q" ) else ( set "opt=" )
    git clone %opt% "%remote_repo%" "%local_repo%"
    goto :eof

:init [--silently]
    if not exist "%local_repo%\.git" set "__cloned=yes" && call :clone "%~1"
    goto :eof

:list
    call :init

    echo === Languages ===
    echo.
    for /f %%G in ('dir /b /on "%local_repo%\*%~1*.gitignore"') do (
        echo %%~nG
    )

    echo.
    echo === Global ===
    echo.
    for /f %%G in ('dir /b /on "%local_repo%\Global\*%~1*.gitignore"') do (
        echo %%~nG
    )

    goto :eof

:search
    if "%~1"=="" echo %basename%: missing search expr.. && goto :eof

    call :init

    rem `findstr` options:
    rem   /R         Uses search strings as regular expressions.
    rem   /S         Searches for matching files in the current directory and all
    rem              subdirectories.
    rem   /I         Specifies that the search is not to be case-sensitive.
    rem   /N         Prints the line number before each line that matches.
    rem   /P         Skip files with non-printable characters.
    rem   /A:attr    Specifies color attribute with two hex digits. See "color /?"
    rem   strings    Text to be searched for.
    rem   [drive:][path]filename
    rem              Specifies a file or files to search.

    pushd "%local_repo%"
    findstr /S /R /I /N /P /A:03 "%~1" *.gitignore
    popd

    goto :eof

:update
    call :init

    rem If the repo was just cloned, don't perform a `pull`
    if not defined __cloned (
        echo updating..
        pushd "%local_repo%"
        git pull -q --ff origin master
        popd
    )

    goto :eof

:dump
    call :init --silently

    set "language_file=%local_repo%\%~1.gitignore"
    set "global_file=%local_repo%\Global\%~1.gitignore"

    if exist "%language_file%" (
        echo ### %~1
        echo.
        type "%language_file%"
        echo.
        echo.
    ) else if exist "%global_file%" (
        echo ### %~1
        echo.
        type "%global_file%"
        echo.
        echo.
    ) else (
        echo Unknown argument: %~1
    )

    goto :eof

Fix help text in gibo.bat

Fix help text in gibo.bat

Closes #37


:: Save source for C code and remove compiled libraries
ren "%SRC_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SRC_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
md %SP_DIR%\goodvibes\share\
"%CC%" /LD symmetry.c /F "%SP_DIR%\goodvibes\share\symmetry_win.dll"

:: Save source for C code and remove compiled libraries
ren "%SRC_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SRC_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
md %SP_DIR%\goodvibes\share\
"%CC%" /LD symmetry.c /Fe:"%SP_DIR%\goodvibes\share\symmetry_win.dll"

Update bld.bat

Update bld.bat


@echo off

rem ==========================================================================
rem Shortcuts for various tasks, emulating UNIX "make" on Windows.
rem It is primarly intended as a shortcut for compiling / installing
rem psutil ("make.bat build", "make.bat install") and running tests
rem ("make.bat test").
rem
rem This script is modeled after my Windows installation which uses:
rem - Visual studio 2008 for Python 2.6, 2.7, 3.2
rem - Visual studio 2010 for Python 3.3+
rem ...therefore it might not work on your Windows installation.
rem
rem By default C:\Python27\python.exe is used.
rem To compile for a specific Python version run:
rem     set PYTHON=C:\Python34\python.exe & make.bat build
rem
rem To use a different test script:
rem      set PYTHON=C:\Python34\python.exe & set TSCRIPT=foo.py & make.bat test
rem ==========================================================================

if "%PYTHON%" == "" (
    set PYTHON=C:\Python27\python.exe
)
if "%TSCRIPT%" == "" (
    set TSCRIPT=test\test_psutil.py
)

set PYTHON26=C:\Python26\python.exe
set PYTHON27=C:\Python27\python.exe
set PYTHON33=C:\Python33\python.exe
set PYTHON34=C:\Python34\python.exe
set PYTHON26-64=C:\Python26-64\python.exe
set PYTHON27-64=C:\Python27-64\python.exe
set PYTHON33-64=C:\Python33-64\python.exe
set PYTHON34-64=C:\Python34-64\python.exe

set ALL_PYTHONS=%PYTHON26% %PYTHON27% %PYTHON33% %PYTHON34% %PYTHON26-64% %PYTHON27-64% %PYTHON33-64% %PYTHON34-64%

rem Needed to locate the .pypirc file and upload exes on PYPI.
set HOME=%USERPROFILE%

rem ==========================================================================

if "%1" == "help" (
    :help
    echo Run `make ^<target^>` where ^<target^> is one of:
    echo   build         compile without installing
    echo   build-all     build exes + wheels
    echo   clean         clean build files
    echo   flake8        run flake8
    echo   install       compile and install
    echo   setup-dev-env install pip, pywin32, wheels, etc. for all python versions
    echo   test          run tests
    echo   test-memleaks run memory leak tests
    echo   test-process  run process related tests
    echo   test-system   run system APIs related tests
    echo   uninstall     uninstall
    echo   upload-all    upload exes + wheels
    goto :eof
)

if "%1" == "clean" (
    for /r %%R in (__pycache__) do if exist %%R (rmdir /S /Q %%R)
    for /r %%R in (*.pyc) do if exist %%R (del /s %%R)
    for /r %%R in (*.pyd) do if exist %%R (del /s %%R)
    for /r %%R in (*.orig) do if exist %%R (del /s %%R)
    for /r %%R in (*.bak) do if exist %%R (del /s %%R)
    for /r %%R in (*.rej) do if exist %%R (del /s %%R)
    if exist psutil.egg-info (rmdir /S /Q psutil.egg-info)
    if exist build (rmdir /S /Q build)
    if exist dist (rmdir /S /Q dist)
    goto :eof
)

if "%1" == "build" (
    :build
    "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
    %PYTHON% setup.py build
    if %errorlevel% neq 0 goto :error
	rem copies *.pyd files in ./psutil directory in order to allow
	rem "import psutil" when using the interactive interpreter from
    rem within this directory.
    %PYTHON% setup.py build_ext -i
    if %errorlevel% neq 0 goto :error
    goto :eof
)

if "%1" == "install" (
    :install
    call :build
    %PYTHON% setup.py install
    goto :eof
)

if "%1" == "uninstall" (
    for %%A in ("%PYTHON%") do (
        set folder=%%~dpA
    )
    for /F "delims=" %%i in ('dir /b %folder%\Lib\site-packages\*psutil*') do (
        rmdir /S /Q %folder%\Lib\site-packages\%%i
    )
    goto :eof
)

if "%1" == "test" (
    call :install
    %PYTHON% %TSCRIPT%
    goto :eof
)

if "%1" == "test-process" (
    call :install
    %PYTHON% -m unittest -v test.test_psutil.TestProcess
    goto :eof
)

if "%1" == "test-system" (
    call :install
    %PYTHON% -m unittest -v test.test_psutil.TestSystem
    goto :eof
)

if "%1" == "test-memleaks" (
    call :install
    %PYTHON% test\test_memory_leaks.py
    goto :eof
)

if "%1" == "build-all" (
    :build-all
    "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo building exe for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wininst || goto :error
        @echo ------------------------------------------------
        @echo building wheel for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wheel || goto :error
    )
    echo OK
    goto :eof
)

if "%1" == "upload-all" (
    :upload-exes
    "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo uploading exe for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wininst upload || goto :error
        @echo ------------------------------------------------
        @echo uploading wheel for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wheel upload || goto :error
    )
    echo OK
    goto :eof
)

if "%1" == "setup-dev-env" (
    :setup-env
    @echo ------------------------------------------------
    @echo downloading pip installer
    @echo ------------------------------------------------
    C:\python27\python.exe -c "import urllib2; r = urllib2.urlopen('https://raw.github.com/pypa/pip/master/contrib/get-pip.py'); open('get-pip.py', 'wb').write(r.read())"
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo installing pip for %%P
        @echo ------------------------------------------------
        %%P get-pip.py
    )
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo installing deps for %%P
        @echo ------------------------------------------------
        rem mandatory / for unittests
        %%P -m pip install unittest2 ipaddress mock wmi wheel pypiwin32 --upgrade
        rem nice to have
        %%P -m pip install ipdb pep8 pyflakes flake8 --upgrade
    )
    goto :eof
)

if "%1" == "flake8" (
    :flake8
    %PYTHON% -c "from flake8.main import main; main()"
    goto :eof
)

goto :help

:error
    @echo ------------------------------------------------
    @echo last command exited with error code %errorlevel%
    @echo ------------------------------------------------
    @exit /b %errorlevel%
    goto :eof

@echo off

rem ==========================================================================
rem Shortcuts for various tasks, emulating UNIX "make" on Windows.
rem It is primarly intended as a shortcut for compiling / installing
rem psutil ("make.bat build", "make.bat install") and running tests
rem ("make.bat test").
rem
rem This script is modeled after my Windows installation which uses:
rem - Visual studio 2008 for Python 2.6, 2.7, 3.2
rem - Visual studio 2010 for Python 3.3+
rem ...therefore it might not work on your Windows installation.
rem
rem By default C:\Python27\python.exe is used.
rem To compile for a specific Python version run:
rem     set PYTHON=C:\Python34\python.exe & make.bat build
rem
rem To use a different test script:
rem      set PYTHON=C:\Python34\python.exe & set TSCRIPT=foo.py & make.bat test
rem ==========================================================================

if "%PYTHON%" == "" (
    set PYTHON=C:\Python27\python.exe
)
if "%TSCRIPT%" == "" (
    set TSCRIPT=test\test_psutil.py
)

set VSINSTALLDIR=%VS90COMNTOOLS%..\..

set PYTHON26=C:\Python26\python.exe
set PYTHON27=C:\Python27\python.exe
set PYTHON33=C:\Python33\python.exe
set PYTHON34=C:\Python34\python.exe
set PYTHON26-64=C:\Python26-64\python.exe
set PYTHON27-64=C:\Python27-64\python.exe
set PYTHON33-64=C:\Python33-64\python.exe
set PYTHON34-64=C:\Python34-64\python.exe

set ALL_PYTHONS=%PYTHON26% %PYTHON27% %PYTHON33% %PYTHON34% %PYTHON26-64% %PYTHON27-64% %PYTHON33-64% %PYTHON34-64%

rem Needed to locate the .pypirc file and upload exes on PYPI.
set HOME=%USERPROFILE%

rem ==========================================================================

if "%1" == "help" (
    :help
    echo Run `make ^<target^>` where ^<target^> is one of:
    echo   build         compile without installing
    echo   build-all     build exes + wheels
    echo   clean         clean build files
    echo   flake8        run flake8
    echo   install       compile and install
    echo   setup-dev-env install pip, pywin32, wheels, etc. for all python versions
    echo   test          run tests
    echo   test-memleaks run memory leak tests
    echo   test-process  run process related tests
    echo   test-system   run system APIs related tests
    echo   uninstall     uninstall
    echo   upload-all    upload exes + wheels
    goto :eof
)

if "%1" == "clean" (
    for /r %%R in (__pycache__) do if exist %%R (rmdir /S /Q %%R)
    for /r %%R in (*.pyc) do if exist %%R (del /s %%R)
    for /r %%R in (*.pyd) do if exist %%R (del /s %%R)
    for /r %%R in (*.orig) do if exist %%R (del /s %%R)
    for /r %%R in (*.bak) do if exist %%R (del /s %%R)
    for /r %%R in (*.rej) do if exist %%R (del /s %%R)
    if exist psutil.egg-info (rmdir /S /Q psutil.egg-info)
    if exist build (rmdir /S /Q build)
    if exist dist (rmdir /S /Q dist)
    goto :eof
)

if "%1" == "build" (
    :build
    "%VSINSTALLDIR%\VC\bin\vcvars64.bat"
    %PYTHON% setup.py build
    if %errorlevel% neq 0 goto :error
	rem copies *.pyd files in ./psutil directory in order to allow
	rem "import psutil" when using the interactive interpreter from
    rem within this directory.
    %PYTHON% setup.py build_ext -i
    if %errorlevel% neq 0 goto :error
    goto :eof
)

if "%1" == "install" (
    :install
    call :build
    %PYTHON% setup.py install
    goto :eof
)

if "%1" == "uninstall" (
    for %%A in ("%PYTHON%") do (
        set folder=%%~dpA
    )
    for /F "delims=" %%i in ('dir /b %folder%\Lib\site-packages\*psutil*') do (
        rmdir /S /Q %folder%\Lib\site-packages\%%i
    )
    goto :eof
)

if "%1" == "test" (
    call :install
    %PYTHON% %TSCRIPT%
    goto :eof
)

if "%1" == "test-process" (
    call :install
    %PYTHON% -m unittest -v test.test_psutil.TestProcess
    goto :eof
)

if "%1" == "test-system" (
    call :install
    %PYTHON% -m unittest -v test.test_psutil.TestSystem
    goto :eof
)

if "%1" == "test-memleaks" (
    call :install
    %PYTHON% test\test_memory_leaks.py
    goto :eof
)

if "%1" == "build-all" (
    :build-all
    "%VSINSTALLDIR%\VC\bin\vcvars64.bat"
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo building exe for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wininst || goto :error
        @echo ------------------------------------------------
        @echo building wheel for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wheel || goto :error
    )
    echo OK
    goto :eof
)

if "%1" == "upload-all" (
    :upload-exes
    "%VSINSTALLDIR%\VC\bin\vcvars64.bat"
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo uploading exe for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wininst upload || goto :error
        @echo ------------------------------------------------
        @echo uploading wheel for %%P
        @echo ------------------------------------------------
        %%P setup.py build bdist_wheel upload || goto :error
    )
    echo OK
    goto :eof
)

if "%1" == "setup-dev-env" (
    :setup-env
    @echo ------------------------------------------------
    @echo downloading pip installer
    @echo ------------------------------------------------
    C:\python27\python.exe -c "import urllib2; r = urllib2.urlopen('https://raw.github.com/pypa/pip/master/contrib/get-pip.py'); open('get-pip.py', 'wb').write(r.read())"
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo installing pip for %%P
        @echo ------------------------------------------------
        %%P get-pip.py
    )
    for %%P in (%ALL_PYTHONS%) do (
        @echo ------------------------------------------------
        @echo installing deps for %%P
        @echo ------------------------------------------------
        rem mandatory / for unittests
        %%P -m pip install unittest2 ipaddress mock wmi wheel pypiwin32 --upgrade
        rem nice to have
        %%P -m pip install ipdb pep8 pyflakes flake8 --upgrade
    )
    goto :eof
)

if "%1" == "flake8" (
    :flake8
    %PYTHON% -c "from flake8.main import main; main()"
    goto :eof
)

goto :help

:error
    @echo ------------------------------------------------
    @echo last command exited with error code %errorlevel%
    @echo ------------------------------------------------
    @exit /b %errorlevel%
    goto :eof

improve make.bat's resiliency to Visual Studio install locations


where nmake.exe 2> NUL
if %ERRORLEVEL% GTR 0 call  "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
@rem Allow python build to succeed:
@rem http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat
SET VS90COMNTOOLS=%VS120COMNTOOLS%
nmake /nologo /s /f winbuild\Makefile %1

@rem if we don't have nmake in the path, we need to run setup
where nmake.exe 2> NUL
if %ERRORLEVEL% GTR 0 set need_setup=1

@rem if we don't have the include path set, we need to run setup
if not defined INCLUDE set need_setup=1

@rem run setup if we need to
if %need_setup% == 1 call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64

@rem Allow python build to succeed:
@rem http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat
SET VS90COMNTOOLS=%VS120COMNTOOLS%

@rem finally, run make
nmake /nologo /s /f winbuild\Makefile %1

Adjust windows build script

Adjust windows build script

This makes it succeed if the tools are in the path but the INCLUDE path
isn't configured.


Fix script.

Fix script.


@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if not defined PACKER_DEBUG echo off

echo ==^> Saving all installation files

if not defined PACKER_LOG_DIR set PACKER_LOG_DIR=z:\c\packer_logs

set PACKER_LOG_PATH=%PACKER_LOG_DIR%\%COMPUTERNAME%
if not exist "%PACKER_LOG_PATH%" mkdir "%PACKER_LOG_PATH%"
if not exist "%PACKER_LOG_PATH%" echo ==^> ERROR: Unable to create directory "%PACKER_LOG_PATH%" & goto exit1

xcopy /c /i /y "%TEMP%\*.log.txt" "%PACKER_LOG_PATH%\"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: xcopy /c /i /y "%TEMP%\*.log.txt" "%PACKER_LOG_PATH%\"

xcopy /c /e /h /i /k /r /y "%TEMP%" "%PACKER_LOG_PATH%\temp\"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: xcopy /c /e /h /i /k /r /y "%TEMP%" "%PACKER_LOG_PATH%\temp\"

xcopy /c /e /h /i /k /r /y "%SystemRoot%\TEMP" "%PACKER_LOG_PATH%\windows_temp\"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: xcopy /c /e /h /i /k /r /y "%SystemRoot%\TEMP" "%PACKER_LOG_PATH%\windows_temp\"

:exit0

@ping 127.0.0.1
@ver>nul

@goto :exit

:exit1

@ping 127.0.0.1
@verify other 2>nul

:exit

@echo ==^> Script exiting with errorlevel %ERRORLEVEL%
@exit /b %ERRORLEVEL%

@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if not defined PACKER_DEBUG echo off

echo ==^> Saving all installation files

if not defined PACKER_LOG_DIR set PACKER_LOG_DIR=z:\c\packer_logs

set PACKER_LOG_PATH=%PACKER_LOG_DIR%\%COMPUTERNAME%
if not exist "%PACKER_LOG_PATH%" mkdir "%PACKER_LOG_PATH%"
if not exist "%PACKER_LOG_PATH%" echo ==^> WARNING: Unable to create directory "%PACKER_LOG_PATH%" & goto exit0

xcopy /c /i /y "%TEMP%\*.log.txt" "%PACKER_LOG_PATH%\"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: xcopy /c /i /y "%TEMP%\*.log.txt" "%PACKER_LOG_PATH%\"

xcopy /c /e /h /i /k /r /y "%TEMP%" "%PACKER_LOG_PATH%\temp\"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: xcopy /c /e /h /i /k /r /y "%TEMP%" "%PACKER_LOG_PATH%\temp\"

xcopy /c /e /h /i /k /r /y "%SystemRoot%\TEMP" "%PACKER_LOG_PATH%\windows_temp\"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: xcopy /c /e /h /i /k /r /y "%SystemRoot%\TEMP" "%PACKER_LOG_PATH%\windows_temp\"

:exit0

@ping 127.0.0.1
@ver>nul

@goto :exit

:exit1

@ping 127.0.0.1
@verify other 2>nul

:exit

@echo ==^> Script exiting with errorlevel %ERRORLEVEL%
@exit /b %ERRORLEVEL%

Change fatal to warning in save-temp-dirs.cmd


REM ---------------------------------------------------------------------------
REM Builds pieces of the ARIS File SDK
REM ---------------------------------------------------------------------------

REM ---------------------------------------------------------------------------
REM Dependencies
REM
REM This script is dependent on:
REM     MSBuild
REM     F# compiler
REM     C# compiler
REM     MSVC++ compiler
REM ---------------------------------------------------------------------------

SET GEN_HDR_SLN=.\GenerateHeader\GenerateHeader.sln
SET GEN_HDR_PATH=.\GenerateHeader\GenerateHeader\bin\Release\GenerateHeader.exe
SET TYPEDEFS_FOLDER=..\type_definitions

if NOT EXIST %TYPEDEFS_FOLDER% MKDIR %TYPEDEFS_FOLDER%
DEL /Y %TYPEDEFS_FOLDER%\*.*

REM ---------------------------------------------------------------------------
REM Build the tool that generates types for programming languages.
REM ---------------------------------------------------------------------------

msbuild %GEN_HDR_SLN% /m /t:Clean /p:Configuration="Release"
msbuild %GEN_HDR_SLN% /m /t:Build /p:Configuration="Release"

REM ---------------------------------------------------------------------------
REM Generate the types for programming languages.
REM ---------------------------------------------------------------------------

REM FileHeader

call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FileHeader.definition -o %TYPEDEFS_FOLDER%\FileHeader.h
call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FileHeader.definition -o %TYPEDEFS_FOLDER%\FileHeaderFieldsOnly.h -m fieldsonly
call %GEN_HDR_PATH% -g C# -i .\GenerateHeader\FileHeader.definition -o %TYPEDEFS_FOLDER%\FileHeader.cs

REM FrameHeader

call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FrameHeader.definition -o %TYPEDEFS_FOLDER%\FrameHeader.h
call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FrameHeader.definition -o %TYPEDEFS_FOLDER%\FrameHeaderFieldsOnly.h -m fieldsonly
call %GEN_HDR_PATH% -g C# -i .\GenerateHeader\FrameHeader.definition -o %TYPEDEFS_FOLDER%\FrameHeader.cs

REM ---------------------------------------------------------------------------
REM Build code to verify correctness of generated types.
REM ---------------------------------------------------------------------------

msbuild %GEN_HDR_SLN% /m /t:TestCType:Clean /p:Configuration="Release" /p:Platform="x86"
msbuild %GEN_HDR_SLN% /m /t:TestCType /p:Configuration="Release" /p:Platform="x86"

msbuild %GEN_HDR_SLN% /m /t:TestCSharpType:Clean /p:Configuration="Release"
msbuild %GEN_HDR_SLN% /m /t:TestCSharpType /p:Configuration="Release"

REM ---------------------------------------------------------------------------
REM Verify correctness of generated types.
REM ---------------------------------------------------------------------------

call GenerateHeader\Release\TestCType.exe ArisFileHeader
call GenerateHeader\Release\TestCType.exe ArisFileHeaderFieldsOnly
call GenerateHeader\TestCSharpType\bin\Release\TestCSharpType.exe Aris.FileTypes.ArisFileHeader

call GenerateHeader\Release\TestCType.exe ArisFrameHeader
call GenerateHeader\Release\TestCType.exe ArisFrameHeaderFieldsOnly
call GenerateHeader\TestCSharpType\bin\Release\TestCSharpType.exe Aris.FileTypes.ArisFrameHeader

REM ---------------------------------------------------------------------------
REM Builds pieces of the ARIS File SDK
REM ---------------------------------------------------------------------------

REM ---------------------------------------------------------------------------
REM Dependencies
REM
REM This script is dependent on:
REM     MSBuild
REM     F# compiler
REM     C# compiler
REM     MSVC++ compiler
REM ---------------------------------------------------------------------------

SET GEN_HDR_SLN=.\GenerateHeader\GenerateHeader.sln
SET GEN_HDR_PATH=.\GenerateHeader\GenerateHeader\bin\Release\GenerateHeader.exe
SET TYPEDEFS_FOLDER=..\type_definitions

if NOT EXIST %TYPEDEFS_FOLDER% MKDIR %TYPEDEFS_FOLDER%
DEL /Y %TYPEDEFS_FOLDER%\*.*

REM ---------------------------------------------------------------------------
REM Build the tool that generates types for programming languages.
REM ---------------------------------------------------------------------------

msbuild %GEN_HDR_SLN% /m /t:Clean /p:Configuration="Release"
msbuild %GEN_HDR_SLN% /m /t:GenerateHeader /p:Configuration="Release"

REM ---------------------------------------------------------------------------
REM Generate the types for programming languages.
REM ---------------------------------------------------------------------------

REM FileHeader

call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FileHeader.definition -o %TYPEDEFS_FOLDER%\FileHeader.h
call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FileHeader.definition -o %TYPEDEFS_FOLDER%\FileHeaderFieldsOnly.h -m fieldsonly
call %GEN_HDR_PATH% -g C# -i .\GenerateHeader\FileHeader.definition -o %TYPEDEFS_FOLDER%\FileHeader.cs

REM FrameHeader

call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FrameHeader.definition -o %TYPEDEFS_FOLDER%\FrameHeader.h
call %GEN_HDR_PATH% -g C  -i .\GenerateHeader\FrameHeader.definition -o %TYPEDEFS_FOLDER%\FrameHeaderFieldsOnly.h -m fieldsonly
call %GEN_HDR_PATH% -g C# -i .\GenerateHeader\FrameHeader.definition -o %TYPEDEFS_FOLDER%\FrameHeader.cs

REM ---------------------------------------------------------------------------
REM Build code to verify correctness of generated types.
REM ---------------------------------------------------------------------------

msbuild %GEN_HDR_SLN% /m /t:TestCType:Clean /p:Configuration="Release" /p:Platform="x86"
msbuild %GEN_HDR_SLN% /m /t:TestCType /p:Configuration="Release" /p:Platform="x86"

msbuild %GEN_HDR_SLN% /m /t:TestCSharpType:Clean /p:Configuration="Release"
msbuild %GEN_HDR_SLN% /m /t:TestCSharpType /p:Configuration="Release"

REM ---------------------------------------------------------------------------
REM Verify correctness of generated types.
REM ---------------------------------------------------------------------------

call GenerateHeader\Release\TestCType.exe ArisFileHeader
call GenerateHeader\Release\TestCType.exe ArisFileHeaderFieldsOnly
call GenerateHeader\TestCSharpType\bin\Release\TestCSharpType.exe Aris.FileTypes.ArisFileHeader

call GenerateHeader\Release\TestCType.exe ArisFrameHeader
call GenerateHeader\Release\TestCType.exe ArisFrameHeaderFieldsOnly
call GenerateHeader\TestCSharpType\bin\Release\TestCSharpType.exe Aris.FileTypes.ArisFrameHeader

Fix a build issue when building from scratch


@REM Copyright (c) 2008 - 2010, Apple, Inc.  All rights reserved.
@REM All rights reserved. This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM Example usage of this script. default is a DEBUG build
@REM b
@REM b clean
@REM b release
@REM b release clean
@REM b -v -y build.log

ECHO OFF
@REM Setup Build environment. Sets WORKSPACE and puts build in path
CALL ..\edksetup.bat

@REM Set for tools chain. Currently RVCT31
SET TARGET_TOOLS=RVCT31
SET TARGET=DEBUG

@if /I "%1"=="RELEASE" (
  @REM If 1st argument is release set TARGET to RELEASE and shift arguments to remove it
  SET TARGET=RELEASE
  shift /1
)

SET BUILD_ROOT=%WORKSPACE%\Build\BeagleBoard\%TARGET%_%TARGET_TOOLS%

@REM Build the Beagle Board firmware and creat an FD (FLASH Device) Image.
CALL build -p BeagleBoardPkg\BeagleBoardPkg.dsc -a ARM -t RVCT31 -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8

@if /I "%1"=="CLEAN" goto Clean

@REM
@REM Ram starts at 0x80000000
@REM OMAP 3530 TRM defines 0x80008208 as the entry point
@REM The reset vector is caught by the mask ROM in the OMAP 3530 so that is why this entry
@REM point looks so strange.
@REM OMAP 3430 TRM section 26.4.8 has Image header information. (missing in OMAP 3530 TRM)
@REM
cd Tools

ECHO Building tools...
CALL nmake

ECHO Patching image with ConfigurationHeader.dat
CALL GenerateImage -D ..\ConfigurationHeader.dat -E 0x80008208 -I %BUILD_ROOT%\FV\BEAGLEBOARD_EFI.fd -O %BUILD_ROOT%\FV\BeagleBoard_EFI_flashboot.fd

ECHO Patching ..\Debugger_scripts ...
SET DEBUGGER_SCRIPT=..\Debugger_scripts
@for /f %%a IN ('dir /b %DEBUGGER_SCRIPT%\*.inc %DEBUGGER_SCRIPT%\*.cmm') do (
  @CALL replace %DEBUGGER_SCRIPT%\%%a %BUILD_ROOT%\%%a ZZZZZZ %BUILD_ROOT% WWWWWW  %WORKSPACE%
)

cd ..
EXIT /B

:Clean
cd Tools
CALL nmake clean
cd ..

@REM Copyright (c) 2008 - 2010, Apple, Inc.  All rights reserved.
@REM All rights reserved. This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM Example usage of this script. default is a DEBUG build
@REM b
@REM b clean
@REM b release
@REM b release clean
@REM b -v -y build.log

ECHO OFF
@REM Setup Build environment. Sets WORKSPACE and puts build in path
CALL ..\edksetup.bat

@REM Set for tools chain. Currently RVCT31
SET TARGET_TOOLS=RVCT31
SET TARGET=DEBUG

@if /I "%1"=="RELEASE" (
  @REM If 1st argument is release set TARGET to RELEASE and shift arguments to remove it
  SET TARGET=RELEASE
  shift /1
)

SET BUILD_ROOT=%WORKSPACE%\Build\BeagleBoard\%TARGET%_%TARGET_TOOLS%

@REM Build the Beagle Board firmware and creat an FD (FLASH Device) Image.
CALL build -p BeagleBoardPkg\BeagleBoardPkg.dsc -a ARM -t RVCT31 -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8
if ERRORLEVEL 1 goto Exit

@if /I "%1"=="CLEAN" goto Clean

@REM
@REM Ram starts at 0x80000000
@REM OMAP 3530 TRM defines 0x80008208 as the entry point
@REM The reset vector is caught by the mask ROM in the OMAP 3530 so that is why this entry
@REM point looks so strange.
@REM OMAP 3430 TRM section 26.4.8 has Image header information. (missing in OMAP 3530 TRM)
@REM
cd Tools

ECHO Building tools...
CALL nmake

ECHO Patching image with ConfigurationHeader.dat
CALL GenerateImage -D ..\ConfigurationHeader.dat -E 0x80008208 -I %BUILD_ROOT%\FV\BEAGLEBOARD_EFI.fd -O %BUILD_ROOT%\FV\BeagleBoard_EFI_flashboot.fd

ECHO Patching ..\Debugger_scripts ...
SET DEBUGGER_SCRIPT=..\Debugger_scripts
@for /f %%a IN ('dir /b %DEBUGGER_SCRIPT%\*.inc %DEBUGGER_SCRIPT%\*.cmm') do (
  @CALL replace %DEBUGGER_SCRIPT%\%%a %BUILD_ROOT%\%%a ZZZZZZ %BUILD_ROOT% WWWWWW  %WORKSPACE%
)

cd ..
:Exit
EXIT /B

:Clean
cd Tools
CALL nmake clean
cd ..

Make build script exit on build error

Make build script exit on build error

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@10027 6f19259b-4bc3-4df7-8a09-765794883524


git submodule update --init --recursive

rm -rf vcpkg

git clone https://github.com/Microsoft/vcpkg.git

cd vcpkg

call .\bootstrap-vcpkg.bat

vcpkg install libevent:x64-windows-static

vcpkg install protobuf:x64-windows-static

vcpkg install lua:x64-windows-static

vcpkg install sdl2:x64-windows-static

vcpkg install gtest:x64-windows-static

cd..

xcopy vcpkg\installed\x64-windows-static\lib lib\Release\ /s /e /Y
xcopy vcpkg\installed\x64-windows-static\bin ..\_Out\Release\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\debug\lib lib\Debug\  /s /e /Y
xcopy vcpkg\installed\x64-windows-static\debug\bin ..\_Out\Debug\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\tools\protobuf\protoc.exe ..\NFComm\NFMessageDefine\ /s /e /Y

cd..

git submodule update --init --recursive

rm -rf vcpkg

git clone https://github.com/Microsoft/vcpkg.git

cd vcpkg

call .\bootstrap-vcpkg.bat

vcpkg install libevent:x64-windows-static

vcpkg install protobuf:x64-windows-static

vcpkg install lua:x64-windows-static

vcpkg install sdl2:x64-windows-static

vcpkg install gtest:x64-windows-static

vcpkg install glm:x64-windows-static

cd..

xcopy vcpkg\installed\x64-windows-static\lib lib\Release\ /s /e /Y
xcopy vcpkg\installed\x64-windows-static\bin ..\_Out\Release\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\debug\lib lib\Debug\  /s /e /Y
xcopy vcpkg\installed\x64-windows-static\debug\bin ..\_Out\Debug\  /s /e /Y

xcopy vcpkg\installed\x64-windows-static\tools\protobuf\protoc.exe ..\NFComm\NFMessageDefine\ /s /e /Y

cd..

add glm library

add glm library


@echo off
rem
rem Install or update Cygwin.
rem

setlocal

set _PACKAGES=cron,diffutils,inetutils,ncurses,netcat,openssh,p7zip,procps,python,rsync,screen,unzip,vim,zip,genisoimage,w3m,wodim
set _ROOTDIR=C:\cygwin
set _SITE=http://mirrors.xmission.com/cygwin

goto :main

:stop_services
    sc query sshd | findstr STATE > NUL:
    set _SSHD=%ERRORLEVEL%
    if %_SSHD% EQU 0 sc stop sshd > NUL:

    sc query cron | findstr STATE > NUL:
    set _CRON=%ERRORLEVEL%
    if %_CRON% EQU 0 sc stop cron > NUL:

    sc query rsyncd | findstr STATE > NUL:
    set _RSYNCD=%ERRORLEVEL%
    if %_RSYNCD% EQU 0 sc stop rsyncd > NUL:
goto :eof

:start_services
    if %_RSYNCD% EQU 0 sc start rsyncd > NUL:
    if %_CRON% EQU 0 sc start cron > NUL:
    if %_SSHD% EQU 0 sc start sshd > NUL:
goto :eof

:get_setup_exe
    if not exist %_ROOTDIR% mkdir %_ROOTDIR%
    wget --quiet -O %_ROOTDIR%\setup.exe http://cygwin.com/setup.exe
goto :eof

:setup
    %_ROOTDIR%\setup.exe --site %_SITE% --quiet-mode --no-shortcuts --root %_ROOTDIR% --local-package-dir %_ROOTDIR%\LocalPackageDir %_PACKAGES%
goto :eof

:main
    call :get_setup_exe
    call :stop_services
    call :setup
    call :start_services

rem echo Creating passwd and group files...
rem C:\cygwin\bin\bash --login -i -c '/usr/bin/mkpasswd --local --domain ^> /etc/passwd'
rem C:\cygwin\bin\bash --login -i -c '/usr/bin/mkgroup --local --domain ^> /etc/group'
rem
rem echo Configuring cyglsa...
rem C:\cygwin\bin\bash --login -i -c "/usr/bin/cyglsa-config"
rem
rem echo Configuring sshd...
rem C:\cygwin\bin\bash --login -i -c "/usr/bin/ssh-host-config --yes"
rem C:\cygwin\bin\bash --login -i -c "/usr/bin/sed -i -e 's/#UseDNS yes/UseDNS no/' /etc/sshd_config"
rem C:\cygwin\bin\bash --login -i -c "/usr/bin/chown fdsv-sa-prx-sshdsrvr /etc/ssh* /var/empty /var/log/lastlog"

endlocal

@echo off
rem
rem Install or update Cygwin.
rem

setlocal

set _PACKAGES=cron,diffutils,inetutils,ncurses,netcat,openssh,p7zip,procps,python,rsync,screen,unzip,vim,zip,genisoimage,w3m,wodim
set _ROOTDIR=C:\cygwin
set _SITE=http://mirrors.xmission.com/cygwin

goto :main

:stop_service
    echo Stopping %1
    sc stop %1 > NUL:
goto :eof

:start_service
    echo Starting %1
    sc start %1 > NUL:
goto :eof

:stop_services
    sc query sshd | findstr STATE > NUL:
    set _SSHD=%ERRORLEVEL%
    if %_SSHD% EQU 0 call :stop_service sshd

    sc query cron | findstr STATE > NUL:
    set _CRON=%ERRORLEVEL%
    if %_CRON% EQU 0 call :stop_service cron

    sc query rsyncd | findstr STATE > NUL:
    set _RSYNCD=%ERRORLEVEL%
    if %_RSYNCD% EQU 0 call :stop_service rsyncd
goto :eof

:start_services
    if %_RSYNCD% EQU 0 call :start_service rsyncd
    if %_CRON% EQU 0 call :start_service cron
    if %_SSHD% EQU 0 call :start_service sshd
goto :eof

:get_setup_exe
    if not exist %_ROOTDIR% (
        echo Creating %_ROOTDIR%
        mkdir %_ROOTDIR%
    )
    echo Fetching latest setup.exe
    wget --quiet -O %_ROOTDIR%\setup.exe http://cygwin.com/setup.exe
goto :eof

:setup
    echo Running setup.exe
    %_ROOTDIR%\setup.exe --site %_SITE% --quiet-mode --no-shortcuts --root %_ROOTDIR% --local-package-dir %_ROOTDIR%\LocalPackageDir %_PACKAGES%
goto :eof

:create_passwd
    rem echo Creating passwd and group files
    rem C:\cygwin\bin\bash --login -i -c '/usr/bin/mkpasswd --local --domain ^> /etc/passwd'
    rem C:\cygwin\bin\bash --login -i -c '/usr/bin/mkgroup --local --domain ^> /etc/group'
goto :eof

:config_lsa
    rem echo Configuring cyglsa
    rem C:\cygwin\bin\bash --login -i -c "/usr/bin/cyglsa-config"
goto :eof

:config_sshd
    sc query sshd | findstr "service does not exist" > NUL:
    if %ERRORLEVEL% NEQ 0 goto :eof
    echo Configuring sshd
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/ssh-host-config --yes"
    %_ROOTDIR%\bin\bash --login -i -c "/usr/bin/sed -i -e 's/#UseDNS yes/UseDNS no/' /etc/sshd_config"
    rem%_ROOTDIR%\bin\bash --login -i -c "/usr/bin/chown fdsv-sa-prx-sshdsrvr /etc/ssh* /var/empty /var/log/lastlog"
goto :eof

:main
    call :get_setup_exe
    call :stop_services
    call :setup
    call :start_services
    call :create_passwd
    call :config_lsa
    call :config_sshd

endlocal

work on config_sshd

cygwin-setup.bat: work on config_sshd


mkdir C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload

call git clone git://github.com/tpope/vim-surround C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone git://github.com/tpope/vim-commentary.git C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/easymotion/vim-easymotion C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/kien/rainbow_parentheses.vim C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/itchyny/calendar.vim C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/itchyny/lightline.vim C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/Yggdroot/indentLine C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/Raimondi/delimitMate.git C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\

Add bat file for vim initialization on windows.


@echo off
setlocal

cd /d "%~dp0"

set PackagesDir=packages
set NuGetPath=.nuget\NuGet.exe
set FakePath=%PackagesDir%\FAKE\tools\Fake.exe
set RubyVersion=ruby-2.3.0-x64-mingw32
set RubyPackage=%RubyVersion%.7z

if not exist "%FakePath%" "%NuGetPath%" Install FAKE -Version 4.26.0 -OutputDirectory "%PackagesDir%" -ExcludeVersion
if not errorlevel 0 goto :eof

if not exist "%PackagesDir%\7-Zip.CommandLine" "%NuGetPath%" Install 7-Zip.CommandLine -Version 9.20.0 -OutputDirectory "%PackagesDir%" -ExcludeVersion
if not errorlevel 0 goto :eof

if not exist "%PackagesDir%\%RubyPackage%" powershell.exe -NoProfile -ExecutionPolicy Bypass -Command Invoke-WebRequest "http://dl.bintray.com/oneclick/rubyinstaller/%RubyPackage%" -OutFile "packages\%RubyPackage%"
if not errorlevel 0 goto :eof

if not exist "%PackagesDir%\%RubyVersion%" "%PackagesDir%\7-Zip.CommandLine\tools\7za" x "%PackagesDir%\%RubyPackage%" -o".\%PackagesDir%" -y
if not errorlevel 0 goto :eof

cmd /c "%PackagesDir%\%RubyVersion%\bin\gem" install pact:1.9.1
if not errorlevel 0 goto :eof

if "%1" equ "UploadPact" set branch=--envvar branch %2

set PATH=%PackagesDir%\%RubyVersion%\bin;%PATH%
"%FakePath%" build.fsx %1 --nocache %branch%
endlocal

if "%1" neq "UploadPact" goto :eof

git add --force ../pact/ad_posting_api_client-ad_posting_api.json ../pact/README.md
if not errorlevel 0 goto :eof

git commit --author="Build Agent <%3>" --message="update pact"
if not errorlevel 0 goto :eof

git push origin HEAD
if not errorlevel 0 goto :eof

:end
exit /b %errorlevel%

@echo off
setlocal

cd /d "%~dp0"

set PackagesDir=packages
set NuGetPath=.nuget\NuGet.exe
set FakePath=%PackagesDir%\FAKE\tools\Fake.exe
set RubyVersion=ruby-2.3.0-x64-mingw32
set RubyPackage=%RubyVersion%.7z

if not exist "%FakePath%" "%NuGetPath%" Install FAKE -Version 4.26.0 -OutputDirectory "%PackagesDir%" -ExcludeVersion
if errorlevel 1 goto :end

if not exist "%PackagesDir%\7-Zip.CommandLine" "%NuGetPath%" Install 7-Zip.CommandLine -Version 9.20.0 -OutputDirectory "%PackagesDir%" -ExcludeVersion
if errorlevel 1 goto :end

if not exist "%PackagesDir%\%RubyPackage%" powershell.exe -NoProfile -ExecutionPolicy Bypass -Command Invoke-WebRequest "http://dl.bintray.com/oneclick/rubyinstaller/%RubyPackage%" -OutFile "packages\%RubyPackage%"
if errorlevel 1 goto :end

if not exist "%PackagesDir%\%RubyVersion%" "%PackagesDir%\7-Zip.CommandLine\tools\7za" x "%PackagesDir%\%RubyPackage%" -o".\%PackagesDir%" -y
if errorlevel 1 goto :end

cmd /c "%PackagesDir%\%RubyVersion%\bin\gem" install pact:1.9.1
if errorlevel 1 goto :end

if "%1" equ "UploadPact" set branch=--envvar branch %2

set PATH=%PackagesDir%\%RubyVersion%\bin;%PATH%
"%FakePath%" build.fsx %1 --nocache %branch%
if errorlevel 1 goto :end
endlocal

if "%1" neq "UploadPact" goto :end

git add --force ../pact/ad_posting_api_client-ad_posting_api.json ../pact/README.md
if errorlevel 1 goto :end

git commit --author="Build Agent <%3>" --message="update pact"

git push origin HEAD
if errorlevel 1 goto :end

:end
exit /b %errorlevel%

stop build if fake fails

stop build if fake fails


mkdir build
cd build

cmake ^
    -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
    -DBUILD_TESTING=ON ^
    %SRC_DIR%
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1

:: Test.
ctest --output-on-failure -C Release
if errorlevel 1 exit 1

Create bld_cxx.bat

Create bld_cxx.bat


echo "Windows"
exit 0
(if not exist \home mkdir \home)
(if not exist \home\nodered mkdir \home\nodered)
(if not exist \home\nodered\.node-red mkdir \home\nodered\.node-red)
copy npm_.cmd \home\nodered\.node-red\npm_.cmd
pushd \home\nodered\.node-red
npm install node-red-dashboard node-red-contrib-azureiothubnode node-red-contrib-cognitive-services node-red-contrib-azure-blob-storage node-red-contrib-azure-table-storage node-red-contrib-azure-sql node-red-contrib-azure-documentdb node-red-contrib-azureiotc2d node-red-node-swagger & (
     copy npm_.cmd npm.cmd /y
     popd
     copy npm_.cmd npm.cmd /y
)

fix postinstall

fix postinstall