@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0
set SBT_ARGS=

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET "PATH=%JAVA_HOME%\bin;%PATH%"

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET _jvmopts_line=%%A
  IF NOT "!_jvmopts_line:~0,1!"=="#" (
    SET JAVA_OPTS=%%A !JAVA_OPTS!
  )
)
rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

set INIT_SBT_VERSION=_TO_BE_REPLACED

:args_loop
if "%~1" == "" goto args_end

if "%~1" == "-jvm-debug" (
  set JVM_DEBUG=true
  set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
  set /a JVM_DEBUG_PORT=%1 2>nul >nul
  if not "%~1" == "!JVM_DEBUG_PORT!" (
    set SBT_ARGS=!SBT_ARGS! %1
  )
) else (
  set SBT_ARGS=!SBT_ARGS! %1
)

shift
goto args_loop
:args_end

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :process

call :checkjava

call :copyrt

call :sync_preloaded

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:process
rem parses 1.7, 1.8, 9, etc out of java version "1.8.0_91"
"%_JAVACMD%" -Xmx512M -version 2> "%TEMP%\out.txt"
set JAVA_VERSION=0
>nul findstr /c:"version \"9" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=9)
>nul findstr /c:"version \"1.8" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.8)
>nul findstr /c:"version \"1.7" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.7)
>nul findstr /c:"version \"1.6" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.6)
>nul findstr /c:"version \"1.5" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.5)
exit /B 0

:checkjava
set required_version=1.6
if /I "%JAVA_VERSION%" GEQ "%required_version%" (
  exit /B 0
)
echo.
echo The Java Development Kit (JDK) installation you have is not up to date.
echo sbt requires at least version %required_version%+, you have
echo version %JAVA_VERSION%
echo.
echo Please go to http://www.oracle.com/technetwork/java/javase/downloads/ and download
echo a valid JDK and install before running sbt.
echo.
exit /B 1

:copyrt
if /I "%JAVA_VERSION%" GEQ "9" (
  set rtexport=!SBT_HOME!java9-rt-export.jar

  "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "!rtexport!" --rt-ext-dir > "%TEMP%.\rtext.txt"
  set /p java9_ext= < "%TEMP%.\rtext.txt"
  set java9_rt=!java9_ext!\rt.jar

  if not exist "!java9_rt!" (
    mkdir "!java9_ext!"
    "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "!rtexport!" "!java9_rt!"
  )
  set _JAVA_OPTS=!_JAVA_OPTS! -Dscala.ext.dirs="!java9_ext!"

  rem check to see if a GC has been set in the opts
  echo !_JAVA_OPTS! | findstr /r "Use.*GC" >nul
  if ERRORLEVEL 1 (
    rem don't have a GC set - revert to old GC
    set _JAVA_OPTS=!_JAVA_OPTS! -XX:+UseParallelGC
  )
)
exit /B 0

:sync_preloaded
if "%INIT_SBT_VERSION%"=="" (
  rem FIXME: better %INIT_SBT_VERSION% detection
  FOR /F "tokens=* USEBACKQ" %%F IN (`dir /b "%SBT_HOME%\..\lib\local-preloaded\org.scala-sbt\sbt" /B`) DO (
    SET INIT_SBT_VERSION=%%F
  )
)
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "1.8" (
  where robocopy >nul 2>nul
  if %ERRORLEVEL% equ 0 (
    REM echo %PRELOAD_SBT_JAR%
    if not exist %PRELOAD_SBT_JAR% (
      if exist "%SBT_HOME%\..\lib\local-preloaded\" (
        echo 'about to robocopy'
        robocopy "%SBT_HOME%\..\lib\local-preloaded" "%UserProfile%\.sbt\preloaded" /E
      )
    )
  )
)
exit /B 0

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0
set SBT_ARGS=

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET "PATH=%JAVA_HOME%\bin;%PATH%"

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET _jvmopts_line=%%A
  IF NOT "!_jvmopts_line:~0,1!"=="#" (
    SET JAVA_OPTS=%%A !JAVA_OPTS!
  )
)
rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

set INIT_SBT_VERSION=_TO_BE_REPLACED

:args_loop
if "%~1" == "" goto args_end

if "%~1" == "-jvm-debug" (
  set JVM_DEBUG=true
  set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
  set /a JVM_DEBUG_PORT=%1 2>nul >nul
  if not "%~1" == "!JVM_DEBUG_PORT!" (
    set SBT_ARGS=!SBT_ARGS! %1
  )
) else (
  set SBT_ARGS=!SBT_ARGS! %1
)

shift
goto args_loop
:args_end

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :process

call :checkjava

call :copyrt

call :sync_preloaded

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:process
rem parses 1.7, 1.8, 9, etc out of java version "1.8.0_91"
"%_JAVACMD%" -Xmx512M -version 2> "%TEMP%\out.txt"
set JAVA_VERSION=0
>nul findstr /c:"version \"9" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=9)
>nul findstr /c:"version \"1.8" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.8)
>nul findstr /c:"version \"1.7" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.7)
>nul findstr /c:"version \"1.6" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.6)
>nul findstr /c:"version \"1.5" "%TEMP%\out.txt"
if /I %ERRORLEVEL% EQU 0 (set JAVA_VERSION=1.5)
exit /B 0

:checkjava
set required_version=1.6
if /I "%JAVA_VERSION%" GEQ "%required_version%" (
  exit /B 0
)
echo.
echo The Java Development Kit (JDK) installation you have is not up to date.
echo sbt requires at least version %required_version%+, you have
echo version %JAVA_VERSION%
echo.
echo Please go to http://www.oracle.com/technetwork/java/javase/downloads/ and download
echo a valid JDK and install before running sbt.
echo.
exit /B 1

:copyrt
if /I "%JAVA_VERSION%" GEQ "9" (
  set rtexport=!SBT_HOME!java9-rt-export.jar

  "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "!rtexport!" --rt-ext-dir > "%TEMP%.\rtext.txt"
  set /p java9_ext= < "%TEMP%.\rtext.txt"
  set java9_rt=!java9_ext!\rt.jar

  if not exist "!java9_rt!" (
    mkdir "!java9_ext!"
    "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "!rtexport!" "!java9_rt!"
  )
  set _JAVA_OPTS=!_JAVA_OPTS! -Dscala.ext.dirs="!java9_ext!"

  rem check to see if a GC has been set in the opts
  echo !_JAVA_OPTS! | findstr /r "Use.*GC" >nul
  if ERRORLEVEL 1 (
    rem don't have a GC set - revert to old GC
    set _JAVA_OPTS=!_JAVA_OPTS! -XX:+UseParallelGC
  )
)
exit /B 0

:sync_preloaded
if "%INIT_SBT_VERSION%"=="" (
  rem FIXME: better %INIT_SBT_VERSION% detection
  FOR /F "tokens=* USEBACKQ" %%F IN (`dir /b "%SBT_HOME%\..\lib\local-preloaded\org.scala-sbt\sbt" /B`) DO (
    SET INIT_SBT_VERSION=%%F
  )
)
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "1.8" (
  where robocopy >nul 2>nul
  if %ERRORLEVEL% equ 0 (
    REM echo %PRELOAD_SBT_JAR%
    if not exist %PRELOAD_SBT_JAR% (
      if exist "%SBT_HOME%\..\lib\local-preloaded\" (
        echo "about to robocopy"
        robocopy "%SBT_HOME%\..\lib\local-preloaded" "%UserProfile%\.sbt\preloaded" /E
      )
    )
  )
)
exit /B 0

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

Fix quotes in sbt.bat

Fix quotes in sbt.bat


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

IF [%1] EQU [] (
	echo USAGE: %0 server.properties
	EXIT /B 1
)

SetLocal
IF ["%KAFKA_LOG4J_OPTS%"] EQU [""] (
    set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%~dp0../../config/log4j.properties
)
IF ["%KAFKA_HEAP_OPTS%"] EQU [""] (
    set KAFKA_HEAP_OPTS=-Xmx1G -Xms1G
)
%~dp0kafka-run-class.bat kafka.Kafka %*
EndLocal

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

IF [%1] EQU [] (
	echo USAGE: %0 server.properties
	EXIT /B 1
)

SetLocal
IF ["%KAFKA_LOG4J_OPTS%"] EQU [""] (
    set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%~dp0../../config/log4j.properties
)
IF ["%KAFKA_HEAP_OPTS%"] EQU [""] (
    rem detect OS architecture
    wmic os get osarchitecture | find /i "32-bit" >nul 2>&1
    IF NOT ERRORLEVEL 1 (
        rem 32-bit OS
        set KAFKA_HEAP_OPTS=-Xmx512M -Xms512M
    ) ELSE (
        rem 64-bit OS
        set KAFKA_HEAP_OPTS=-Xmx1G -Xms1G
    )
)
%~dp0kafka-run-class.bat kafka.Kafka %*
EndLocal

KAFKA-4271: Fix the server start script for Windows 32-bit OS

Without this fix the new consumer fails to run on a 32-bit Windows OS.

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Jason Gustafson, Guozhang Wang

Closes #2189 from vahidhashemian/KAFKA-4271


$PYTHON -m pip install --no-deps --ignore-installed  .
if errorlevel 1 exit 1

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

Update bld.bat

Update bld.bat


@echo off
SET pathToVS12=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
SET pathToVS11=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe

IF EXIST %pathToVS12%(
"%pathToVS12%" /RootSuffix YC /ReSharper.Internal
Exit /b
)

IF EXIST %pathToVS11%
(
"%pathToVS11%" /RootSuffix YC /ReSharper.Internal
Exit /b
)
ELSE
(
echo "Microsoft Visual Studio 11 and Microsoft Visual Studio 12 weren't found. Try run plugin manually with keys /RootSuffix YC /ReSharper.Internal"
)

