@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 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%

: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 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.java.com/getjava/ and download
echo a valid Java Runtime 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%" (
    echo Copying runtime jar.
    mkdir "%java9_ext%"
    "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "%rtexport%" "%java9_rt%"
  )
  set _JAVA_OPTS=!_JAVA_OPTS! -Dscala.ext.dirs="%java9_ext%"
)
exit /B 0

:sync_preloaded
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "8" (
  where robocopy >nul 2>nul
  if %ERRORLEVEL% equ 0 (
    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"
      )
    )
  )
)
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 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%

: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 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.java.com/getjava/ and download
echo a valid Java Runtime 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%" (
    echo Copying runtime jar.
    mkdir "%java9_ext%"
    "%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -jar "%rtexport%" "%java9_rt%"
  )
  set _JAVA_OPTS=!_JAVA_OPTS! -Dscala.ext.dirs="%java9_ext%"
)
exit /B 0

:sync_preloaded
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "8" (
  where robocopy >nul 2>nul
  if %ERRORLEVEL% equ 0 (
    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"
      )
    )
  )
)
exit /B 0

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

Fix Windows script

Fix Windows script


@echo off

echo Current environment variables
SET

echo Current directory
chdir

REM You can remove this conditional once you've added a repository
IF "%BUILDBOX_REPO%" == "" (
  echo Congratulations! You just ran a build! Now it's time to fill out this build script and customize your project
  exit /b 0
)

REM Here are some basic setup instructions for checking out a git repository.
REM You have to manage checking out and updating the repo yourself.

IF NOT EXIST ".git" (
  echo Cloning %BUILDBOX_REPO%
  call git clone "%BUILDBOX_REPO%" .
  if %errorlevel% neq 0 exit /b %errorlevel%
)

echo Cleaning the repo
call git clean -fd
if %errorlevel% neq 0 exit /b %errorlevel%

echo Fetching latest commits from origin
call git fetch
if %errorlevel% neq 0 exit /b %errorlevel%

echo Checking out %BUILDBOX_COMMIT%
call git checkout -f "%BUILDBOX_COMMIT%"
if %errorlevel% neq 0 exit /b %errorlevel%

REM Here is an example on how to run tests for a Ruby on Rails project with rspec.
REM You can change these commands to be what ever you like.

echo Bundling
call bundle install
if %errorlevel% neq 0 exit /b %errorlevel%

REM bundle exec rake db:schema:load
echo Running specs
call bundle exec rspec
if %errorlevel% neq 0 exit /b %errorlevel%

REM Want to do something paticular for a specific branch? You can do that!
IF "%BUILDBOX_BRANCH%" == "master" (
  REM Do something special if the current branch is 'master'
)

@echo off

REM echo --- Environment Variables
REM SET

echo --- Creating Build Environment

REM Returns the location of this file

SET BUILDBOX_DIR=%~dp0

REM Add the BUILDBOX_DIR to the PATH

SET PATH=%PATH%;%BUILDBOX_DIR%

REM Create the build directory

SET SANITIED_PROJECT_SLUG=%BUILDBOX_PROJECT_SLUG:/=\%
SET BUILDBOX_BUILD_DIR=%BUILDBOX_DIR%%BUILDBOX_AGENT_NAME%\%SANITIED_PROJECT_SLUG%

