@REM @file
@REM   This stand-alone program is typically called by the edksetup.bat file,
@REM   however it may be executed directly from the BaseTools project folder
@REM   if the file is not executed within a WORKSPACE\BaseTools folder.
@REM
@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
@REM
@REM This program and the accompanying materials are licensed and made available
@REM under the terms and conditions of the BSD License which accompanies this
@REM 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
@REM IMPLIED.
@REM

@echo off
pushd .

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

if /I "%1"=="-h" goto Usage
if /I "%1"=="-help" goto Usage
if /I "%1"=="--help" goto Usage
if /I "%1"=="/h" goto Usage
if /I "%1"=="/help" goto Usage
if /I "%1"=="/?" goto Usage

:loop
  if "%1"=="" goto setup_workspace
  if /I "%1"=="--nt32" (
    @REM Ignore --nt32 flag
    shift
    goto loop
  )
  if /I "%1"=="Reconfig" (
    shift
    set RECONFIG=TRUE
    goto loop
  )
  if /I "%1"=="Rebuild" (
    shift
    set REBUILD=TRUE
    goto loop
  )
  if /I "%1"=="ForceRebuild" (
    shift
    set FORCE_REBUILD=TRUE
    goto loop
  )
  if "%1"=="" goto setup_workspace
  if exist %1 (
    if not defined BASE_TOOLS_PATH (
      if exist %1\Source set BASE_TOOLS_PATH=%1
      shift
      goto loop
    )
    if not defined EDK_TOOLS_PATH (
      if exist %1\Bin\Win32 set EDK_TOOLS_PATH=%1
      shift
      goto loop
    )
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  ) else (
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  )
  goto loop

@REM
@REM Check the required system environment variables
@REM

:setup_workspace
  REM
  REM check the EDK_TOOLS_PATH
  REM
  if not defined EDK_TOOLS_PATH goto no_EDK_TOOLS_PATH
  if exist %EDK_TOOLS_PATH% goto set_PATH

:no_EDK_TOOLS_PATH
  if not defined WORKSPACE (
    if defined BASE_TOOLS_PATH (
      set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! Neither BASE_TOOLS_PATH nor EDK_TOOLS_PATH are set. !!!
      echo.
      goto end
    )
  ) else (
    if exist %WORKSPACE%\BaseTools\Bin (
      set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! No tools path available. Please set EDK_TOOLS_PATH !!!
      echo.
      goto end
    )
  )

:set_PATH
  if defined WORKSPACE_TOOLS_PATH goto check_PATH
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  goto PATH_ok

:check_PATH
  if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this session.

:PATH_ok
REM
REM copy *.template to %CONF_PATH%
REM
if not defined WORKSPACE (
   if defined RECONFIG (
     echo.
     echo !!! WARNING !!! WORKSPACE environment variable was not set, cannot Reconfig !!!
     echo.
   )
   goto skip_reconfig
)

if not defined CONF_PATH (
  set CONF_PATH=%WORKSPACE%\Conf
)

if NOT exist %CONF_PATH% (
  if defined PACKAGES_PATH (
    for %%i IN (%PACKAGES_PATH%) DO (
      if exist %%~fi\Conf (
        set CONF_PATH=%%i\Conf
        goto CopyConf
      )
    )
  )
)

:CopyConf
if NOT exist %CONF_PATH% (
  mkdir %CONF_PATH%
) else (
  if defined RECONFIG (
    echo.
    echo  Over-writing the files in the CONF_PATH directory
    echo  using the default template files
    echo.
  )
)