Edit script that runs studio with plugin


@TITLE Building Mesa3D
@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set mesa=%mesa%\
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%cmake\bin\;%PATH%
@set ERRORLEVEL=0
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%Python\;%mesa%Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=y
@set pyfrstupd=1
@if EXIST pyupd.ini set /p pyfrstupd=<pyupd.ini
@if %pyfrstupd%==0 set pyupd=n
@if %pyfrstupd%==0 set /p pyupd=Install/update python modules (y/n):
@if "%pyupd%"=="y" (
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@echo 0 > pyupd.ini
)
@set abi=x86
@set /p x64=Do you want to build for x64? (y/n) Otherwise build for x86:
@if /I "%x64%"=="y" set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set hostabi=x86
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set hostabi=x64
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64\%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set PATH=%mesa%flexbison\;%PATH%
@TITLE Building Mesa3D %abi%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT "%buildllvm%"=="y" GOTO build_dxtn
@echo.
@cd %mesa%llvm
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@if EXIST %mesa%ninja set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I "%oldtoolset%"=="y" set ninja=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if /I "%ninja%"=="y" set toolchain=Ninja
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cd %llvmbuildsys%
@set cmakecmd=cmake -G "%toolchain%"
@if %hostabi%==x64 set cmakecmd=%cmakecmd% -Thost=x64
@set cmakecmd=%cmakecmd% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@%cmakecmd%
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" cmake --build . --config Release --target install
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > %mesa%toolset-%abi%.ini

:build_dxtn
@if NOT EXIST %gcc% GOTO build_mesa
@if NOT EXIST %mesa%dxtn GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" GOTO build_mesa
@set PATH=%gcc%\;%PATH%
@cd %mesa%dxtn
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared -m%minabi% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO distcreate
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO exit
)
@cd %mesa%mesa
@set openswr=n
@set sconscmd=python %mesa%Python\Scripts\scons.py build=release platform=windows machine=%longabi% libgl-gdi
@set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@echo.
@if /I "%openswr%"=="y" set sconscmd=%sconscmd% swr=1
@set /p osmesa=Do you want to build off-screen rendering drivers (y/n):
@echo.
@if /I "%osmesa%"=="y" set sconscmd=%sconscmd% osmesa
@set /p graw=Do you want to build graw library (y/n):
@echo.
@if /I "%graw%"=="y" set sconscmd=%sconscmd% graw-gdi
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST %gcc% set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST %msys2% set mingwtest=%mingwtest%2
@if %mingwtest%==12 set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 set PATH=%gcc%\;%PATH%
@if /I "%mingw%"=="y" set sconscmd=%sconscmd% toolchain=crossmingw
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ar.exe %gcc%\%altabi%-w64-mingw32-ar.exe
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe %gcc%\%altabi%-w64-mingw32-ranlib.exe
@if /I "%mingw%"=="y" call "%msys2%" -use-full-path
@if /I "%mingw%"=="y" (
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa
GOTO build_mesa_exec
)

:build_with_vs
@set cleanbuild=n
@if EXIST build\windows-%longabi% set /p cleanbuild=Do you want to clean build (y/n):
@if EXIST build\windows-%longabi% echo.
@if /I "%cleanbuild%"=="y" RD /S /Q build\windows-%longabi%
@if %vsenvloaded%==0 (
@call %vsenv%
@cd %mesa%mesa
@echo.
)

:build_mesa_exec
@%sconscmd%
@echo.

:distcreate
@set /p dist=Create or update Mesa3D distribution package (y/n):
@echo.
@if /I NOT "%dist%"=="y" GOTO exit
@cd %mesa%
@if NOT EXIST mesa-dist-win MD mesa-dist-win
@cd mesa-dist-win
@if NOT EXIST bin MD bin
@cd bin
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@cd %abi%
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\libgl-gdi\opengl32.dll opengl32.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX2.dll swrAVX2.dll
@copy %mesa%mesa\build\windows-%longabi%\mesa\drivers\osmesa\osmesa.dll osmesa-swrast.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\osmesa\osmesa.dll osmesa-gallium.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\graw-gdi\graw.dll graw.dll
@copy %mesa%dxtn\%abi%\dxtn.dll dxtn.dll
@echo.
@pause

:exit
exit

@TITLE Building Mesa3D
@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set mesa=%mesa%\
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%cmake\bin\;%PATH%
@set ERRORLEVEL=0
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%Python\;%mesa%Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=y
@set pyfrstupd=1
@if EXIST pyupd.ini set /p pyfrstupd=<pyupd.ini
@if %pyfrstupd%==0 set pyupd=n
@if %pyfrstupd%==0 set /p pyupd=Install/update python modules (y/n):
@if "%pyupd%"=="y" (
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@echo 0 > pyupd.ini
)
@set abi=x86
@set /p x64=Do you want to build for x64? (y/n) Otherwise build for x86:
@if /I "%x64%"=="y" set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set hostabi=x86
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set hostabi=x64
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64\%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set PATH=%mesa%flexbison\;%PATH%
@TITLE Building Mesa3D %abi%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT "%buildllvm%"=="y" GOTO build_dxtn
@echo.
@cd %mesa%llvm
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@if EXIST %mesa%ninja set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I "%oldtoolset%"=="y" set ninja=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if /I "%ninja%"=="y" set toolchain=Ninja
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cd %llvmbuildsys%
@set cmakecmd=cmake -G "%toolchain%"
@if %hostabi%==x64 set cmakecmd=%cmakecmd% -Thost=x64
@set cmakecmd=%cmakecmd% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@%cmakecmd%
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" cmake --build . --config Release --target install
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > %mesa%toolset-%abi%.ini

:build_dxtn
@if NOT EXIST %gcc% GOTO build_mesa
@if NOT EXIST %mesa%dxtn GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" GOTO build_mesa
@set PATH=%gcc%\;%PATH%
@cd %mesa%dxtn
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared -m%minabi% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO distcreate
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO exit
)
@cd %mesa%
@if NOT EXIST mesa echo Mesa3D source code not found. Attempting to download it using git as long as it is in PATH...
@if NOT EXIST mesa set /p branch=Enter Mesa source code branch name - defaults to master:
@if "%branch%"=="" set branch=master
@if NOT EXIST mesa echo.
@if NOT EXIST mesa git clone --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa
@cd mesa
git apply ..\mesa-dist-win\patches\scons-llvm5.patch
git apply ..\mesa-dist-win\patches\s3tc.patch
@set openswr=n
@set sconscmd=python %mesa%Python\Scripts\scons.py build=release platform=windows machine=%longabi% libgl-gdi
@set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@echo.
@if /I "%openswr%"=="y" set sconscmd=%sconscmd% swr=1
@set /p osmesa=Do you want to build off-screen rendering drivers (y/n):
@echo.
@if /I "%osmesa%"=="y" set sconscmd=%sconscmd% osmesa
@set /p graw=Do you want to build graw library (y/n):
@echo.
@if /I "%graw%"=="y" set sconscmd=%sconscmd% graw-gdi
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST %gcc% set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST %msys2% set mingwtest=%mingwtest%2
@if %mingwtest%==12 set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 set PATH=%gcc%\;%PATH%
@if /I "%mingw%"=="y" set sconscmd=%sconscmd% toolchain=crossmingw
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ar.exe %gcc%\%altabi%-w64-mingw32-ar.exe
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe %gcc%\%altabi%-w64-mingw32-ranlib.exe
@if /I "%mingw%"=="y" call "%msys2%" -use-full-path
@if /I "%mingw%"=="y" (
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa
GOTO build_mesa_exec
)

:build_with_vs
@set cleanbuild=n
@if EXIST build\windows-%longabi% set /p cleanbuild=Do you want to clean build (y/n):
@if EXIST build\windows-%longabi% echo.
@if /I "%cleanbuild%"=="y" RD /S /Q build\windows-%longabi%
@if %vsenvloaded%==0 (
@call %vsenv%
@cd %mesa%mesa
@echo.
)

:build_mesa_exec
@%sconscmd%
@echo.

:distcreate
@set /p dist=Create or update Mesa3D distribution package (y/n):
@echo.
@if /I NOT "%dist%"=="y" GOTO exit
@cd %mesa%
@if NOT EXIST mesa-dist-win MD mesa-dist-win
@cd mesa-dist-win
@if NOT EXIST bin MD bin
@cd bin
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@cd %abi%
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\libgl-gdi\opengl32.dll opengl32.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX2.dll swrAVX2.dll
@copy %mesa%mesa\build\windows-%longabi%\mesa\drivers\osmesa\osmesa.dll osmesa-swrast.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\osmesa\osmesa.dll osmesa-gallium.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\graw-gdi\graw.dll graw.dll
@copy %mesa%dxtn\%abi%\dxtn.dll dxtn.dll
@echo.
@pause

:exit
exit

Build script: Fetch Mesa source code using git when possible Allows automatic patch applying. Hooked 2 patches: - S3TC texture cache; - LLVM 5.0 Scons build compatibility patch.


@echo off

set targetDllPath="%~1\bin\SDL2.dll"
if not exist %targetDllPath% (
    echo Copying SDL2.dll to %targetDllPath%
    copy SDL2.dll %targetDllPath% || exit /b 1
)

cd /d %1
if not exist build mkdir build
cd build

set slnName="%~2.sln"
set binTargetName="%~2-gamebins"