IF NOT EXIST %BUILDBOX_BUILD_DIR% (
  REM Create the build directory

  ECHO ^> MKDIR %BUILDBOX_BUILD_DIR%
  MKDIR %BUILDBOX_BUILD_DIR%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

REM Move to the build directory

ECHO ^> CD %BUILDBOX_BUILD_DIR%
CD %BUILDBOX_BUILD_DIR%
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Do we need to do a git checkout?

IF NOT EXIST ".git" (
  ECHO ^> git clone %BUILDBOX_REPO%
  CALL git clone "%BUILDBOX_REPO%" . -v
  ECHO It was this: %ERRORLEVEL%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

REM Clean the repo

ECHO ^> git clean -fdq
CALL git clean -fdq
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Fetch the latest code

ECHO ^> git fetch -q
CALL git fetch -q
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Only reset to the branch if we're not on a tag

IF "%BUILDBOX_TAG%" == "" (
  ECHO ^> git reset --hard origin/%BUILDBOX_BRANCH%
  CALL git reset --hard origin/%BUILDBOX_BRANCH%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

ECHO ^> git checkout -qf "%BUILDBOX_COMMIT%"
CALL git checkout -qf "%BUILDBOX_COMMIT%"
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

echo --- Running %BUILDBOX_SCRIPT_PATH%

IF "%BUILDBOX_SCRIPT_PATH%" == "" (
  echo ERROR: No script path has been set for this project. Please go to \"Project Settings\" and add the path to your build script
  exit 1
) ELSE (
  CALL %BUILDBOX_SCRIPT_PATH%
)

Work on the bootstrap.bat file

Work on the bootstrap.bat file


git submodule update --init --recursive
.\externals\gyp\gyp project.gyp --depth .
.\externals\gyp\gyp tests.gyp --depth .

Add windows configure script

Add windows configure script


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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM M2_HOME - location of maven2's installed home dir
@REM
@REM Optional ENV vars
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

set CLASSWORLDS_VERSION=1.1-SNAPSHOT

@REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

echo.
echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = %JAVA_HOME%
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:chkMHome
if not "%M2_HOME%"=="" goto valMHome

echo.
echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end

:valMHome
if exist "%M2_HOME%\bin\m2.bat" goto init

echo.
echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME%
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set MAVEN_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set MAVEN_CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of agruments (up to the command line limit, anyway).
set MAVEN_CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit
if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS="-Xmx256m"
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
SET MAVEN_CLASSPATH="%M2_HOME%\core\classworlds-%CLASSWORLDS_VERSION%.jar"
SET MAVEN_MAIN_CLASS=org.codehaus.classworlds.Launcher
SET CLASSWORLDS_CONF="%M2_HOME%\bin\classworlds.conf"

@REM Start MAVEN2
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% "-Dclassworlds.conf=%CLASSWORLDS_CONF%" "-Dmaven.home=%M2_HOME%" %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
goto :end

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set MAVEN_JAVA_EXE=
set MAVEN_CLASSPATH=
set MAVEN_MAIN_CLASS=
set MAVEN_CMD_LINE_ARGS=
set CLASSWORLDS_VERSION=
goto postExec

:endNT
@endlocal

:postExec
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

set CLASSWORLDS_VERSION=1.1-SNAPSHOT

@REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

echo.
echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = %JAVA_HOME%
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:chkMHome
if not "%M2_HOME%"=="" goto valMHome

if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\..
if not "%M2_HOME%"=="" goto valMHome

echo.
echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end

:valMHome
if exist "%M2_HOME%\bin\m2.bat" goto init

echo.
echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME%
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set MAVEN_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set MAVEN_CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of agruments (up to the command line limit, anyway).
set MAVEN_CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit
if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS="-Xmx256m"
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
SET MAVEN_CLASSPATH="%M2_HOME%\core\classworlds-%CLASSWORLDS_VERSION%.jar"
SET MAVEN_MAIN_CLASS=org.codehaus.classworlds.Launcher
SET CLASSWORLDS_CONF="%M2_HOME%\bin\classworlds.conf"

@REM Start MAVEN2
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% "-Dclassworlds.conf=%CLASSWORLDS_CONF%" "-Dmaven.home=%M2_HOME%" %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
goto :end

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set MAVEN_JAVA_EXE=
set MAVEN_CLASSPATH=
set MAVEN_MAIN_CLASS=
set MAVEN_CMD_LINE_ARGS=
set CLASSWORLDS_VERSION=
goto postExec

:endNT
@endlocal

:postExec
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

work without M2_HOME - base on location of batch file

git-svn-id: 2c527eb49caa05e19d6b2be874bf74fa9d7ea670@163157 13f79535-47bb-0310-9956-ffa450edef68


@echo off
:: Microsoft Azure CLI - Windows Installer - Author file components script
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::
:: This re-builds partial WiX files for use in cloning the repo after install.
:: heat.exe from the WiX toolset is used for this.
::

:: to avoid https://github.com/npm/npm/issues/6438
chcp 850

set NODE_VERSION=8.12.0
set NPM_VERSION=6.4.1

:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;"

pushd %~dp0..\

set NODE_X86_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x86/node.exe
set NODE_X64_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x64/node.exe
set NPM_DOWNLOAD_URL=https://codeload.github.com/npm/npm/zip/v%NPM_VERSION%
:: This is the redirect url for https://github.com/npm/npm/archive/v%NPM_VERSION%.zip

echo Cleaning previous build artifacts...

set OUTPUT_FOLDER=.\out
if exist %OUTPUT_FOLDER% rmdir /s /q %OUTPUT_FOLDER%
mkdir %OUTPUT_FOLDER%

set TEMP_REPO_FOLDER=zcli
set TEMP_AUX_REPO_FOLDER=zNode
set TEMP_NPM_REPO_FOLDER=zNPM
set X86=x86
set X64=x64
set TEMP_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_REPO_FOLDER%
set TEMP_AUX_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_AUX_REPO_FOLDER%
set TEMP_NPM_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_NPM_REPO_FOLDER%
if not exist %TEMP_REPO% goto CLONE_REPO

echo Temporary clone of the repo already exists. Removing it...
pushd %TEMP_REPO%\..\
if exist %TEMP_REPO_FOLDER% rmdir /s /q %TEMP_REPO_FOLDER%
::rmdir always returns 0, so check folder's existence
if exist %TEMP_REPO_FOLDER% (
    echo Failed to delete %TEMP_REPO_FOLDER%.
    goto ERROR
)
popd

:CLONE_REPO
mkdir %TEMP_REPO%
echo Cloning the repo elsewhere on disk...
pushd ..\..\
robocopy . %TEMP_REPO% /MIR /XD .git tools features scripts test node_modules /NFL /NDL /NJH /NJS
::robocopy emits error code greater or equal than 8(most other commands use any non-zero values)
if %errorlevel% geq 8 (
    echo Robocopy failed to copy xplat sources to the %TEMP_REPO%.
    goto ERROR
)
popd

if not exist %TEMP_AUX_REPO% goto DOWNLOAD_TASK

echo Temporary clone of auxilary repo exists. Removing it...
pushd %TEMP_AUX_REPO%\..\
if exist %TEMP_AUX_REPO_FOLDER% rmdir /s /q %TEMP_AUX_REPO_FOLDER%
if exist %TEMP_AUX_REPO_FOLDER% (
    echo Failed to delete %TEMP_AUX_REPO_FOLDER%.
    goto ERROR
)
popd

:DOWNLOAD_TASK
mkdir %TEMP_AUX_REPO%
echo Downloading node x86 and x64...
pushd %TEMP_AUX_REPO%
mkdir %X86%
pushd %X86%
curl -o node.exe %NODE_X86_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
mkdir %X64%
pushd %X64%
curl -o node.exe %NODE_X64_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
popd

if not exist %TEMP_NPM_REPO% goto NPM_DOWNLOAD_TASK

echo Temporary clone of auxilary npm repo exists. Removing it...
pushd %TEMP_NPM_REPO%\..\
if exist %TEMP_NPM_REPO% rmdir /s /q %TEMP_NPM_REPO%
if exist %TEMP_NPM_REPO% (
    echo Failed to delete %TEMP_NPM_REPO%.
    goto ERROR
)
popd

:NPM_DOWNLOAD_TASK
mkdir %TEMP_NPM_REPO%
echo Downloading npm from %NPM_DOWNLOAD_URL%...
pushd %TEMP_NPM_REPO%
curl -k -o npm.zip %NPM_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
echo Unzipping npm from archive...
unzip -q npm.zip
if %errorlevel% neq 0 goto ERROR
del npm.zip
popd

echo.
echo Copying node into bin directory...
:: We copy node.exe to bin directory to compile streamline files and other tasks.
:: During clean up phase, we delete it from bin directory. The reason for doing this is because the
:: entire source repo is harvested during set up authoring. We want to author node by hand after determining architecture type (32 or 64 bit).
pushd %TEMP_AUX_REPO%\%X86%
robocopy . %TEMP_REPO%\bin /NFL /NDL /NJH /NJS
if %errorlevel% geq 8 (
    echo Robocopy failed to copy node.exe to the %TEMP_REPO%\bin.
    goto ERROR
)
popd

echo Preparing to run npm install...
pushd %TEMP_REPO%
set NPMLOCAL=.\bin\node.exe %TEMP_NPM_REPO%\npm-%NPM_VERSION%\cli.js
echo.
:: Notice we're not using the locally downloaded npm anymore.
:: This is because we've made the build machine have the version we need.
:: If ever needed, just switch to use "NPMLOCAL" instead of "npm" and we'll be good.
echo Perform npm version check
call npm -v
echo Running npm install...
call npm install --production
echo.
echo if YOU SEE A FAILURE AT THE BOTTOM OF THE NPM OUTPUT:
echo If you do not have Node.js installed on this local machine, the Azure
echo postinstall command run by npm will fail.
echo.
echo This is fine as long as only the Azure module had this issue. Onward!
echo.
popd

echo Compiling streamline files...
pushd %TEMP_REPO%
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c lib
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline\lib\streams
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline-streams\lib
if %errorlevel% neq 0 goto ERROR
popd

echo Generating streamline files...
pushd %TEMP_REPO%
.\bin\node.exe bin\azure --gen
popd

echo Removing unncessary files from the enlistment for the CLI to function...
:: This is cleaner than using /EXCLUDE:... commands and easier to see line-by-line...
pushd %TEMP_REPO%

for %%i in (
    .idea
    __temp
    bin\node_modules
) do (
    if exist %%i (
        echo Deleting %%i...
        rmdir /s /q %%i
    )
)

for %%i in (
    *.md
    *.git*
    *.npm*
    *.njsproj
    *.sln
    azure_error
    azure.err
    checkstyle-result.xml
    test-result.xml
    .travis.yml
    .jshintrc
    .gitattributes
    .gitignore
    ChangeLog.txt
    bin\npm.cmd
    bin\node.exe
    LICENSE.txt
) do (
    if exist %%i (
        echo Deleting %%i...
        del /q %%i
    )
)

cd lib
del /Q /S *._js
cd ..
del /Q /S .ntvs_analysis.*
echo.
popd

echo Creating the wbin (Windows binaries) folder that will be added to the path...
mkdir %TEMP_REPO%\wbin
copy .\scripts\azure.cmd %TEMP_REPO%\wbin\
if %errorlevel% neq 0 goto ERROR
echo Adding license documents...
copy ..\resources\*.rtf %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR
copy ..\resources\ThirdPartyNotices.txt %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR

echo.

:SUCCESS
echo Looks good.

goto END

:ERROR
echo Error occurred, please check the output for details.
exit /b 1

:END
exit /b 0
popd

@echo off
:: Microsoft Azure CLI - Windows Installer - Author file components script
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::
:: This re-builds partial WiX files for use in cloning the repo after install.
:: heat.exe from the WiX toolset is used for this.
::

:: to avoid https://github.com/npm/npm/issues/6438
chcp 850

set NODE_VERSION=8.12.0
set NPM_VERSION=6.4.1

:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;"

pushd %~dp0..\

set NODE_X86_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x86/node.exe
set NODE_X64_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x64/node.exe
set NPM_DOWNLOAD_URL=https://github.com/npm/cli/archive/v%NPM_VERSION%.zip

echo Cleaning previous build artifacts...

set OUTPUT_FOLDER=.\out
if exist %OUTPUT_FOLDER% rmdir /s /q %OUTPUT_FOLDER%
mkdir %OUTPUT_FOLDER%

set TEMP_REPO_FOLDER=zcli
set TEMP_AUX_REPO_FOLDER=zNode
set TEMP_NPM_REPO_FOLDER=zNPM
set X86=x86
set X64=x64
set TEMP_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_REPO_FOLDER%
set TEMP_AUX_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_AUX_REPO_FOLDER%
set TEMP_NPM_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_NPM_REPO_FOLDER%
if not exist %TEMP_REPO% goto CLONE_REPO

echo Temporary clone of the repo already exists. Removing it...
pushd %TEMP_REPO%\..\
if exist %TEMP_REPO_FOLDER% rmdir /s /q %TEMP_REPO_FOLDER%
::rmdir always returns 0, so check folder's existence
if exist %TEMP_REPO_FOLDER% (
    echo Failed to delete %TEMP_REPO_FOLDER%.
    goto ERROR
)
popd

:CLONE_REPO
mkdir %TEMP_REPO%
echo Cloning the repo elsewhere on disk...
pushd ..\..\
robocopy . %TEMP_REPO% /MIR /XD .git tools features scripts test node_modules /NFL /NDL /NJH /NJS
::robocopy emits error code greater or equal than 8(most other commands use any non-zero values)
if %errorlevel% geq 8 (
    echo Robocopy failed to copy xplat sources to the %TEMP_REPO%.
    goto ERROR
)
popd

if not exist %TEMP_AUX_REPO% goto DOWNLOAD_TASK

echo Temporary clone of auxilary repo exists. Removing it...
pushd %TEMP_AUX_REPO%\..\
if exist %TEMP_AUX_REPO_FOLDER% rmdir /s /q %TEMP_AUX_REPO_FOLDER%
if exist %TEMP_AUX_REPO_FOLDER% (
    echo Failed to delete %TEMP_AUX_REPO_FOLDER%.
    goto ERROR
)
popd

:DOWNLOAD_TASK
mkdir %TEMP_AUX_REPO%
echo Downloading node x86 and x64...
pushd %TEMP_AUX_REPO%
mkdir %X86%
pushd %X86%
curl -o node.exe %NODE_X86_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
mkdir %X64%
pushd %X64%
curl -o node.exe %NODE_X64_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
popd

if not exist %TEMP_NPM_REPO% goto NPM_DOWNLOAD_TASK

echo Temporary clone of auxilary npm repo exists. Removing it...
pushd %TEMP_NPM_REPO%\..\
if exist %TEMP_NPM_REPO% rmdir /s /q %TEMP_NPM_REPO%
if exist %TEMP_NPM_REPO% (
    echo Failed to delete %TEMP_NPM_REPO%.
    goto ERROR
)
popd

:NPM_DOWNLOAD_TASK
mkdir %TEMP_NPM_REPO%
echo Downloading npm from %NPM_DOWNLOAD_URL%...
pushd %TEMP_NPM_REPO%
curl -k -o cli-%NPM_VERSION%.zip %NPM_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
echo Unzipping npm from archive...
unzip -q cli-%NPM_VERSION%.zip
if %errorlevel% neq 0 goto ERROR
del cli-%NPM_VERSION%.zip
popd

echo.
echo Copying node into bin directory...
:: We copy node.exe to bin directory to compile streamline files and other tasks.
:: During clean up phase, we delete it from bin directory. The reason for doing this is because the
:: entire source repo is harvested during set up authoring. We want to author node by hand after determining architecture type (32 or 64 bit).
pushd %TEMP_AUX_REPO%\%X86%
robocopy . %TEMP_REPO%\bin /NFL /NDL /NJH /NJS
if %errorlevel% geq 8 (
    echo Robocopy failed to copy node.exe to the %TEMP_REPO%\bin.
    goto ERROR
)
popd

echo Preparing to run npm install...
pushd %TEMP_REPO%
set NPMLOCAL=.\bin\node.exe %TEMP_NPM_REPO%\npm-%NPM_VERSION%\cli.js
echo.
:: Notice we're not using the locally downloaded npm anymore.
:: This is because we've made the build machine have the version we need.
:: If ever needed, just switch to use "NPMLOCAL" instead of "npm" and we'll be good.
echo Perform npm version check
call npm -v
echo Running npm install...
call npm install --production
echo.
echo if YOU SEE A FAILURE AT THE BOTTOM OF THE NPM OUTPUT:
echo If you do not have Node.js installed on this local machine, the Azure
echo postinstall command run by npm will fail.
echo.
echo This is fine as long as only the Azure module had this issue. Onward!
echo.
popd

echo Compiling streamline files...
pushd %TEMP_REPO%
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c lib
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline\lib\streams
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline-streams\lib
if %errorlevel% neq 0 goto ERROR
popd

echo Generating streamline files...
pushd %TEMP_REPO%
.\bin\node.exe bin\azure --gen
popd

echo Removing unncessary files from the enlistment for the CLI to function...
:: This is cleaner than using /EXCLUDE:... commands and easier to see line-by-line...
pushd %TEMP_REPO%

for %%i in (
    .idea
    __temp
    bin\node_modules
) do (
    if exist %%i (
        echo Deleting %%i...
        rmdir /s /q %%i
    )
)

for %%i in (
    *.md
    *.git*
    *.npm*
    *.njsproj
    *.sln
    azure_error
    azure.err
    checkstyle-result.xml
    test-result.xml
    .travis.yml
    .jshintrc
    .gitattributes
    .gitignore
    ChangeLog.txt
    bin\npm.cmd
    bin\node.exe
    LICENSE.txt
) do (
    if exist %%i (
        echo Deleting %%i...
        del /q %%i
    )
)

cd lib
del /Q /S *._js
cd ..
del /Q /S .ntvs_analysis.*
echo.
popd

echo Creating the wbin (Windows binaries) folder that will be added to the path...
mkdir %TEMP_REPO%\wbin
copy .\scripts\azure.cmd %TEMP_REPO%\wbin\
if %errorlevel% neq 0 goto ERROR
echo Adding license documents...
copy ..\resources\*.rtf %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR
copy ..\resources\ThirdPartyNotices.txt %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR

echo.

:SUCCESS
echo Looks good.

goto END

:ERROR
echo Error occurred, please check the output for details.
exit /b 1

:END
exit /b 0
popd

update repo clone script for npm download for win msi


@echo off
:: Microsoft Azure CLI - Windows Installer - Author file components script
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::
:: This re-builds partial WiX files for use in cloning the repo after install.
:: heat.exe from the WiX toolset is used for this.
::

:: to avoid https://github.com/npm/npm/issues/6438
chcp 850

set NODE_VERSION=8.12.0
set NPM_VERSION=6.4.1

:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;"

pushd %~dp0..\

set NODE_X86_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x86/node.exe
set NODE_X64_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x64/node.exe
set NPM_DOWNLOAD_URL=https://github.com/npm/cli/archive/v%NPM_VERSION%.zip

echo Cleaning previous build artifacts...

set OUTPUT_FOLDER=.\out
if exist %OUTPUT_FOLDER% rmdir /s /q %OUTPUT_FOLDER%
mkdir %OUTPUT_FOLDER%

set TEMP_REPO_FOLDER=zcli
set TEMP_AUX_REPO_FOLDER=zNode
set TEMP_NPM_REPO_FOLDER=zNPM
set X86=x86
set X64=x64
set TEMP_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_REPO_FOLDER%
set TEMP_AUX_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_AUX_REPO_FOLDER%
set TEMP_NPM_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_NPM_REPO_FOLDER%
if not exist %TEMP_REPO% goto CLONE_REPO

echo Temporary clone of the repo already exists. Removing it...
pushd %TEMP_REPO%\..\
if exist %TEMP_REPO_FOLDER% rmdir /s /q %TEMP_REPO_FOLDER%
::rmdir always returns 0, so check folder's existence
if exist %TEMP_REPO_FOLDER% (
    echo Failed to delete %TEMP_REPO_FOLDER%.
    goto ERROR
)
popd

:CLONE_REPO
mkdir %TEMP_REPO%
echo Cloning the repo elsewhere on disk...
pushd ..\..\
robocopy . %TEMP_REPO% /MIR /XD .git tools features scripts test node_modules /NFL /NDL /NJH /NJS
::robocopy emits error code greater or equal than 8(most other commands use any non-zero values)
if %errorlevel% geq 8 (
    echo Robocopy failed to copy xplat sources to the %TEMP_REPO%.
    goto ERROR
)
popd

if not exist %TEMP_AUX_REPO% goto DOWNLOAD_TASK

echo Temporary clone of auxilary repo exists. Removing it...
pushd %TEMP_AUX_REPO%\..\
if exist %TEMP_AUX_REPO_FOLDER% rmdir /s /q %TEMP_AUX_REPO_FOLDER%
if exist %TEMP_AUX_REPO_FOLDER% (
    echo Failed to delete %TEMP_AUX_REPO_FOLDER%.
    goto ERROR
)
popd

:DOWNLOAD_TASK
mkdir %TEMP_AUX_REPO%
echo Downloading node x86 and x64...
pushd %TEMP_AUX_REPO%
mkdir %X86%
pushd %X86%
curl -o node.exe %NODE_X86_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
mkdir %X64%
pushd %X64%
curl -o node.exe %NODE_X64_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
popd

if not exist %TEMP_NPM_REPO% goto NPM_DOWNLOAD_TASK

echo Temporary clone of auxilary npm repo exists. Removing it...
pushd %TEMP_NPM_REPO%\..\
if exist %TEMP_NPM_REPO% rmdir /s /q %TEMP_NPM_REPO%
if exist %TEMP_NPM_REPO% (
    echo Failed to delete %TEMP_NPM_REPO%.
    goto ERROR
)
popd

:NPM_DOWNLOAD_TASK
mkdir %TEMP_NPM_REPO%
echo Downloading npm from %NPM_DOWNLOAD_URL%...
pushd %TEMP_NPM_REPO%
curl -k -o cli-%NPM_VERSION%.zip %NPM_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
echo Unzipping npm from archive...
unzip -q cli-%NPM_VERSION%.zip
if %errorlevel% neq 0 goto ERROR
del cli-%NPM_VERSION%.zip
popd

echo.
echo Copying node into bin directory...
:: We copy node.exe to bin directory to compile streamline files and other tasks.
:: During clean up phase, we delete it from bin directory. The reason for doing this is because the
:: entire source repo is harvested during set up authoring. We want to author node by hand after determining architecture type (32 or 64 bit).
pushd %TEMP_AUX_REPO%\%X86%
robocopy . %TEMP_REPO%\bin /NFL /NDL /NJH /NJS
if %errorlevel% geq 8 (
    echo Robocopy failed to copy node.exe to the %TEMP_REPO%\bin.
    goto ERROR
)
popd

echo Preparing to run npm install...
pushd %TEMP_REPO%
set NPMLOCAL=.\bin\node.exe %TEMP_NPM_REPO%\npm-%NPM_VERSION%\cli.js
echo.
:: Notice we're not using the locally downloaded npm anymore.
:: This is because we've made the build machine have the version we need.
:: If ever needed, just switch to use "NPMLOCAL" instead of "npm" and we'll be good.
echo Perform npm version check
call npm -v
echo Running npm install...
call npm install --production
echo.
echo if YOU SEE A FAILURE AT THE BOTTOM OF THE NPM OUTPUT:
echo If you do not have Node.js installed on this local machine, the Azure
echo postinstall command run by npm will fail.
echo.
echo This is fine as long as only the Azure module had this issue. Onward!
echo.
popd

echo Compiling streamline files...
pushd %TEMP_REPO%
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c lib
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline\lib\streams
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline-streams\lib
if %errorlevel% neq 0 goto ERROR
popd

echo Generating streamline files...
pushd %TEMP_REPO%
.\bin\node.exe bin\azure --gen
popd

echo Removing unncessary files from the enlistment for the CLI to function...
:: This is cleaner than using /EXCLUDE:... commands and easier to see line-by-line...
pushd %TEMP_REPO%

for %%i in (
    .idea
    __temp
    bin\node_modules
) do (
    if exist %%i (
        echo Deleting %%i...
        rmdir /s /q %%i
    )
)

for %%i in (
    *.md
    *.git*
    *.npm*
    *.njsproj
    *.sln
    azure_error
    azure.err
    checkstyle-result.xml
    test-result.xml
    .travis.yml
    .jshintrc
    .gitattributes
    .gitignore
    ChangeLog.txt
    bin\npm.cmd
    bin\node.exe
    LICENSE.txt
) do (
    if exist %%i (
        echo Deleting %%i...
        del /q %%i
    )
)

cd lib
del /Q /S *._js
cd ..
del /Q /S .ntvs_analysis.*
echo.
popd

echo Creating the wbin (Windows binaries) folder that will be added to the path...
mkdir %TEMP_REPO%\wbin
copy .\scripts\azure.cmd %TEMP_REPO%\wbin\
if %errorlevel% neq 0 goto ERROR
echo Adding license documents...
copy ..\resources\*.rtf %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR
copy ..\resources\ThirdPartyNotices.txt %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR

echo.

:SUCCESS
echo Looks good.

goto END

:ERROR
echo Error occurred, please check the output for details.
exit /b 1

:END
exit /b 0
popd

@echo off
:: Microsoft Azure CLI - Windows Installer - Author file components script
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::
:: This re-builds partial WiX files for use in cloning the repo after install.
:: heat.exe from the WiX toolset is used for this.
::

:: to avoid https://github.com/npm/npm/issues/6438
chcp 850

set NODE_VERSION=8.12.0
set NPM_VERSION=6.4.1

:: Add Git to the path as this should be run through a .NET command prompt
:: and not a Git bash shell... We also need the gnu toolchain (for curl & unzip)
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin;"

pushd %~dp0..\

set NODE_X86_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x86/node.exe
set NODE_X64_DOWNLOAD_URL=http://nodejs.org/dist/v%NODE_VERSION%/win-x64/node.exe
set NPM_DOWNLOAD_URL=https://codeload.github.com/npm/cli/zip/v%NPM_VERSION%
:: This is the redirect url for https://github.com/npm/cli/archive/v%NPM_VERSION%.zip

echo Cleaning previous build artifacts...

set OUTPUT_FOLDER=.\out
if exist %OUTPUT_FOLDER% rmdir /s /q %OUTPUT_FOLDER%
mkdir %OUTPUT_FOLDER%

set TEMP_REPO_FOLDER=zcli
set TEMP_AUX_REPO_FOLDER=zNode
set TEMP_NPM_REPO_FOLDER=zNPM
set X86=x86
set X64=x64
set TEMP_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_REPO_FOLDER%
set TEMP_AUX_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_AUX_REPO_FOLDER%
set TEMP_NPM_REPO=%HOMEDRIVE%%HOMEPATH%\%TEMP_NPM_REPO_FOLDER%
if not exist %TEMP_REPO% goto CLONE_REPO

echo Temporary clone of the repo already exists. Removing it...
pushd %TEMP_REPO%\..\
if exist %TEMP_REPO_FOLDER% rmdir /s /q %TEMP_REPO_FOLDER%
::rmdir always returns 0, so check folder's existence
if exist %TEMP_REPO_FOLDER% (
    echo Failed to delete %TEMP_REPO_FOLDER%.
    goto ERROR
)
popd

:CLONE_REPO
mkdir %TEMP_REPO%
echo Cloning the repo elsewhere on disk...
pushd ..\..\
robocopy . %TEMP_REPO% /MIR /XD .git tools features scripts test node_modules /NFL /NDL /NJH /NJS
::robocopy emits error code greater or equal than 8(most other commands use any non-zero values)
if %errorlevel% geq 8 (
    echo Robocopy failed to copy xplat sources to the %TEMP_REPO%.
    goto ERROR
)
popd

if not exist %TEMP_AUX_REPO% goto DOWNLOAD_TASK

echo Temporary clone of auxilary repo exists. Removing it...
pushd %TEMP_AUX_REPO%\..\
if exist %TEMP_AUX_REPO_FOLDER% rmdir /s /q %TEMP_AUX_REPO_FOLDER%
if exist %TEMP_AUX_REPO_FOLDER% (
    echo Failed to delete %TEMP_AUX_REPO_FOLDER%.
    goto ERROR
)
popd

:DOWNLOAD_TASK
mkdir %TEMP_AUX_REPO%
echo Downloading node x86 and x64...
pushd %TEMP_AUX_REPO%
mkdir %X86%
pushd %X86%
curl -o node.exe %NODE_X86_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
mkdir %X64%
pushd %X64%
curl -o node.exe %NODE_X64_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
popd
popd

if not exist %TEMP_NPM_REPO% goto NPM_DOWNLOAD_TASK

echo Temporary clone of auxilary npm repo exists. Removing it...
pushd %TEMP_NPM_REPO%\..\
if exist %TEMP_NPM_REPO% rmdir /s /q %TEMP_NPM_REPO%
if exist %TEMP_NPM_REPO% (
    echo Failed to delete %TEMP_NPM_REPO%.
    goto ERROR
)
popd

:NPM_DOWNLOAD_TASK
mkdir %TEMP_NPM_REPO%
echo Downloading npm from %NPM_DOWNLOAD_URL%...
pushd %TEMP_NPM_REPO%
curl -k -o npm.zip %NPM_DOWNLOAD_URL%
if %errorlevel% neq 0 goto ERROR
echo Unzipping npm from archive...
unzip -q npm.zip
if %errorlevel% neq 0 goto ERROR
del npm.zip
popd

echo.
echo Copying node into bin directory...
:: We copy node.exe to bin directory to compile streamline files and other tasks.
:: During clean up phase, we delete it from bin directory. The reason for doing this is because the
:: entire source repo is harvested during set up authoring. We want to author node by hand after determining architecture type (32 or 64 bit).
pushd %TEMP_AUX_REPO%\%X86%
robocopy . %TEMP_REPO%\bin /NFL /NDL /NJH /NJS
if %errorlevel% geq 8 (
    echo Robocopy failed to copy node.exe to the %TEMP_REPO%\bin.
    goto ERROR
)
popd

echo Preparing to run npm install...
pushd %TEMP_REPO%
set NPMLOCAL=.\bin\node.exe %TEMP_NPM_REPO%\npm-%NPM_VERSION%\cli.js
echo.
:: Notice we're not using the locally downloaded npm anymore.
:: This is because we've made the build machine have the version we need.
:: If ever needed, just switch to use "NPMLOCAL" instead of "npm" and we'll be good.
echo Perform npm version check
call npm -v
echo Running npm install...
call npm install --production
echo.
echo if YOU SEE A FAILURE AT THE BOTTOM OF THE NPM OUTPUT:
echo If you do not have Node.js installed on this local machine, the Azure
echo postinstall command run by npm will fail.
echo.
echo This is fine as long as only the Azure module had this issue. Onward!
echo.
popd

echo Compiling streamline files...
pushd %TEMP_REPO%
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c lib
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline\lib\streams
if %errorlevel% neq 0 goto ERROR
.\bin\node.exe node_modules\streamline\bin\_node --verbose -c node_modules\streamline-streams\lib
if %errorlevel% neq 0 goto ERROR
popd

echo Generating streamline files...
pushd %TEMP_REPO%
.\bin\node.exe bin\azure --gen
popd

echo Removing unncessary files from the enlistment for the CLI to function...
:: This is cleaner than using /EXCLUDE:... commands and easier to see line-by-line...
pushd %TEMP_REPO%

for %%i in (
    .idea
    __temp
    bin\node_modules
) do (
    if exist %%i (
        echo Deleting %%i...
        rmdir /s /q %%i
    )
)

for %%i in (
    *.md
    *.git*
    *.npm*
    *.njsproj
    *.sln
    azure_error
    azure.err
    checkstyle-result.xml
    test-result.xml
    .travis.yml
    .jshintrc
    .gitattributes
    .gitignore
    ChangeLog.txt
    bin\npm.cmd
    bin\node.exe
    LICENSE.txt
) do (
    if exist %%i (
        echo Deleting %%i...
        del /q %%i
    )
)

cd lib
del /Q /S *._js
cd ..
del /Q /S .ntvs_analysis.*
echo.
popd

echo Creating the wbin (Windows binaries) folder that will be added to the path...
mkdir %TEMP_REPO%\wbin
copy .\scripts\azure.cmd %TEMP_REPO%\wbin\
if %errorlevel% neq 0 goto ERROR
echo Adding license documents...
copy ..\resources\*.rtf %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR
copy ..\resources\ThirdPartyNotices.txt %TEMP_REPO%
if %errorlevel% neq 0 goto ERROR

echo.

:SUCCESS
echo Looks good.

goto END

:ERROR
echo Error occurred, please check the output for details.
exit /b 1

:END
exit /b 0
popd

Update prepareRepoClone.cmd

Update prepareRepoClone.cmd


add batch file for GoVM

add batch file for GoVM


@echo off

set LEIN_VERSION=1.4.0-SNAPSHOT

setLocal EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" (
    set LEIN_DIR=%~dp0
    set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
)

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if not exist "%LEIN_JAR%" goto NO_LEIN_JAR

if "x%LEIN_HOME%" == "x" (
    set LEIN_HOME=%HOMEDRIVE%%HOMEPATH%/.lein
)

call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (.\lib\dev\*.jar) do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in (%LEIN_HOME%\plugins\*.jar) do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH="%LEIN_JAR%";%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;src;"%CLASSPATH%"

if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
rem ##################################################

if not "x%INSIDE_EMACS%" == "x" goto SKIP_JLINE
if "x%1" == "xrepl"             goto SET_JLINE
if "x%1" == "xinteractive"      goto SET_JLINE
if "x%1" == "xint"              goto SET_JLINE
goto :SKIP_JLINE

:SET_JLINE
set JLINE=jline.ConsoleRunner
:SKIP_JLINE

if "x%JAVA_CMD%" == "x" set JAVA_CMD="java"

%JAVA_CMD% -client %JAVA_OPTS% -cp %CLASSPATH% %JLINE% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:NO_LEIN_JAR
echo.
echo "%LEIN_JAR%" can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:SELF_INSTALL
if exist "%LEIN_JAR%" (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl -f -L -o
)
set LEIN_JAR_URL=http://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del "%LEIN_JAR%">nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:EOF

@echo off

set LEIN_VERSION=1.4.0-SNAPSHOT

setLocal EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" (
    set LEIN_DIR=%~dp0
    set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
)

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if not exist "%LEIN_JAR%" goto NO_LEIN_JAR

if "x%LEIN_HOME%" == "x" (
    set LEIN_HOME=%HOMEDRIVE%%HOMEPATH%/.lein
)

call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (".\lib\dev\*.jar") do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in ("%LEIN_HOME%\plugins\*.jar") do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH="%LEIN_JAR%";%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;src;"%CLASSPATH%"

if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
rem ##################################################

if not "x%INSIDE_EMACS%" == "x" goto SKIP_JLINE
if "x%1" == "xrepl"             goto SET_JLINE
if "x%1" == "xinteractive"      goto SET_JLINE
if "x%1" == "xint"              goto SET_JLINE
goto :SKIP_JLINE

:SET_JLINE
set JLINE=jline.ConsoleRunner
:SKIP_JLINE

if "x%JAVA_CMD%" == "x" set JAVA_CMD="java"

%JAVA_CMD% -client %JAVA_OPTS% -cp %CLASSPATH% %JLINE% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:NO_LEIN_JAR
echo.
echo "%LEIN_JAR%" can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:SELF_INSTALL
if exist "%LEIN_JAR%" (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl -f -L -o
)
set LEIN_JAR_URL=http://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del "%LEIN_JAR%">nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:EOF

Allow for spaces in LEIN_HOME.

Allow for spaces in LEIN_HOME.


cd win32

cscript configure.js compiler=msvc iconv=yes icu=no zlib=yes lzma=no python=no ^
        prefix=%LIBRARY_PREFIX% include=%LIBRARY_INC% lib=%LIBRARY_LIB%

if errorlevel 1 exit 1

nmake /f Makefile.msvc
if errorlevel 1 exit 1

nmake /f Makefile.msvc install
if errorlevel 1 exit 1

cd win32

REM have to set manifest for VS2008.
REM No idea why, but exe's won't run otherwise
set MANIFEST=no
if "%VS_MAJOR%" == "9" (
    set MANIFEST=yes
)

cscript configure.js compiler=msvc iconv=yes icu=no zlib=yes lzma=no python=no vcmanifest=%MANIFEST% ^
        prefix=%LIBRARY_PREFIX% include=%LIBRARY_INC% lib=%LIBRARY_LIB%

if errorlevel 1 exit 1

nmake /f Makefile.msvc
if errorlevel 1 exit 1

nmake /f Makefile.msvc install
if errorlevel 1 exit 1

REM For some reason the includes get put down one level
move %LIBRARY_INC%\libxml2\libxml %LIBRARY_INC%
if errorlevel 1 exit 1

rmdir %LIBRARY_INC%\libxml2

embed manifest for VS2008

embed manifest for VS2008


@echo off

:: +-------------------------------------------------------------------------
:: |
:: | WPN-XM Server Stack - Build Menu
:: |
:: +-----------------------------------------------------------------------<3

SetLocal
cls

:: set window title
TITLE WPN-XM Server Stack for Windows - Build Menu

:: display a Menu

:SHOWMENU
cls
echo.
echo             WPN-XM Build Menu
echo             =================
echo.
echo   [1] Start "One-Click Build"
echo   [2] Download Components for all packaging Installation Wizards
echo   [3] Build the packaging Installation Wizards
echo   [4] Build the   web     Installation Wizard
echo   [5] Build the "Server-Control-Panel" (Tray Application)
echo   [x] Quit
echo.

:: ask for input

set input=0
set /p input="Your selection: "

:: accept input and forward to handlers

if %input%==1 goto OPTION1
if %input%==2 goto OPTION2
if %input%==3 goto OPTION3
if %input%==4 goto OPTION4
if %input%==5 goto OPTION5
IF %input%==x goto QUIT
goto SHOWMENU

:: handlers

:OPTION1
    echo.
    echo One-Click Build
    echo.
    call build.bat
goto END

:OPTION2
    echo.
    echo Downloading all Components for packaging Installation Wizards
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml download-components
goto END

:OPTION3
    echo.
    echo Building packaged Installation Wizards (use existing Downloads)
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml compile-full-no-download compile-standard-no-download compile-lite-no-download
goto END

:OPTION4
    echo.
    echo Building Web-Installation Wizards
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml compile-webinstaller compile-webinstaller-debug
goto END

:OPTION5
    echo.
    echo Building the "Server-Control-Panel" (Tray Application)
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml build-server-control-panel
goto END

:END
pause

:QUIT

@echo off

:: +-------------------------------------------------------------------------
:: |
:: | WPN-XM Server Stack - Build Menu
:: |
:: +-----------------------------------------------------------------------<3

SetLocal
cls

:: set window title
TITLE WPN-XM Server Stack for Windows - Build Menu

:: display a Menu

:SHOWMENU
cls
echo.
echo             WPN-XM Build Menu
echo             =================
echo.
echo   [1] Start "One-Click Build"
echo   [2] Download Components for all packaging Installation Wizards
echo   [3] Build  packaged  Installation Wizards
echo   [4] Build    web     Installation Wizards
echo   [5] Build "Server-Control-Panel" (Tray Application)
echo   [x] Quit
echo.

:: ask for input

set input=0
set /p input="Your selection: "

:: accept input and forward to handlers

if %input%==1 goto OPTION1
if %input%==2 goto OPTION2
if %input%==3 goto OPTION3
if %input%==4 goto OPTION4
if %input%==5 goto OPTION5
IF %input%==x goto QUIT
goto SHOWMENU

:: handlers

:OPTION1
    echo.
    echo One-Click Build
    echo.
    call build.bat
goto END

:OPTION2
    echo.
    echo Downloading all Components for packaging Installation Wizards
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml download-components
goto END

:OPTION3
    echo.
    echo Building packaged Installation Wizards (use existing Downloads)
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml compile-full-no-download compile-standard-no-download compile-lite-no-download
goto END

:OPTION4
    echo.
    echo Building Web-Installation Wizards
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml compile-webinstaller compile-webinstaller-debug
goto END

:OPTION5
    echo.
    echo Building the "Server-Control-Panel" (Tray Application)
    echo.
    call bin\phing\phing.bat -f %~dp0build.xml build-server-control-panel
goto END

:END
pause

:QUIT

fix menu point names

fix menu point names


@ECHO OFF
ECHO.
ECHO ===============================================================
ECHO.
ECHO Building: %1
ECHO.
ECHO ===============================================================
ECHO.

Call "C:\Program Files (x86)\MSBuild\12.0\Bin\MsBuild.exe" %1 /p:Configuration=Release /consoleloggerparameters:Summary;ErrorsOnly /nologo /p:PostBuildEvent=

@ECHO OFF
ECHO.
ECHO ===============================================================
ECHO.
ECHO Building: %1
ECHO.
ECHO ===============================================================
ECHO.

Call "C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %1 /p:Configuration=Release /consoleloggerparameters:Summary;ErrorsOnly /nologo /p:PostBuildEvent=

Update MSBuild ref

Update MSBuild ref


add batch to calc run time

add batch to calc run time


:: npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

:: Install dependencies
if %USE_CONDA% == yes (
  if %PYTHON_VERSION% == 3.6 (
    conda install -q -y python=3.6.8=h9f7ef89_7
  )

  conda install -q -y -c conda-forge --file requirements/conda_win.txt
  if errorlevel 1 exit 1

  conda install -q -y -c conda-forge --file requirements/tests.txt
  if errorlevel 1 exit 1

  conda install -q -y -c conda-forge nodejs
  if errorlevel 1 exit 1

  conda install -q -y -c conda-forge yarn
  if errorlevel 1 exit 1
) else (
  pip install -r requirements/conda_win.txt
  if errorlevel 1 exit 1

  pip install -r requirements/tests.txt
  if errorlevel 1 exit 1

  if %PYTHON_VERSION% == 3.7 (
    pip install -U pywinpty
    if errorlevel 1 exit 1

    pip install --pre -U spyder
    if errorlevel 1 exit 1
  )

  :: Install nodejs
  conda install -q -y -c conda-forge nodejs
  if errorlevel 1 exit 1

  :: Install yarn
  conda install -q -y -c conda-forge yarn
  if errorlevel 1 exit 1
)

pip install -q codecov
if errorlevel 1 exit 1

add fix for npm install in Windows

add fix for npm install in Windows


@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.

@echo off

if "%OS%" == "Windows_NT" setlocal

pushd "%~dp0"
call cassandra.in.bat

if NOT DEFINED JAVA_HOME goto :err
set TOOL_MAIN=org.apache.cassandra.tools.SSTableRepairedAtSetter

REM ***** JAVA options *****
set JAVA_OPTS=^
 -Dlogback.configurationFile=logback-tools.xml

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CLASSPATH% %TOOL_MAIN% %*
goto finally

:err
echo JAVA_HOME environment variable must be set!
set ERRORLEVEL=1
pause

:finally
ENDLOCAL & set RC=%ERRORLEVEL%
goto :exit_with_code

:returncode
exit /B %RC%

:exit_with_code
call :returncode %RC%

Add sstablerepairedset.bat

Add sstablerepairedset.bat

Patch by pmotta; reviewed by jmckenzie for CASSANDRA-9982


echo stop any instances that might already be running.
pskill javaw.exe
pskill java.exe

cd /d %~dp0\..
echo working directory is
cd

IF NOT "%1"=="FULL" GOTO UPDATEMMTREE

pushd ..\3rdparty
svn cleanup --non-interactive
svn update --accept postpone --force --ignore-externals --non-interactive
popd
pushd ..\3rdpartypublic
echo update 3rdpartypublic tree from the repository
svn cleanup --non-interactive
rem - been having trouble updating from boost.org, but don't need to do that anyhow for now.
svn update --accept postpone --force --ignore-externals --non-interactive
popd

:UPDATEMMTREE
echo update micromanager tree from the repository
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
pushd SecretDeviceAdapters
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
popd

echo Building native C++ libraries....

echo setup include path for Vizual Studio....
set include=
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto _x64
pushd "\Program Files\Microsoft Visual Studio 9.0\VC\"
goto setvcvars
:_x64
pushd "\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
:setvcvars
call vcvarsall.bat
popd

set include=d:\projects\3rdpartypublic\boost;%include%

echo include path is:
set include

echo continue working in:
cd
set buildswitch=BUILD
IF "%1%"=="FULL" SET buildswitch=REBUILD

echo building core with command:
echo devenv /%buildswitch% "Release|x64" .\MMCore\MMCore.vcproj
devenv /%buildswitch% "Release|x64" .\MMCore\MMCore.vcproj

echo building python wrapper with command:
echo devenv /%buildswitch% Release .\MMCorePy_wrap\MMCorePy_wrap.sln
devenv /%buildswitch% Release .\MMCorePy_wrap\MMCorePy_wrap.sln
copy .\bin_x64\MMCorePy.py .\Install_x64\micro-manager
copy .\bin_x64\_MMCorePy.pyd .\Install_x64\micro-manager
copy .\MMCorePy_wrap\MMCoreWrapDemo.py .\Install_x64\micro-manager

echo building Java wrapper with command:
echo devenv /%buildswitch% "Release|x64" .\MMCoreJ_wrap\MMCoreJ_wrap.sln
devenv /%buildswitch% "Release|x64" .\MMCoreJ_wrap\MMCoreJ_wrap.sln

echo Update the version number in MMStudioMainFrame
set mmversion=""
set YYYYMMDD=""
set TARGETNAME=""
call buildscripts\setmmversionvariable
call buildscripts\setyyyymmddvariable
pushd .\mmstudio\src\org\micromanager
rem for nightly builds we put the version + the date-stamp
rem arg2 is either RELEASE OR NIGHTLY
if "%2%" == "RELEASE" goto releaseversion
sed -i "s/\"1\.4.*/\"%mmversion%  %YYYYMMDD%\";/"  MMStudioMainFrame.java
set TARGETNAME=MMSetup64BIT_%mmversion%_%YYYYMMDD%.exe
goto continuebuild
:releaseversion
sed -i "s/\"1\.4.*/\"%mmversion%\";/"  MMStudioMainFrame.java
set TARGETNAME=MMSetup64BIT_%mmversion%.exe
:continuebuild
popd

rem remove any installer package with exactly the same name as the current output
echo trying to delete \Projects\micromanager\Install_x64\Output\MMSetup_.exe
del \Projects\micromanager\Install_x64\Output\MMSetup_.exe
echo trying to delete \Projects\micromanager\Install_x64\Output\%TARGETNAME%
del \Projects\micromanager\Install_x64\Output\%TARGETNAME%

ECHO incremental build of Java components...

set cleantarget=
IF "%1%"=="FULL" SET cleantarget=clean

PUSHD \projects\micromanager\mmStudio\src
echo building mmStudio with command:
echo call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
POPD

rem haven't got to the bottom of this yet, but Pixel Calibrator and Slide Explorer need this jar file there....
copy \projects\micromanager\bin_x64\plugins\Micro-Manager\MMJ_.jar \projects\micromanager\bin_x64\

pushd buildscripts
call buildJars %1
popd

set DEVICELISTBUILDER=1
pushd mmStudio\src
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install packInstaller
GOTO NOTAMD64
:AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install makeDeviceList packInstaller
:NOTAMD64
popd
set DEVICELISTBUILDER=""

pushd \Projects\micromanager\Install_x64\Output
rename MMSetup_.exe  %TARGETNAME%
popd

REM -- try to install on build machine
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE2
GOTO CANTINSTALLHERE
:AMD64BUILDMACHINE2
\Projects\micromanager\Install_x64\Output\%TARGETNAME% /silent
ECHO "Done installing"
:CANTINSTALLHERE

IF NOT "%3%" == "UPLOAD" GOTO FINISH
pscp -i c:\projects\MM.ppk -batch /projects/micromanager/Install_x64/Output/%TARGETNAME% MM@valelab.ucsf.edu:./public_html/nightlyBuilds/1.4/Windows/%TARGETNAME%
:FINISH

echo stop any instances that might already be running.
pskill javaw.exe
pskill java.exe

cd /d %~dp0\..
echo working directory is
cd

IF NOT "%1"=="FULL" GOTO UPDATEMMTREE

pushd ..\3rdparty
svn cleanup --non-interactive
svn update --accept postpone --force --ignore-externals --non-interactive
popd
pushd ..\3rdpartypublic
echo update 3rdpartypublic tree from the repository
svn cleanup --non-interactive
rem - been having trouble updating from boost.org, but don't need to do that anyhow for now.
svn update --accept postpone --force --ignore-externals --non-interactive
popd

:UPDATEMMTREE
echo update micromanager tree from the repository
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
pushd SecretDeviceAdapters
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
popd

echo Building native C++ libraries....

echo setup include path for Vizual Studio....
set include=
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto _x64
pushd "\Program Files\Microsoft Visual Studio 9.0\VC\"
goto setvcvars
:_x64
pushd "\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
:setvcvars
call vcvarsall.bat
popd

set include=d:\projects\3rdpartypublic\boost;%include%

echo include path is:
set include

echo continue working in:
cd
set buildswitch=
IF "%1%"=="FULL" SET buildswitch=/rebuild

echo building core with command:
echo vcbuild /M8 %buildswitch% .\MMCore\MMCore.vcproj "Release|x64"
vcbuild /M8 %buildswitch% .\MMCore\MMCore.vcproj "Release|x64"

echo building python wrapper with command:
echo vcbuild /M8 %buildswitch% .\MMCorePy_wrap\MMCorePy_wrap.sln "Release|x64"
vcbuild /M8 %buildswitch% .\MMCorePy_wrap\MMCorePy_wrap.sln "Release|x64"
copy .\bin_x64\MMCorePy.py .\Install_x64\micro-manager
copy .\bin_x64\_MMCorePy.pyd .\Install_x64\micro-manager
copy .\MMCorePy_wrap\MMCoreWrapDemo.py .\Install_x64\micro-manager

echo building Java wrapper with command:
echo vcbuild /M8 %buildswitch% .\MMCoreJ_wrap\MMCoreJ_wrap.sln "Release|x64"
vcbuild /M8 %buildswitch% .\MMCoreJ_wrap\MMCoreJ_wrap.sln "Release|x64"

echo Update the version number in MMStudioMainFrame
set mmversion=""
set YYYYMMDD=""
set TARGETNAME=""
call buildscripts\setmmversionvariable
call buildscripts\setyyyymmddvariable
pushd .\mmstudio\src\org\micromanager
rem for nightly builds we put the version + the date-stamp
rem arg2 is either RELEASE OR NIGHTLY
if "%2%" == "RELEASE" goto releaseversion
sed -i "s/\"1\.4.*/\"%mmversion%  %YYYYMMDD%\";/"  MMStudioMainFrame.java
set TARGETNAME=MMSetup64BIT_%mmversion%_%YYYYMMDD%.exe
goto continuebuild
:releaseversion
sed -i "s/\"1\.4.*/\"%mmversion%\";/"  MMStudioMainFrame.java
set TARGETNAME=MMSetup64BIT_%mmversion%.exe
:continuebuild
popd

rem remove any installer package with exactly the same name as the current output
echo trying to delete \Projects\micromanager\Install_x64\Output\MMSetup_.exe
del \Projects\micromanager\Install_x64\Output\MMSetup_.exe
echo trying to delete \Projects\micromanager\Install_x64\Output\%TARGETNAME%
del \Projects\micromanager\Install_x64\Output\%TARGETNAME%

ECHO incremental build of Java components...

set cleantarget=
IF "%1%"=="FULL" SET cleantarget=clean

PUSHD \projects\micromanager\mmStudio\src
echo building mmStudio with command:
echo call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
POPD

rem haven't got to the bottom of this yet, but Pixel Calibrator and Slide Explorer need this jar file there....
copy \projects\micromanager\bin_x64\plugins\Micro-Manager\MMJ_.jar \projects\micromanager\bin_x64\

pushd buildscripts
call buildJars %1
popd

set DEVICELISTBUILDER=1
pushd mmStudio\src
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install packInstaller
GOTO NOTAMD64
:AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install makeDeviceList packInstaller
:NOTAMD64
popd
set DEVICELISTBUILDER=""

pushd \Projects\micromanager\Install_x64\Output
rename MMSetup_.exe  %TARGETNAME%
popd

REM -- try to install on build machine
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE2
GOTO CANTINSTALLHERE
:AMD64BUILDMACHINE2
\Projects\micromanager\Install_x64\Output\%TARGETNAME% /silent
ECHO "Done installing"
:CANTINSTALLHERE

IF NOT "%3%" == "UPLOAD" GOTO FINISH
pscp -i c:\projects\MM.ppk -batch /projects/micromanager/Install_x64/Output/%TARGETNAME% arthur@valelab.ucsf.edu:../MM/public_html/nightlyBuilds/1.4/Windows/%TARGETNAME%
:FINISH

Make MM buildable using Visual Studio 2008 Express (64 bit)

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@8271 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd


@ECHO OFF

IF "%1"=="" GOTO :usage
IF "%2"=="" GOTO :usage
IF "%3"=="" GOTO :usage
IF "%4"=="" GOTO :usage
IF "%5"=="" GOTO :usage

@ECHO "SET DOCKER_HOST TO %1"
SET DOCKER_HOST=%1

@ECHO "BUILD DOCKER IMAGE"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" build -t jcorioland/vorlonjs:0.1 .

@ECHO "LOG INTO DOCKER HUB"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" login -u "%3" -p "%4" -e "%5"

@ECHO "PUSH IMAGE INTO DOCKER HUB"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" push jcorioland/vorlonjs:0.1

@ECHO "LOG OUT FROM DOCKER HUB"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" logout

GOTO :eof

:usage
@ECHO Usage: %0 ^<DOCKER_HOST^> ^<CERT_FOLDER^> ^<DOCKER_HUB_USERNAME^> ^<DOCKER_HUB_PASSWORD^>
EXIT /B 1

@ECHO OFF

IF "%1"=="" GOTO :usage
IF "%2"=="" GOTO :usage
IF "%3"=="" GOTO :usage
IF "%4"=="" GOTO :usage
IF "%5"=="" GOTO :usage

@ECHO "SET DOCKER_HOST TO %1"
SET DOCKER_HOST=%1

@ECHO "BUILD DOCKER IMAGE"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" build -t jcorioland/vorlonjs:0.1 .

@ECHO "LOG INTO DOCKER HUB"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" login --username="%3" --password="%4" --email="%5" https://index.docker.io/v1/

@ECHO "PUSH IMAGE INTO DOCKER HUB"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" push jcorioland/vorlonjs:0.1

@ECHO "LOG OUT FROM DOCKER HUB"
docker --tls --tlscacert="%2\ca.pem" --tlscert="%2\cert.pem" --tlskey="%2\key.pem" logout

GOTO :eof

:usage
@ECHO Usage: %0 ^<DOCKER_HOST^> ^<CERT_FOLDER^> ^<DOCKER_HUB_USERNAME^> ^<DOCKER_HUB_PASSWORD^>
EXIT /B 1

update docker image build script

update docker image build script


@echo off
setlocal

set VERSION=1.0.2

set OUTPUT=c:\NuGet\

%OUTPUT%nuget.exe push %OUTPUT%Packages\MMaitre.TraceEtw.%VERSION%.nupkg

@echo off
setlocal

set VERSION=1.0.13

set OUTPUT=c:\NuGet\

%OUTPUT%nuget.exe push %OUTPUT%Packages\MMaitre.TraceEtw.%VERSION%.nupkg

Update publication version

Update publication version


SETLOCAL
SET VERSION=%1
CALL Scripts\buildpack %VERSION% || exit /B 1
nuget push .\Artifacts\Mapsui.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.ArcGIS.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Extensions.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Wpf.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Android.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.iOS.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Forms.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Avalonia.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Maui.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Uno.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.WinUI.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Eto.%VERSION%.nupkg -source nuget.org || exit /B 1
git commit -m %VERSION% -a || exit /B 1
git tag %VERSION% || exit /B 1
git push origin %VERSION% || exit /B 1
git push || exit /B 1

SETLOCAL
SET VERSION=%1
CALL Scripts\buildpack %VERSION% || exit /B 1
nuget push .\Artifacts\Mapsui.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.ArcGIS.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Extensions.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Wpf.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Android.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.iOS.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Forms.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Avalonia.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Maui.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.Uno.%VERSION%.nupkg -source nuget.org || exit /B 1
REM nuget push .\Artifacts\Mapsui.WinUI.%VERSION%.nupkg -source nuget.org || exit /B 1
nuget push .\Artifacts\Mapsui.Eto.%VERSION%.nupkg -source nuget.org || exit /B 1
git commit -m %VERSION% -a || exit /B 1
git tag %VERSION% || exit /B 1
git push origin %VERSION% || exit /B 1
git push || exit /B 1

Enable maui in nuget push

Enable maui in nuget push


csc /t:library /out:HaliteHelper.dll HaliteHelper.cs
csc /reference:HaliteHelper.dll -out:MyBot.exe MyBot.cs
csc /reference:HaliteHelper.dll -out:RandomBot.exe RandomBot.cs
halite -d "30 30" "./MyBot.exe" "./RandomBot.exe"

csc /t:library /out:HaliteHelper.dll HaliteHelper.cs
csc /reference:HaliteHelper.dll -out:MyBot.exe MyBot.cs
csc /reference:HaliteHelper.dll -out:RandomBot.exe RandomBot.cs
halite -d "30 30" "MyBot.exe" "RandomBot.exe"

Update runGame.bat

Update runGame.bat


::
:: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
::
:: This file is part of Orfeo Toolbox
::
::   https://www.orfeo-toolbox.org/
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::   http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

:: Setup environment for OTB package
set CURRENT_SCRIPT_DIR=%~dp0

call :prefix_path PATH "%CURRENT_SCRIPT_DIR%bin"
call :prefix_path PYTHONPATH "%CURRENT_SCRIPT_DIR%lib\python"
call :prefix_path OTB_APPLICATION_PATH "%CURRENT_SCRIPT_DIR%lib\otb\applications"

set GDAL_DATA=%CURRENT_SCRIPT_DIR%share\data
set GEOTIFF_CSV=%CURRENT_SCRIPT_DIR%share\epsg_csv
set GDAL_DRIVER_PATH=disable
:: Set numeric locale to C
set LC_NUMERIC=C
goto :eof

:prefix_path
setlocal enabledelayedexpansion
set output=%~2
set var=%1
set content=
if defined %var% ( set content=!%var%! )
if not "%content%" == "" ( set output=%output%;%content% )
endlocal & set %1=%output%
goto :eof

::
:: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
::
:: This file is part of Orfeo Toolbox
::
::   https://www.orfeo-toolbox.org/
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::   http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
@echo off
:: Setup environment for OTB package
set CURRENT_SCRIPT_DIR=%~dp0

call :prefix_path PATH "%CURRENT_SCRIPT_DIR%bin"
call :prefix_path PYTHONPATH "%CURRENT_SCRIPT_DIR%lib\python"
call :prefix_path OTB_APPLICATION_PATH "%CURRENT_SCRIPT_DIR%lib\otb\applications"

set GDAL_DATA=%CURRENT_SCRIPT_DIR%share\data
set GEOTIFF_CSV=%CURRENT_SCRIPT_DIR%share\epsg_csv
set GDAL_DRIVER_PATH=disable
:: Set numeric locale to C
set LC_NUMERIC=C
goto :eof

:prefix_path
setlocal enabledelayedexpansion
set output=%~2
set var=%1
set content=
if not defined %var% ( goto :prefix_path_testcontent )
set content=!%var%!
:prefix_path_testcontent
if "%content%" == "" ( goto :prefix_path_end )
set output=%output%;%content%
:prefix_path_end
endlocal & set %1=%output%
goto :eof

BUG: fix otbenv.bat, problem with closing parenthesis in PATH


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

:: Add more build steps here, if they are necessary.

:: See
:: http://docs.continuum.io/conda/build.html
:: for a list of environment variables that are set during the build process.

add bld.bat

add bld.bat

Former-commit-id: 188c517328dd8f337d658c0f09604207e30ef8b5


change step 2

change step 2


@echo off
rem Submit and compare new and old performance test on cluster by default.
SetLocal EnableDelayedExpansion

set ShellDir=%~dp0
if %ShellDir:~-1%==\ set ShellDir=%ShellDir:~0,-1%
set CommonToolDir=%ShellDir%\..\..\tools
rem call %CommonToolDir%\set-common-dir-and-tools.bat
for /F "tokens=*" %%a in (' hostname ') do set hostname=%%a

if "%~1" == "" (
    echo Usage  :  %0  PerfRunCount SubmitTimes  NewPerfExeDir       OldPerfExeDir            MobiusJarDir           LogDir               LogName
    echo Example : %0  1            1            D:\mobius\new-test  D:\mobius\latest-master  d:\mobius\dependencies D:\mobius\perf-logs  perf--by-%USERNAME%--on-%hostname%.log
    echo To avoid default, you can set variables of the above and : OldPerfAppName NewPerfAppName JarOptions SparkOptions .
    echo Such as :
    echo set OldPerfExeDir=D:\msgit\orgMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
    echo set NewPerfExeDir=D:\msgit\lqmMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
    echo set MobiusJarDir=d:\mobius\perf-lz\dependencies
    echo set OldPerfAppName=org-perf
    echo set NewPerfAppName=new-perf
    exit /b 5
)

set PerfRunCount=%1
if not [%2] == [] (set "SubmitTimes=%2") else (set "SubmitTimes=1")
if not [%3] == [] set NewPerfExeDir=%3
if not [%4] == [] set OldPerfExeDir=%4
if not [%5] == [] set MobiusJarDir=%5
if not [%6] == [] set LogDir=%6
if not [%7] == [] set LogName=%7

if [%NewPerfExeDir%] == [] set NewPerfExeDir=D:\msgit\lqmMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
if [%OldPerfExeDir%] == [] set OldPerfExeDir=D:\msgit\orgMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
if [%MobiusJarDir%] == [] set MobiusJarDir=d:\mobius\perf-lz\dependencies
if [%LogDir%] == [] set LogDir=D:\mobius\perf-logs
if [%LogName%] == [] set LogName=perf--by-%USERNAME%--on-%hostname%.log

if [%JarOptions%]==[] set JarOptions=--jars %MobiusJarDir%\spark-csv_2.10-1.4.0.jar,%MobiusJarDir%\commons-csv-1.4.jar

set eventOptions=--conf spark.eventLog.enabled=true --conf spark.eventLog.dir=hdfs:///perf/eventlog

set PerfExeName=SparkCLRPerf.exe

call %CommonToolDir%\bat\check-exist-path.bat %OldPerfExeDir%\%PerfExeName% old-perf-exe || exit /b 1
call %CommonToolDir%\bat\check-exist-path.bat %NewPerfExeDir%\%PerfExeName% new-perf-exe || exit /b 1

set logPath=%LogDir%\%LogName%
if not exist %LogDir% md %LogDir%

rem for /F "tokens=*" %%a in (' lzmw ^| lzmw -it ".*--w1 .([\d-]+ [\d:]+).*" -o "$1" -PAC ^| lzmw -t "\s+" -o "__" -PAC ^| lzmw -it ":" -o "_" -PAC ') do set lzDateTimeNow=%%a
rem for /F "tokens=*" %%a in (' echo %logPath% ^| lzmw -it "[^\\\\/]+\s*$" -o "" -PAC ') do if not exist %%a md %%a

echo Submit parameters will be saved in %logPath%

if [%SparkOptions%] == [] (
    set SparkOptions=--total-executor-cores 30 --executor-memory 8G
    set SparkOptions=--total-executor-cores 100 --executor-memory 30G --driver-memory 32G
    set SparkOptions=--num-executors 100 --executor-cores 28 --executor-memory 30G --driver-memory 32G
    set SparkOptions=--num-executors 100 --executor-cores 28 --executor-memory 8G --driver-memory 12G
    set SparkOptions=--master yarn-cluster !SparkOptions! %JarOptions% %eventOptions%
)

if [%OldPerfAppName%]==[] (
    call %CommonToolDir%\bat\get-name-by-git-in-dir-to-var %OldPerfExeDir% OldPerfAppName
    if not [!OldPerfAppName!]==[] set OldPerfAppName=%PerfExeName%-!OldPerfAppName!
)

if [%NewPerfAppName%]==[] (
    call %CommonToolDir%\bat\get-name-by-git-in-dir-to-var %NewPerfExeDir% NewPerfAppName
    if not [!NewPerfAppName!]==[] set NewPerfAppName=%PerfExeName%-!NewPerfAppName!
)

if [%OldPerfAppName%] == [%NewPerfAppName%] (
    set OldPerfAppName=%PerfExeName%-old
    set NewPerfAppName=%PerfExeName%-new
)

for /L %%k in (1,1,%SubmitTimes%) do (
    call :Submit_Dir_AppName %OldPerfExeDir% %OldPerfAppName%
    echo.
    call :Submit_Dir_AppName %NewPerfExeDir% %NewPerfAppName%
)

exit /b 0

:Submit_Dir_AppName
    set args=D:\Temp\TempDirForSpark %PerfRunCount% hdfs:///perf/data/deletions/*
    set exeDir=%1
    if not "%~2" == "" set appName=%2
    rem Use test exe directory name if not input appName
    if "%~2" == "" for /F "tokens=*" %%a in ('echo %1 ^| lzmw -it ".*?([\w-]+)\s*$" -o "$1" -PAC ') do set appName=%%a
    rem Append args as name tail to be obvious when lookup on cluster web page
    call %CommonToolDir%\bat\get-appendix-name-from %SparkOptions%
    set submitArgs=--name %appName%-run-%PerfRunCount%__%AppNameBySparkOptions% %SparkOptions% --exe SparkCLRPerf.exe %exeDir% %args%
    echo %date% %time% sparkclr-submit.cmd %submitArgs%
    echo %date% %time% sparkclr-submit.cmd %submitArgs% >> %logPath%
    call sparkclr-submit.cmd %submitArgs%  2>&1 | lzmw -it "tracking URL|final status" -PC -c -T 2 >> %logPath%
    echo. >> %logPath%

@echo off
rem Submit and compare new and old performance test on cluster by default.
rem Example :
rem set OldPerfExeDir=d:\msgit\Mobius-1.6.200-PREVIEW-1\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
rem set NewPerfExeDir=d:\msgit\revMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
rem set JarOptions=--jars d:\msgit\Mobius-1.6.200-PREVIEW-1\build\dependencies\commons-csv-1.1.jar,d:\msgit\Mobius-1.6.200-PREVIEW-1\build\dependencies\spark-csv_2.10-1.3.0.jar
rem set SparkOptions=--master yarn-cluster --total-executor-cores 50 --executor-memory 8G --conf spark.eventLog.enabled=true --conf spark.eventLog.dir=hdfs:///perf/eventlog %JarOptions%
rem set OldPerfAppName=SparkCLRPerf.exe-Mobius-1.6.200-PREVIEW-1
rem set JustShowCmd=1

SetLocal EnableDelayedExpansion

set ShellDir=%~dp0
if %ShellDir:~-1%==\ set ShellDir=%ShellDir:~0,-1%
set CommonToolDir=%ShellDir%\..\..\tools
call %CommonToolDir%\set-common-dir-and-tools.bat

for /F "tokens=*" %%a in (' hostname ') do set hostname=%%a

if "%~1" == "" (
    echo Usage  :  %0  PerfRunCount [SubmitTimes]  [NewPerfExeDir]       [OldPerfExeDir]            [MobiusJarDir]           [LogDir]               [LogName]
    echo Example : %0  1             1            D:\mobius\new-test  D:\mobius\latest-master  d:\mobius\dependencies D:\mobius\perf-logs  perf--by-%USERNAME%--on-%hostname%.log
    echo To avoid default, you can set variables of the above and : OldPerfAppName NewPerfAppName JarOptions SparkOptions .
    echo Such as :
    echo set OldPerfExeDir=D:\msgit\orgMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
    echo set NewPerfExeDir=D:\msgit\lqmMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
    echo set OldPerfAppName=org-perf
    echo set NewPerfAppName=new-perf
    rem echo set MobiusJarDir=d:\mobius\perf-lz\dependencies
    echo set PerfTestData=hdfs:///perf/data/deletions/*
    echo set PerfTestTmpDir=D:\Temp\TempDirForSpark
    echo set JustShowCmd=1 will just print the final command and not execute submitting.
    exit /b 5
)

set PerfRunCount=%1
if not [%2] == [] (set "SubmitTimes=%2") else (set "SubmitTimes=1")
if not [%3] == [] set NewPerfExeDir=%3
if not [%4] == [] set OldPerfExeDir=%4
if not [%5] == [] set MobiusJarDir=%5
if not [%6] == [] set LogDir=%6
if not [%7] == [] set LogName=%7

if [%NewPerfExeDir%] == [] set NewPerfExeDir=D:\msgit\lqmMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
if [%OldPerfExeDir%] == [] set OldPerfExeDir=D:\msgit\orgMobius\csharp\Perf\Microsoft.Spark.CSharp\bin\Release
if [%MobiusJarDir%] == [] set MobiusJarDir=d:\mobius\perf-lz\dependencies
if [%LogDir%] == [] set LogDir=D:\mobius\perf-logs
if [%LogName%] == [] set LogName=perf--by-%USERNAME%--on-%hostname%.log
if not defined PerfTestTmpDir set PerfTestTmpDir=D:\Temp\TempDirForSpark
if not defined PerfTestData set PerfTestData=hdfs:///perf/data/deletions/*

rem JarOptions and EventOptions will not effect if defined SparkOptions
if not defined JarOptions set JarOptions=--jars %MobiusJarDir%\spark-csv_2.10-1.4.0.jar,%MobiusJarDir%\commons-csv-1.4.jar
if not defined EventOptions set EventOptions=--conf spark.eventLog.enabled=true --conf spark.eventLog.dir=hdfs:///perf/eventlog

set PerfExeName=SparkCLRPerf.exe

call %CommonToolDir%\bat\check-exist-path.bat %OldPerfExeDir%\%PerfExeName% old-perf-exe || exit /b 1
call %CommonToolDir%\bat\check-exist-path.bat %NewPerfExeDir%\%PerfExeName% new-perf-exe || exit /b 1

set logPath=%LogDir%\%LogName%
if not exist %LogDir% md %LogDir%

rem for /F "tokens=*" %%a in (' lzmw ^| lzmw -it ".*--w1 .([\d-]+ [\d:]+).*" -o "$1" -PAC ^| lzmw -t "\s+" -o "__" -PAC ^| lzmw -it ":" -o "_" -PAC ') do set lzDateTimeNow=%%a
rem for /F "tokens=*" %%a in (' echo %logPath% ^| lzmw -it "[^\\\\/]+\s*$" -o "" -PAC ') do if not exist %%a md %%a

echo Submit parameters will be saved in %logPath%

if not defined SparkOptions (
    set SparkOptions=--total-executor-cores 30 --executor-memory 8G
    set SparkOptions=--total-executor-cores 100 --executor-memory 30G --driver-memory 32G
    set SparkOptions=--num-executors 100 --executor-cores 28 --executor-memory 30G --driver-memory 32G
    set SparkOptions=--num-executors 100 --executor-cores 28 --executor-memory 8G --driver-memory 12G
    set SparkOptions=--master yarn-cluster !SparkOptions! %JarOptions% %EventOptions%
)

for /F "tokens=*" %%a in ('echo !SparkOptions! ^| lzmw -it ".*--jars\s+(\S+).*" -o "$1" -PAC ^| lzmw -it "\s*,\s*" -o "\n" -PAC ') do (
    if not exist %%a ( echo Not exist %%a | lzmw -PA -it ".*" ) else (echo Found jar : %%a | lzmw -PA -ie ".*")
)

if not defined OldPerfAppName (
    call %CommonToolDir%\bat\get-name-by-git-in-dir-to-var %OldPerfExeDir% OldPerfAppName
    if not "!OldPerfAppName!" == "" ( set "OldPerfAppName=%PerfExeName%-!OldPerfAppName!" ) else ( set "OldPerfAppName=%PerfExeName%" )
)

if not defined NewPerfAppName (
    call %CommonToolDir%\bat\get-name-by-git-in-dir-to-var %NewPerfExeDir% NewPerfAppName
    if not "!NewPerfAppName!" == "" ( set "NewPerfAppName=%PerfExeName%-!NewPerfAppName!" ) else ( set "NewPerfAppName=%PerfExeName%" )
)

if "%OldPerfAppName%" == "%NewPerfAppName%" (
    set OldPerfAppName=%PerfExeName%-old
    set NewPerfAppName=%PerfExeName%-new
)

echo PerfRunCount = %PerfRunCount%, SubmitTimes = %SubmitTimes% | lzmw -PA -ie "\w+"

for /L %%k in (1,1,%SubmitTimes%) do (
    call :Submit_Dir_AppName %OldPerfExeDir% %OldPerfAppName%
    echo.
    call :Submit_Dir_AppName %NewPerfExeDir% %NewPerfAppName%
)

exit /b 0

:Submit_Dir_AppName
    set args=%PerfTestTmpDir% %PerfRunCount% %PerfTestData%
    set exeDir=%1
    if not "%~2" == "" set appName=%2
    rem Use test exe directory name if not input appName
    if "%~2" == "" for /F "tokens=*" %%a in ('echo %1 ^| lzmw -it ".*?([\w-]+)\s*$" -o "$1" -PAC ') do set appName=%%a
    rem Append args as name tail to be obvious when lookup on cluster web page
    call %CommonToolDir%\bat\get-appendix-name-from %SparkOptions%
    set submitArgs=--name %appName%-run-%PerfRunCount%__%AppNameBySparkOptions% %SparkOptions% --exe SparkCLRPerf.exe %exeDir% %args%
    echo.
    echo %date% %time% sparkclr-submit.cmd %submitArgs% | lzmw -PA -ie "([\w\.]*\.\w*mobius\w*\.[\w\.]*)|SparkOption\w*|(?:=)\w+|\s+\d+\w{0,2}(\s+|$)" -t "((--name))\s+(((\S+)))" -a
    if "%JustShowCmd%" == "1" exit /b 0
    echo %date% %time% sparkclr-submit.cmd %submitArgs% >> %logPath%
    call sparkclr-submit.cmd %submitArgs% 2>&1 | lzmw -P -it "error|exception|not found|cannot|failed|warn" -a
    :: call sparkclr-submit.cmd %submitArgs%  2>&1 | lzmw -it "tracking URL|final status" -PC -c -T 2 >> %logPath%
    echo. >> %logPath%

Update submit-perf-test-comparison.bat add example in itself.


@echo off
rem check that JAVA_HOME and LCF_HOME are set
if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
if not exist "%LCF_HOME%\properties.ini" goto nolcfhome
rem save existing path here
set OLDDIR=%CD%
cd "%LCF_HOME%\processes"
set CLASSPATH=.
for %%f in (jar/*) do call script\setclasspath.bat %%f
set JAVADEFINES=
for %%g in (define/*) do call script\setdefine.bat %%g
rem restore old path here
cd "%OLDDIR%"
"%JAVA_HOME%\bin\java" "-Dorg.apache.lcf.configfile=%LCF_HOME%\properties.ini" %JAVADEFINES% -classpath "%CLASSPATH%" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto done
:nojavahome
echo Environment variable JAVA_HOME is not set properly.
goto done
:nolcfhome
echo Environment variable LCF_HOME is not set properly.
goto done
:done

@echo off
rem check that JAVA_HOME and LCF_HOME are set
if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
if not exist "%LCF_HOME%\properties.ini" goto nolcfhome
rem save existing path here
set OLDDIR=%CD%
cd "%LCF_HOME%\processes"
set CLASSPATH=.
for %%f in (jar/*) do call script\setclasspath.bat %%f
set JAVADEFINES=
for %%g in (define/*) do call script\setdefine.bat %%g
rem restore old path here
cd "%OLDDIR%"
"%JAVA_HOME%\bin\java" "-Dorg.apache.lcf.configfile=%LCF_HOME%\properties.ini" %JAVADEFINES% -classpath "%CLASSPATH%" %*
goto done
:nojavahome
echo Environment variable JAVA_HOME is not set properly.
goto done
:nolcfhome
echo Environment variable LCF_HOME is not set properly.
goto done
:done

Use %* instead of enumerated arguments when calling java

git-svn-id: 0503cfb7d358eaa9bd718f348f448f10022ea703@939729 13f79535-47bb-0310-9956-ffa450edef68


@echo off
setlocal

set PROJDIR=%~dp0..
set DISTBASE=%PROJDIR%\dist

set GIT=C:\Program Files\Git\bin\git.exe
set REPOURL=https://github.com/poderosaproject/poderosa.git

RD /S /Q "%DISTBASE%\Poderosa-X.X.X"

"%GIT%" clone "%REPOURL%" "%DISTBASE%\Poderosa-X.X.X"

RD /S /Q "%DISTBASE%\Poderosa-X.X.X\.git"

pause

@echo off
setlocal

set PROJDIR=%~dp0..
set DISTBASE=%PROJDIR%\dist

set GIT=C:\Program Files\Git\bin\git.exe
set REPOURL=https://github.com/poderosaproject/poderosa.git

RD /S /Q "%DISTBASE%\Poderosa-X.X.X"

"%GIT%" clone "%REPOURL%" "%DISTBASE%\Poderosa-X.X.X"

RD /S /Q "%DISTBASE%\Poderosa-X.X.X\.git"

for /F skip^=2^ delims^=^"^ tokens^=2 %%T in ('FIND "PODEROSA_VERSION" "%DISTBASE%\Poderosa-X.X.X\Plugin\VersionInfo.cs"') do (
  set PODEROSA_VERSION=%%T
)

RD /S /Q "%DISTBASE%\Poderosa-%PODEROSA_VERSION%"
REN "%DISTBASE%\Poderosa-X.X.X" "Poderosa-%PODEROSA_VERSION%"

pause

update batch file.

update batch file.


@echo on
setlocal

:: setup compil env
set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
:: find the varsall parameters
if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "static" set VC_VARSALL=amd64

set qtplatform=%PLATFORM%
call %VC_DIR% %VC_VARSALL%

for %%* in (.) do set CurrDirName=%%~nx*
C:\Qt\%QT_VER%\%qtplatform%\bin\qmake .\app\ || exit /B 1

:: compilation
nmake qmake_all || exit /B 1
nmake || exit /B 1
nmake release || exit /B 1
echo "step 4"
nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1
echo "step 5"

:: qt deploy
C:\Qt\%QT_VER%\%qtplatform%\bin\windeployqt.exe %CurrDirName%\release\ --qmldir C:\project\qregovar\app\UI\

@echo on
setlocal

:: setup compil env
set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
:: find the varsall parameters
if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
if "%PLATFORM%" == "static" set VC_VARSALL=amd64

set qtplatform=%PLATFORM%
call %VC_DIR% %VC_VARSALL%

for %%* in (.) do set CurrDirName=%%~nx*
C:\Qt\%QT_VER%\%qtplatform%\bin\qmake .\app\ || exit /B 1

:: compilation
nmake qmake_all || exit /B 1
nmake || exit /B 1
nmake release || exit /B 1
echo "step 4"
nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1
echo "step 5"

:: qt deploy
C:\Qt\%QT_VER%\%qtplatform%\bin\windeployqt.exe %CurrDirName% --qmldir C:\project\qregovar\app\UI\

Update build-msvc.bat

Update build-msvc.bat


function cdt()
{

    case "$1" in
    "-h") showcdtusage;;

    "") cdtbranches unstable;;
    "unstable") cdtbranches $1;;
    "10.3") cdtbranches $1;;
    "10.2") cdtbranches $1;;
    "10.1") cdtbranches $1;;

    "conv") cd /c/src/conversion;;
    "home") cd /c/users/chirag.shukla;;
    "d") cd /d;;
    "safe") cd /d/safe_exes;;
    "tempsrc") cd /d/tempsrc;;
    "stash") cd /d/stashedsrc;;
    "review") cd /d/code-review;;
    esac
}

function cdtbranches()
{
    cd /c/src/leds/branches/$1
}

function showcdtusage()
{
    echo 'Usage: . cdt 10.2        cd into 10.2 branch'
    echo '       . cdt 10.1        cd into 10.1 branch'
    echo '       . cdt unstable    cd into unstable branch'
    echo '       . cdt             cd into unstable branch'
    echo '       . cdt conv        cd into conversion'
    echo '       . cdt home        cd into c:\users\zf'
    echo '       . cdt d           cd into d: drive'
    echo '       . cdt safe        cd into d:\safe_exes'
    echo '       . cdt tempsrc     cd into d:\tempsrc'
    echo '       . cdt stash       cd into d:\stashedsrc'
    echo '       . cdt review      cd into d:\code-review'
}

Change directory - useful with ConEmu and MinGW


@echo off
setlocal

set "async=true"
set "freq=120"

goto :parsePackage

:: functions

:help

type "%~dp0help\popcornd.txt"

goto :eof

:usage

call :help 1>&2
exit /b 1

goto :eof

:: end functions

:parsePackage

if "%~1" == "" goto usage
set "package=%~1"
shift

:parseArgs

if "%~1" == "" goto doneParsing

if /i "%~1" == "-?" goto help
if /i "%~1" == "-h" goto help
if /i "%~1" == "--help" goto help

if /i "%~1" == "-f" (
    shift
    set "freq=%~1"
)

if /i "%~1" == "--freq" (
    shift
    set "freq=%~1"
)

if /i "%~1" == "--forward" (
    shift
    set "forwardArgs=%~1"
)

if /i "%~1" == "--stop-after" (
    shift
    set "duration=%~1"
)

if /i "%~1" == "--sync" set "async=false"

shift
goto parseArgs

:doneParsing

if "%async%" == "true" (
    start /b "%~f0" --sync %*
    exit %errorlevel%
)

@echo off
setlocal

set "async=true"
set "freq=120"

goto :parsePackage

:: functions

:help

type "%~dp0help\popcornd.txt"

goto :eof

:usage

call :help 1>&2
exit /b 1

goto :eof

:: end functions

:parsePackage

if "%~1" == "" goto usage
set "package=%~1"
shift

:parseArgs

if "%~1" == "" goto doneParsing

if /i "%~1" == "-?" goto help
if /i "%~1" == "-h" goto help
if /i "%~1" == "--help" goto help

if /i "%~1" == "-f" (
    shift
    set "freq=%~1"
)

if /i "%~1" == "--freq" (
    shift
    set "freq=%~1"
)

if /i "%~1" == "--forward" (
    shift
    set "forwardArgs=%~1"
)

if /i "%~1" == "--stop-after" (
    shift
    set "duration=%~1"
)

if /i "%~1" == "--sync" set "async=false"

shift
goto parseArgs

:doneParsing

if "%async%" == "true" (
    start /b "%~f0" --sync %*
    exit /b %errorlevel%
)

exit => exit /b

exit => exit /b