if NOT exist %CONF_PATH%\target.txt (
  echo copying ... target.template to %CONF_PATH%\target.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (
    echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
) else (
  if defined RECONFIG echo over-write ... target.template to %CONF_PATH%\target.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
)

if NOT exist %CONF_PATH%\tools_def.txt (
  echo copying ... tools_def.template to %CONF_PATH%\tools_def.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (
    echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
) else (
  if defined RECONFIG echo over-write ... tools_def.template to %CONF_PATH%\tools_def.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
)

if NOT exist %CONF_PATH%\build_rule.txt (
  echo copying ... build_rule.template to %CONF_PATH%\build_rule.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (
    echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
) else (
  if defined RECONFIG echo over-write ... build_rule.template to %CONF_PATH%\build_rule.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
)

echo           PATH      = %PATH%
echo.
if defined WORKSPACE (
  echo      WORKSPACE      = %WORKSPACE%
)
if defined PACKAGES_PATH (
  echo  PACKAGES_PATH      = %PACKAGES_PATH%
)
echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%
if defined BASE_TOOLS_PATH (
  echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
)
if defined EDK_TOOLS_BIN (
  echo  EDK_TOOLS_BIN      = %EDK_TOOLS_BIN%
)
echo      CONF_PATH      = %CONF_PATH%
echo.

:skip_reconfig

@REM
@REM Test if we are going to have to do a build
@REM
if defined FORCE_REBUILD goto check_build_environment
if defined REBUILD goto check_build_environment
if not exist "%EDK_TOOLS_PATH%" goto check_build_environment

IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_build_environment

goto end

:check_build_environment

  if not defined FORCE_REBUILD (
    echo.
    echo Rebuilding of tools is not required.  Binaries of the latest,
    echo tested versions of the tools have been tested and included in the
    echo EDK II repository.
    echo.
    echo If you really want to build the tools, use the ForceRebuild option.
    echo.
    goto end
  )

  if not defined BASE_TOOLS_PATH (
     if not exist "Source\C\Makefile" (
       if not exist "%EDK_TOOLS_PATH%\Source\C\Makefile" goto no_source_files
       set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
     ) else (
       set BASE_TOOLS_PATH=%CD%
     )
  )
  set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH%

  set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python
  set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%

  if not defined PYTHON_HOME (
    if defined PYTHONHOME (
      set PYTHON_HOME=%PYTHONHOME%
    ) else (
      echo.
      echo  !!! ERROR !!! PYTHON_HOME is required to build or execute the tools, please set it. !!!
      echo.
      goto end
    )
  )

  @REM We have Python, now test for FreezePython application
  if not defined PYTHON_FREEZER_PATH (
    @REM see if we can find FreezePython.ex
    if exist "%PYTHON_HOME%\Tools\cx_Freeze-3.0.3\FreezePython.exe" (
      set PYTHON_FREEZER_PATH=%PYTHON_HOME%\Tools\cx_Freeze-3.0.3
    )
    if exist "%PYTHON_HOME%\Tools\cx_Freeze\FreezePython.exe" (
      set PYTHON_FREEZER_PATH=%PYTHON_HOME%\Tools\cx_Freeze
    )
    if exist "C:\cx_Freeze\FreezePython.exe" (
        set PYTHON_FREEZER_PATH=C:\cx_Freeze
    )
    if exist "C:\cx_Freeze-3.0.3" (
        set PYTHON_FREEZER_PATH=C:\cx_Freeze-3.0.3
    )
    if not defined PYTHON_FREEZER_PATH (
      echo.
      echo !!! WARNING !!! Will not be able to compile Python programs to .exe
      echo Will setup environment to run Python scripts directly.
      echo.
      set "PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH%"
      set "PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH%"
      set "PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH%"
      set PATHEXT=%PATHEXT%;.py
    )
  )

  echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
  echo     PYTHON_PATH     = %PYTHON_PATH%
  echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%
  echo.

  call "%EDK_TOOLS_PATH%\get_vsvars.bat"
  if not defined VCINSTALLDIR (
    @echo.
    @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!
    @echo.
    goto end
  )

:VisualStudioAvailable
  if not defined FORCE_REBUILD goto IncrementalBuild

:CleanAndBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake cleanall
  del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
  popd
  @REM Let CleanAndBuild fall through to IncrementalBuild

:IncrementalBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake c
  popd

  if defined PYTHON_FREEZER_PATH (
    echo BUILDING PYTHON TOOLS
    pushd .
    cd %BASE_TOOLS_PATH%
    call nmake python
    popd
  ) else (
    echo.
    echo !!! WARNING !!! Cannot make executable from Python code, executing python scripts instead !!!
    echo.
  )
  goto end

:no_source_files
  echo.
  echo !!! ERROR !!! Cannot build BaseTools applications - no source directory located !!!
  echo.
  goto end

:Usage
  @echo.
  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"
  @echo.
  @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path.
  @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.
  @echo         Rebuild           If sources are available perform an Incremental build, only
  @echo                           build those updated tools.
  @echo         ForceRebuild      If sources are available, rebuild all tools regardless of
  @echo                           whether they have been updated or not.
  @echo         Reconfig          Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.

:end
set REBUILD=
set FORCE_REBUILD=
set RECONFIG=
popd

@REM @file
@REM   This stand-alone program is typically called by the edksetup.bat file,
@REM   however it may be executed directly from the BaseTools project folder
@REM   if the file is not executed within a WORKSPACE\BaseTools folder.
@REM
@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
@REM
@REM This program and the accompanying materials are licensed and made available
@REM under the terms and conditions of the BSD License which accompanies this
@REM 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
@REM IMPLIED.
@REM

@echo off
pushd .

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

if /I "%1"=="-h" goto Usage
if /I "%1"=="-help" goto Usage
if /I "%1"=="--help" goto Usage
if /I "%1"=="/h" goto Usage
if /I "%1"=="/help" goto Usage
if /I "%1"=="/?" goto Usage

:loop
  if "%1"=="" goto setup_workspace
  if /I "%1"=="--nt32" (
    @REM Ignore --nt32 flag
    shift
    goto loop
  )
  if /I "%1"=="Reconfig" (
    shift
    set RECONFIG=TRUE
    goto loop
  )
  if /I "%1"=="Rebuild" (
    shift
    set REBUILD=TRUE
    goto loop
  )
  if /I "%1"=="ForceRebuild" (
    shift
    set FORCE_REBUILD=TRUE
    goto loop
  )
  if "%1"=="" goto setup_workspace
  if exist %1 (
    if not defined BASE_TOOLS_PATH (
      if exist %1\Source set BASE_TOOLS_PATH=%1
      shift
      goto loop
    )
    if not defined EDK_TOOLS_PATH (
      if exist %1\Bin\Win32 set EDK_TOOLS_PATH=%1
      shift
      goto loop
    )
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  ) else (
    echo.
    echo !!! ERROR !!! Unknown argument, %1 !!!
    echo.
    goto end
  )
  goto loop

@REM
@REM Check the required system environment variables
@REM

:setup_workspace
  REM
  REM check the EDK_TOOLS_PATH
  REM
  if not defined EDK_TOOLS_PATH goto no_EDK_TOOLS_PATH
  if exist %EDK_TOOLS_PATH% goto set_PATH

:no_EDK_TOOLS_PATH
  if not defined WORKSPACE (
    if defined BASE_TOOLS_PATH (
      set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! Neither BASE_TOOLS_PATH nor EDK_TOOLS_PATH are set. !!!
      echo.
      goto end
    )
  ) else (
    if exist %WORKSPACE%\BaseTools\Bin (
      set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
      goto set_PATH
    ) else (
      echo.
      echo !!! ERROR !!! No tools path available. Please set EDK_TOOLS_PATH !!!
      echo.
      goto end
    )
  )

:set_PATH
  if defined WORKSPACE_TOOLS_PATH goto check_PATH
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  goto PATH_ok

:check_PATH
  if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok
  if not defined EDK_TOOLS_BIN (
    if exist %EDK_TOOLS_PATH%\Bin\Win32 (
      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
      echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32
      echo Or configure EDK_TOOLS_BIN env to point Win32 directory.
      echo.
      goto end
    )
  )
  set PATH=%EDK_TOOLS_BIN%;%PATH%
  set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
  echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this session.

:PATH_ok
REM
REM copy *.template to %CONF_PATH%
REM
if not defined WORKSPACE (
   if defined RECONFIG (
     echo.
     echo !!! WARNING !!! WORKSPACE environment variable was not set, cannot Reconfig !!!
     echo.
   )
   goto skip_reconfig
)

if not defined CONF_PATH (
  set CONF_PATH=%WORKSPACE%\Conf
)

if NOT exist %CONF_PATH% (
  if defined PACKAGES_PATH (
    for %%i IN (%PACKAGES_PATH%) DO (
      if exist %%~fi\Conf (
        set CONF_PATH=%%i\Conf
        goto CopyConf
      )
    )
  )
)

:CopyConf
if NOT exist %CONF_PATH% (
  mkdir %CONF_PATH%
) else (
  if defined RECONFIG (
    echo.
    echo  Over-writing the files in the CONF_PATH directory
    echo  using the default template files
    echo.
  )
)

if NOT exist %CONF_PATH%\target.txt (
  echo copying ... target.template to %CONF_PATH%\target.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (
    echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
) else (
  if defined RECONFIG echo over-write ... target.template to %CONF_PATH%\target.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt > nul
)

if NOT exist %CONF_PATH%\tools_def.txt (
  echo copying ... tools_def.template to %CONF_PATH%\tools_def.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (
    echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
) else (
  if defined RECONFIG echo over-write ... tools_def.template to %CONF_PATH%\tools_def.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.txt > nul
)

if NOT exist %CONF_PATH%\build_rule.txt (
  echo copying ... build_rule.template to %CONF_PATH%\build_rule.txt
  if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (
    echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\
  )
  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
) else (
  if defined RECONFIG echo over-write ... build_rule.template to %CONF_PATH%\build_rule.txt
  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %CONF_PATH%\build_rule.txt > nul
)

echo           PATH      = %PATH%
echo.
if defined WORKSPACE (
  echo      WORKSPACE      = %WORKSPACE%
)
if defined PACKAGES_PATH (
  echo  PACKAGES_PATH      = %PACKAGES_PATH%
)
echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%
if defined BASE_TOOLS_PATH (
  echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%
)
if defined EDK_TOOLS_BIN (
  echo  EDK_TOOLS_BIN      = %EDK_TOOLS_BIN%
)
echo      CONF_PATH      = %CONF_PATH%
echo.

:skip_reconfig

@REM
@REM Test if we are going to have to do a build
@REM
if defined FORCE_REBUILD goto check_build_environment
if defined REBUILD goto check_build_environment
if not exist "%EDK_TOOLS_PATH%" goto check_build_environment

IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\EfiRom.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenBootSector.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenPage.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\GenVtf.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_c_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_c_tools

goto check_python_tools

:check_c_tools
  echo.
  echo !!! ERROR !!! Binary C tools are missing. They are requried to be built from BaseTools Source.
  echo.
  goto end

:check_python_tools
IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" goto check_build_environment
IF NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" goto check_build_environment

goto end

:check_build_environment
  if defined BASETOOLS_PYTHON_SOURCE goto VisualStudioAvailable

  if not defined BASE_TOOLS_PATH (
     if not exist "Source\C\Makefile" (
       if not exist "%EDK_TOOLS_PATH%\Source\C\Makefile" goto no_source_files
       set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
     ) else (
       set BASE_TOOLS_PATH=%CD%
     )
  )

  if not defined PYTHON_HOME (
    if defined PYTHONHOME (
      set PYTHON_HOME=%PYTHONHOME%
    ) else (
      echo.
      echo  !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set.
      echo PYTHON_HOME is required to build or execute the python tools.
      echo.
      goto end
    )
  )

  @REM We have Python, now test for FreezePython application
  if not defined PYTHON_FREEZER_PATH (
    echo.
    echo !!! WARNING !!! PYTHON_FREEZER_PATH environment variable is not set.
    echo Setup environment to run Python scripts directly.
    echo.
    set "PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike"
  )

  set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python
  set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%

  echo                PATH = %PATH%
  echo         PYTHON_HOME = %PYTHON_HOME%
  echo          PYTHONPATH = %PYTHONPATH%
  if defined PYTHON_FREEZER_PATH (
    echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%
  )
  echo.

:VisualStudioAvailable
  if not defined FORCE_REBUILD (
    if not defined REBUILD (
      goto end
    )
  )
  call "%EDK_TOOLS_PATH%\get_vsvars.bat"
  if not defined VCINSTALLDIR (
    @echo.
    @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!
    @echo.
    goto end
  )
  if not defined FORCE_REBUILD goto IncrementalBuild

:CleanAndBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake cleanall
  del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
  popd
  @REM Let CleanAndBuild fall through to IncrementalBuild

:IncrementalBuild
  pushd .
  cd %BASE_TOOLS_PATH%
  call nmake c
  popd

  if defined PYTHON_FREEZER_PATH (
    echo BUILDING PYTHON TOOLS
    pushd .
    cd %BASE_TOOLS_PATH%
    call nmake python
    popd
  ) else (
    echo.
    echo !!! WARNING !!! Cannot make executable from Python code, executing python scripts instead !!!
    echo.
  )
  goto end

:no_source_files
  echo.
  echo !!! ERROR !!! Cannot build BaseTools applications - no source directory located !!!
  echo.
  goto end

:Usage
  @echo.
  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"
  @echo.
  @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path.
  @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.
  @echo         Rebuild           If sources are available perform an Incremental build, only
  @echo                           build those updated tools.
  @echo         ForceRebuild      If sources are available, rebuild all tools regardless of
  @echo                           whether they have been updated or not.
  @echo         Reconfig          Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.

:end
set REBUILD=
set FORCE_REBUILD=
set RECONFIG=
popd

BaseTools: Update toolsetup.bat to set PYTHONPATH env to run python source

When python tool exe doesn't exist, toolsetup.bat will set up PYTHONPATH,
and set python tool dos script directory into system PATH.

Cc: Yonghong Zhu <78d981fe33a016071af5222c56d5cf77f30fb0b2@intel.com>
Cc: Michael Kinney <fd20bc543a9f65bb633fac7d08a403c1f1c8eb6c@intel.com>
Cc: Erik Bjorge <330ad10f99fcdfb914fa4e3b5d9f2ec8c03e31ae@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <6480311aeeb4b006862f6d13ebabddc03f51e507@intel.com>
Reviewed-by: Yonghong Zhu <78d981fe33a016071af5222c56d5cf77f30fb0b2@intel.com>
Reviewed-by: Erik Bjorge <330ad10f99fcdfb914fa4e3b5d9f2ec8c03e31ae@intel.com>


@ECHO OFF

REM create bin directory if it doesn't exist
if not exist ..\bin mkdir ..\bin

REM delete output from previous run
del actual.txt

REM compile the code into the bin folder
javac  javac  -cp ..\src -Xlint:none -d ..\bin ..\src\seedu\addressbook\Main.java

REM run the program, feed commands from input.txt file and redirect the output to the actual.txt
java -classpath ..\bin seedu.addressbook.Main < input.txt > actual.txt

REM compare the output to the expected output
FC actual.txt expected.txt

@ECHO OFF

REM create bin directory if it doesn't exist
if not exist ..\bin mkdir ..\bin

REM delete output from previous run
del actual.txt

REM compile the code into the bin folder
javac  -cp ..\src -Xlint:none -d ..\bin ..\src\seedu\addressbook\Main.java

REM run the program, feed commands from input.txt file and redirect the output to the actual.txt
java -classpath ..\bin seedu.addressbook.Main < input.txt > actual.txt

REM compare the output to the expected output
FC actual.txt expected.txt

Remove duplicate javac from test script

Remove duplicate javac from test script


update master version

update master version


REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

tools\nant\bin\nant.exe -f:Common.Logging.build test-integration -D:buildconfigflag.release=false

update to opt-OUT of RELEASE build so that missing SNK file from project.json won't fail the CI build


@echo off
pushd %~dp0
setlocal

if exist bin goto build
mkdir bin

:Build

REM Find the most recent 32bit MSBuild.exe on the system. If v12.0 (installed with VS2013) does not exist, fall back to
REM v4.0. Also handle x86 operating systems, where %ProgramFiles(x86)% is not defined. Always quote the %MSBuild% value
REM when setting the variable and never quote %MSBuild% references.
set MSBuild="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %MSBuild% @set MSBuild="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %MSBuild% @set MSBuild="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"

if "%1" == "" goto BuildDefaults

%MSBuild% Runtime.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildDefaults
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildFail
echo.
echo *** BUILD FAILED ***
goto End

:BuildSuccess
echo.
echo **** BUILD SUCCESSFUL ***
goto end

:End
popd
endlocal

@echo off
pushd %~dp0
setlocal

if exist bin goto build
mkdir bin

:Build

REM Find the most recent 32bit MSBuild.exe on the system. Require v12.0 (installed with VS2013) or later since .NET 4.0
REM is not supported. Also handle x86 operating systems, where %ProgramFiles(x86)% is not defined. Always quote the
REM %MSBuild% value when setting the variable and never quote %MSBuild% references.
set MSBuild="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %MSBuild% @set MSBuild="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"

if "%1" == "" goto BuildDefaults

%MSBuild% Runtime.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildDefaults
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildFail
echo.
echo *** BUILD FAILED ***
goto End

:BuildSuccess
echo.
echo **** BUILD SUCCESSFUL ***
goto end

:End
popd
endlocal

Remove build.cmd fallback to v4 version of MSBuild.exe - we don't support .NET 4.0 and shouldn't build or test using the older target framework - testing is particularly problematic since some unit tests fail due to .NET 4.0 quirks (legacy System.Uri behavior in particular) - part 1 of fixes for #1960


Set AppName="Sudoku"

rem 64Bit Systems
rem Set MsBuildPath="%windir%\Microsoft.NET\Framework64\v4.0.30319\MsBuild.exe"
rem Set MsBuildPath="%ProgramFiles%\MsBuild\14.0\bin\amd64\MsBuild.exe"

rem 32Bit Systems
rem Set MsBuildPath="%windir%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe"
Set MsBuildPath="%ProgramFiles%\MsBuild\14.0\bin\MsBuild.exe"
Set Wix3xPath=%ProgramFiles%\WiX Toolset v3.11\bin
rem cd %AppName%
%MsBuildPath% %AppName%.sln /p:Configuration=Debug /p:Platform="Any CPU"
%MsBuildPath% %AppName%.sln /p:Configuration=Release /p:Platform="Any CPU"
rem cd ..
"%Wix3xPath%\candle.exe" -nologo %AppName%.wxs -out %AppName%.wixobj  -ext WixUIExtension  -ext WixNetFxExtension
"%Wix3xPath%\light.exe" -nologo %AppName%.wixobj -out %AppName%.msi  -ext WixUIExtension  -ext WixNetFxExtension
pause

Set AppName="Sudoku"

if not defined ProgramFiles(x86) goto x86
rem 64Bit Systems
  Set X86ProgramFiles=%ProgramFiles(x86)%
rem Set MsBuildPath="%windir%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe"
Set MsBuildPath="%X86ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MsBuild.exe"
rem only 64 bit projects  Set MsBuildPath="%X86ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MsBuild.exe"
rem Set MsBuildPath="%windir%\Microsoft.NET\Framework64\v4.0.30319\MsBuild.exe"
  goto x86End

:x86
rem 32Bit Systems
  Set X86ProgramFiles=%ProgramFiles%
rem Set MsBuildPath="%windir%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe"
Set MsBuildPath="%ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MsBuild.exe"
:x86End

Set Wix3xPath=%X86ProgramFiles%\WiX Toolset v3.11\bin
rem cd %AppName%
%MsBuildPath% %AppName%.sln /p:Configuration=Debug /p:Platform="Any CPU"
%MsBuildPath% %AppName%.sln /p:Configuration=Release /p:Platform="Any CPU"
rem cd ..
"%Wix3xPath%\candle.exe" -nologo %AppName%.wxs -out %AppName%.wixobj  -ext WixUIExtension  -ext WixNetFxExtension
"%Wix3xPath%\light.exe" -nologo %AppName%.wixobj -out %AppName%.msi  -ext WixUIExtension  -ext WixNetFxExtension
pause

Build changes for Windows 64 Bit (Win10)


cd jenkins
for /f "" %%i in (version.txt) do (
   set version=%%i
)
cd ..
dir
rmdir /s /q build
mkdir build
cd build
dir
"c:\program files (x86)\cmake\bin\cmake" -G "Visual Studio 10 2010" -D BUILD_PYSWIG_WRAPPERS:BOOL=OFF -D BUILD_LUA_WRAPPERS:BOOL=OFF ..
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ALL_BUILD.vcxproj /p:Configuration=Release
if errorlevel 1 exit /B 1

rem copy down the redistributables (maybe they're on the server somewhere?)
powershell Set-ExecutionPolicy unrestricted
powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('http://deepcl.hughperkins.com/Downloads/vc2010redist.zip', 'vc2010redist.zip')
if errorlevel 1 exit /B 1

"c:\program files\7-Zip\7z.exe" x vc2010redist.zip
if errorlevel 1 exit /B 1

copy vc2010redist\win32\* Release

cd Release
"c:\program files\7-Zip\7z.exe" a deepcl-win32-%version%.zip *
if errorlevel 1 exit /B 1

cd ..
echo %version%>latestUnstable.txt

cd jenkins
for /f "" %%i in (version.txt) do (
   set version=%%i
)
cd ..

powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('http://deepcl.hughperkins.com/Downloads/turbojpeg-1.4.0-win32-static.zip', 'turbojpeg-win32.zip')
if errorlevel 1 exit /B 1
mkdir turbojpeg-win32
cd turbojpeg-win32
"c:\program files\7-Zip\7z.exe" x ..\turbojpeg-win32.zip
if errorlevel 1 exit /B 1

dir
rmdir /s /q build
mkdir build
cd build
dir
"c:\program files (x86)\cmake\bin\cmake" -G "Visual Studio 10 2010" -D BUILD_PYSWIG_WRAPPERS:BOOL=OFF -D BUILD_LUA_WRAPPERS:BOOL=OFF -D JPEG_INCLUDE_DIR=%CD%\..\turbojpeg-win32 -D JPEG_LIBRARY=%CD%\..\turbojpeg-win32\turbojpeg-static.lib ..
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ALL_BUILD.vcxproj /p:Configuration=Release
if errorlevel 1 exit /B 1

rem copy down the redistributables (maybe they're on the server somewhere?)
powershell Set-ExecutionPolicy unrestricted
powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('http://deepcl.hughperkins.com/Downloads/vc2010redist.zip', 'vc2010redist.zip')
if errorlevel 1 exit /B 1

"c:\program files\7-Zip\7z.exe" x vc2010redist.zip
if errorlevel 1 exit /B 1

copy vc2010redist\win32\* Release

cd Release
"c:\program files\7-Zip\7z.exe" a deepcl-win32-%version%.zip *
if errorlevel 1 exit /B 1

cd ..
echo %version%>latestUnstable.txt

update jenkins config

update jenkins config


@echo off
echo splitting...
java -Xmx2000m -jar %splitter% --output-dir=out ..\osm\valgrande.osm > out\splitter.log
echo creating map...
rem java -jar %mkgmap% -c optionsfile_gps.args out\63240001.osm.pbf
java -jar %mkgmap% -c optionsfile.args out\63240001.osm.pbf
echo complete
pause

@echo off
echo creating out folder...
if not exist "out" mkdir out
echo splitting...
java -Xmx2000m -jar %splitter% --output-dir=out ..\osm\valgrande.osm > out\splitter.log
echo creating map...
rem java -jar %mkgmap% -c optionsfile_gps.args out\63240001.osm.pbf
java -jar %mkgmap% -c optionsfile.args out\63240001.osm.pbf
echo complete
pause

create out folder if not exits

create out folder if not exits


@echo on

set J11_HOME=%1
set J14_HOME=%2

set APP_VERSION=%3
set APP_NAME=%4
set APP_DESCRIPTION=%5
set APP_VENDOR=%6
set APP_MAIN_JAR=%7
set APP_MAIN_CLASS=%8
set IMAGE_TYPE=%9

REM https://stackoverflow.com/questions/8328338/how-do-you-utilize-more-than-9-arguments-when-calling-a-label-in-a-cmd-batch-scr%
REM Shift arguments after 9
shift
set BUILD_DIR=%9
shift
set INPUT=%9
shift
set OUTPUT=%9
shift
set APP_ICON=%9
shift
set JVM_ARGS=%9

call %J11_HOME%\bin\jlink.exe --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules ALL-MODULE-PATH --output %BUILD_DIR%\java-runtime
REM call "%J11_HOME%\bin\jlink" --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.desktop,java.sql,java.logging,jdk.unsupported,java.xml,java.prefs,javafx.base,javafx.controls,javafx.graphics,javafx.swing --output %BUILD_DIR%\java-runtime

call %J14_HOME%\bin\jpackage.exe ^
  --app-version %APP_VERSION% ^
  --name %APP_NAME% ^
  --description %APP_DESCRIPTION% ^
  --vendor %APP_VENDOR% ^
  --main-jar %APP_MAIN_JAR% ^
  --main-class %APP_MAIN_CLASS% ^
  --type %IMAGE_TYPE% ^
  --input %INPUT% ^
  --dest %OUTPUT% ^
  --java-options "%JVM_ARGS%" ^
  --icon %APP_ICON% ^
  --runtime-image %BUILD_DIR%\java-runtime ^
  --win-shortcut --win-menu ^
  --verbose

REM call "%J14_HOME%\bin\jpackage.exe" ^
REM   --type exe ^
REM   --app-version %VERSION% ^
REM   --input %INPUT% ^
REM   --name "pdf-map" ^
REM   --description "PDF Mapping tool" ^
REM   --vendor "iTo" ^
REM   --main-jar %JAR% ^
REM   --main-class "lt.ito.pdfmap.MainKt" ^
REM   --dest %OUTPUT% ^
REM   --java-options "-splash:$APPDIR/resources/splash.png -Xmx600m -Xms128m" ^
REM   --icon %APP_ICON% ^
REM   --temp %BUILD_DIR%\tmp ^
REM   --runtime-image %BUILD_DIR%\java-runtime ^
REM   --win-shortcut --win-menu ^
REM   --verbose

@echo on

set J11_HOME=%1
set J14_HOME=%2

set APP_VERSION=%3
set APP_NAME=%4
set APP_DESCRIPTION=%5
set APP_VENDOR=%6
set APP_MAIN_JAR=%7
set APP_MAIN_CLASS=%8
set IMAGE_TYPE=%9

REM https://stackoverflow.com/questions/8328338/how-do-you-utilize-more-than-9-arguments-when-calling-a-label-in-a-cmd-batch-scr%
REM Shift arguments after 9
shift
set BUILD_DIR=%9
shift
set INPUT=%9
shift
set OUTPUT=%9
shift
set APP_ICON=%9
shift
set JVM_ARGS=%9

call %J11_HOME%\bin\jlink.exe --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules ALL-MODULE-PATH --output %BUILD_DIR%\java-runtime
REM call "%J11_HOME%\bin\jlink" --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.desktop,java.sql,java.logging,jdk.unsupported,java.xml,java.prefs,javafx.base,javafx.controls,javafx.graphics,javafx.swing --output %BUILD_DIR%\java-runtime

call %J14_HOME%\bin\jpackage.exe ^
  --app-version %APP_VERSION% ^
  --name %APP_NAME% ^
  --description %APP_DESCRIPTION% ^
  --vendor %APP_VENDOR% ^
  --main-jar %APP_MAIN_JAR% ^
  --main-class %APP_MAIN_CLASS% ^
  --type %IMAGE_TYPE% ^
  --input %INPUT% ^
  --dest %OUTPUT% ^
  --java-options %JVM_ARGS% ^
  --icon %APP_ICON% ^
  --runtime-image %BUILD_DIR%\java-runtime ^
  --win-shortcut --win-menu ^
  --verbose

REM call "%J14_HOME%\bin\jpackage.exe" ^
REM   --type exe ^
REM   --app-version %VERSION% ^
REM   --input %INPUT% ^
REM   --name "pdf-map" ^
REM   --description "PDF Mapping tool" ^
REM   --vendor "iTo" ^
REM   --main-jar %JAR% ^
REM   --main-class "lt.ito.pdfmap.MainKt" ^
REM   --dest %OUTPUT% ^
REM   --java-options "-splash:$APPDIR/resources/splash.png -Xmx600m -Xms128m" ^
REM   --icon %APP_ICON% ^
REM   --temp %BUILD_DIR%\tmp ^
REM   --runtime-image %BUILD_DIR%\java-runtime ^
REM   --win-shortcut --win-menu ^
REM   --verbose

Update jvm-args

Update jvm-args


cd lib
nmake -f Makefile.msvc install
cd ..

cd src
nmake -f Makefile.msvc install
cd ..

cd modules\suggest
nmake -f Makefile.msvc install
cd ..\..

cd modules\tokenizers
nmake -f Makefile.msvc install
cd ..\..

add install_windows.bat

add install_windows.bat


@echo off
..\runtime\bin\python\python_mcp install.py
pause

@echo off
.\fml\python\python_fml install.py
pause

Fix Forge install script to use python shipped with FML.


Install modules for windows

Install modules for windows


@echo off
SETLOCAL ENABLEEXTENSIONS
set SJAR=sikulix

if not defined SIKULIX_HOME goto NOHOME
if EXIST "%SIKULIX_HOME%%SJAR%.jar" goto YESHOME
if not EXIST "%SIKULIX_HOME%\%SJAR%.jar" goto BADHOME
set SJAR=\sikulix

:BADHOME
echo +++ SIKULIX_HOME specified but not useable %SIKULIX_HOME%

:NOHOME
set SIKULIX_HOME=%~dp0

:YESHOME
set PARMS=-Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine

if not defined JAVA_HOME goto CHECKJAVA
IF EXIST "%JAVA_HOME%\bin\java.exe" goto JAVA_OK
echo +++ JAVA_HOME specified but not useable %JAVA_HOME%
echo +++ looking for Java in system path and then in standard places

:CHECKJAVA
java 2> nul
if errorlevel 9009 goto CHECKPLACES
goto JAVA_OK_PATH

:CHECKPLACES
set PROGRAMS=%ProgramFiles%
if defined ProgramFiles(x86) set PROGRAMS32=%ProgramFiles(x86)%

IF not EXIST "%PROGRAMS%\Java\jre8\bin\java.exe" goto JAVA7
set JAVA_HOME=%PROGRAMS%\Java\jre8
goto JAVA_OK

:JAVA7
IF not EXIST "%PROGRAMS%\Java\jre7\bin\java.exe" goto JAVA6
set JAVA_HOME=%PROGRAMS%\Java\jre7
goto JAVA_OK

:JAVA6
IF not EXIST "%PROGRAMS%\Java\jre6\bin\java.exe" goto JAVANO
set JAVA_HOME=%PROGRAMS%\Java\jre6
goto JAVA_OK

:JAVANO
if not defined PROGRAMS32 goto JAVANO32

IF not EXIST "%PROGRAMS32%\Java\jre8\bin\java.exe" goto JAVA732
set JAVA_HOME=%PROGRAMS32%\Java\jre8
goto JAVA_OK

:JAVA732
IF not EXIST "%PROGRAMS32%\Java\jre7\bin\java.exe" goto JAVA632
set JAVA_HOME=%PROGRAMS32%\Java\jre7
goto JAVA_OK

:JAVA632
IF not EXIST "%PROGRAMS32%\Java\jre6\bin\java.exe" goto JAVANO32
set JAVA_HOME=%PROGRAMS32%\Java\jre6
goto JAVA_OK

:JAVANO32
echo +++ Java not found in standard places %PROGRAMS% or %PROGRAMS32%
echo +++ JAVA_HOME not specified
goto STOPIT

:JAVA_OK_PATH
echo +++ running this Java
set SIKULI_COMMAND=%*
java -version
PATH=%SIKULIX_HOME%libs;%PATH%
echo +++ trying to run SikuliX
echo +++ using: %PARMS% -jar %SIKULIX_HOME%%SJAR%.jar %SIKULI_COMMAND%
java %PARMS% -jar "%SIKULIX_HOME%%SJAR%.jar" %SIKULI_COMMAND%
GOTO FINALLY

:JAVA_OK
echo +++ running this Java
set SIKULI_COMMAND=%*
"%JAVA_HOME%\bin\java.exe" -version
PATH=%SIKULIX_HOME%libs;%PATH%
echo +++ trying to run SikuliX
echo +++ using: %PARMS% -jar %SIKULIX_HOME%%SJAR%.jar %SIKULI_COMMAND%
"%JAVA_HOME%\bin\java.exe" %PARMS% -jar "%SIKULIX_HOME%%SJAR%.jar" %SIKULI_COMMAND%
GOTO FINALLY

:STOPIT
echo.+++ ended with some errors
:FINALLY
ENDLOCAL

@echo off
SETLOCAL ENABLEEXTENSIONS
set SJAR=sikulix

if not defined SIKULIX_HOME goto NOHOME
if EXIST "%SIKULIX_HOME%%SJAR%.jar" goto YESHOME
if not EXIST "%SIKULIX_HOME%\%SJAR%.jar" goto BADHOME
set SJAR=\sikulix

:BADHOME
echo +++ SIKULIX_HOME specified but not useable %SIKULIX_HOME%

:NOHOME
set SIKULIX_HOME=%~dp0

:YESHOME
set PARMS=-Xms64M -Xmx1024M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine

if not defined JAVA_HOME goto CHECKJAVA
IF EXIST "%JAVA_HOME%\bin\java.exe" goto JAVA_OK
echo +++ JAVA_HOME specified but not useable %JAVA_HOME%
echo +++ looking for Java in system path and then in standard places

:CHECKJAVA
java 2> nul
if errorlevel 9009 goto CHECKPLACES
goto JAVA_OK_PATH

:CHECKPLACES
set PROGRAMS=%ProgramFiles%
if defined ProgramFiles(x86) set PROGRAMS32=%ProgramFiles(x86)%

IF not EXIST "%PROGRAMS%\Java\jre8\bin\java.exe" goto JAVA7
set JAVA_HOME=%PROGRAMS%\Java\jre8
goto JAVA_OK

:JAVA7
IF not EXIST "%PROGRAMS%\Java\jre7\bin\java.exe" goto JAVA6
set JAVA_HOME=%PROGRAMS%\Java\jre7
goto JAVA_OK

:JAVA6
IF not EXIST "%PROGRAMS%\Java\jre6\bin\java.exe" goto JAVANO
set JAVA_HOME=%PROGRAMS%\Java\jre6
goto JAVA_OK

:JAVANO
if not defined PROGRAMS32 goto JAVANO32

IF not EXIST "%PROGRAMS32%\Java\jre8\bin\java.exe" goto JAVA732
set JAVA_HOME=%PROGRAMS32%\Java\jre8
goto JAVA_OK

:JAVA732
IF not EXIST "%PROGRAMS32%\Java\jre7\bin\java.exe" goto JAVA632
set JAVA_HOME=%PROGRAMS32%\Java\jre7
goto JAVA_OK

:JAVA632
IF not EXIST "%PROGRAMS32%\Java\jre6\bin\java.exe" goto JAVANO32
set JAVA_HOME=%PROGRAMS32%\Java\jre6
goto JAVA_OK

:JAVANO32
echo +++ Java not found in standard places %PROGRAMS% or %PROGRAMS32%
echo +++ JAVA_HOME not specified
goto STOPIT

:JAVA_OK_PATH
echo +++ running this Java
set SIKULI_COMMAND=%*
java -version
PATH=%SIKULIX_HOME%libs;%PATH%
echo +++ trying to run SikuliX
echo +++ using: %PARMS% -jar %SIKULIX_HOME%%SJAR%.jar %SIKULI_COMMAND%
java %PARMS% -jar "%SIKULIX_HOME%%SJAR%.jar" %SIKULI_COMMAND%
GOTO FINALLY

:JAVA_OK
echo +++ running this Java
set SIKULI_COMMAND=%*
"%JAVA_HOME%\bin\java.exe" -version
PATH=%SIKULIX_HOME%libs;%PATH%
echo +++ trying to run SikuliX
echo +++ using: %PARMS% -jar %SIKULIX_HOME%%SJAR%.jar %SIKULI_COMMAND%
"%JAVA_HOME%\bin\java.exe" %PARMS% -jar "%SIKULIX_HOME%%SJAR%.jar" %SIKULI_COMMAND%
GOTO FINALLY

:STOPIT
echo.+++ ended with some errors
:FINALLY
ENDLOCAL

add sikuli memory to 1024M

add sikuli memory to 1024M


echo off
 python python\servercode\simchipcomputer.py %*
rem start cmd
Pause

add simlulink simplecompute

add simlulink simplecompute


if exist target\BouncyBall-1.0-SNAPSHOT.jar (
  set JAR=target\BouncyBall-1.0-SNAPSHOT.jar
) else (
  set JAR=BouncyBall-1.0-SNAPSHOT.jar
)

java -jar -Xmx256m -Xms256m %JAR%

Create start.bat

Create start.bat


add plink tunnel

add plink tunnel


//Creates a Copy of "High Performance" Power Profile
c:\windows\system32\powercfg.exe -duplicatescheme 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

//Changes Name and Description of "High Performance" Power Profile
c:\windows\system32\powercfg.exe -changename 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c SecureDoc "Power settings required for hard disk encryption"

//Sets The New "SecureDoc" Power Profile as Active
c:\windows\system32\powercfg.exe -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

//Disable Sleep and Hibernate
c:\windows\system32\powercfg.exe -change -monitor-timeout-ac 0
c:\windows\system32\powercfg.exe -change -monitor-timeout-dc 0
c:\windows\system32\powercfg.exe -change -disk-timeout-ac 0
c:\windows\system32\powercfg.exe -change -disk-timeout-dc 0
c:\windows\system32\powercfg.exe -change -standby-timeout-ac 0
c:\windows\system32\powercfg.exe -change -standby-timeout-dc 0
c:\windows\system32\powercfg.exe -change -hibernate-timeout-ac 0
c:\windows\system32\powercfg.exe -change -hibernate-timeout-dc 0

//Lid Close Do Nothing
c:\windows\system32\powercfg.exe -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

Create powersettings.bat

Create powersettings.bat


cd %~dp0

java -cp "..\lib\h2-1.4.189.jar" org.h2.tools.RunScript -url jdbc:h2:%~dp0\\..\\codegen\\h2 -script %~dp0\\..\\src\\main\\resources\\db\\00-base.h2.sql
java -cp "..\lib\h2-1.4.189.jar" org.h2.tools.RunScript -url jdbc:h2:%~dp0\\..\\codegen\\h2 -script %~dp0\\..\\src\\main\\resources\\db\\01-google.h2.sql

cd ..
mvn -Dcodegen clean install

cd %~dp0

java -cp "..\lib\h2-1.4.189.jar" org.h2.tools.RunScript -url "jdbc:h2:%~dp0\\..\\codegen\\h2" -script "%~dp0\\..\\src\\main\\resources\\db\\00-base.h2.sql"
java -cp "..\lib\h2-1.4.189.jar" org.h2.tools.RunScript -url "jdbc:h2:%~dp0\\..\\codegen\\h2" -script "%~dp0\\..\\src\\main\\resources\\db\\01-google.h2.sql"

cd ..
mvn -Dcodegen clean install

Fix sqlgen space issue on Windows close #103


@echo off
REM ======================================================================
REM
REM  Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
REM  University of Wisconsin-Madison, WI.
REM
REM  Licensed under the Apache License, Version 2.0 (the "License"); you
REM  may not use this file except in compliance with the License.  You may
REM  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 ======================================================================

REM ======================================================================
REM First set all the variables that contain common bits for our build
REM environment.
REM * * * * * * * * * * * * * PLEASE READ * * * * * * * * * * * * * * * *
REM Microsoft Visual Studio will choke on variables that contain strings
REM exceeding 255 chars, so be careful when editing this file! It's
REM totally lame but there's nothing we can do about it.
REM ======================================================================

REM 64-bit environments have a slightly different directory layout here
REM we take this in to account so that we can prefix paths later with the
REM the correct program files path. (Note, this assumes a clean install.
REM I'll harden it further if there is a requirement for it.)
set PROGRAMS_DIR=%ProgramFiles%
if not "A%ProgramFiles(x86)%"=="A" set PROGRAMS_DIR=%SystemDrive%\PROGRA~2

REM Set paths to Visual C++, the Platform SDKs, and Perl
set VS_DIR=%PROGRAMS_DIR%\Microsoft Visual Studio 9.0
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VC_DIR%\bin
set PERL_DIR=%SystemDrive%\Perl\bin;%SystemDrive%\Perl64\bin;%SystemDrive%\prereq\ActivePerl-5.10.1\bin
set SDK_DIR=%ProgramFiles%\Microsoft Platform SDK
set DBG_DIR=%ProgramFiles%\Debugging Tools for Windows (x86);%ProgramFiles%\Debugging Tools for Windows (x64)
set DOTNET_DIR=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set JDK_DIR="E:\Program Files\Java\jdk1.6.0_16"

REM For some reason this is not defined whilst in some environments
if "A%VS90COMNTOOLS%"=="A" set VS90COMNTOOLS=%VS_DIR%\Common7\Tools\

REM Specify symbol image path for debugging
if "A%_NT_SYMBOL_PATH%"=="A" set _NT_SYMBOL_PATH=SRV*%SystemDrive%\Symbols*http://msdl.microsoft.com/download/symbols

REM For externals: it just tells them we would like to have manifest
REM files embeded in the rem DLLs (In the future, when we do not have
REM VC6, we can remove this.  After we--of course--remove any reference
REM to it from the externals)
set NEED_MANIFESTS_IN_EXTERNALS=True

REM Where do the completed externals live?
if "A%EXTERN_DIR%"=="A" set EXTERN_DIR=%cd%\..\externals
set EXT_INSTALL=%EXTERN_DIR%\install
set EXT_TRIGGERS=%EXTERN_DIR%\triggers

REM Specify which versions of the externals we're using. To add a
REM new external, just add its version here, and add that to the
REM EXTERNALS_NEEDED variable defined below.
set EXT_GSOAP_VERSION=gsoap-2.7.10-p3
set EXT_OPENSSL_VERSION=openssl-0.9.8h-p1
set EXT_POSTGRESQL_VERSION=postgresql-8.0.2
set EXT_KERBEROS_VERSION=krb5-1.4.3-p0
set EXT_PCRE_VERSION=pcre-7.6
set EXT_DRMAA_VERSION=drmaa-1.6
set EXT_CURL_VERSION=curl-7.19.6-p1
set EXT_HADOOP_VERSION=hadoop-0.20.0-p2

REM Now tell the build system what externals we need built.
set EXTERNALS_NEEDED=%EXT_GSOAP_VERSION% %EXT_OPENSSL_VERSION% %EXT_KERBEROS_VERSION% %EXT_PCRE_VERSION% %EXT_POSTGRESQL_VERSION% %EXT_DRMAA_VERSION% %EXT_CURL_VERSION% %EXT_HADOOP_VERSION%

REM Put msconfig in the PATH, since it's got lots of stuff we need
REM like awk, gunzip, tar, bison, yacc...
set PATH=%cd%;%SystemRoot%;%SystemRoot%\system32;%PERL_DIR%;%VS_DIR%;%VC_DIR%;%VC_BIN%;%SDK_DIR%;%DOTNET_DIR%;%DBG_DIR%;%JDK_LIB%

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM Since we a still stuck in the past (i.e. supporting Win2K) we must
REM lie to the setenv script, and pretend the DevEnvDir environment
REM is alredy configured properly (yay! jump to VC2K8, but support
REM Win2K... *sigh*)
set MSVCDir=%VC_DIR%
set DevEnvDir=%VS_DIR%\Common7\IDE
set MSVCVer=9.0
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure Visual C++
call "%VC_DIR%\vcvarsall.bat" x86
if not defined INCLUDE ( echo. && echo *** Failed to run vcvarsall.bat! Is Microsoft Visual Studio installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM We set these here as the above script will find the wrong versions
REM of everything... *sigh*
set WindowsSdkDir=%SDK_DIR%
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure the Platform SDK environment
call "%SDK_DIR%\SetEnv.Cmd" /2000 /RETAIL
if not defined MSSDK ( echo. && echo *** Failed to run setenv.cmd! Are the Microsoft Platform SDK installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
set INCLUDE=%SDK_DIR%\Include;%VC_DIR%\ATLMFC\INCLUDE;%VC_DIR%\INCLUDE;
set LIB=%SDK_DIR%\Lib;%VC_DIR%\ATLMFC\LIB;%VC_DIR%\LIB;
set LIBPATH=%DOTNET_DIR%;%VC_DIR%\ATLMFC\LIB;%VC_DIR%\LIB;
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Set up some stuff for BISON
set BISON_SIMPLE=%cd%\bison.simple
set BISON_HAIRY=%cd%\bison.hairy

REM Tell the build system where we can find soapcpp2
set SOAPCPP2=%EXT_INSTALL%\%EXT_GSOAP_VERSION%\soapcpp2.exe

REM Determine the build id, if it is defined
pushd ..
set BID=none
if exist BUILD-ID. (
    echo Found BUILD-ID in %cd%
    for /f %%i in ('more BUILD-ID') do set BID=%%i
) else (
    echo No build-id defined: %cd%\BUILD-ID is missing.
)
echo Using build-id: %BID% & echo.
popd

REM Determine the number of processor we can run concurrent jobs on.  We base
REM this number on the count of cores or CPUs kept by the OS:
if "A%NUMBER_OF_PROCESSORS%"=="A" set PROCESSORS=1
set PROCESSORS=%NUMBER_OF_PROCESSORS%

set CONDOR_NOWARN=/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /D_CRT_NON_CONFORMING_SWPRINTFS
REM /D_CONST_RETURN
set CONDOR_CPPARGS=/GR /MP%PROCESSORS%
set CONDOR_DEFINE=/DHAVE_CONFIG_H /DBUILDID=%BID% %CONDOR_CPPARGS% %CONDOR_NOWARN%
set CONDOR_INCLUDE=/I "..\src\h" /I "..\src\condor_includes" /I "..\src\condor_c++_util" /I "..\src\condor_daemon_client" /I "..\src\condor_daemon_core.V6" /I "..\src\condor_schedd.V6" /I "..\src\condor_classad.V6" /I "..\src\ccb"
set CONDOR_LIB=crypt32.lib mpr.lib psapi.lib mswsock.lib netapi32.lib imagehlp.lib ws2_32.lib powrprof.lib iphlpapi.lib userenv.lib
set CONDOR_LIBPATH=/NOLOGO

REM ======================================================================
REM Now set the individual variables specific to each external package.
REM Some have been defined, but are not in use yet (they have /NOLOGO
REM to make them a no-op during the build).
REM ======================================================================

REM ** GSOAP
set CONDOR_GSOAP_INCLUDE=/I %EXT_INSTALL%\%EXT_GSOAP_VERSION%\src
set CONDOR_GSOAP_LIB=/NOLOGO
set CONDOR_GSOAP_LIBPATH=/NOLOGO

REM ** OPENSSL
set CONDOR_OPENSSL_INCLUDE=/I %EXT_INSTALL%\%EXT_OPENSSL_VERSION%\inc32
set CONDOR_OPENSSL_LIB=libeay32.lib ssleay32.lib
set CONDOR_OPENSSL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_OPENSSL_VERSION%\out32dll

REM ** POSTGRESQL
set CONDOR_POSTGRESQL_INCLUDE=/I %EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\inc32
set CONDOR_POSTGRESQL_LIB=libpqdll.lib
set CONDOR_POSTGRESQL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\out32dll

REM ** KERBEROS
set CONDOR_KERB_INCLUDE=/I %EXT_INSTALL%\%EXT_KERBEROS_VERSION%\include
set CONDOR_KERB_LIB=comerr32.lib gssapi32.lib k5sprt32.lib krb5_32.lib xpprof32.lib
set CONDOR_KERB_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_KERBEROS_VERSION%\lib

REM ** PCRE
set CONDOR_PCRE_INCLUDE=/I %EXT_INSTALL%\%EXT_PCRE_VERSION%\include
set CONDOR_PCRE_LIB=libpcre.lib
set CONDOR_PCRE_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_PCRE_VERSION%\lib

REM ** JDK
set CONDOR_JDK_INCLUDE=/I %JDK_DIR%\include /I %JDK_DIR%\include\win32
set CONDOR_JDK_LIB=jvm.lib
set CONDOR_JDK_LIBPATH=/LIBPATH:%JDK_DIR%\lib

REM Dump the Windows build environment at this point
REM echo ----------------------- WIN ENV DUMP ----------------------
REM set
REM echo ----------------------- WIN ENV DUMP ----------------------

exit /B 0

@echo off
REM ======================================================================
REM
REM  Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
REM  University of Wisconsin-Madison, WI.
REM
REM  Licensed under the Apache License, Version 2.0 (the "License"); you
REM  may not use this file except in compliance with the License.  You may
REM  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 ======================================================================

REM ======================================================================
REM First set all the variables that contain common bits for our build
REM environment.
REM * * * * * * * * * * * * * PLEASE READ * * * * * * * * * * * * * * * *
REM Microsoft Visual Studio will choke on variables that contain strings
REM exceeding 255 chars, so be careful when editing this file! It's
REM totally lame but there's nothing we can do about it.
REM ======================================================================

REM 64-bit environments have a slightly different directory layout here
REM we take this in to account so that we can prefix paths later with the
REM the correct program files path. (Note, this assumes a clean install.
REM I'll harden it further if there is a requirement for it.)
set PROGRAMS_DIR=%ProgramFiles%
if not "A%ProgramFiles(x86)%"=="A" set PROGRAMS_DIR=%SystemDrive%\PROGRA~2

REM Set paths to Visual C++, the Platform SDKs, and Perl
set VS_DIR=%PROGRAMS_DIR%\Microsoft Visual Studio 9.0
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VC_DIR%\bin
set PERL_DIR=%SystemDrive%\Perl\bin;%SystemDrive%\Perl64\bin;%SystemDrive%\prereq\ActivePerl-5.10.1\bin
set SDK_DIR=%ProgramFiles%\Microsoft Platform SDK
set DBG_DIR=%ProgramFiles%\Debugging Tools for Windows (x86);%ProgramFiles%\Debugging Tools for Windows (x64)
set DOTNET_DIR=%SystemRoot%\Microsoft.NET\Framework\v3.5;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set JDK_DIR="E:\Program Files\Java\jdk1.6.0_16"

REM For some reason this is not defined whilst in some environments
if "A%VS90COMNTOOLS%"=="A" set VS90COMNTOOLS=%VS_DIR%\Common7\Tools\

REM Specify symbol image path for debugging
if "A%_NT_SYMBOL_PATH%"=="A" set _NT_SYMBOL_PATH=SRV*%SystemDrive%\Symbols*http://msdl.microsoft.com/download/symbols

REM For externals: it just tells them we would like to have manifest
REM files embeded in the rem DLLs (In the future, when we do not have
REM VC6, we can remove this.  After we--of course--remove any reference
REM to it from the externals)
set NEED_MANIFESTS_IN_EXTERNALS=True

REM Where do the completed externals live?
if "A%EXTERN_DIR%"=="A" set EXTERN_DIR=%cd%\..\externals
set EXT_INSTALL=%EXTERN_DIR%\install
set EXT_TRIGGERS=%EXTERN_DIR%\triggers

REM Specify which versions of the externals we're using. To add a
REM new external, just add its version here, and add that to the
REM EXTERNALS_NEEDED variable defined below.
set EXT_GSOAP_VERSION=gsoap-2.7.10-p4
set EXT_OPENSSL_VERSION=openssl-0.9.8l
set EXT_POSTGRESQL_VERSION=postgresql-8.0.2
set EXT_KERBEROS_VERSION=krb5-1.4.3-p0
set EXT_PCRE_VERSION=pcre-7.6
set EXT_DRMAA_VERSION=drmaa-1.6
set EXT_CURL_VERSION=curl-7.19.6-p1
set EXT_HADOOP_VERSION=hadoop-0.20.0-p2

REM Now tell the build system what externals we need built.
set EXTERNALS_NEEDED=%EXT_GSOAP_VERSION% %EXT_OPENSSL_VERSION% %EXT_KERBEROS_VERSION% %EXT_PCRE_VERSION% %EXT_POSTGRESQL_VERSION% %EXT_DRMAA_VERSION% %EXT_CURL_VERSION% %EXT_HADOOP_VERSION%

REM Put msconfig in the PATH, since it's got lots of stuff we need
REM like awk, gunzip, tar, bison, yacc...
set PATH=%cd%;%SystemRoot%;%SystemRoot%\system32;%PERL_DIR%;%VS_DIR%;%VC_DIR%;%VC_BIN%;%SDK_DIR%;%DOTNET_DIR%;%DBG_DIR%;%JDK_LIB%

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM Since we a still stuck in the past (i.e. supporting Win2K) we must
REM lie to the setenv script, and pretend the DevEnvDir environment
REM is alredy configured properly (yay! jump to VC2K8, but support
REM Win2K... *sigh*)
set MSVCDir=%VC_DIR%
set DevEnvDir=%VS_DIR%\Common7\IDE
set MSVCVer=9.0
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure Visual C++
call "%VC_DIR%\vcvarsall.bat" x86
if not defined INCLUDE ( echo. && echo *** Failed to run vcvarsall.bat! Is Microsoft Visual Studio installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM We set these here as the above script will find the wrong versions
REM of everything... *sigh*
set WindowsSdkDir=%SDK_DIR%
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure the Platform SDK environment
call "%SDK_DIR%\SetEnv.Cmd" /2000 /RETAIL
if not defined MSSDK ( echo. && echo *** Failed to run setenv.cmd! Are the Microsoft Platform SDK installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
set INCLUDE=%SDK_DIR%\Include;%VC_DIR%\ATLMFC\INCLUDE;%VC_DIR%\INCLUDE;
set LIB=%SDK_DIR%\Lib;%VC_DIR%\ATLMFC\LIB;%VC_DIR%\LIB;
set LIBPATH=%DOTNET_DIR%;%VC_DIR%\ATLMFC\LIB;%VC_DIR%\LIB;
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Set up some stuff for BISON
set BISON_SIMPLE=%cd%\bison.simple
set BISON_HAIRY=%cd%\bison.hairy

REM Tell the build system where we can find soapcpp2
set SOAPCPP2=%EXT_INSTALL%\%EXT_GSOAP_VERSION%\soapcpp2.exe

REM Determine the build id, if it is defined
pushd ..
set BID=none
if exist BUILD-ID. (
    echo Found BUILD-ID in %cd%
    for /f %%i in ('more BUILD-ID') do set BID=%%i
) else (
    echo No build-id defined: %cd%\BUILD-ID is missing.
)
echo Using build-id: %BID% & echo.
popd

REM Determine the number of processor we can run concurrent jobs on.  We base
REM this number on the count of cores or CPUs kept by the OS:
if "A%NUMBER_OF_PROCESSORS%"=="A" set PROCESSORS=1
set PROCESSORS=%NUMBER_OF_PROCESSORS%

set CONDOR_NOWARN=/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /D_CRT_NON_CONFORMING_SWPRINTFS
REM /D_CONST_RETURN
set CONDOR_CPPARGS=/GR /MP%PROCESSORS%
set CONDOR_DEFINE=/DHAVE_CONFIG_H /DBUILDID=%BID% %CONDOR_CPPARGS% %CONDOR_NOWARN%
set CONDOR_INCLUDE=/I "..\src\h" /I "..\src\condor_includes" /I "..\src\condor_c++_util" /I "..\src\condor_daemon_client" /I "..\src\condor_daemon_core.V6" /I "..\src\condor_schedd.V6" /I "..\src\condor_classad.V6" /I "..\src\ccb"
set CONDOR_LIB=crypt32.lib mpr.lib psapi.lib mswsock.lib netapi32.lib imagehlp.lib ws2_32.lib powrprof.lib iphlpapi.lib userenv.lib
set CONDOR_LIBPATH=/NOLOGO

REM ======================================================================
REM Now set the individual variables specific to each external package.
REM Some have been defined, but are not in use yet (they have /NOLOGO
REM to make them a no-op during the build).
REM ======================================================================

REM ** GSOAP
set CONDOR_GSOAP_INCLUDE=/I %EXT_INSTALL%\%EXT_GSOAP_VERSION%\src
set CONDOR_GSOAP_LIB=/NOLOGO
set CONDOR_GSOAP_LIBPATH=/NOLOGO

REM ** OPENSSL
set CONDOR_OPENSSL_INCLUDE=/I %EXT_INSTALL%\%EXT_OPENSSL_VERSION%\inc32
set CONDOR_OPENSSL_LIB=libeay32.lib ssleay32.lib
set CONDOR_OPENSSL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_OPENSSL_VERSION%\out32dll

REM ** POSTGRESQL
set CONDOR_POSTGRESQL_INCLUDE=/I %EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\inc32
set CONDOR_POSTGRESQL_LIB=libpqdll.lib
set CONDOR_POSTGRESQL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\out32dll

REM ** KERBEROS
set CONDOR_KERB_INCLUDE=/I %EXT_INSTALL%\%EXT_KERBEROS_VERSION%\include
set CONDOR_KERB_LIB=comerr32.lib gssapi32.lib k5sprt32.lib krb5_32.lib xpprof32.lib
set CONDOR_KERB_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_KERBEROS_VERSION%\lib

REM ** PCRE
set CONDOR_PCRE_INCLUDE=/I %EXT_INSTALL%\%EXT_PCRE_VERSION%\include
set CONDOR_PCRE_LIB=libpcre.lib
set CONDOR_PCRE_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_PCRE_VERSION%\lib

REM ** JDK
set CONDOR_JDK_INCLUDE=/I %JDK_DIR%\include /I %JDK_DIR%\include\win32
set CONDOR_JDK_LIB=jvm.lib
set CONDOR_JDK_LIBPATH=/LIBPATH:%JDK_DIR%\lib

REM Dump the Windows build environment at this point
REM echo ----------------------- WIN ENV DUMP ----------------------
REM set
REM echo ----------------------- WIN ENV DUMP ----------------------

exit /B 0

update the externals on windows also. (#980)


if %sentinel% NEQ __sentinel__ exit

call %tmp%\wget_and_unpack1.bat http://josefsson.org/gnutls4win gnutls-2.9.12.zip %msys_dir%

set out=%msys_dir%\bin\fixup_gnutls.sh
echo #!/bin/sh -e                                                                       >  %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libgnutls.la ^> /lib/libgnutls.la.sed       >> %out%
echo mv /lib/libgnutls.la.sed /lib/libgnutls.la                                         >> %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libgcrypt.la ^> /lib/libgcrypt.la.sed       >> %out%
echo mv /lib/libgcrypt.la.sed /lib/libgcrypt.la                                         >> %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libgpg-error.la ^> /lib/libgpg-error.la.sed >> %out%
echo mv /lib/libgpg-error.la.sed /lib/libgpg-error.la                                   >> %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libtasn1.la ^> /lib/libtasn1.la.sed         >> %out%
echo mv /lib/libtasn1.la.sed /lib/libtasn1.la                                           >> %out%

%msys_dir%\bin\sh.exe -e %out%

if %sentinel% NEQ __sentinel__ exit

call %tmp%\wget_and_unpack1.bat http://josefsson.org/gnutls4win gnutls-2.10.1.zip %msys_dir%

set out=%msys_dir%\bin\fixup_gnutls.sh
echo #!/bin/sh -e                                                                       >  %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libgnutls.la ^> /lib/libgnutls.la.sed       >> %out%
echo mv /lib/libgnutls.la.sed /lib/libgnutls.la                                         >> %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libgcrypt.la ^> /lib/libgcrypt.la.sed       >> %out%
echo mv /lib/libgcrypt.la.sed /lib/libgcrypt.la                                         >> %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libgpg-error.la ^> /lib/libgpg-error.la.sed >> %out%
echo mv /lib/libgpg-error.la.sed /lib/libgpg-error.la                                   >> %out%
echo sed -e s:/usr/i586-mingw32msvc::g /lib/libtasn1.la ^> /lib/libtasn1.la.sed         >> %out%
echo mv /lib/libtasn1.la.sed /lib/libtasn1.la                                           >> %out%

%msys_dir%\bin\sh.exe -e %out%

Update GnuTLS to version 2.10.1

Update GnuTLS to version 2.10.1


devenv ..\Woopsa.sln /build Release /project Woopsa
call nuget-windows.bat

update build script.

update build script.


@ECHO OFF
set BASE=%~dp0
set DEFAULT_TARGET=
IF [%1]==[] set DEFAULT_TARGET="%BASE%atest"
pybot -c regression -L DEBUG --pythonpath "%BASE%src" %DEFAULT_TARGET% %*
pause

Add script to execute tests on windows.

Add script to execute tests on windows.


@echo off
if NOT exist %CD%\..\..\..\build (
  echo ERROR: OpenCV Winpack installation is required
  pause
  exit
)

:: Path to FFMPEG binary files
set PATH=%PATH%;%CD%\..\..\..\build\bin\

:: Detect Python binary
python -V
if %ERRORLEVEL% EQU 0 (
  set PYTHON=python
) else (
  if exist C:\Python27-x64\python.exe (
    set PYTHON=C:\Python27-x64\python.exe
  ) else (
    if exist C:\Python27\python.exe (
      set PYTHON=C:\Python27\python.exe
    ) else (
      echo ERROR: Python not found
      pause
      exit
    )
  )
)
echo Using python: %PYTHON%

:: Detect python architecture
%PYTHON% -c "import platform; exit(64 if platform.architecture()[0] == '64bit' else 32)"
if %ERRORLEVEL% EQU 32 (
  echo Detected: Python 32-bit
  set PYTHONPATH=%CD%\..\..\..\build\python\2.7\x86
) else (
  if %ERRORLEVEL% EQU 64 (
    echo Detected: Python 64-bit
    set PYTHONPATH=%CD%\..\..\..\build\python\2.7\x64
  ) else (
    echo ERROR: Unknown python arch
    pause
    exit
  )
)

:: Launch demo
%PYTHON% demo.py

python: add launch script for winpack python demo


for %%i in ("%~dp0\.") do ( set CURRENT_DIR_NAME=%%~nxi )

add new file

add new file


SET JAVA_HOME=%JAVA_HOME%
SET NUTZ_HOME=.

SET JAVAASSIST_PATH=..\deps\javassist.jar
SET LOG4J_PATH=..\deps\log4j-1.2.15.jar
SET JUNIT_PATH=..\deps\junit-4.7.jar

SET CLASSPATH=%NUTZ_HOME%;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\jre\rt.jar
SET CLASSPATH=%CLASSPATH%;%JAVAASSIST_PATH%;%LOG4J_PATH%;%JUNIT_PATH%

%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testLog4jCreation > log.performance.test.txt
%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testNutzCreation >> log.performance.test.txt
%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testLog4jOutput >> log.performance.test.txt
%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testNutzOutput >> log.performance.test.txt

%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testJdkCreation >> log.performance.test.txt
%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testNutzCreation >> log.performance.test.txt
%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testJdkOutput >> log.performance.test.txt
%JAVA_HOME%\bin\java org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testNutzOutput >> log.performance.test.txt

SET JAVA_HOME=%JAVA_HOME%
SET JAVA_OPT=-server -Xms512m -Xms512m
SET NUTZ_HOME=.

SET JAVAASSIST_PATH=..\deps\javassist.jar
SET LOG4J_PATH=..\deps\log4j-1.2.15.jar
SET JUNIT_PATH=..\deps\junit-4.7.jar

SET CLASSPATH=%NUTZ_HOME%;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\jre\rt.jar
SET CLASSPATH=%CLASSPATH%;%JAVAASSIST_PATH%;%LOG4J_PATH%;%JUNIT_PATH%

%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testLog4jCreation > log.performance.test.txt
%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testNutzCreation >> log.performance.test.txt
%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testLog4jOutput >> log.performance.test.txt
%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.Log4jAdapterPerformanceTest:testNutzOutput >> log.performance.test.txt

%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testJdkCreation >> log.performance.test.txt
%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testNutzCreation >> log.performance.test.txt
%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testJdkOutput >> log.performance.test.txt
%JAVA_HOME%\bin\java %JAVA_OPT% org.nutz.test.utils.SimpleRunner org.nutz.log.JdkAdapterPerformanceTest:testNutzOutput >> log.performance.test.txt

add java command line options

add java command line options


@echo off

conda remove markupsafe --yes
conda install markupsafe --yes
%PYTHON% setup.py --quiet install

Remove markupsafe hack and make setup.py louder


mkdir testrun
copy .coveragerc testrun/
cd testrun
if %errorlevel% neq 0 exit /b %errorlevel%
if %errorlevel% neq 0 exit /b %errorlevel%
coverage report --omit=*wx*

mkdir testrun
copy .coveragerc testrun/
cd testrun
if %errorlevel% neq 0 exit /b %errorlevel%
if %PYTHON% EQU "C:/Python27-x64" (
   coverage run -m nose.core -v ../ --exclude-dir=../pyface/ui/wx)
else (
   coverage run -m nose.core -v ../ --exclude-dir=../pyface/ui/wx --exclude="enaml")
if %errorlevel% neq 0 exit /b %errorlevel%
coverage report --omit=*wx*

fix paths and do not run the enaml tests on python 3


### test_app.bat - 201x - Fabien Desert ###
version = "1.2.0"
build_hour = "11H00"

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

update minor version

update minor version


@echo off

echo Generating C-style Win32 APIs and tests
call dart %~dp0win32\generate_ffi_files.dart
call dart %~dp0win32\generate_tests.dart
echo.

echo Generating COM classes
call dart %~dp0generate\generate.dart %~dp0generate\com %~dp0..\lib\src\generated
echo.

echo Generating Windows Runtime classes from IDL
call dart %~dp0generate\generate.dart %~dp0generate\winrt %~dp0..\lib\src\generated
echo.

echo Generating Windows Runtime classes from inspection
call dart %~dp0winmd\winmd.dart %~dp0..\lib\src\generated
echo.

echo Formatting generated source code
call dart format %~dp0..\lib\src
call dart format %~dp0..\test\api_test.dart
echo.

echo Running tests
call dart pub run test

@echo off

echo Generating C-style Win32 APIs and tests
call dart --enable-experiment=non-nullable %~dp0win32\generate_ffi_files.dart
call dart --enable-experiment=non-nullable %~dp0win32\generate_tests.dart
echo.

echo Generating COM classes
call dart --enable-experiment=non-nullable %~dp0generate\generate.dart %~dp0generate\com %~dp0..\lib\src\generated
echo.

echo Generating Windows Runtime classes from IDL
call dart --enable-experiment=non-nullable %~dp0generate\generate.dart %~dp0generate\winrt %~dp0..\lib\src\generated
echo.

echo Generating Windows Runtime classes from inspection
call dart --enable-experiment=non-nullable %~dp0winmd\winmd.dart %~dp0..\lib\src\generated
echo.

echo Formatting generated source code
call dart --enable-experiment=non-nullable format %~dp0..\lib\src
call dart --enable-experiment=non-nullable format %~dp0..\test\api_test.dart
echo.

echo Running tests
call dart --enable-experiment=non-nullable pub run test

Call non-nullable Dart for generators

Call non-nullable Dart for generators


@echo off

set MSVCVER=2017
set QTVER=5.12.2
set SSLVER=1.1.1b
set PREFIX=C:\Qt
set EXTRABUILDOPTIONS=-qt-sqlite
set PATH=C:\Python\;C:\Python27\;C:\Strawberry\perl\bin;%PATH%

REM DO NOT EDIT BELOW THIS LINE

set STARTDIR=%CD%
set SRCDIR=%CD%\sources
set BUILDDIR=%CD%\build
set PLATFORM=win32-msvc%MSVCVER%
set QTINSTALLDIR=%PREFIX%\%QTVER%\msvc%MSVCVER%-%VSCMD_ARG_TGT_ARCH%-static

set QTRELEASE=official
for %%A in (alpha beta rc) DO (echo.%QTVER% | find /I "%%A">Nul && set QTRELEASE=development)

set QTURL=http://download.qt.io/%QTRELEASE%_releases/qt/%QTVER:~0,-2%/%QTVER%/submodules/qtbase-everywhere-src-%QTVER%.zip
set QTDIR=%SRCDIR%\qtbase-everywhere-src-%QTVER%
set QTBUILDDIR=%QTDIR%\build

set SSLURL=https://www.openssl.org/source/openssl-%SSLVER%.tar.gz
set SSLBUILDDIR=%SRCDIR%\openssl-%SSLVER%
set SSLINSTALLDIR=%QTINSTALLDIR%\openssl-%SSLVER%

set CURLOPTS=-L -C - -O
set ZOPTS=x -aos -y
set PATH=%STARTDIR%\tools\gnuwin32\bin;%STARTDIR%\tools\jom;%STARTDIR%\tools\nasm;%PATH%

@echo off

set MSVCVER=2017
set QTVER=5.13.0
set SSLVER=1.1.1c
set PREFIX=C:\Qt
set EXTRABUILDOPTIONS=-qt-sqlite
set PATH=C:\Python\;C:\Python27\;C:\Strawberry\perl\bin;%PATH%

REM DO NOT EDIT BELOW THIS LINE

set STARTDIR=%CD%
set SRCDIR=%CD%\sources
set BUILDDIR=%CD%\build
set PLATFORM=win32-msvc%MSVCVER%
set QTINSTALLDIR=%PREFIX%\%QTVER%\msvc%MSVCVER%-%VSCMD_ARG_TGT_ARCH%-static

set QTRELEASE=official
for %%A in (alpha beta rc) DO (echo.%QTVER% | find /I "%%A">Nul && set QTRELEASE=development)

set QTURL=http://download.qt.io/%QTRELEASE%_releases/qt/%QTVER:~0,-2%/%QTVER%/submodules/qtbase-everywhere-src-%QTVER%.zip
set QTDIR=%SRCDIR%\qtbase-everywhere-src-%QTVER%
set QTBUILDDIR=%QTDIR%\build

set SSLURL=https://www.openssl.org/source/openssl-%SSLVER%.tar.gz
set SSLBUILDDIR=%SRCDIR%\openssl-%SSLVER%
set SSLINSTALLDIR=%QTINSTALLDIR%\openssl-%SSLVER%

set CURLOPTS=-L -C - -O
set ZOPTS=x -aos -y
set PATH=%STARTDIR%\tools\gnuwin32\bin;%STARTDIR%\tools\jom;%STARTDIR%\tools\nasm;%PATH%

Update options.bat

Update options.bat


@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

:retry
set /a counter+=1
echo Attempt %counter% out of %attempts%

cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/031b8bfe8230279dbd1bff99c33ecd07e373cb87
IF %ERRORLEVEL% NEQ 0 goto error

goto end

:error
if %counter% GEQ %attempts% goto :lastError
goto retry

:lastError
popd
echo An error has occured during npm install.
exit /b 1

:end
popd
echo Finished successfully.
exit /b 0

@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

:retry
set /a counter+=1
echo Attempt %counter% out of %attempts%

cmd /c npm install https://github.com/projectkudu/KuduScript/tarball/b27b514505b3d85ccb1396ab3dc7ed64d1dfd455
IF %ERRORLEVEL% NEQ 0 goto error

goto end

:error
if %counter% GEQ %attempts% goto :lastError
goto retry

:lastError
popd
echo An error has occured during npm install.
exit /b 1

:end
popd
echo Finished successfully.
exit /b 0

Update kudu to use new kuduscript with python3.6 support


@echo off

%~dp0\src\.nuget\nuget restore %~dp0\src\ReactiveTrader.sln

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe %~dp0\src\ReactiveTrader.sln -p:BUILD_VERSION=0.1.0.0

pause

@echo off

%~dp0\src\.nuget\nuget restore %~dp0\src\ReactiveTrader.sln

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe %~dp0\ReactiveTrader.proj -p:BUILD_VERSION=0.1.0.0

pause

change build.bat to rely on ReactiveTrader.proj


@echo off

@echo ================	Build Client	=================
"%VS10PATH%\devenv.com" .\trunk\sln\zpublic.sln /rebuild "Release|Win32"
if ERRORLEVEL 1 exit /b 1
@echo ================	End~~	=================
@exit /b 0

@echo off

@echo ================	Build Client	=================
"%VS11PATH%\devenv.com" .\trunk\sln\zpublic.sln /rebuild "Release"
if ERRORLEVEL 1 exit /b 1
@echo ================	End~~	=================
@exit /b 0

modify build.bat

modify build.bat


@echo Off
dotnet restore
dotnet build
dotnet pack "src\Discord.Net\Discord.Net.csproj" -c "%Configuration%" -o "artifacts" --no-build
dotnet pack "src\Discord.Net.Core\Discord.Net.Core.csproj" -c "%Configuration%" -o "artifacts" --no-build
dotnet pack "src\Discord.Net.Rest\Discord.Net.Rest.csproj" -c "%Configuration%" -o "artifacts" --no-build
dotnet pack "src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" -c "%Configuration%" -o "artifacts" --no-build
dotnet pack "src\Discord.Net.Rpc\Discord.Net.Rpc.csproj" -c "%Configuration%" -o "artifacts" --no-build
dotnet pack "src\Discord.Net.Commands\Discord.Net.Commands.csproj" -c "%Configuration%" -o "artifacts" --no-build

@echo Off
dotnet restore
dotnet build
dotnet pack "src\Discord.Net\Discord.Net.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Core\Discord.Net.Core.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Rest\Discord.Net.Rest.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Rpc\Discord.Net.Rpc.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build
dotnet pack "src\Discord.Net.Commands\Discord.Net.Commands.csproj" -c "%Configuration%" -o "artifacts" --version-suffix "%PrereleaseTag%" --no-build

Add version suffix to build script

Add version suffix to build script


@echo off

set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar

for %%i in (".\lib\*.jar") do CALL lcp %%i
echo %LOCALCLASSPATH%

for %%i in (..\jakarta-site2\lib\*.jar) do CALL lcp %%i

SET BUILDFILE=build.xml
echo %LOCALCLASSPATH%
java -classpath %LOCALCLASSPATH% org.apache.tools.ant.Main -buildfile %BUILDFILE% %1

fix CR/LF problems

fix CR/LF problems

git-svn-id: 7c053b8fbd1fb5868f764c6f9536fc6a9bbe7da9@322665 13f79535-47bb-0310-9956-ffa450edef68


@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

cd src

REM Package restore
call %nuget% restore CcAcca.CacheAbstraction.sln -OutputDirectory %cd%\packages -NonInteractive

REM Build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild CcAcca.CacheAbstraction.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

REM Test
%nuget% install NUnit.Runners -Version 2.6.3 -OutputDirectory packages
packages\NUnit.Runners.2.6.3\tools\nunit-console.exe /config:%config% /framework:net-4.5 ..\bin\%config%\CcAcca.CacheAbstraction.Test\CcAcca.CacheAbstraction.Test.dll

REM Package
mkdir ..\dist
%nuget% pack CcAcca.CacheAbstraction\CcAcca.CacheAbstraction.csproj -OutputDirectory ..\dist -Symbols -Prop Configuration=%config%
%nuget% pack CcAcca.CacheAbstraction.WebApi\CcAcca.CacheAbstraction.WebApi.csproj -OutputDirectory ..\dist -Symbols -Prop Configuration=%config%
%nuget% pack CcAcca.CacheAbstraction.Distributed\CcAcca.CacheAbstraction.Distributed.csproj -OutputDirectory ..\dist -Symbols -Prop Configuration=%config%

@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

cd src

REM Package restore
call %nuget% restore CcAcca.CacheAbstraction.sln -OutputDirectory %cd%\..\packages -NonInteractive

REM Build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild CcAcca.CacheAbstraction.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

REM Test
%nuget% install NUnit.Runners -Version 2.6.3 -OutputDirectory packages
packages\NUnit.Runners.2.6.3\tools\nunit-console.exe /config:%config% /framework:net-4.5 ..\bin\%config%\CcAcca.CacheAbstraction.Test\CcAcca.CacheAbstraction.Test.dll

REM Package
mkdir ..\dist
%nuget% pack CcAcca.CacheAbstraction\CcAcca.CacheAbstraction.csproj -OutputDirectory ..\dist -Symbols -Prop Configuration=%config%
%nuget% pack CcAcca.CacheAbstraction.WebApi\CcAcca.CacheAbstraction.WebApi.csproj -OutputDirectory ..\dist -Symbols -Prop Configuration=%config%
%nuget% pack CcAcca.CacheAbstraction.Distributed\CcAcca.CacheAbstraction.Distributed.csproj -OutputDirectory ..\dist -Symbols -Prop Configuration=%config%

fix path to packages directory

build(build.cmd): fix path to packages directory


@echo off
setlocal

:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=debug

:: Set the various build properties here so that CMake and MSBuild can pick them up
set __ProjectDir=%~dp0
set __ProjectFilesDir=%~dp0
set __SourceDir=%__ProjectDir%\src
set __PackagesDir=%__SourceDir%\.nuget
set __RootBinDir=%__ProjectDir%\binaries
set __LogsDir=%__RootBinDir%\Logs
set __CMakeSlnDir=%__RootBinDir%\CMake
set __MSBCleanBuildArgs=

:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage
if /i "%1" == "x64"    (set __BuildArch=x64&&shift&goto Arg_Loop)

if /i "%1" == "debug"    (set __BuildType=debug&shift&goto Arg_Loop)
if /i "%1" == "release"   (set __BuildType=release&shift&goto Arg_Loop)

if /i "%1" == "clean"   (set __CleanBuild=1&shift&goto Arg_Loop)

if /i "%1" == "unixmscorlib" (set __UnixMscorlibOnly=1&shift&goto Arg_Loop)

echo Invalid commandline argument: %1
goto Usage

:ArgsDone

echo Commencing CoreCLR Repo build
echo.

:: Set the remaining variables based upon the determined build configuration
set __BinDir=%__RootBinDir%\Product\%__BuildArch%\%__BuildType%
set __PackagesBinDir=%__BinDir%\.nuget
set __ToolsDir=%__RootBinDir%\tools
set __TestWorkingDir=%__RootBinDir%\tests\%__BuildArch%\%__BuildType%
set __IntermediatesDir=%__RootBinDir%\intermediates\%__BuildArch%\%__BuildType%

:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set __CMakeBinDir=%__BinDir%
set "__CMakeBinDir=%__CMakeBinDir:\=/%"

:: Switch to clean build mode if the binaries output folder does not exist
if not exist %__RootBinDir% set __CleanBuild=1

:: Configure environment if we are doing a clean build.
if not defined __CleanBuild goto CheckPrereqs
echo Doing a clean build
echo.

:: MSBuild projects would need a rebuild
set __MSBCleanBuildArgs=/t:rebuild

:: Cleanup the binaries drop folder
if exist %__BinDir% rd /s /q %__BinDir%
md %__BinDir%

:: Cleanup the CMake folder
if exist %__CMakeSlnDir% rd /s /q %__CMakeSlnDir%
md %__CMakeSlnDir%

:: Cleanup the logs folder
if exist %__LogsDir% rd /s /q %__LogsDir%
md %__LogsDir%

::Cleanup intermediates folder
if exist %__IntermediatesDir% rd /s /q %__IntermediatesDir%

:: Check prerequisites
:CheckPrereqs
echo Checking pre-requisites...
echo.
::
:: Check presence of CMake on the path
for %%X in (cmake.exe) do (set FOUNDCMake=%%~$PATH:X)
if defined FOUNDCMake goto CheckVS
echo CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path.
goto :eof

:CheckVS
:: Check presence of VS
if defined VS120COMNTOOLS goto CheckVSExistence
echo Installation of VS 2013 is a pre-requisite to build this repository.
goto :eof

:CheckVSExistence
:: Does VS 2013 really exist?
if exist "%VS120COMNTOOLS%\..\IDE\devenv.exe" goto CheckMSBuild
echo Installation of VS 2013 is a pre-requisite to build this repository.
goto :eof

:CheckMSBuild
:: Note: We've disabled node reuse because it causes file locking issues.
::       The issue is that we extend the build with our own targets which
::       means that that rebuilding cannot successfully delete the task
::       assembly.
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/coreclr/wiki/Developer%%20Guide for build instructions. && exit /b 1

:: All set to commence the build

setlocal
if defined __UnixMscorlibOnly goto PerformMScorlibBuild

echo Commencing build of native components for %__BuildArch%/%__BuildType%
echo.

:: Set the environment for the native build
call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
cd %__CMakeSlnDir%

if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
This is due to bug in VS Intaller. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^
of previous version to "%VSINSTALLDIR%" and then resume build.
goto :eof

:GenVSSolution
:: Regenerate the VS solution
call ..\..\src\pal\tools\gen-buildsys-win.bat %__ProjectDir%

:BuildComponents
if exist %__CMakeSlnDir%\install.vcxproj goto BuildCoreCLR
echo Failed to generate native component build project!
goto :eof

REM Build CoreCLR
:BuildCoreCLR
set __CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildArch%__%__BuildType%.log
%_msbuildexe% %__CMakeSlnDir%\install.vcxproj %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=diag;LogFile="%__CoreCLRBuildLog%"
pushd %__ProjectDir%
IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild
echo Native component build failed. Refer %__CoreCLRBuildLog% for details.
goto :eof

:PerformMScorlibBuild
endlocal

setlocal
set __AdditionalMSBuildArgs=

if defined __UnixMscorlibOnly set __AdditionalMSBuildArgs=/p:OS=Unix /p:BuildNugetPackage=false

:: Set the environment for the managed build
call "%VS120COMNTOOLS%\VsDevCmd.bat"
echo Commencing build of mscorlib for %__BuildArch%/%__BuildType%
echo.
set __MScorlibBuildLog=%__LogsDir%\MScorlib_%__BuildArch%__%__BuildType%.log
%_msbuildexe% "%__ProjectFilesDir%build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%__MScorlibBuildLog%" %__AdditionalMSBuildArgs%
IF NOT ERRORLEVEL 1 (
  if defined __UnixMscorlibOnly goto :eof
  goto PerformTestBuild
)

echo MScorlib build failed. Refer %__MScorlibBuildLog% for details.
goto :eof

:PerformTestBuild
echo.
echo Commencing build of tests for %__BuildArch%/%__BuildType%
echo.
call tests\buildtest.cmd
endlocal

::Build complete
echo Repo successfully built.
echo.
echo Product binaries are available at %__BinDir%
echo Test binaries are available at %__TestWorkingDir%
goto :eof

:Usage
echo.
echo Usage:
echo %0 BuildArch BuildType [clean] where:
echo.
echo BuildArch can be: x64
echo BuildType can be: Debug, Release
echo Clean - optional argument to force a clean build.
goto :eof

@echo off
setlocal

:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=debug

:: Set the various build properties here so that CMake and MSBuild can pick them up
set __ProjectDir=%~dp0
set __ProjectFilesDir=%~dp0
set __SourceDir=%__ProjectDir%\src
set __PackagesDir=%__SourceDir%\.nuget
set __RootBinDir=%__ProjectDir%\binaries
set __LogsDir=%__RootBinDir%\Logs
set __CMakeSlnDir=%__RootBinDir%\CMake
set __MSBCleanBuildArgs=

:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage
if /i "%1" == "x64"    (set __BuildArch=x64&&shift&goto Arg_Loop)

if /i "%1" == "debug"    (set __BuildType=debug&shift&goto Arg_Loop)
if /i "%1" == "release"   (set __BuildType=release&shift&goto Arg_Loop)

if /i "%1" == "clean"   (set __CleanBuild=1&shift&goto Arg_Loop)

if /i "%1" == "unixmscorlib" (set __UnixMscorlibOnly=1&shift&goto Arg_Loop)

echo Invalid commandline argument: %1
goto Usage

:ArgsDone

echo Commencing CoreCLR Repo build
echo.

:: Set the remaining variables based upon the determined build configuration
set __BinDir=%__RootBinDir%\Product\%__BuildArch%\%__BuildType%
set __PackagesBinDir=%__BinDir%\.nuget
set __ToolsDir=%__RootBinDir%\tools
set __TestWorkingDir=%__RootBinDir%\tests\%__BuildArch%\%__BuildType%
set __IntermediatesDir=%__RootBinDir%\intermediates\%__BuildArch%\%__BuildType%

:: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
set __CMakeBinDir=%__BinDir%
set "__CMakeBinDir=%__CMakeBinDir:\=/%"

:: Switch to clean build mode if the binaries output folder does not exist
if not exist %__RootBinDir% set __CleanBuild=1

:: Configure environment if we are doing a clean build.
if not defined __CleanBuild goto CheckPrereqs
echo Doing a clean build
echo.

:: MSBuild projects would need a rebuild
set __MSBCleanBuildArgs=/t:rebuild

:: Cleanup the binaries drop folder
if exist %__BinDir% rd /s /q %__BinDir%
md %__BinDir%

:: Cleanup the CMake folder
if exist %__CMakeSlnDir% rd /s /q %__CMakeSlnDir%
md %__CMakeSlnDir%

:: Cleanup the logs folder
if exist %__LogsDir% rd /s /q %__LogsDir%
md %__LogsDir%

::Cleanup intermediates folder
if exist %__IntermediatesDir% rd /s /q %__IntermediatesDir%

:: Check prerequisites
:CheckPrereqs
echo Checking pre-requisites...
echo.
::
:: Check presence of CMake on the path
for %%X in (cmake.exe) do (set FOUNDCMake=%%~$PATH:X)
if defined FOUNDCMake goto CheckVS
echo CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path.
goto :eof

:CheckVS
:: Check presence of VS
if defined VS120COMNTOOLS goto CheckVSExistence
echo Installation of VS 2013 is a pre-requisite to build this repository.
goto :eof

:CheckVSExistence
:: Does VS 2013 really exist?
if exist "%VS120COMNTOOLS%\..\IDE\devenv.exe" goto CheckMSBuild
echo Installation of VS 2013 is a pre-requisite to build this repository.
goto :eof

:CheckMSBuild
:: Note: We've disabled node reuse because it causes file locking issues.
::       The issue is that we extend the build with our own targets which
::       means that that rebuilding cannot successfully delete the task
::       assembly.
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/coreclr/wiki/Developer%%20Guide for build instructions. && exit /b 1

:: All set to commence the build

setlocal
if defined __UnixMscorlibOnly goto PerformMScorlibBuild

echo Commencing build of native components for %__BuildArch%/%__BuildType%
echo.

:: Set the environment for the native build
call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64

if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
This is due to bug in VS Intaller. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^
of previous version to "%VSINSTALLDIR%" and then resume build.
goto :eof

:GenVSSolution
:: Regenerate the VS solution
pushd %__CMakeSlnDir%
call %__SourceDir%\pal\tools\gen-buildsys-win.bat %__ProjectDir%
popd

:BuildComponents
if exist %__CMakeSlnDir%\install.vcxproj goto BuildCoreCLR
echo Failed to generate native component build project!
goto :eof

REM Build CoreCLR
:BuildCoreCLR
set __CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildArch%__%__BuildType%.log
%_msbuildexe% %__CMakeSlnDir%\install.vcxproj %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=diag;LogFile="%__CoreCLRBuildLog%"
IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild
echo Native component build failed. Refer %__CoreCLRBuildLog% for details.
goto :eof

:PerformMScorlibBuild
REM endlocal to rid us of environment changes from vcvarsall.bat
endlocal

REM setlocal to prepare for vsdevcmd.bat
setlocal
set __AdditionalMSBuildArgs=

if defined __UnixMscorlibOnly set __AdditionalMSBuildArgs=/p:OS=Unix /p:BuildNugetPackage=false

:: Set the environment for the managed build
call "%VS120COMNTOOLS%\VsDevCmd.bat"
echo Commencing build of mscorlib for %__BuildArch%/%__BuildType%
echo.
set __MScorlibBuildLog=%__LogsDir%\MScorlib_%__BuildArch%__%__BuildType%.log
%_msbuildexe% "%__ProjectFilesDir%build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%__MScorlibBuildLog%" %__AdditionalMSBuildArgs%
IF NOT ERRORLEVEL 1 (
  if defined __UnixMscorlibOnly goto :eof
  goto PerformTestBuild
)

echo MScorlib build failed. Refer %__MScorlibBuildLog% for details.
goto :eof

:PerformTestBuild
echo.
echo Commencing build of tests for %__BuildArch%/%__BuildType%
echo.
call tests\buildtest.cmd
IF NOT ERRORLEVEL 1 goto SuccessfulBuild
echo Test binaries build failed. Refer %__MScorlibBuildLog% for details.
goto :eof

:SuccessfulBuild
::Build complete
echo Repo successfully built.
echo.
echo Product binaries are available at %__BinDir%
echo Test binaries are available at %__TestWorkingDir%
goto :eof

:Usage
echo.
echo Usage:
echo %0 BuildArch BuildType [clean] where:
echo.
echo BuildArch can be: x64
echo BuildType can be: Debug, Release
echo Clean - optional argument to force a clean build.
goto :eof

Fix build.cmd return codes

Fix build.cmd return codes

Build script was accidentally wiping the return code of the first msbuild step, causing us to continue building even in failure.  Fix this and do a little extra cleanup.