IF NOT EXIST %slnName% (
cmake -G "Visual Studio 16 2019" ^
    -A x64 ^
    -DHALLEY_PATH=../halley ^
    -DBUILD_HALLEY_TOOLS=0 ^
    -DBUILD_HALLEY_TESTS=0 ^
    -DCMAKE_INCLUDE_PATH="lib\include" ^
    -DCMAKE_LIBRARY_PATH="lib\windows64" ^
    -DBOOST_ROOT="lib\boost" ^
    -DBoost_USE_STATIC_LIBS=1 ^
    .. || exit /b 1
)

cmake.exe --build . --target %binTargetName% --config %3 || exit /b 1

echo Build successful.

@echo off

set targetDllDir="%~1\bin"
if not exist %targetDllDir% (
    mkdir %targetDllDir%
)
set targetDllPath="%~1\bin\SDL2.dll"
if not exist %targetDllPath% (
    echo Copying SDL2.dll to %targetDllPath%
    copy SDL2.dll %targetDllPath% || exit /b 1
)

cd /d %1
if not exist build mkdir build
cd build

set slnName="%~2.sln"
set binTargetName="%~2-gamebins"

IF NOT EXIST %slnName% (
cmake -G "Visual Studio 16 2019" ^
    -A x64 ^
    -DHALLEY_PATH=../halley ^
    -DBUILD_HALLEY_TOOLS=0 ^
    -DBUILD_HALLEY_TESTS=0 ^
    -DCMAKE_INCLUDE_PATH="lib\include" ^
    -DCMAKE_LIBRARY_PATH="lib\windows64" ^
    -DBOOST_ROOT="lib\boost" ^
    -DBoost_USE_STATIC_LIBS=1 ^
    .. || exit /b 1
)

cmake.exe --build . --target %binTargetName% --config %3 || exit /b 1

echo Build successful.

Create bin dir if needed

Create bin dir if needed


@if not defined PACKER_DEBUG echo off

setlocal EnableDelayedExpansion EnableExtensions

:: If TEMP is not defined in this shell instance, define it ourselves
if not defined TEMP set TEMP=%USERPROFILE%\AppData\Local\Temp

set ULTRADEFRAG_VERSION=6.0.2

if exist "%SystemDrive%\Program Files (x86)" (
  set ULTRADEFRAG_ZIP=ultradefrag-portable-%ULTRADEFRAG_VERSION%.bin.i386.zip
) else (
  set ULTRADEFRAG_ZIP=ultradefrag-portable-%ULTRADEFRAG_VERSION%.bin.amd64.zip
)

set ULTRADEFRAG_URL=http://downloads.sourceforge.net/ultradefrag/%ULTRADEFRAG_ZIP%
set ULTRADEFRAG_DIR=%TEMP%\ultradefrag
set ULTRADEFRAG_ZIP_LOCAL_PATH=%ULTRADEFRAG_DIR%\%ULTRADEFRAG_ZIP%

mkdir "%ULTRADEFRAG_DIR%"

echo ==^> Downloadling %ULTRADEFRAG_URL% to %ULTRADEFRAG_ZIP_LOCAL_PATH%
PATH=%PATH%;a:\
for %%i in (_download.cmd) do set _download=%%~$PATH:i
if defined _download (
  call "%_download%" "%ULTRADEFRAG_URL%" "%ULTRADEFRAG_ZIP_LOCAL_PATH%"
) else (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%ULTRADEFRAG_URL%', '%ULTRADEFRAG_ZIP_LOCAL_PATH%')" <NUL
)

echo ==^> Download complete

echo ==^> Unzipping UltraDefrag from "%ULTRADEFRAG_ZIP_LOCAL_PATH%"
"%ProgramFiles%\7-Zip\7z.exe" e -o"%ULTRADEFRAG_DIR%" "%ULTRADEFRAG_ZIP_LOCAL_PATH%"

echo ==^> Running UltraDefrag on %SystemDrive%
"%ULTRADEFRAG_DIR%\udefrag.exe" --optimize --repeat %SystemDrive%

echo ==^> Removing "%%ULTRADEFRAG_DIR%%"
del /F /S /Q "%%ULTRADEFRAG_DIR%%"

exit 0

@if not defined PACKER_DEBUG echo off

setlocal EnableDelayedExpansion EnableExtensions

:: If TEMP is not defined in this shell instance, define it ourselves
if not defined TEMP set TEMP=%USERPROFILE%\AppData\Local\Temp

set ULTRADEFRAG_VERSION=6.0.2

if exist "%SystemDrive%\Program Files (x86)" (
  set ULTRADEFRAG_ZIP=ultradefrag-portable-%ULTRADEFRAG_VERSION%.bin.i386.zip
) else (
  set ULTRADEFRAG_ZIP=ultradefrag-portable-%ULTRADEFRAG_VERSION%.bin.amd64.zip
)

set ULTRADEFRAG_URL=http://downloads.sourceforge.net/ultradefrag/%ULTRADEFRAG_ZIP%
set ULTRADEFRAG_DIR=%TEMP%\ultradefrag
set ULTRADEFRAG_ZIP_LOCAL_PATH=%ULTRADEFRAG_DIR%\%ULTRADEFRAG_ZIP%

mkdir "%ULTRADEFRAG_DIR%"

echo ==^> Downloadling %ULTRADEFRAG_URL% to %ULTRADEFRAG_ZIP_LOCAL_PATH%
PATH=%PATH%;a:\
for %%i in (_download.cmd) do set _download=%%~$PATH:i
if defined _download (
  call "%_download%" "%ULTRADEFRAG_URL%" "%ULTRADEFRAG_ZIP_LOCAL_PATH%"
) else (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%ULTRADEFRAG_URL%', '%ULTRADEFRAG_ZIP_LOCAL_PATH%')" <NUL
)

echo ==^> Download complete

echo ==^> Unzipping UltraDefrag from "%ULTRADEFRAG_ZIP_LOCAL_PATH%"
"%ProgramFiles%\7-Zip\7z.exe" e -o"%ULTRADEFRAG_DIR%" "%ULTRADEFRAG_ZIP_LOCAL_PATH%"

echo ==^> Running UltraDefrag on %SystemDrive%
"%ULTRADEFRAG_DIR%\udefrag.exe" --optimize --repeat %SystemDrive%

echo ==^> Removing "%ULTRADEFRAG_DIR%"
del /F /S /Q "%ULTRADEFRAG_DIR%"

exit 0

Fix extra % on ultradefrag dir, resulting in incomplete removal https://github.com/misheska/basebox-packer/issues/70


@echo off

REM Follow these instructions to install Node and requirejs
REM http://requirejs.org/docs/optimization.html#download
REM npm install -g requirejs
REM npm install -g almond

REM We use requirejs's "r.js" to do the build, and almondjs for the lightweight AMD loading.

REM Set paths for modules you expect to be loaded by the page, or by a CDN, to "empty:"
REM   http://requirejs.org/docs/optimization.html#empty

REM r.js.cmd is the npm globally installed r.js command file.

r.js.cmd -o baseUrl=../src name=../chrome/almond include=../chrome/main out=../all.js wrap=true optimize=none paths.jquery=empty:

REM ----------
REM Sample output:

REM d:\dev\git_repos\grimbo-bookmarklets\bookmarklets\settlersonlinesimulator.com\chrome>build.bat
REM
REM Tracing dependencies for: chrome/almond
REM
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/all.js
REM ----------------
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/chrome/almond.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/adventures-page.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/units-required.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/full-adventure-info.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/sort-adventures.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/chrome/main.js

@echo off

REM Follow these instructions to install Node and requirejs
REM http://requirejs.org/docs/optimization.html#download
REM npm install -g requirejs
REM npm install -g almond

REM We use requirejs's "r.js" to do the build, and almondjs for the lightweight AMD loading.

REM Set paths for modules you expect to be loaded by the page, or by a CDN, to "empty:"
REM   http://requirejs.org/docs/optimization.html#empty

REM r.js.cmd is the npm globally installed r.js command file.

call r.js.cmd -o baseUrl=../src name=../chrome/almond include=../chrome/main out=../all.min.js wrap=true paths.jquery=empty:
call r.js.cmd -o baseUrl=../src name=../chrome/almond include=../chrome/main out=../all.js wrap=true optimize=none paths.jquery=empty:

REM ----------
REM Sample output:

REM d:\dev\git_repos\grimbo-bookmarklets\bookmarklets\settlersonlinesimulator.com\chrome>build.bat
REM
REM Tracing dependencies for: chrome/almond
REM
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/all.js
REM ----------------
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/chrome/almond.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/adventures-page.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/units-required.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/full-adventure-info.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/sort-adventures.js
REM d:/dev/git_repos/grimbo-bookmarklets/bookmarklets/settlersonlinesimulator.com/chrome/main.js

Build both min and non-min version of all.js for Chrome.


REM --allow-incomplete-classpath due to missing XZ implementation
%GRAALVM_HOME%/bin/native-image --allow-incomplete-classpath --no-server -H:Name="DictionaryPC" com.hughes.android.dictionary.engine.Runner --no-fallback -cp bin/;commons-compress.jar;commons-text.jar;commons-lang3.jar;icu4j-49.1.jar -H:IncludeResources="com/ibm/icu/.*" -H:ReflectionConfigurationFiles=native-image-reflection.json

Add native-image.cmd to build a Windows native binary


@echo off
setlocal
set JING_HOME=%~d0%~p0..
%JAVA_HOME%\bin\java -Dant.home=%JING_HOME% -cp %JING_HOME%\lib\ant.jar;%JING_HOME%\lib\saxon.jar;%JING_HOME%\lib\crimson.jar;%JING_HOME%\lib\optional.jar;%JAVA_HOME%\lib\tools.jar;%JING_HOME%\lib\regex.jar;%JING_HOME%\lib\regex2.jar;%JING_HOME%\lib\isorelax.jar org.apache.tools.ant.Main -buildfile %JING_HOME%\build.xml %*

@echo off
setlocal
set JING_HOME=%~d0%~p0..
%JAVA_HOME%\bin\java -Dant.home=%JING_HOME% -cp %JING_HOME%\lib\ant.jar;%JING_HOME%\lib\crimson.jar;%JING_HOME%\lib\saxon.jar;%JING_HOME%\lib\optional.jar;%JAVA_HOME%\lib\tools.jar;%JING_HOME%\lib\regex.jar;%JING_HOME%\lib\regex2.jar;%JING_HOME%\lib\isorelax.jar org.apache.tools.ant.Main -buildfile %JING_HOME%\build.xml %*

Put crimson before saxon.

Put crimson before saxon.

git-svn-id: ca8e9bb6f3f9b50a093b443c23951d3c25ca0913@1197 369101cc-9a96-11dd-8e58-870c635edf7a


@echo off
setlocal
if not "%~1"=="" set GIT_HOME=%~f1
if "%GIT_HOME%"=="" call :FindGitHome "git.cmd"

if exist "%GIT_HOME%" goto :GitHomeOK

echo MsysGit installation directory not found.>&2
echo Try to give the directory name on the command line:>&2
echo   %0 "%ProgramFiles%\Git"
endlocal
exit /B 1

:GitHomeOK
set ERR=0

echo Installing gitle into "%GIT_HOME%"...

call :ChkGetopt getopt.exe || set ERR=1
if %ERR%==1 goto :End
echo getopt.exe... Found

if not exist "%GIT_HOME%\bin\git-le" goto :Install
echo GitFlow is already installed.>&2
set /p mychoice="Do you want to replace it [y/n]"
if "%mychoice%"=="y" goto :DeleteOldFiles
goto :Abort

:DeleteOldFiles
echo Deleting old files...
for /F %%i in ("%GIT_HOME%\git-le*" "%GIT_HOME%\gitle-*") do if exist "%%~fi" del /F /Q "%%~fi"

:Install
echo Copying files...
::goto :EOF
xcopy "%~dp0\..\git-le"            "%GIT_HOME%\bin"                 /Y /R /F
if errorlevel 4 if not errorlevel 5 goto :AccessDenied
if errorlevel 1 set ERR=1
xcopy "%~dp0\..\git-le*"           "%GIT_HOME%\bin"                 /Y /R /F || set ERR=1
xcopy "%~dp0\..\gitle-*"           "%GIT_HOME%\bin"                 /Y /R /F || set ERR=1

if %ERR%==1 choice /T 30 /C Y /D Y /M "Some unexpected errors happened. Sorry, you'll have to fix them by yourself."

:End
endlocal & exit /B %ERR%
goto :EOF

:AccessDenied
set ERR=1
echo.
echo You should run this script with "Full Administrator" rights:>&2
echo - Right-click with Shift on the script from the Explorer>&2
echo - Select "Run as administrator">&2
choice /T 30 /C YN /D Y /N >nul
goto :End

:Abort
echo Installation canceled.>&2
set ERR=1
goto :End

:ChkGetopt
:: %1 is getopt.exe
if exist "%GIT_HOME%\bin\%1" goto :EOF
if exist "%USERPROFILE%\bin\%1" goto :EOF
if exist "%~f$PATH:1" goto :EOF
echo %GIT_HOME%\bin\%1 not found.>&2
echo You have to install this file manually. See the GitFlow README.
exit /B 1

:FindGitHome
setlocal
set GIT_CMD_DIR=%~dp$PATH:1
if "%GIT_CMD_DIR%"=="" endlocal & goto :EOF
endlocal & set GIT_HOME=%GIT_CMD_DIR:~0,-5%
goto :EOF

@echo off
setlocal
if not "%~1"=="" set GIT_HOME=%~f1
if "%GIT_HOME%"=="" call :FindGitHome "git.cmd"

if exist "%GIT_HOME%" goto :GitHomeOK

echo MsysGit installation directory not found.>&2
echo Try to give the directory name on the command line:>&2
echo   %0 "%ProgramFiles%\Git"
endlocal
exit /B 1

:GitHomeOK
set ERR=0

echo Installing git-le into "%GIT_HOME%"...

call :ChkGetopt getopt.exe || set ERR=1
if %ERR%==1 goto :End
echo getopt.exe... Found

if not exist "%GIT_HOME%\bin\git-le" goto :Install
echo GitFlow is already installed.>&2
set /p mychoice="Do you want to replace it [y/n]"
if "%mychoice%"=="y" goto :DeleteOldFiles
goto :Abort

:DeleteOldFiles
echo Deleting old files...
for /F %%i in ("%GIT_HOME%\git-le*") do if exist "%%~fi" del /F /Q "%%~fi"

:Install
echo Copying files...
::goto :EOF
xcopy "%~dp0\..\git-le"            "%GIT_HOME%\bin"                 /Y /R /F
if errorlevel 4 if not errorlevel 5 goto :AccessDenied
if errorlevel 1 set ERR=1
xcopy "%~dp0\..\git-le*"           "%GIT_HOME%\bin"                 /Y /R /F || set ERR=1

if %ERR%==1 choice /T 30 /C Y /D Y /M "Some unexpected errors happened. Sorry, you'll have to fix them by yourself."

:End
endlocal & exit /B %ERR%
goto :EOF

:AccessDenied
set ERR=1
echo.
echo You should run this script with "Full Administrator" rights:>&2
echo - Right-click with Shift on the script from the Explorer>&2
echo - Select "Run as administrator">&2
choice /T 30 /C YN /D Y /N >nul
goto :End

:Abort
echo Installation canceled.>&2
set ERR=1
goto :End

:ChkGetopt
:: %1 is getopt.exe
if exist "%GIT_HOME%\bin\%1" goto :EOF
if exist "%USERPROFILE%\bin\%1" goto :EOF
if exist "%~f$PATH:1" goto :EOF
echo %GIT_HOME%\bin\%1 not found.>&2
echo You have to install this file manually. See the GitFlow README.
exit /B 1

:FindGitHome
setlocal
set GIT_CMD_DIR=%~dp$PATH:1
if "%GIT_CMD_DIR%"=="" endlocal & goto :EOF
endlocal & set GIT_HOME=%GIT_CMD_DIR:~0,-5%
goto :EOF

add msysgit install script

add msysgit install script


if "%APPVEYOR_REPO_TAG%" NEQ "True" goto :ok

set HERE=%~dp0

git tag -a %APPVEYOR_BUILD_VERSION% -m "Release vesion %APPVEYOR_BUILD_VERSION%" || goto :ko
git push --tags https://%GITHUB_TOKEN%:@github.com/pchalamet/full-build.git || goto :ko

%HERE%tools\github-release.exe release ^
                         --user pchalamet ^
                         --repo full-build ^
						 --tag %APPVEYOR_BUILD_VERSION% ^
						 --name "full-build %APPVEYOR_BUILD_VERSION%" ^
                         --description "%APPVEYOR_PROJECT_NAME% %APPVEYOR_BUILD_VERSION% - %PLATFORM% %CONFIGURATION%" ^
                         --pre-release || goto :ko

%HERE%tools\github-release upload ^
                     --user pchalamet ^
					 --repo full-build ^
                     --tag %APPVEYOR_BUILD_VERSION% ^
                     --name "%APPVEYOR_PROJECT_NAME%-net45-%PLATFORM%" ^
                     --file %HERE%/src/bin/%CONFIGURATION%.zip || goto :ko

:ok
exit /b 0

:ko
exit /b 5

if "%APPVEYOR_REPO_TAG%" NEQ "True" goto :ok

set HERE=%~dp0

git tag -a %APPVEYOR_BUILD_VERSION% -m "Release vesion %APPVEYOR_BUILD_VERSION%" || goto :ko
git push --tags https://%GITHUB_TOKEN%@github.com/pchalamet/full-build.git || goto :ko

%HERE%tools\github-release.exe release ^
                         --user pchalamet ^
                         --repo full-build ^
						 --tag %APPVEYOR_BUILD_VERSION% ^
						 --name "full-build %APPVEYOR_BUILD_VERSION%" ^
                         --description "%APPVEYOR_PROJECT_NAME% %APPVEYOR_BUILD_VERSION% - %PLATFORM% %CONFIGURATION%" ^
                         --pre-release || goto :ko

%HERE%tools\github-release upload ^
                     --user pchalamet ^
					 --repo full-build ^
                     --tag %APPVEYOR_BUILD_VERSION% ^
                     --name "%APPVEYOR_PROJECT_NAME%-net45-%PLATFORM%" ^
                     --file %HERE%/src/bin/%CONFIGURATION%.zip || goto :ko

:ok
exit /b 0

:ko
exit /b 5

fix token

fix token


@setlocal enableextensions enabledelayedexpansion & set "PATH0=%~f0" & PowerShell.exe -Command "& (Invoke-Expression -Command ('{#' + ((Get-Content '!PATH0:'=''!') -join \"`n\") + '}'))" %* & exit /b !errorlevel!
#
# - Name
#     Install-Vim.bat
#
# - Contents
#     Install Vim.
#
# - Reference
#     PowerShell on *.bat - http://pf-j.sakura.ne.jp/program/tips/ps1bat2.htm
#     Vim - KaoriYa - https://www.kaoriya.net/software/vim/
#
# - Revision
#     2016-05-24 created.
#     yyyy-MM-dd modified.
#

################
# constant
################
$psDir = "$env:USERPROFILE\Documents\WindowsPowerShell"; if (-Not(Test-Path -Path $psDir)) { mkdir $psDir }
$psProfile = "$psDir\Microsoft.PowerShell_profile.ps1"
$vimZip = "$docDir\vim.zip"
$vimUri = 'https://github.com/koron/vim-kaoriya/releases/download/v8.0.0596-20170502/vim80-kaoriya-win64-8.0.0596-20170502.zip'

################
# main
################
# Get vim.zip.
Invoke-RestMethod -Uri $vimUri -OutFile $vimZip -UseBasicParsing

# Unzip vim.zip.
$shApp = New-Object -Com shell.application
$unzip = $shApp.NameSpace($vimZip)
foreach ($item in $unzip.items()) { $shApp.Namespace("$env:USERPROFILE\Documents").copyhere($item, 0x8); }

# Get the full path of the vim.exe.
$vimExe = (Get-Item "$env:USERPROFILE\Documents\vim*\vim.exe").FullName

# If there is no description about Vim in Profile,
if (-Not((Get-Content $psProfile | Select-String '# vim').Matches.Success))
{
    # Add a description about Vim.
    Write-Output "# vim`r`nNew-Alias vi $vimExe`r`nNew-Alias vim $vimExe`r`nfunction view() { $vimExe -R `$args }`r`n" >> $psProfile
}

# Display Profile information.
Get-Item $psProfile
Get-Content $psProfile

# EOF

@setlocal enableextensions enabledelayedexpansion & set "PATH0=%~f0" & PowerShell.exe -Command "& (Invoke-Expression -Command ('{#' + ((Get-Content '!PATH0:'=''!') -join \"`n\") + '}'))" %* & exit /b !errorlevel!
#
# - Name
#     Install-Vim.bat
#
# - Contents
#     Install Vim.
#
# - Reference
#     PowerShell on *.bat - http://pf-j.sakura.ne.jp/program/tips/ps1bat2.htm
#     Vim - KaoriYa - https://www.kaoriya.net/software/vim/
#
# - Revision
#     2016-05-24 created.
#     yyyy-MM-dd modified.
#

################
# constant
################
$psDir = "$env:USERPROFILE\Documents\WindowsPowerShell"; if (-Not(Test-Path -Path $psDir)) { mkdir $psDir }
$psProfile = "$psDir\Microsoft.PowerShell_profile.ps1"
$vimZip = "$env:USERPROFILE\Documents\vim.zip"
$vimUri = 'https://github.com/koron/vim-kaoriya/releases/download/v8.0.0596-20170502/vim80-kaoriya-win64-8.0.0596-20170502.zip'

################
# main
################
# Get vim.zip.
if (-Not(Test-Path -Path $vimZip)) { Invoke-RestMethod -Uri $vimUri -OutFile $vimZip -UseBasicParsing }

# Unzip vim.zip.
if (-Not(Test-Path -Path $vimZip))
{
    if (-Not(Test-Path -Path "$env:USERPROFILE\Documents\vim*\vim.exe"))
    {
        $shApp = New-Object -Com shell.application
        $unzip = $shApp.NameSpace($vimZip)
        foreach ($item in $unzip.items()) { $shApp.Namespace("$env:USERPROFILE\Documents").copyhere($item, 0x8); }
    }
}
else
}
    Write-Output "[ERROR]: Failed to download from Uri($vimUri)."
    exit 1
}

# Get the full path of the vim.exe.
if (Test-Path -Path "$env:USERPROFILE\Documents\vim*\vim.exe")
{
    $vimExe = (Get-Item "$env:USERPROFILE\Documents\vim*\vim.exe").FullName
}
else
{
    Write-Output "[ERROR]: Failed to unzip file($vimZip)."
    exit 1
}

# If there is no description about Vim in Profile,
if (-Not((Get-Content $psProfile | Select-String '# vim').Matches.Success))
{
    # Add a description about Vim.
    Write-Output "# vim`r`nNew-Alias vi $vimExe`r`nNew-Alias vim $vimExe`r`nfunction view() { $vimExe -R `$args }`r`n" >> $psProfile
}

# Display Profile information.
Get-Item $psProfile
Write-Output '================'
Get-Content $psProfile
Write-Output '================'

Update Install-Vim.bat

Update Install-Vim.bat


;= echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here

clear=cls
cmderr=cd /d "%CMDER_ROOT%"
e.=explorer .
gvim="C:\Program Files (x86)\Vim\vim80\gvim.exe" $*
history=cat "%CMDER_ROOT%\config\.history"
ll=ls -l -h --show-control-chars -F --color $*
ls=ls --show-control-chars -F --color $*
nuget="C:\workspace\nuget\nuget.exe" $*
pip2="C:\Program Files\Anaconda2\Scripts\pip.exe" $*
pip3="C:\Program Files\Anaconda3\Scripts\pip.exe" $*
pwd=cd
unalias=alias /d $1
vi=vim $*
vim="C:\Program Files (x86)\Vim\vim80\vim.exe" $*
vimdiff="C:\Program Files (x86)\Vim\vim80\vim.exe" -d $*
vsdevcmd="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat"
vsmsbuild="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsMSBuildCmd.bat"

;= Git
g=git $*

;= Git Add
ga=git add --verbose $*
gae=git add --verbose --edit $*
gai=git add --verbose --interactive $*
gap=git add --verbose --patch $*
gau=git add --verbose --update $*

;= Git Branch
gb=git branch -vv $*
gba=git branch -vv --all $*
gbc=git checkout -b $*
gbd=git branch --delete $*
gbm=git branch --move $*
gbs=git show-branch $*

;= Git Commit
gc=git commit -v $*
gca=git commit -v --all $*
gcF=git commit -v --amend $*
gcm=git commit --message $*
gcp=git cherry-pick --ff $*
gcS=git commit --gpg-sign $*
gcSF=git commit --amend --gpg-sign $*
gco=git checkout $*
gcs=git show $*

;= Git Diff
gd=git diff $*
gdc=git diff --cached $*

;= Git Fetch
gf=git fetch --all --tags --prune $*
gfc=git clone $*
gfcr=git clone --recurse-submodules $*
gfm=git pull
gfr=git pull --rebase
gfx="C:\workspace\aliases\gfx.cmd" $*
gfu=git remote --verbose update --prune $*

;= Git Grep
gg=git grep $*
ggi=git grep --interactive $*
ggl=git grep --files-with-matches $*
ggv=git grep --invert-match $*
ggw=git grep --word-regexp $*

;= Git Index
gia=git add $*
gid=git diff --cached $*
gir=git reset $*

;= Git Log Author
gl=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ai %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" $*
gla=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ai %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all $*
glag=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ai %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all --graph $*
gld=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ai %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent $*
gldp=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ai %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent --patch $*
glg=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ai %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --graph $*

;= Git Log Committer
glc=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%ci %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" $*
glca=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%ci %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all $*
glcag=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%ci %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all --graph $*
glcd=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%ci %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent $*
glcdp=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%ci %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent --patch $*
glcg=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%ci %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --graph $*

gls=git log --topo-order --stat --pretty=format:"${_git_log_medium_format}" $*

;= Git Merge
gm=git merge $*
gma=git merge --abort $*
gmt=git mergetool $*

;= Git Push
gp=git push $*
gpt=git push --tags $*

;= Git Rebase
gr=git rebase $*
gra=git rebase --abort $*
grc=git rebase --continue $*
gri=git rebase --interactive $*

;= Git Remote

;= Git Stash
gs=git stash $*
gsa=git stash apply $*
gsd=git stash show --patch --stat $*
gsx=git stash drop $*
gsl=git stash list $*
gsp=git stash pop $*
gss=git stash save --include-untracked $*

;= Git Working Copy
gwa=git add --verbose $*
gws=git status $*
gwd=git diff $*
gwr=git reset --soft $*
gwc=git clean $*

;= echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here

clear=cls
cmderr=cd /d "%CMDER_ROOT%"
e.=explorer .
gvim="C:\Program Files (x86)\Vim\vim80\gvim.exe" $*
history=cat "%CMDER_ROOT%\config\.history"
ll=ls -l -h --show-control-chars -F --color $*
ls=ls --show-control-chars -F --color $*
nuget="C:\workspace\nuget\nuget.exe" $*
pip2="C:\Program Files\Anaconda2\Scripts\pip.exe" $*
pip3="C:\Program Files\Anaconda3\Scripts\pip.exe" $*
pwd=cd
unalias=alias /d $1
vi=vim $*
vim="C:\Program Files (x86)\Vim\vim80\vim.exe" $*
vimdiff="C:\Program Files (x86)\Vim\vim80\vim.exe" -d $*
vsdevcmd="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat"
vsmsbuild="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsMSBuildCmd.bat"

;= Git
g=git $*

;= Git Add
ga=git add --verbose $*
gae=git add --verbose --edit $*
gad=git add --verbose --interactive $*
gap=git add --verbose --patch $*
gau=git add --verbose --update $*

;= Git Branch
gb=git branch -vv $*
gba=git branch -vv --all $*
gbc=git checkout -b $*
gbd=git branch --delete $*
gbm=git branch --move $*
gbs=git show-branch $*

;= Git Commit
gc=git commit -v $*
gca=git commit -v --all $*
gcF=git commit -v --amend $*
gcm=git commit --message $*
gcp=git cherry-pick --ff $*
gcS=git commit --gpg-sign $*
gcSF=git commit --amend --gpg-sign $*
gco=git checkout $*
gcs=git show $*

;= Git Diff
gd=git diff $*
gdc=git diff --cached $*

;= Git Fetch
gf=git fetch --all --tags --prune $*
gfc=git clone $*
gfcr=git clone --recurse-submodules $*
gfm=git pull
gfr=git pull --rebase
gfx="C:\workspace\aliases\gfx.cmd" $*
gfu=git remote --verbose update --prune $*

;= Git Grep
gg=git grep $*
ggi=git grep --interactive $*
ggl=git grep --files-with-matches $*
ggv=git grep --invert-match $*
ggw=git grep --word-regexp $*

;= Git Index
gia=git add $*
gid=git diff --cached $*
gir=git reset $*

;= Git Log Author
gl=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ad %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" $*
gla=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ad %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all $*
glag=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ad %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all --graph $*
gld=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ad %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent $*
gldp=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ad %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent --patch $*
glg=git log --topo-order --pretty=format:"%C(4)%aN %C(7)<%aE> %C(4)%ar %C(3)%ad %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --graph $*

;= Git Log Committer
glc=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%cd %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" $*
glca=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%cd %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all $*
glcag=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%cd %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --all --graph $*
glcd=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%cd %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent $*
glcdp=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%cd %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --no-merges --first-parent --patch $*
glcg=git log --topo-order --pretty=format:"%C(4)%cN %C(7)<%cE> %C(4)%cr %C(3)%cd %C(2)%h%C(3)%d %C(7)%<(80,trunc)%s" --graph $*

gls=git log --topo-order --stat --pretty=format:"${_git_log_medium_format}" $*

;= Git Merge
gm=git merge $*
gma=git merge --abort $*
gmt=git mergetool $*

;= Git Push
gp=git push $*
gpt=git push --tags $*

;= Git Rebase
gr=git rebase $*
gra=git rebase --abort $*
grc=git rebase --continue $*
gri=git rebase --interactive $*

;= Git Remote

;= Git Stash
gs=git stash $*
gsa=git stash apply $*
gsd=git stash show --patch --stat $*
gsx=git stash drop $*
gsl=git stash list $*
gsp=git stash pop $*
gss=git stash save --include-untracked $*

;= Git Working Copy
gwa=git add --verbose $*
gws=git status $*
gwd=git diff $*
gwr=git reset --soft $*
gwc=git clean $*

Change windows git log aliases to use %ad and %cd


rmdir /s /q app\cache\dev
rmdir /s /q app\cache\prod
rem php app/console cache:clear
php app/console assets:install web --symlink

add cc.bat

add cc.bat


setlocal
set MAGENTO_PLUGIN=C:\projects\channelengine-magento
set MAGENTO_ROOT=C:\projects\magento

echo %MAGENTO_PLUGIN%
echo %MAGENTO_ROOT%

mklink "%MAGENTO_ROOT%\app\etc\modules\Tritac_ChannelEngine.xml" "%MAGENTO_PLUGIN%\app\etc\modules\Tritac_ChannelEngine.xml"
mklink "%MAGENTO_ROOT%\app\design\frontend\base\default\layout\channelengine.xml" "%MAGENTO_PLUGIN%\app\design\frontend\base\default\layout\channelengine.xml"

mklink /D "%MAGENTO_ROOT%\app\code\community\Tritac\ChannelEngine" "%MAGENTO_PLUGIN%\app\code\community\Tritac\ChannelEngine"
mklink /D "%MAGENTO_ROOT%\app\design\adminhtml\default\default\template\channelengine" "%MAGENTO_PLUGIN%\app\design\adminhtml\default\default\template\channelengine"
mklink /D "%MAGENTO_ROOT%\app\design\frontend\base\default\template\channelengine" "%MAGENTO_PLUGIN%\app\design\frontend\base\default\template\channelengine"
mklink /D "%MAGENTO_ROOT%\lib\Tritac\ChannelEngineApiClient" "%MAGENTO_PLUGIN%\lib\Tritac\ChannelEngineApiClient"

Add symlink script

Add symlink script


setenv bootargs console=${console} console=tty1 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
load mmc 0:1 ${fdt_addr_r} ${fdtfile} || load mmc 0:1 ${fdt_addr_r} boot/${fdtfile}
load mmc 0:1 ${kernel_addr_r} zImage || load mmc 0:1 ${kernel_addr_r} boot/zImage || load mmc 0:1 ${kernel_addr_r} uImage || load mmc 0:1 ${kernel_addr_r} boot/uImage
bootz ${kernel_addr_r} - ${fdt_addr_r} || bootm ${kernel_addr_r} - ${fdt_addr_r}

# Default to (primary) SD
rootdev=mmcblk0p2
if itest.b *0x28 == 0x02 ; then
	# U-Boot loaded from eMMC or secondary SD so use it for rootfs too
	echo "U-boot loaded from eMMC or secondary SD"
	rootdev=mmcblk1p2
fi
setenv bootargs console=${console} console=tty1 root=/dev/${rootdev} rootwait panic=10 ${extra}
load mmc 0:1 ${fdt_addr_r} ${fdtfile} || load mmc 0:1 ${fdt_addr_r} boot/${fdtfile}
load mmc 0:1 ${kernel_addr_r} zImage || load mmc 0:1 ${kernel_addr_r} boot/zImage || load mmc 0:1 ${kernel_addr_r} uImage || load mmc 0:1 ${kernel_addr_r} boot/uImage
bootz ${kernel_addr_r} - ${fdt_addr_r} || bootm ${kernel_addr_r} - ${fdt_addr_r}

adjust root for eMMC boot

u-boot: adjust root for eMMC boot

Adjust the bootscript so that if U-Boot is loaded from the eMMC, then
kernel "root" parameter is set to use eMMC second partition.

Signed-off-by: Diego Rondini <f48a046fa74db96735a4084e98d9bb18d62ce377@kynetics.com>


taskkill /F /IM Webshop.exe

SET dest=%~dp0../test

if not exist "%dest%" mkdir "%dest%"
xcopy /Y /s "%~dp0bin\Debug" "%dest%"

SET webDest="%dest%/webContent"

if not exist %webDest% mkdir %webDest%
xcopy /Y /s "%~dp0webContent\web" %webDest%

copy /Y "%~dp0startApp.bat" "%dest%/startApp.bat"
START "" "%dest%/startApp.bat"

taskkill /F /IM Webshop.exe

SET dest=%~dp0productionEnv

if not exist "%dest%" mkdir "%dest%"
xcopy /Y /s "%~dp0bin\Debug" "%dest%"

SET webDest="%dest%/webContent"

if not exist %webDest% mkdir %webDest%
xcopy /Y /s "%~dp0webContent\web" %webDest%

copy /Y "%~dp0startApp.bat" "%dest%/startApp.bat"
START "" "%dest%/startApp.bat"

update deploy script

update deploy script


@ECHO OFF
SETLOCAL
TITLE Building Notepad2...
SET NOTEPAD_VERSION=4.1.24
SET PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621

SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
CALL build_x64.cmd

rem Get the revision
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "buildnum=%%K"&Call :SubRevNumber %%buildnum:*Z=%%)

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

CALL :SubInstaller

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
ECHO:Notepad2-mod.zip created successfully!

POPD
GOTO :END

:END
TITLE Finished!
ECHO. && ECHO.
ENDLOCAL && PAUSE
EXIT

:SubZipFiles
TITLE Creating the ZIP files...
ECHO.

MD "temp_zip" >NUL 2>&1
MD "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\ReadMe-mod.txt" "temp_zip\Readme.txt" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NOTEPAD_VERSION%_r%buildnum%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "ReadMe.txt" >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

ECHO:Notepad2-mod.%NOTEPAD_VERSION%_r%buildnum%_%2.zip created successfully!
MOVE /Y "Notepad2-mod.%NOTEPAD_VERSION%_r%buildnum%_%2.zip" "..\packages" >NUL 2>&1
ECHO.
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF NOT DEFINED VS100COMNTOOLS (
  ECHO:Visual Studio 2010 NOT FOUND!!! && PAUSE
  ECHO.
  GOTO :ErrorDetected
)

TITLE Building installer...
ECHO:Building installer...

PUSHD ..\distrib
MD binaries\x86-32 >NUL 2>&1
MD binaries\x86-64 >NUL 2>&1

COPY /B /V /Y ..\Release\Notepad2.exe binaries\x86-32\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-32\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-32\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-32\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-32\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-32\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-32\readme.txt
rem Set the revision for the DisplayVersion
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%buildnum% binaries\x86-32\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-32\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-32\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-32 res\cabinet.x86-32.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-32 >NUL 2>&1

COPY /B /V /Y ..\Release_x64\Notepad2.exe binaries\x86-64\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-64\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-64\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-64\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-64\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-64\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-64\readme.txt
rem Set the revision for the DisplayVersion
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%buildnum% binaries\x86-64\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-64\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-64\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-64 res\cabinet.x86-64.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-64 >NUL 2>&1
RD /q binaries >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Full|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

"%PERL_PATH%\perl\bin\perl.exe" addon_build.pl

MD ..\wdkbuild\packages >NUL 2>&1
MOVE setup.x86-32\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-32.7z >NUL
MOVE setup.x86-32\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-32.exe >NUL
MOVE setup.x86-32\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-32.exe >NUL
MOVE setup.x86-64\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-64.7z >NUL
MOVE setup.x86-64\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-64.exe >NUL
MOVE setup.x86-64\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-64.exe >NUL

RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD /Q /S addon >NUL 2>&1
RD /Q /S obj >NUL 2>&1

POPD
GOTO :EOF

:SubRevNumber
SET buildnum=%*
GOTO :EOF

:ErrorDetected
ECHO. && ECHO.
ECHO:Compilation FAILED!!!
ECHO. && ECHO.
ENDLOCAL
PAUSE
EXIT

@ECHO OFF
SETLOCAL
TITLE Building Notepad2...
SET PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621

SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
CALL build_x64.cmd

rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NOTEPAD_VERSION=%VerMajor%.%VerMinor%.%VerBuild%

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

CALL :SubInstaller

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
ECHO:Notepad2-mod.zip created successfully!

POPD
GOTO :END

:END
TITLE Finished!
ECHO. && ECHO.
ENDLOCAL && PAUSE
EXIT

:SubZipFiles
TITLE Creating the ZIP files...
ECHO.

MD "temp_zip" >NUL 2>&1
MD "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\ReadMe-mod.txt" "temp_zip\Readme.txt" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NOTEPAD_VERSION%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "ReadMe.txt" >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

ECHO:Notepad2-mod.%NOTEPAD_VERSION%_r%VerRev%_%2.zip created successfully!
MOVE /Y "Notepad2-mod.%NOTEPAD_VERSION%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
ECHO.
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF NOT DEFINED VS100COMNTOOLS (
  ECHO:Visual Studio 2010 NOT FOUND!!! && PAUSE
  ECHO.
  GOTO :ErrorDetected
)

TITLE Building installer...
ECHO:Building installer...

PUSHD ..\distrib
MD binaries\x86-32 >NUL 2>&1
MD binaries\x86-64 >NUL 2>&1

COPY /B /V /Y ..\Release\Notepad2.exe binaries\x86-32\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-32\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-32\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-32\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-32\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-32\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-32\readme.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%VerRev% binaries\x86-32\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-32\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-32\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-32 res\cabinet.x86-32.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-32 >NUL 2>&1

COPY /B /V /Y ..\Release_x64\Notepad2.exe binaries\x86-64\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-64\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-64\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-64\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-64\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-64\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-64\readme.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%VerRev% binaries\x86-64\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-64\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-64\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-64 res\cabinet.x86-64.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-64 >NUL 2>&1
RD /q binaries >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Full|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

"%PERL_PATH%\perl\bin\perl.exe" addon_build.pl

MD ..\wdkbuild\packages >NUL 2>&1
MOVE setup.x86-32\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-32.7z >NUL
MOVE setup.x86-32\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-32.exe >NUL
MOVE setup.x86-32\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-32.exe >NUL
MOVE setup.x86-64\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-64.7z >NUL
MOVE setup.x86-64\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-64.exe >NUL
MOVE setup.x86-64\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-64.exe >NUL

RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD /Q /S addon >NUL 2>&1
RD /Q /S obj >NUL 2>&1

POPD
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:ErrorDetected
ECHO. && ECHO.
ECHO:Compilation FAILED!!!
ECHO. && ECHO.
ENDLOCAL
PAUSE
EXIT

update make_packages.bat to get Notepad2's version automatically


@ECHO OFF
setlocal
SET ALLYPATH=..\
SET ALLYCOM=%ALLYPATH%components\

set PYTHONPATH=%ALLYCOM%ally
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-plugin
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-api
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-sqlalchemy
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-asyncore-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-mongrel2-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%service-cdm
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%service-gateway
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%service-gateway-recaptcha

SET ALLYPLUG=%ALLYPATH%plugins\

set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%administration
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gateway
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gateway_captcha
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-action
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-core
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-security
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%internationalization
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%security
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%security-rbac
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-acl
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-cdm
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-sqlalchemy

SET FULLPATH=
SET SUPERPLUG=%FULLPATH%plugins\
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%binary-gm
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%binary-ffmpeg
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%binary-exiv2
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk-sync
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk-embed
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-audio
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-image
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-video
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-address
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-article
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-security
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-collaborator
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-country
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-language
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-person
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-person-icon
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-post
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-source
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-user
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%support
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%url-info
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%content-article
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%content-packager
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%content-publisher
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%frontline
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%frontline-inlet

IF NOT EXIST distribution\application.properties python distribution\application.py -dump

python distribution\application.py

@ECHO OFF
setlocal
SET ALLYPATH=..\
SET ALLYCOM=%ALLYPATH%components\

set PYTHONPATH=%ALLYCOM%ally
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-plugin
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-api
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-core-sqlalchemy
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-asyncore-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%ally-http-mongrel2-server
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%service-cdm
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%service-gateway
set PYTHONPATH=%PYTHONPATH%;%ALLYCOM%service-gateway-recaptcha

SET ALLYPLUG=%ALLYPATH%plugins\

set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%administration
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gateway
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gateway_captcha
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-action
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-core
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%gui-security
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%internationalization
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%security
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%security-rbac
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-acl
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-cdm
set PYTHONPATH=%PYTHONPATH%;%ALLYPLUG%support-sqlalchemy

SET FULLPATH=
SET SUPERPLUG=%FULLPATH%plugins\
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%binary-gm
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%binary-ffmpeg
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%binary-exiv2
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk-sync
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%livedesk-embed
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-audio
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-image
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%media-archive-video
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-address
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-article
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-security
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-collaborator
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-country
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-language
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-person
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-person-icon
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-post
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-source
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-user
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%superdesk-verification
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%support
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%url-info
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%content-article
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%content-packager
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%content-publisher
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%frontline
set PYTHONPATH=%PYTHONPATH%;%SUPERPLUG%frontline-inlet

IF NOT EXIST distribution\application.properties python distribution\application.py -dump

python distribution\application.py

hide comments

LB-1160: hide comments

start-sources.bat change


mkdir "/Equipment/TrolleyInterface/Settings"
mkdir "/Equipment/TrolleyInterface/Monitor"
mkdir "/Equipment/TrolleyInterface/Hardware"

create SHORT "/Equipment/TrolleyInterface/Hardware/Pressure Sensor Calibration[7]"

cd "/Equipment/TrolleyInterface/Monitor"

create BOOL "Barcode Error"
create BOOL "Temperature Interrupt"
create BOOL "Power Supply Status[3]"
create BOOL "Read Thread Active"
create BOOL "Control Thread Active"
create BOOL "NMR Check Sum"
create BOOL "Config Check Sum"
create BOOL "Frame Check Sum"
create FLOAT "Power Factor"
create FLOAT "Temperature In"
create FLOAT "Temperature Ext1"
create FLOAT "Pressure Temperature"
create FLOAT "Pressure"
create FLOAT "Vmin 1"
create FLOAT "Vmax 1"
create FLOAT "Vmin 2"
create FLOAT "Vmax 2"
create INT "Data Frame Index"
create INT "Buffer Load"
create INT "Interface Buffer Load"
create INT "FIFO Status"
create STRING "Current Mode"

cd "/Equipment/TrolleyInterface/Settings"
create BOOL "Root Output"
set "Root Output" false
create STRING "Root Dir[1][256]"
set "Root Dir" "/home/newg2/Applications/field-daq/resources/Root/"
create BOOL "Simulation Switch"
set "Simulation Switch" false
create INT "Cmd"
set "Cmd" 0

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Simulation"
cd "/Equipment/TrolleyInterface/Settings/Simulation"
create STRING "Data Source[1][256]"
set "Data Source" "/home/newg2/Applications/field-daq/resources/NMRDataTemp/data-2017-02-28_20-08-11.dat"

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Sg382"
cd "/Equipment/TrolleyInterface/Settings/Sg382"
create DOUBLE "RF Frequency"
create DOUBLE "RF Amplitude"
set "RF Frequency" 61.666
set "RF Amplitude" 13.8

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Trolley Power"
cd "/Equipment/TrolleyInterface/Settings/Trolley Power"
create INT "Voltage"
set "Voltage" 174

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Run Config"
cd "/Equipment/TrolleyInterface/Settings/Run Config"
create STRING "Mode"
create STRING "Idle Mode"
create INT "Debug Level"
set "Mode" "Continuous"
set "Idle Mode" "Idle"
set "Debug Level" 1
mkdir "Continuous"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Continuous"
create INT "Baseline Cycles"
set "Baseline Cycles" 5
cd "/Equipment/TrolleyInterface/Settings/Run Config"
mkdir "Idle"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Idle"
create BOOL "Read Barcode"
set "Read Barcode" true
cd "/Equipment/TrolleyInterface/Settings/Run Config"
mkdir "Sleep"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Sleep"
create BOOL "Power Down"
set "Power Down" false
cd "/Equipment/TrolleyInterface/Settings/Run Config"
mkdir "Interactive"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Interactive"
create INT "Trigger"
create INT "Repeat"
set "Trigger" 0
set "Repeat" 1

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Cycle"
cd "/Equipment/TrolleyInterface/Settings/Cycle"

create INT "Interface Comm Stop"
create INT "Trolley Comm Start"
create INT "Trolley Comm Data Start"
create INT "Trolley Comm Stop"
create INT "Switch To RF"
create INT "Power ON"
create INT "RF Enable"
create INT "Switch To Comm"
create INT "Interface Comm Start"
create INT "Cycle Length"
create INT "RF Prescale"
create INT "Switch RF Offset"
create INT "Switch Comm Offset"

set "Interface Comm Stop" 40
set "Trolley Comm Start" 200
set "Trolley Comm Data Start" 1200
set "Trolley Comm Stop" 13150
set "Switch To RF" 13250
set "Power ON" 12750
set "RF Enable" 12250
set "Switch To Comm" 28350
set "Interface Comm Start" 28390
set "Cycle Length" 29410
set "RF Prescale" 62
set "Switch RF Offset" 100
set "Switch Comm Offset" 100

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Probe"
cd "/Equipment/TrolleyInterface/Settings/Probe"
create STRING "Source[1][256]"
set Source "Odb"
create STRING "Script Dir[1][256]"
set "Script Dir" "/home/newg2/Applications/field-daq/online/TrolleyProbeScripts/"
create STRING "Script[1][256]"
set "Script" "Test"

mkdir "Probe0"
cd "Probe0"
create INT "Probe ID"
create INT "Probe Enable"
create INT "Preamp Delay"
create INT "Preamp Period"
create INT "ADC Gate Delay"
create INT "ADC Gate Offset"
create INT "ADC Gate Period"
create INT "TX Delay"
create INT "TX Period"
create INT "User Data"
set "Probe ID" 0
set "Probe Enable" 0
set "Preamp Delay" 373
set "Preamp Period" 14000
set "ADC Gate Delay" 0
set "ADC Gate Offset" 0
set "ADC Gate Period" 15000
set "TX Delay" 300
set "TX Period" 450
set "User Data" 8606
cd "/Equipment/TrolleyInterface/Settings/Probe"
cp "Probe0" "Probe1"
cp "Probe0" "Probe2"
cp "Probe0" "Probe3"
cp "Probe0" "Probe4"
cp "Probe0" "Probe5"
cp "Probe0" "Probe6"
cp "Probe0" "Probe7"
cp "Probe0" "Probe8"
cp "Probe0" "Probe9"
cp "Probe0" "Probe10"
cp "Probe0" "Probe11"
cp "Probe0" "Probe12"
cp "Probe0" "Probe13"
cp "Probe0" "Probe14"
cp "Probe0" "Probe15"
cp "Probe0" "Probe16"
set "Probe1/Probe ID" 1
set "Probe2/Probe ID" 2
set "Probe3/Probe ID" 3
set "Probe4/Probe ID" 4
set "Probe5/Probe ID" 5
set "Probe6/Probe ID" 6
set "Probe7/Probe ID" 7
set "Probe8/Probe ID" 8
set "Probe9/Probe ID" 9
set "Probe10/Probe ID" 10
set "Probe11/Probe ID" 11
set "Probe12/Probe ID" 12
set "Probe13/Probe ID" 13
set "Probe14/Probe ID" 14
set "Probe15/Probe ID" 15
set "Probe16/Probe ID" 16
set "Probe0/Probe Enable" 1

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Barcode"
cd "/Equipment/TrolleyInterface/Settings/Barcode"
create INT "LED Voltage"
create INT "Sample Period"
create INT "Acq Delay"
set "LED Voltage" 1024
set "Sample Period" 2000
set "Acq Delay" 16

cd "/Equipment/TrolleyInterface/Settings"
cp "/Equipment/TrolleyInterface/Settings/Cycle" "/Equipment/TrolleyInterface/Monitor/Cycle"
cp "/Equipment/TrolleyInterface/Settings/Barcode" "/Equipment/TrolleyInterface/Monitor/Barcode"

mkdir "/Equipment/TrolleyInterface/Settings"
mkdir "/Equipment/TrolleyInterface/Monitor"
mkdir "/Equipment/TrolleyInterface/Hardware"

create SHORT "/Equipment/TrolleyInterface/Hardware/Pressure Sensor Calibration[7]"

cd "/Equipment/TrolleyInterface/Monitor"

create BOOL "Barcode Error"
create BOOL "Temperature Interrupt"
create BOOL "Power Supply Status[3]"
create BOOL "Read Thread Active"
create BOOL "Control Thread Active"
create BOOL "NMR Check Sum"
create BOOL "Config Check Sum"
create BOOL "Frame Check Sum"
create FLOAT "Power Factor"
create FLOAT "Temperature In"
create FLOAT "Temperature Ext1"
create FLOAT "Pressure Temperature"
create FLOAT "Pressure"
create FLOAT "Vmin 1"
create FLOAT "Vmax 1"
create FLOAT "Vmin 2"
create FLOAT "Vmax 2"
create INT "Data Frame Index"
create INT "Buffer Load"
create INT "Interface Buffer Load"
create INT "FIFO Status"
create STRING "Current Mode"

cd "/Equipment/TrolleyInterface/Settings"
create BOOL "Root Output"
set "Root Output" false
create STRING "Root Dir[1][256]"
set "Root Dir" "/home/newg2/Applications/field-daq/resources/Root/"
create BOOL "Simulation Switch"
set "Simulation Switch" false
create INT "Cmd"
set "Cmd" 0

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Simulation"
cd "/Equipment/TrolleyInterface/Settings/Simulation"
create STRING "Data Source[1][256]"
set "Data Source" "/home/newg2/Applications/field-daq/resources/NMRDataTemp/data-2017-02-28_20-08-11.dat"

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Trolley Power"
cd "/Equipment/TrolleyInterface/Settings/Trolley Power"
create INT "Voltage"
set "Voltage" 174

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Run Config"
cd "/Equipment/TrolleyInterface/Settings/Run Config"
create STRING "Mode"
create STRING "Idle Mode"
create INT "Debug Level"
set "Mode" "Continuous"
set "Idle Mode" "Idle"
set "Debug Level" 1
mkdir "Continuous"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Continuous"
create INT "Baseline Cycles"
set "Baseline Cycles" 5
cd "/Equipment/TrolleyInterface/Settings/Run Config"
mkdir "Idle"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Idle"
create BOOL "Read Barcode"
set "Read Barcode" true
cd "/Equipment/TrolleyInterface/Settings/Run Config"
mkdir "Sleep"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Sleep"
create BOOL "Power Down"
set "Power Down" false
cd "/Equipment/TrolleyInterface/Settings/Run Config"
mkdir "Interactive"
cd "/Equipment/TrolleyInterface/Settings/Run Config/Interactive"
create INT "Trigger"
create INT "Repeat"
set "Trigger" 0
set "Repeat" 1

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Cycle"
cd "/Equipment/TrolleyInterface/Settings/Cycle"

create INT "Interface Comm Stop"
create INT "Trolley Comm Start"
create INT "Trolley Comm Data Start"
create INT "Trolley Comm Stop"
create INT "Switch To RF"
create INT "Power ON"
create INT "RF Enable"
create INT "Switch To Comm"
create INT "Interface Comm Start"
create INT "Cycle Length"
create INT "RF Prescale"
create INT "Switch RF Offset"
create INT "Switch Comm Offset"

set "Interface Comm Stop" 40
set "Trolley Comm Start" 200
set "Trolley Comm Data Start" 1200
set "Trolley Comm Stop" 13150
set "Switch To RF" 13250
set "Power ON" 12750
set "RF Enable" 12250
set "Switch To Comm" 28350
set "Interface Comm Start" 28390
set "Cycle Length" 29410
set "RF Prescale" 62
set "Switch RF Offset" 100
set "Switch Comm Offset" 100

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Probe"
cd "/Equipment/TrolleyInterface/Settings/Probe"
create STRING "Source[1][256]"
set Source "Odb"
create STRING "Script Dir[1][256]"
set "Script Dir" "/home/newg2/Applications/field-daq/online/TrolleyProbeScripts/"
create STRING "Script[1][256]"
set "Script" "Test"

mkdir "Probe0"
cd "Probe0"
create INT "Probe ID"
create INT "Probe Enable"
create INT "Preamp Delay"
create INT "Preamp Period"
create INT "ADC Gate Delay"
create INT "ADC Gate Offset"
create INT "ADC Gate Period"
create INT "TX Delay"
create INT "TX Period"
create INT "User Data"
set "Probe ID" 0
set "Probe Enable" 0
set "Preamp Delay" 373
set "Preamp Period" 14000
set "ADC Gate Delay" 0
set "ADC Gate Offset" 0
set "ADC Gate Period" 15000
set "TX Delay" 300
set "TX Period" 450
set "User Data" 8606
cd "/Equipment/TrolleyInterface/Settings/Probe"
cp "Probe0" "Probe1"
cp "Probe0" "Probe2"
cp "Probe0" "Probe3"
cp "Probe0" "Probe4"
cp "Probe0" "Probe5"
cp "Probe0" "Probe6"
cp "Probe0" "Probe7"
cp "Probe0" "Probe8"
cp "Probe0" "Probe9"
cp "Probe0" "Probe10"
cp "Probe0" "Probe11"
cp "Probe0" "Probe12"
cp "Probe0" "Probe13"
cp "Probe0" "Probe14"
cp "Probe0" "Probe15"
cp "Probe0" "Probe16"
set "Probe1/Probe ID" 1
set "Probe2/Probe ID" 2
set "Probe3/Probe ID" 3
set "Probe4/Probe ID" 4
set "Probe5/Probe ID" 5
set "Probe6/Probe ID" 6
set "Probe7/Probe ID" 7
set "Probe8/Probe ID" 8
set "Probe9/Probe ID" 9
set "Probe10/Probe ID" 10
set "Probe11/Probe ID" 11
set "Probe12/Probe ID" 12
set "Probe13/Probe ID" 13
set "Probe14/Probe ID" 14
set "Probe15/Probe ID" 15
set "Probe16/Probe ID" 16
set "Probe0/Probe Enable" 1

cd "/Equipment/TrolleyInterface/Settings"
mkdir "Barcode"
cd "/Equipment/TrolleyInterface/Settings/Barcode"
create INT "LED Voltage"
create INT "Sample Period"
create INT "Acq Delay"
set "LED Voltage" 1024
set "Sample Period" 2000
set "Acq Delay" 16

cd "/Equipment/TrolleyInterface/Settings"
cp "/Equipment/TrolleyInterface/Settings/Cycle" "/Equipment/TrolleyInterface/Monitor/Cycle"
cp "/Equipment/TrolleyInterface/Settings/Barcode" "/Equipment/TrolleyInterface/Monitor/Barcode"

remove sg382 odb

remove sg382 odb