@ECHO OFF

REM $Id$

if "%JAVA_HOME%" == "" goto noJavaHome

set TMP_BARCODE4J_HOME=
rem %~dp0 is the expanded pathname of the current script under NT
if "%OS%"=="Windows_NT" set TMP_BARCODE4J_HOME=%~dp0

set TMP_LIBDIR=%TMP_BARCODE4J_HOME%lib
if exist %TMP_BARCODE4J_HOME%build\barcode4j.jar goto srcdist
:bindist
set TMP_CLASSPATH=%TMP_BARCODE4J_HOME%barcode4j.jar
goto skip1
:srcdist
set TMP_CLASSPATH=%TMP_BARCODE4J_HOME%build\barcode4j.jar
:skip1
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\xml-apis-1.3.04.jar
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\xercesImpl-2.9.0.jar
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\xalan-2.7.0.jar
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\serializer-2.7.0.jar
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\avalon-framework-4.2.0.jar
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\commons-cli-1.0.jar
REM ECHO %TMP_CLASSPATH%

if "%OS%"=="Windows_NT" goto WinNT

:Win98
"%JAVA_HOME%\bin\java" -cp %TMP_CLASSPATH% org.krysalis.barcode4j.cli.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO exit

:WinNT
"%JAVA_HOME%\bin\java" -cp %TMP_CLASSPATH% org.krysalis.barcode4j.cli.Main %*
GOTO exit

:noJavaHome
ECHO Please set the JAVA_HOME environment variable.

:exit

REM @ECHO OFF

REM $Id$

if "%JAVA_HOME%" == "" goto noJavaHome

set TMP_BARCODE4J_HOME=
rem %~dp0 is the expanded pathname of the current script under NT
if "%OS%"=="Windows_NT" set TMP_BARCODE4J_HOME=%~dp0

set TMP_LIBDIR=%TMP_BARCODE4J_HOME%lib
if exist "%TMP_BARCODE4J_HOME%build\barcode4j.jar" goto srcdist
:bindist
set TMP_CLASSPATH=%TMP_BARCODE4J_HOME%barcode4j.jar
goto skip1
:srcdist
set TMP_CLASSPATH=%TMP_BARCODE4J_HOME%build\barcode4j.jar
:skip1
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\avalon-framework-4.2.0.jar
set TMP_CLASSPATH=%TMP_CLASSPATH%;%TMP_LIBDIR%\commons-cli-1.0.jar
REM ECHO %TMP_CLASSPATH%

if "%OS%"=="Windows_NT" goto WinNT

:Win98
"%JAVA_HOME%\bin\java" -cp "%TMP_CLASSPATH%" org.krysalis.barcode4j.cli.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO exit

:WinNT
"%JAVA_HOME%\bin\java" -cp "%TMP_CLASSPATH%" org.krysalis.barcode4j.cli.Main %*
GOTO exit

:noJavaHome
ECHO Please set the JAVA_HOME environment variable.

:exit

Fix problems with spaces in paths.

Fix problems with spaces in paths.


REM Version
set /p version="Version? [e.g. 0.0.5]"
REM 32bit
mkdir TEMP
copy SymbSearch\bin\x86\Release\ TEMP
copy LICENCE TEMP
cd TEMP
"C:\Program Files\7-Zip\7z.exe" a -r ..\RELEASE\SymbSearch-%version%-win32.zip *
del /Q *
REM 64bit
copy SymbSearch\bin\x64\Release\ TEMP
copy LICENCE TEMP
cd TEMP
"C:\Program Files\7-Zip\7z.exe" a -r ..\RELEASE\SymbSearch-%version%-win64.zip *
cd ..
rd /Q /S TEMP

Fix #27: Add pack-it.bat

Fix #27: Add pack-it.bat


build\nuget.exe pack src\PygmentSharp\PygmentSharp.Core\PygmentSharp.Core.csproj -Build -Properties Configuration=Release

Package RELEASE mode

Package RELEASE mode


@echo off
REM ---------------------------------------------------------------------------
REM        Copyright 2005-2009 WSO2, Inc. http://www.wso2.org
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 Main Script for WSO2 Carbon
rem
rem Environment Variable Prequisites
rem
rem   CARBON_HOME   Home of CARBON installation. If not set I will  try
rem                   to figure it out.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------
:checkJava

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto checkServer

:noJavaHome
echo "You must set the JAVA_HOME variable before running CARBON."
goto end

rem ----- Only set CARBON_HOME if not already set ----------------------------
:checkServer
setlocal enabledelayedexpansion
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
SET curDrive=%cd:~0,1%
SET wsasDrive=%CARBON_HOME:~0,1%
if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:

rem find CARBON_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if not exist "%CARBON_HOME%\bin\version.txt" goto noServerHome

set AXIS2_HOME=%CARBON_HOME%
goto updateClasspath

:noServerHome
echo CARBON_HOME is set incorrectly or CARBON could not be located. Please set CARBON_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath
cd %CARBON_HOME%
set CARBON_CLASSPATH=
FOR %%C in ("%CARBON_HOME%\bin\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\%%~nC%%~xC"

set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;

FOR %%D in ("%CARBON_HOME%\lib\commons-lang*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nD%%~xD"

rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:setupArgs
if ""%1""=="""" goto doneStart

if ""%1""==""-run""     goto commandLifecycle
if ""%1""==""--run""    goto commandLifecycle
if ""%1""==""run""      goto commandLifecycle

if ""%1""==""-restart""  goto commandLifecycle
if ""%1""==""--restart"" goto commandLifecycle
if ""%1""==""restart""   goto commandLifecycle

if ""%1""==""debug""    goto commandDebug
if ""%1""==""-debug""   goto commandDebug
if ""%1""==""--debug""  goto commandDebug

if ""%1""==""version""   goto commandVersion
if ""%1""==""-version""  goto commandVersion
if ""%1""==""--version"" goto commandVersion

if ""%1""==""optimize""  	goto profileOptimizer
if ""%1""==""-optimize"" 	goto profileOptimizer
if ""%1""==""--optimize""	goto profileOptimizer

shift
goto setupArgs

rem ----- commandVersion -------------------------------------------------------
:commandVersion
shift
type "%CARBON_HOME%\bin\version.txt"
type "%CARBON_HOME%\bin\wso2carbon-version.txt"
goto end

rem ----- commandDebug ---------------------------------------------------------
:commandDebug
shift
set DEBUG_PORT=%1
if "%DEBUG_PORT%"=="" goto noDebugPort
if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option.
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
echo Please start the remote debugging client to continue...
goto findJdk

:noDebugPort
echo Please specify the debug port after the --debug option
goto end

rem ----- commandLifecycle -----------------------------------------------------
:commandLifecycle
goto findJdk

rem ----- profile optimization then start the server---------------------------------
:profileOptimizer
setlocal enableDelayedExpansion
set found=false
for %%a in (!originalArgs!) do (
	if !found!==true (
		set profile=-Dprofile=%%a
		set found=false
	)
	if %%a==-Dprofile ( set found=true
	)
)
call bin\profileSetup.bat %profile%
endlocal
goto findJdk

:doneStart
if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

rem ---------- Handle the SSL Issue with proper JDK version --------------------
rem find the version of the jdk
:findJdk

set CMD=RUN %*

:checkJdk17
PATH %PATH%;%JAVA_HOME%\bin\
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "JAVA_VERSION=%%j%%k"
if %JAVA_VERSION% LSS 17 goto unknownJdk
if %JAVA_VERSION% GTR 110 goto unknownJdk
goto jdk17

:unknownJdk
echo Starting WSO2 Carbon (in unsupported JDK)
echo [ERROR] CARBON is supported only on JDK 1.7, 1.8, 9, 10 and 11
goto jdk17

:jdk17
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer
cd %CARBON_HOME%

rem ------------------ Remove tmp folder on startup -----------------------------
set TMP_DIR=%CARBON_HOME%\tmp
cd "%TMP_DIR%"
del *.* /s /q > nul
FOR /d %%G in ("*.*") DO rmdir %%G /s /q
cd ..

rem ---------- Add jars to classpath ----------------

set CARBON_CLASSPATH=.\lib;%CARBON_CLASSPATH%

if %JAVA_VERSION% GEQ 110 set CARBON_CLASSPATH=.\lib\endorsed\*;%CARBON_CLASSPATH%

if %JAVA_VERSION% LEQ 18 set JAVA_VER_BASED_OPTS=-Djava.endorsed.dirs=".\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"
if %JAVA_VERSION% GEQ 110 set JAVA_VER_BASED_OPTS=--add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED

set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof"  -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% %JAVA_VER_BASED_OPTS% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dcatalina.base="%CARBON_HOME%\lib\tomcat" -Dwso2.carbon.xml=%CARBON_HOME%\repository\conf\carbon.xml -Dwso2.registry.xml="%CARBON_HOME%\repository\conf\registry.xml" -Dwso2.user.mgt.xml="%CARBON_HOME%\repository\conf\user-mgt.xml" -Dwso2.transports.xml="%CARBON_HOME%\repository\conf\mgt-transports.xml" -Djava.util.logging.config.file="%CARBON_HOME%\repository\conf\etc\logging-bridge.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcarbon.config.dir.path="%CARBON_HOME%\repository\conf"  -Dcomponents.repo="%CARBON_HOME%\repository\components" -Dconf.location="%CARBON_HOME%\repository\conf" -Dcom.atomikos.icatch.file="%CARBON_HOME%\lib\transactions.properties" -Dcom.atomikos.icatch.hide_init_file_path="true" -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dcom.sun.jndi.ldap.connect.pool.authentication=simple -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 -Dorg.terracotta.quartz.skipUpdateCheck=true -Dcarbon.classpath=%CARBON_CLASSPATH% -Dfile.encoding=UTF8 -DworkerNode=false -Dhttpclient.hostnameVerifier="DefaultAndLocalhost" -Dcarbon.new.config.dir.path="%CARBON_HOME%\repository\resources\conf"
set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof"  -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dcatalina.base="%CARBON_HOME%\lib\tomcat" -Dwso2.carbon.xml=%CARBON_HOME%\repository\conf\carbon.xml -Dwso2.registry.xml="%CARBON_HOME%\repository\conf\registry.xml" -Dwso2.user.mgt.xml="%CARBON_HOME%\repository\conf\user-mgt.xml" -Dwso2.transports.xml="%CARBON_HOME%\repository\conf\mgt-transports.xml" -Djava.util.logging.config.file="%CARBON_HOME%\repository\conf\etc\logging-bridge.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcarbon.config.dir.path="%CARBON_HOME%\repository\conf"  -Dcomponents.repo="%CARBON_HOME%\repository\components" -Dconf.location="%CARBON_HOME%\repository\conf" -Dcom.atomikos.icatch.file="%CARBON_HOME%\lib\transactions.properties" -Dcom.atomikos.icatch.hide_init_file_path="true" -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dcom.sun.jndi.ldap.connect.pool.authentication=simple -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 -Dorg.terracotta.quartz.skipUpdateCheck=true -Dcarbon.classpath=%CARBON_CLASSPATH% -Dorg.opensaml.httpclient.https.disableHostnameVerification=true -Dfile.encoding=UTF8 -Dhttpclient.hostnameVerifier=AllowAll

:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.wso2.carbon.bootstrap.Bootstrap %CMD%
if "%ERRORLEVEL%"=="121" goto runJava
:end
goto endlocal

:endlocal

:END

@echo off
REM ---------------------------------------------------------------------------
REM        Copyright 2005-2009 WSO2, Inc. http://www.wso2.org
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 Main Script for WSO2 Carbon
rem
rem Environment Variable Prequisites
rem
rem   CARBON_HOME   Home of CARBON installation. If not set I will  try
rem                   to figure it out.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------
:checkJava

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto checkServer

:noJavaHome
echo "You must set the JAVA_HOME variable before running CARBON."
goto end

rem ----- Only set CARBON_HOME if not already set ----------------------------
:checkServer
setlocal enabledelayedexpansion
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
SET curDrive=%cd:~0,1%
SET wsasDrive=%CARBON_HOME:~0,1%
if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:

rem find CARBON_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if not exist "%CARBON_HOME%\bin\version.txt" goto noServerHome

set AXIS2_HOME=%CARBON_HOME%
goto updateClasspath

:noServerHome
echo CARBON_HOME is set incorrectly or CARBON could not be located. Please set CARBON_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath
cd %CARBON_HOME%
set CARBON_CLASSPATH=
FOR %%C in ("%CARBON_HOME%\bin\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\bin\%%~nC%%~xC"

set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;

FOR %%D in ("%CARBON_HOME%\lib\commons-lang*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nD%%~xD"

rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:setupArgs
if ""%1""=="""" goto doneStart

if ""%1""==""-run""     goto commandLifecycle
if ""%1""==""--run""    goto commandLifecycle
if ""%1""==""run""      goto commandLifecycle

if ""%1""==""-restart""  goto commandLifecycle
if ""%1""==""--restart"" goto commandLifecycle
if ""%1""==""restart""   goto commandLifecycle

if ""%1""==""debug""    goto commandDebug
if ""%1""==""-debug""   goto commandDebug
if ""%1""==""--debug""  goto commandDebug

if ""%1""==""version""   goto commandVersion
if ""%1""==""-version""  goto commandVersion
if ""%1""==""--version"" goto commandVersion

if ""%1""==""optimize""  	goto profileOptimizer
if ""%1""==""-optimize"" 	goto profileOptimizer
if ""%1""==""--optimize""	goto profileOptimizer

shift
goto setupArgs

rem ----- commandVersion -------------------------------------------------------
:commandVersion
shift
type "%CARBON_HOME%\bin\version.txt"
type "%CARBON_HOME%\bin\wso2carbon-version.txt"
goto end

rem ----- commandDebug ---------------------------------------------------------
:commandDebug
shift
set DEBUG_PORT=%1
if "%DEBUG_PORT%"=="" goto noDebugPort
if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option.
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
echo Please start the remote debugging client to continue...
goto findJdk

:noDebugPort
echo Please specify the debug port after the --debug option
goto end

rem ----- commandLifecycle -----------------------------------------------------
:commandLifecycle
goto findJdk

rem ----- profile optimization then start the server---------------------------------
:profileOptimizer
setlocal enableDelayedExpansion
set found=false
for %%a in (!originalArgs!) do (
	if !found!==true (
		set profile=-Dprofile=%%a
		set found=false
	)
	if %%a==-Dprofile ( set found=true
	)
)
call bin\profileSetup.bat %profile%
endlocal
goto findJdk

:doneStart
if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

rem ---------- Handle the SSL Issue with proper JDK version --------------------
rem find the version of the jdk
:findJdk

set CMD=RUN %*

:checkJdk17
PATH %PATH%;%JAVA_HOME%\bin\
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "JAVA_VERSION=%%j%%k"
if %JAVA_VERSION% LSS 17 goto unknownJdk
if %JAVA_VERSION% GTR 110 goto unknownJdk
goto jdk17

:unknownJdk
echo Starting WSO2 Carbon (in unsupported JDK)
echo [ERROR] CARBON is supported only on JDK 1.7, 1.8, 9, 10 and 11
goto jdk17

:jdk17
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer
cd %CARBON_HOME%

rem ------------------ Remove tmp folder on startup -----------------------------
set TMP_DIR=%CARBON_HOME%\tmp
cd "%TMP_DIR%"
del *.* /s /q > nul
FOR /d %%G in ("*.*") DO rmdir %%G /s /q
cd ..

rem ---------- Add jars to classpath ----------------

set CARBON_CLASSPATH=".\lib\*";%CARBON_CLASSPATH%

if %JAVA_VERSION% GEQ 110 set CARBON_CLASSPATH=".\lib\endorsed\*";%CARBON_CLASSPATH%

if %JAVA_VERSION% LEQ 18 set JAVA_VER_BASED_OPTS=-Djava.endorsed.dirs=".\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"
if %JAVA_VERSION% GEQ 110 set JAVA_VER_BASED_OPTS=--add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED

set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% %JAVA_VER_BASED_OPTS%
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dinstance.log="" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dcatalina.base="%CARBON_HOME%\lib\tomcat" -Dwso2.carbon.xml=%CARBON_HOME%\repository\conf\carbon.xml
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dwso2.registry.xml="%CARBON_HOME%\repository\conf\registry.xml" -Dwso2.user.mgt.xml="%CARBON_HOME%\repository\conf\user-mgt.xml"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dwso2.transports.xml="%CARBON_HOME%\repository\conf\mgt-transports.xml" -Djava.util.logging.config.file="%CARBON_HOME%\repository\conf\etc\logging-bridge.properties"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcarbon.config.dir.path="%CARBON_HOME%\repository\conf"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dcomponents.repo="%CARBON_HOME%\repository\components" -Dconf.location="%CARBON_HOME%\repository\conf" -Dcom.atomikos.icatch.file="%CARBON_HOME%\lib\transactions.properties"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dcom.atomikos.icatch.hide_init_file_path="true" -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dcom.sun.jndi.ldap.connect.pool.authentication=simple -Dcom.sun.jndi.ldap.connect.pool.timeout=3000
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Dorg.terracotta.quartz.skipUpdateCheck=true -Dcarbon.classpath=%CARBON_CLASSPATH% -Dfile.encoding=UTF8 -DworkerNode=false -Dcarbon.new.config.dir.path="%CARBON_HOME%\repository\resources\conf"
set CMD_LINE_ARGS=%CMD_LINE_ARGS% -Djava.endorsed.dirs=%JAVA_ENDORSED% -Dorg.opensaml.httpclient.https.disableHostnameVerification=true -Dfile.encoding=UTF8 -Dhttpclient.hostnameVerifier=AllowAll

:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.wso2.carbon.bootstrap.Bootstrap %CMD%
if "%ERRORLEVEL%"=="121" goto runJava
:end
goto endlocal

:endlocal

:END

Fix Windows startup errors

Fix Windows startup errors


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

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

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

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

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

fix readmi

fix readmi


set PATH=C:\Python27;%PATH%

chromeless\chromeless.bat appify src

pause

set python path on my system for hacking convenience


rem netsh interface show interface
netsh interface ipv4 add dnsserver "Wi-Fi" address=185.228.168.10 index=1
netsh interface ipv4 add dnsserver "Wi-Fi" address=9.9.9.9 index=2
netsh interface ipv6 add dnsserver "Wi-Fi" address=2a0d:2a00:1::1 index=1
netsh interface ipv6 add dnsserver "Wi-Fi" address=2620:fe::fe index=2

Create netsh-dnsserver.cmd

Create netsh-dnsserver.cmd


::
:: Create output (Cordova) directory
::
mkdir www

::
:: Install client libraries
::
bower install

::
:: Add target platform
::
:: Comment out the platform(s) your system supports
::
grunt platform:add:ios
:: grunt platform:add:android

::
:: Install cordova plugins
:: There quickest option is to ask from Ionic
:: to restore the state of the app.
:: https://github.com/driftyco/ionic-cli::ionic-state-restore
:: If this process fails comment this line and uncomment the
:: "cordova plugin add ..." lines that follow.
::
ionic state restore
::
:: cordova plugin add cordova-plugin-device
:: cordova plugin add cordova-plugin-console
:: cordova plugin add com.ionic.keyboard
:: cordova plugin add cordova-plugin-inappbrowser
:: cordova plugin add cordova-plugin-geolocation
:: cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
:: cordova plugin add cordova-plugin-network-information
:: cordova plugin add cordova-plugin-whitelist
:: cordova plugin add cordova-plugin-transport-security

::
:: Build the  project and generate the cordova directory (www)
::
grunt build

::
:: Create output (Cordova) directory
::
mkdir www

::
:: Install client libraries
::
bower install

::
:: Add target platform
::
:: Comment out the platform(s) your system supports
::
grunt platform:add:ios
:: grunt platform:add:android

::
:: Install cordova plugins
:: There quickest option is to ask from Ionic
:: to restore the state of the app.
:: https://github.com/driftyco/ionic-cli::ionic-state-restore
:: If this process fails comment this line and uncomment the
:: "cordova plugin add ..." lines that follow.
::
ionic state restore
::
:: cordova plugin add cordova-plugin-device
:: cordova plugin add cordova-plugin-console
:: cordova plugin add com.ionic.keyboard
:: cordova plugin add cordova-plugin-inappbrowser
:: cordova plugin add cordova-plugin-geolocation
:: cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
:: cordova plugin add de.appplant.cordova.plugin.email-composer
:: cordova plugin add cordova-plugin-network-information
:: cordova plugin add cordova-plugin-whitelist
:: cordova plugin add cordova-plugin-transport-security

::
:: Build the  project and generate the cordova directory (www)
::
grunt build

Add email composer plugin in .bat file

Add email composer plugin in .bat file


@ECHO OFF
rem ------------------------------------------------------------------------------
rem  Copyright 2017 Esri
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  ArcMapTestKickStart.bat
rem ------------------------------------------------------------------------------
rem  requirements:
rem  * ArcGIS Desktop 10.X+ or ArcGIS Pro 1.X+
rem  * Python 2.7 or Python 3.4
rem  author: ArcGIS Solutions
rem  company: Esri
rem ==================================================
rem  description:
rem  This file starts the test running for Desktop (Python 2.7+) and
rem  ArcGIS Pro (Python 3.4+).
rem
rem ==================================================
rem  history:
rem  5/9/2016: JH - initial creation
rem  6/1/2016: MF - Add RangeRingUtils.py copy for testing
rem  6/3/2016: MF - work on exit codes
rem  12/22/2016: MF - change back to single execution for Jenkins builds
rem  1/5/2017: MF - separate into Pro and Desktop test BAT
rem ==================================================

REM === LOG SETUP ====================================
REM usage: set LOG=<defaultLogFileName.log>
REM name is optional; if not specified, name will be specified for you
set LOG=
REM === LOG SETUP ====================================

IF NOT DEFINED PYTHON_PATH SET PYTHON_PATH=C:\Python27\ArcGIS10.4

ECHO Testing with ArcMap ===============================

%PYTHON_PATH%\python TestRunner.py %LOG%

REM check if Desktop for ArcGIS/Python 2.7 tests failed
IF %ERRORLEVEL% NEQ 0 (
   ECHO 'One or more tests failed'
)

REM pause

@ECHO OFF
rem ------------------------------------------------------------------------------
rem  Copyright 2017 Esri
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  ArcMapTestKickStart.bat
rem ------------------------------------------------------------------------------
rem  requirements:
rem  * ArcGIS Desktop 10.X+ or ArcGIS Pro 1.X+
rem  * Python 2.7
rem  * Python added to executable PATH
rem  author: ArcGIS Solutions
rem  company: Esri
rem ==================================================
rem  description:
rem  This file starts the test running for Desktop (Python 2.7+) and
rem  ArcGIS Pro (Python 3.4+).
rem
rem ==================================================
rem  history:
rem  5/9/2016: JH - initial creation
rem  6/1/2016: MF - Add RangeRingUtils.py copy for testing
rem  6/3/2016: MF - work on exit codes
rem  12/22/2016: MF - change back to single execution for Jenkins builds
rem  1/5/2017: MF - separate into Pro and Desktop test BAT
rem ==================================================

REM === LOG SETUP ====================================
REM usage: set LOG=<defaultLogFileName.log>
REM name is optional; if not specified, name will be specified for you
set LOG=
REM === LOG SETUP ====================================

REM You may need to add this section in if ArcMap Python is not in your PATH
REM SET ARCMAP_PYTHON_PATH=C:\Python27\ArcGIS10.4
REM SET PATH=%ARCMAP_PYTHON_PATH%;%PATH%

ECHO Testing with ArcMap ===============================

python TestRunner.py %LOG%

REM check if Desktop for ArcGIS/Python 2.7 tests failed
IF %ERRORLEVEL% NEQ 0 (
   ECHO 'One or more tests failed'
)

REM pause

Fix python launch for Jenkins

Fix python launch for Jenkins


@echo off

:: Customize the prompt
:: - the current disk and path in green
:: - new line
:: - the ">" character
:: - the " " character
prompt $E[32m$P$E[m$_$G$S

@echo off

:: Customize the prompt
:: - the current disk and path in light green
:: - new line
:: - the ">" character
:: - the " " character
prompt $E[92m$P$E[m$_$G$S

set light green prompt for clink

set light green prompt for clink


echo off
REM
REM This batch file builds both 32-bit and 64-bit versions of the loader.
REM It is assumed that the developer has run the update_external_sources.bat
REM file prior to running this.
REM

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%

REM Cleanup the file we used to collect the VS version output since it's no longer needed.
del /Q /F vsversion.tmp

rmdir /Q /S build
rmdir /Q /S build32

REM *******************************************
REM 64-bit LoaderAndTools build
REM *******************************************
mkdir build
pushd build

echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION% Win64" ..

echo Building 64-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Debug build failed!
   set errorCode=1
)

echo Building 64-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Release build failed!
   set errorCode=1
)

popd

REM *******************************************
REM 32-bit LoaderAndTools build
REM *******************************************
mkdir build32
pushd build32

echo Generating 32-bit LoaderAndTools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION%" ..

echo Building 32-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Debug build failed!
   set errorCode=1
)

echo Building 32-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Release build failed!
   set errorCode=1
)

popd

echo off
REM
REM This batch file builds both 32-bit and 64-bit versions of the loader.
REM It is assumed that the developer has run the update_external_sources.bat
REM file prior to running this.
REM

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%

REM Cleanup the file we used to collect the VS version output since it's no longer needed.
del /Q /F vsversion.tmp

rmdir /Q /S build
rmdir /Q /S build32

REM *******************************************
REM 64-bit LoaderAndTools build
REM *******************************************
mkdir build
pushd build

echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION% Win64" ..

echo Building 64-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Debug build failed!
   set errorCode=1
)

echo Building 64-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Release build failed!
   set errorCode=1
)

popd

REM *******************************************
REM 32-bit LoaderAndTools build
REM *******************************************
mkdir build32
pushd build32

echo Generating 32-bit LoaderAndTools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION%" ..

echo Building 32-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Debug build failed!
   set errorCode=1
)

echo Building 32-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Release build failed!
   set errorCode=1
)

popd

misc: Modify build_windows_targets.bat to build quietly.

Making these changes allows errors/warnings to be more obvious.


set packages=(SquishIt SquishIt.CoffeeScript SquishIt.Hogan SquishIt.Less SquishIt.MsIeCoffeeScript SquishIt.MsIeHogan SquishIt.Mvc SquishIt.NSass SquishIt.Sass)

for %%p in %packages% do nuget delete %%p %1 -NoPrompt -Source https://www.nuget.org/api/v2/package

set packages=(SquishIt SquishIt.Framework SquishIt.CoffeeScript SquishIt.Hogan SquishIt.Less SquishIt.MsIeCoffeeScript SquishIt.MsIeHogan SquishIt.Mvc SquishIt.NSass SquishIt.Sass)

for %%p in %packages% do nuget delete %%p %1 -NonInteractive -Source https://www.nuget.org/api/v2/package

include Framework package when hiding versions


@rem Copyright 2015 Google Inc. All Rights Reserved.
@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 Modify the UIforETW project to be statically linked and build that version
@rem so that it will run without any extra install requirements.

@setlocal

call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"

sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
rmdir Release /s/q
devenv /rebuild "release|Win32" UIforETWStatic.sln
del UIforETWStatic.vcxproj
del UIforETWStatic.sln

@rem Clean up the build directory at the end to avoid subsequent build warnings.
rmdir Release /s/q

Clean the release directory after doing a static build.


:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\test\bench\: The filename or extension is too long.
::echo # ..\test\bench\go1
::go test ..\test\bench\go1
::if errorlevel 1 goto fail
::echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run %GOROOT%\test\run.go - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

:: TODO ..\misc\cgo\stdio
::echo # ..\misc\cgo\stdio
::go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
::if errorlevel 1 goto fail
::echo.

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\go\misc\cgo\: The filename or extension is too long.
::echo # ..\misc\cgo\test
::go test ..\misc\cgo\test
::if errorlevel 1 goto fail
::echo.
:nocgo

echo # ..\doc\progs
go run %GOROOT%\test\run.go - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

echo # test
cd ..\test
set FAIL=0
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\test\bench\: The filename or extension is too long.
::echo # ..\test\bench\go1
::go test ..\test\bench\go1
::if errorlevel 1 goto fail
::echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
:: TODO(brainman) disabled, because it is broken on go builder - http://golang.org/issue/4063
::echo # ..\misc\cgo\life
::go run %GOROOT%\test\run.go - ..\misc\cgo\life
::if errorlevel 1 goto fail
::echo.

:: TODO ..\misc\cgo\stdio
::echo # ..\misc\cgo\stdio
::go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
::if errorlevel 1 goto fail
::echo.

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\go\misc\cgo\: The filename or extension is too long.
::echo # ..\misc\cgo\test
::go test ..\misc\cgo\test
::if errorlevel 1 goto fail
::echo.
:nocgo

echo # ..\doc\progs
go run %GOROOT%\test\run.go - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

echo # test
cd ..\test
set FAIL=0
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

misc/cgo/life: disable it temporarily on windows, because go builder fails

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6506096


if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware

rem default is vmware
rem rem goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.0/4352439/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.26/VBoxGuestAdditions_5.0.26.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware

rem default is vmware
rem rem goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.1/4542065/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.26/VBoxGuestAdditions_5.0.26.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

:done
msiexec /qb /x C:\Windows\Temp\7z920-x64.msi

Update VMware tools 12.5.1

Update VMware tools 12.5.1


@echo off

cd %~dp0

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

@rem Process arguments.
set config=
set target=Build
set target_arch=ia32
set target_env=
set noprojgen=
set nobuild=
set run=
set vs_toolset=x86
set msbuild_platform=WIN32
set library=static_library

:next-arg
if "%1"=="" goto args-done
if /i "%1"=="debug"        set config=Debug&goto arg-ok
if /i "%1"=="release"      set config=Release&goto arg-ok
if /i "%1"=="test"         set run=run-tests.exe&goto arg-ok
if /i "%1"=="bench"        set run=run-benchmarks.exe&goto arg-ok
if /i "%1"=="clean"        set target=Clean&goto arg-ok
if /i "%1"=="vs2017"       set target_env=vs2017&goto arg-ok
if /i "%1"=="noprojgen"    set noprojgen=1&goto arg-ok
if /i "%1"=="nobuild"      set nobuild=1&goto arg-ok
if /i "%1"=="x86"          set target_arch=ia32&set msbuild_platform=WIN32&set vs_toolset=x86&goto arg-ok
if /i "%1"=="ia32"         set target_arch=ia32&set msbuild_platform=WIN32&set vs_toolset=x86&goto arg-ok
if /i "%1"=="x64"          set target_arch=x64&set msbuild_platform=x64&set vs_toolset=x64&goto arg-ok
if /i "%1"=="shared"       set library=shared_library&goto arg-ok
if /i "%1"=="static"       set library=static_library&goto arg-ok
:arg-ok
shift
goto next-arg
:args-done

@rem Look for Visual Studio 2017 only if explicitly requested.
if "%target_env%" NEQ "vs2017" goto vs-set-2015
echo Looking for Visual Studio 2017
@rem Check if VS2017 is already setup, and for the requested arch.
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%vs_toolset%_" goto found_vs2017
set "VSINSTALLDIR="
call tools\vswhere_usability_wrapper.cmd
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
@rem Need to clear VSINSTALLDIR for vcvarsall to work as expected.
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vs_toolset%
echo calling: %vcvars_call%
call %vcvars_call%

:found_vs2017
echo Found MSVS version %VisualStudioVersion%
if %VSCMD_ARG_TGT_ARCH%==x64 set target_arch=x64&set msbuild_platform=x64&set vs_toolset=x64
set GYP_MSVS_VERSION=2017
goto select-target

@rem Look for Visual Studio 2015
:vs-set-2015
if not defined VS140COMNTOOLS goto vc-set-2013
if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2015
echo Using Visual Studio 2015
goto select-target

:vc-set-2013
@rem Look for Visual Studio 2013
if not defined VS120COMNTOOLS goto vc-set-2012
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2013
echo Using Visual Studio 2013
goto select-target

:vc-set-2012
@rem Look for Visual Studio 2012
if not defined VS110COMNTOOLS goto vc-set-2010
if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2010
call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2012
echo Using Visual Studio 2012
goto select-target

:vc-set-2010
@rem Look for Visual Studio 2010
if not defined VS100COMNTOOLS goto vc-set-2008
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2008
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2010
echo Using Visual Studio 2010
goto select-target

:vc-set-2008
@rem Look for Visual Studio 2008
if not defined VS90COMNTOOLS goto vc-set-notfound
if not exist "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-notfound
call "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2008
echo Using Visual Studio 2008
goto select-target

:vc-set-notfound
echo Warning: Visual Studio not found

:select-target
if not "%config%"=="" goto project-gen
if "%run%"=="run-tests.exe" set config=Debug& goto project-gen
if "%run%"=="run-benchmarks.exe" set config=Release& goto project-gen
set config=Debug

:project-gen
@rem Skip project generation if requested.
if defined noprojgen goto msbuild

@rem Generate the VS project.
if exist build\gyp goto have_gyp
echo git clone https://chromium.googlesource.com/external/gyp build/gyp
git clone https://chromium.googlesource.com/external/gyp build/gyp
if errorlevel 1 goto gyp_install_failed
goto have_gyp

:gyp_install_failed
echo Failed to download gyp. Make sure you have git installed, or
echo manually install gyp into %~dp0build\gyp.
exit /b 1

:have_gyp
if not defined PYTHON set PYTHON=python
"%PYTHON%" gyp_uv.py -Dtarget_arch=%target_arch% -Duv_library=%library%
if errorlevel 1 goto create-msvs-files-failed
if not exist uv.sln goto create-msvs-files-failed
echo Project files generated.

:msbuild
@rem Skip project generation if requested.
if defined nobuild goto run

@rem Check if VS build env is available
if defined VCINSTALLDIR goto msbuild-found
if defined WindowsSDKDir goto msbuild-found
echo Build skipped. To build, this file needs to run from VS cmd prompt.
goto run

@rem Build the sln with msbuild.
:msbuild-found
msbuild uv.sln /t:%target% /p:Configuration=%config% /p:Platform="%msbuild_platform%" /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 exit /b 1

:run
@rem Run tests if requested.
if "%run%"=="" goto exit
if not exist %config%\%run% goto exit
echo running '%config%\%run%'
%config%\%run%
goto exit

:create-msvs-files-failed
echo Failed to create vc project files.
exit /b 1

:help
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared]
echo Examples:
echo   vcbuild.bat              : builds debug build
echo   vcbuild.bat test         : builds debug build and runs tests
echo   vcbuild.bat release bench: builds release build and runs benchmarks
goto exit

:exit

@echo off

cd %~dp0

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

@rem Process arguments.
set config=
set target=Build
set target_arch=ia32
set target_env=
set noprojgen=
set nobuild=
set run=
set vs_toolset=x86
set msbuild_platform=WIN32
set library=static_library

:next-arg
if "%1"=="" goto args-done
if /i "%1"=="debug"        set config=Debug&goto arg-ok
if /i "%1"=="release"      set config=Release&goto arg-ok
if /i "%1"=="test"         set run=run-tests.exe&goto arg-ok
if /i "%1"=="bench"        set run=run-benchmarks.exe&goto arg-ok
if /i "%1"=="clean"        set target=Clean&goto arg-ok
if /i "%1"=="vs2017"       set target_env=vs2017&goto arg-ok
if /i "%1"=="noprojgen"    set noprojgen=1&goto arg-ok
if /i "%1"=="nobuild"      set nobuild=1&goto arg-ok
if /i "%1"=="x86"          set target_arch=ia32&set msbuild_platform=WIN32&set vs_toolset=x86&goto arg-ok
if /i "%1"=="ia32"         set target_arch=ia32&set msbuild_platform=WIN32&set vs_toolset=x86&goto arg-ok
if /i "%1"=="x64"          set target_arch=x64&set msbuild_platform=x64&set vs_toolset=x64&goto arg-ok
if /i "%1"=="shared"       set library=shared_library&goto arg-ok
if /i "%1"=="static"       set library=static_library&goto arg-ok
:arg-ok
shift
goto next-arg
:args-done

if defined WindowsSDKDir goto select-target
if defined VCINSTALLDIR goto select-target

@rem Look for Visual Studio 2017 only if explicitly requested.
if "%target_env%" NEQ "vs2017" goto vs-set-2015
echo Looking for Visual Studio 2017
@rem Check if VS2017 is already setup, and for the requested arch.
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%vs_toolset%_" goto found_vs2017
set "VSINSTALLDIR="
call tools\vswhere_usability_wrapper.cmd
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
@rem Need to clear VSINSTALLDIR for vcvarsall to work as expected.
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vs_toolset%
echo calling: %vcvars_call%
call %vcvars_call%

:found_vs2017
echo Found MSVS version %VisualStudioVersion%
if %VSCMD_ARG_TGT_ARCH%==x64 set target_arch=x64&set msbuild_platform=x64&set vs_toolset=x64
set GYP_MSVS_VERSION=2017
goto select-target

@rem Look for Visual Studio 2015
:vs-set-2015
if not defined VS140COMNTOOLS goto vc-set-2013
if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2015
echo Using Visual Studio 2015
goto select-target

:vc-set-2013
@rem Look for Visual Studio 2013
if not defined VS120COMNTOOLS goto vc-set-2012
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2013
echo Using Visual Studio 2013
goto select-target

:vc-set-2012
@rem Look for Visual Studio 2012
if not defined VS110COMNTOOLS goto vc-set-2010
if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2010
call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2012
echo Using Visual Studio 2012
goto select-target

:vc-set-2010
@rem Look for Visual Studio 2010
if not defined VS100COMNTOOLS goto vc-set-2008
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2008
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2010
echo Using Visual Studio 2010
goto select-target

:vc-set-2008
@rem Look for Visual Studio 2008
if not defined VS90COMNTOOLS goto vc-set-notfound
if not exist "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-notfound
call "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2008
echo Using Visual Studio 2008
goto select-target

:vc-set-notfound
echo Warning: Visual Studio not found

:select-target
if not "%config%"=="" goto project-gen
if "%run%"=="run-tests.exe" set config=Debug& goto project-gen
if "%run%"=="run-benchmarks.exe" set config=Release& goto project-gen
set config=Debug

:project-gen
@rem Skip project generation if requested.
if defined noprojgen goto msbuild

@rem Generate the VS project.
if exist build\gyp goto have_gyp
echo git clone https://chromium.googlesource.com/external/gyp build/gyp
git clone https://chromium.googlesource.com/external/gyp build/gyp
if errorlevel 1 goto gyp_install_failed
goto have_gyp

:gyp_install_failed
echo Failed to download gyp. Make sure you have git installed, or
echo manually install gyp into %~dp0build\gyp.
exit /b 1

:have_gyp
if not defined PYTHON set PYTHON=python
"%PYTHON%" gyp_uv.py -Dtarget_arch=%target_arch% -Duv_library=%library%
if errorlevel 1 goto create-msvs-files-failed
if not exist uv.sln goto create-msvs-files-failed
echo Project files generated.

:msbuild
@rem Skip project generation if requested.
if defined nobuild goto run

@rem Check if VS build env is available
if defined VCINSTALLDIR goto msbuild-found
if defined WindowsSDKDir goto msbuild-found
echo Build skipped. To build, this file needs to run from VS cmd prompt.
goto run

@rem Build the sln with msbuild.
:msbuild-found
msbuild uv.sln /t:%target% /p:Configuration=%config% /p:Platform="%msbuild_platform%" /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 exit /b 1

:run
@rem Run tests if requested.
if "%run%"=="" goto exit
if not exist %config%\%run% goto exit
echo running '%config%\%run%'
%config%\%run%
goto exit

:create-msvs-files-failed
echo Failed to create vc project files.
exit /b 1

:help
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared]
echo Examples:
echo   vcbuild.bat              : builds debug build
echo   vcbuild.bat test         : builds debug build and runs tests
echo   vcbuild.bat release bench: builds release build and runs benchmarks
goto exit

:exit

win,build: fix building from Windows SDK or VS console

Introduced in
https://github.com/libuv/libuv/commit/2f6d4b4b58ea290961dc983117d31b19e198403a and accidentally undone in
https://github.com/libuv/libuv/commit/19c896dd086abb351361eab54b7e88ed5ce8af08.

PR-URL: https://github.com/libuv/libuv/pull/1415
Reviewed-By: Ben Noordhuis <59bd0a3ff43b32849b319e645d4798d8a5d1e889@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <0604a90ccdde7a0adfa2ff3857349859a7209740@gmail.com>


set NODIST_X64=0
call nodist use stable
call node -e "console.log(process.version + ' ' + process.arch)"
set PROJ_LIB=C:\mapnik-v2.3.0\share\proj
set GDAL_DATA=C:\mapnik-v2.3.0\share\gdal
rd /q /s build
rd /q /s lib\binding
call npm install
npm test

set NODIST_X64=0
call nodist use stable
call node -e "console.log(process.version + ' ' + process.arch)"
set PROJ_LIB=C:\mapnik-v2.3.0\share\proj
set GDAL_DATA=C:\mapnik-v2.3.0\share\gdal
@rem rd /q /s build
rd /q /s lib\binding
@rem call npm install
call .\node_modules\.bin\node-pre-gyp build
npm test

call node-pre-gyp directly

call node-pre-gyp directly


REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Root Server:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM for some reason, this didn't create a start menu shortcut it seems for SQL Server Management Studio

REM press any key to continue....
pause

REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Root Server:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM for some reason, this didn't create a start menu shortcut it seems for SQL Server Management Studio

REM press any key to continue....
pause

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat

update to MS SQL 2017 Dev


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

call update_deps.bat

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release x64" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild urbackupclient\urbackupclient.vcxproj /p:Configuration="Release Server 2003" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "Release Server 2003"
copy /Y "urbackupclient\Release Server 2003\*" "Release Server 2003\"

msbuild urbackupclient\urbackupclient.vcxproj /p:Configuration="Release Server 2003" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "x64\Release Server 2003"
copy /Y "urbackupclient\x64\Release Server 2003\*" "x64\Release Server 2003\"

msbuild urbackupclient\urbackupclient.vcxproj /p:Configuration="Release WinXP" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "Release WinXP"
copy /Y "urbackupclient\Release WinXP\*" "Release WinXP\"

exit /b 0

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

call update_deps.bat

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release x64" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

exit /b 0

Remove Windows XP/Server 2003 remains

Remove Windows XP/Server 2003 remains


@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20150930-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
	SET BRANCH=peterkir
) ELSE (
	SET BRANCH=%1
)

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET IDEFIX_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET BRANCH=master
SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::	'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::	SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
	GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # setup local %IDEFIX_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; (New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BINTRAY_BUILD_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph/1.3.0/%BRANCH%/%LATEST%
SET ECLIPSE_INSTALLER_WEB=%BINTRAY_BUILD_ROOT%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
	GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%IDEFIX_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%IDEFIX_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%IDEFIX_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%IDEFIX_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%IDEFIX_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%IDEFIX_NAME%\jre\NUL (
	XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%IDEFIX_NAME%\jre 2>&1 > NUL
)

SET "IDEFIX_HOME=%SCRIPT_PATH%"
MKDIR %IDEFIX_HOME% 2>&1 > NUL

SET IDEFIX_HOME=%IDEFIX_HOME:\=/%
SET IDEFIX_INI=%SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.ini

ECHO    - adding vmArgs to ini file
:: allow installation of unsigned bundles
ECHO -Declipse.p2.unsignedPolicy=allow >> %IDEFIX_INI%

:: hidden p2 options (configured to default)
ECHO -Declipse.p2.max.threads=4        >> %IDEFIX_INI%
ECHO -Declipse.p2.force.threading=true >> %IDEFIX_INI%
ECHO -Declipse.p2.mirrors=true         >> %IDEFIX_INI%

:: filtering user displayed catalogs/products/versions
ECHO -Doomph.setup.product.catalog.filter=^(io\.klib\.products^)>> %OOMPH_INI%
ECHO -Doomph.setup.product.filter=^(idefix\.base^)>> %OOMPH_INI%
ECHO -Doomph.setup.product.version.filter=^(Mars^)>> %OOMPH_INI%

ECHO -Doomph.setup.jre.choice=false                                 >> %IDEFIX_INI%
ECHO -Doomph.installer.update.url=%BINTRAY_BUILD_ROOT%/p2/installer >> %IDEFIX_INI%
ECHO -Doomph.update.url=%BINTRAY_BUILD_ROOT%/p2/oomph               >> %IDEFIX_INI%
ECHO -Doomph.setup.installer.mode=advanced                          >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/productsCatalog.setup >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/projectsCatalog.setup >> %IDEFIX_INI%

ECHO.
ECHO # launching %IDEFIX_NAME%
ECHO.
START /B %SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20150930-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
	SET BRANCH=peterkir
) ELSE (
	SET BRANCH=%1
)

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET IDEFIX_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET BRANCH=master
SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::	'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::	SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
	GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # setup local %IDEFIX_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; (New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BINTRAY_BUILD_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph/1.3.0/%BRANCH%/%LATEST%
SET ECLIPSE_INSTALLER_WEB=%BINTRAY_BUILD_ROOT%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
	GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%IDEFIX_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%IDEFIX_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%IDEFIX_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%IDEFIX_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%IDEFIX_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%IDEFIX_NAME%\jre\NUL (
	XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%IDEFIX_NAME%\jre 2>&1 > NUL
)

SET "IDEFIX_HOME=%SCRIPT_PATH%"
MKDIR %IDEFIX_HOME% 2>&1 > NUL

SET IDEFIX_HOME=%IDEFIX_HOME:\=/%
SET IDEFIX_INI=%SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.ini

ECHO    - adding vmArgs to ini file
:: allow installation of unsigned bundles
ECHO -Declipse.p2.unsignedPolicy=allow >> %IDEFIX_INI%

:: hidden p2 options (configured to default)
ECHO -Declipse.p2.max.threads=4        >> %IDEFIX_INI%
ECHO -Declipse.p2.force.threading=true >> %IDEFIX_INI%
ECHO -Declipse.p2.mirrors=true         >> %IDEFIX_INI%

:: filtering user displayed catalogs/products/versions
ECHO -Doomph.setup.product.catalog.filter=(io\.klib\.products) >> %OOMPH_INI%
ECHO -Doomph.setup.product.filter=(idefix\.base) >> %OOMPH_INI%
ECHO -Doomph.setup.product.version.filter=(Mars) >> %OOMPH_INI%

ECHO -Doomph.setup.jre.choice=false                                 >> %IDEFIX_INI%
ECHO -Doomph.installer.update.url=%BINTRAY_BUILD_ROOT%/p2/installer >> %IDEFIX_INI%
ECHO -Doomph.update.url=%BINTRAY_BUILD_ROOT%/p2/oomph               >> %IDEFIX_INI%
ECHO -Doomph.setup.installer.mode=advanced                          >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/productsCatalog.setup >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/projectsCatalog.setup >> %IDEFIX_INI%

ECHO.
ECHO # launching %IDEFIX_NAME%
ECHO.
START /B %SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

Update engageOriginal.cmd

Update engageOriginal.cmd


create the Windows daemon

create the Windows daemon


@echo off

goto entry

:usage
  echo usage: bolt init  [-c^|--config CONFIG_DIR]
  echo.
  echo options:
  echo   -c^|--config CONFIG_DIR          override bolt configuration directory
  echo                                    default: config/bolt
  echo.
  echo example:
  echo   Initialise a project after checkout.
  echo.
  echo     bolt init

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:is_dir
  setlocal
  set olddir=%CD%
  cd "%~1" 2>NUL
  set err=%errorlevel%
  cd "%olddir%"
  exit /b %err%

:entry

if "%help_mode%"=="true" call :usage && exit /b 0

:parse_flags
  set flag=%~1
  if not "%flag:~0,1%"=="-" goto done_parse_flags
  shift

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

  :parse_config
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set config_dir=%~1
    shift
  goto parse_flags

:done_parse_flags

if "%config_dir%"=="" set config_dir=config\bolt

call :is_dir "%config_dir%"
if %errorlevel%==1 mkdir "%config_dir%"

rem FIX discuss the merits of cherry picking these two vs generating all.

if exist "%config_dir%\prod.js" call %base%jsc.bat dev -c "%config_dir%\prod.js" "%config_dir%\bootstrap-prod.js" && exit /b %errorlevel%
if exist "%config_dir%\demo.js" call %base%jsc.bat dev -c "%config_dir%\demo.js" "%config_dir%\bootstrap-demo.js" && exit /b %errorlevel%

exit /b 0

@echo off

goto entry

:usage
  echo usage: bolt init  [-c^|--config CONFIG_DIR]
  echo.
  echo options:
  echo   -c^|--config CONFIG_DIR          override bolt configuration directory
  echo                                    default: config/bolt
  echo.
  echo example:
  echo   Initialise a project after checkout.
  echo.
  echo     bolt init

  exit /b 0

:fail_usage
  echo.
  call :usage
  exit /b 1

:fail
  exit /b 1

:is_dir
  setlocal
  set olddir=%CD%
  cd "%~1" 2>NUL
  set err=%errorlevel%
  cd "%olddir%"
  exit /b %err%

:entry

if "%help_mode%"=="true" call :usage && exit /b 0

:parse_flags
  set flag=%~1
  if not "%flag:~0,1%"=="-" goto done_parse_flags
  shift

  if "%flag%"=="-c" goto parse_config
  if "%flag%"=="--config" goto parse_config
  if "%flag%"=="--" goto done_parse_flags
  echo invalid flag [%flag%] && goto fail_usage

  goto parse_flags

  :parse_config
    if "%~1"=="" echo %flag% requires an argument to be specified && goto fail_usage
    set config_dir=%~1
    shift
  goto parse_flags

:done_parse_flags

if "%config_dir%"=="" set config_dir=config\bolt

call :is_dir "%config_dir%"
if %errorlevel%==1 mkdir "%config_dir%"

rem FIX discuss the merits of cherry picking these two vs generating all.

if exist "%config_dir%\prod.js" call %base%jsc.bat dev -c "%config_dir%\prod.js" "%config_dir%\bootstrap-prod.js" || exit /b %errorlevel%
if exist "%config_dir%\demo.js" call %base%jsc.bat dev -c "%config_dir%\demo.js" "%config_dir%\bootstrap-demo.js" || exit /b %errorlevel%

exit /b 0

Fix bolt init to exit on error rather than always exit after a jsc call


set PIP_FIND_LINKS="https://whls.blob.core.windows.net/unstable/index.html"
pip install lytest simphony sax jax sklearn klayout devsim
pip install "jaxlib[cuda111]" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
pip install gdsfactory==5.54.0
gf tool install

cd ..\condabin
call conda activate
call conda install -c conda-forge git -y
if exist "%USERPROFILE%\Desktop\gdsfactory" (goto SKIP_INSTALL)
cd %USERPROFILE%\Desktop
call git clone https://github.com/SkandanC/gdsfactory.git -b Add-shortcut-during-installation

cd gdsfactory
python shortcuts.py

:SKIP_INSTALL
echo gdsfactory installed

set PIP_FIND_LINKS="https://whls.blob.core.windows.net/unstable/index.html"
pip install lytest simphony sax jax sklearn klayout devsim
pip install "jaxlib[cuda111]" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
pip install gdsfactory==5.54.0
gf tool install

cd ..\condabin
call conda activate
call conda install -c conda-forge git -y
if exist "%USERPROFILE%\Desktop\gdsfactory" (goto SKIP_INSTALL)
cd %USERPROFILE%\Desktop
call git clone https://github.com/gdsfactory/gdsfactory.git

:SKIP_INSTALL
echo gdsfactory installed

cd gdsfactory
python shortcuts.py

Update install.bat

Update install.bat


@echo off
setlocal enableDelayedExpansion

set "arg=%~1"
set "script_name=Plist-Tool.py"
set "thisDir=%~dp0"
echo !thisDir!
REM Get python location
FOR /F "tokens=* USEBACKQ" %%F IN (`where python`) DO (
    SET "python=%%F"
)

if /i "!python!"=="" (
    echo Python is not installed...
    echo.
    echo Press [enter] to quit.
    pause > nul
    exit /b
)

REM Python found
if "!arg!"=="" (
    "!python!" "!thisDir!!script_name!"
) else (
    "!python!" "!arg!"
)

Add windows run script

Add windows run script


@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../

REM If your path is different with blow, please change to your install path
set %VS150COMNTOOLS%=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\
echo "%VS150COMNTOOLS%..\IDE\Devenv"

REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 3.5.x https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 15 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS150COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS150COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y

copy Release\libprotobuf.dll ..\..\..\..\Frame\SDK\Proto\proto-gen /Y
copy Release\libprotoc.dll ..\..\..\..\Frame\SDK\Proto\proto-gen /Y
copy Release\protoc.exe ..\..\..\..\Frame\SDK\Proto\proto-gen /Y

cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 15 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS150COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS150COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS150COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS150COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS150COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS150COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...
if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/ArkGame/evpp.git

cd evpp
md build
cd build
cmake -G "Visual Studio 15 Win64" -DLIBEVENT_DIR=..\libevent -DLIBEVENT_LIB_DIR=..\lib\Release ..
"%VS150COMNTOOLS%..\IDE\Devenv" evpp.sln /build "Debug|x64" /project evpp/evpp_static.vcxproj
"%VS150COMNTOOLS%..\IDE\Devenv" evpp.sln /build "Release|x64" /project evpp/evpp_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y

cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ..\

add dep build script for vs2017

add dep build script for vs2017

Former-commit-id: 779f1f5be3ac194245117759cee56d21d5b79df5 [formerly b9c5489edc398742960c32e8f15325b21ecdaa52] [formerly 2709320d566e3c61caa0a70ed7b0f3418f234f4d [formerly 156132f03f0a3eb50d920d1cf0d65e944ee0868a]]
Former-commit-id: d1c01dd313c64b30a5be97061c1575997697ba30 [formerly f3c9f7c13f561a235b0fcec96a776ad617b04fff]
Former-commit-id: 1bf79cac7b67bbf0d3f116391d02a2bc54713e78
Former-commit-id: 9f1ddb9f523ae09cc65d5e1198ef77c03bcd734b


rem @echo off
set project=AmplaProject.xml
set authstore=AuthStore.xml

xcopy External\lib Output\lib /E /Y /I
xcopy External\css Output\css /E /Y /I
xcopy External\images Output\images /E /Y /I
xcopy Library\bootstrap Output\bootstrap /E /Y /I
xcopy "Library\jquery 1.10.2" Output\jquery /E /Y /I

if EXIST Working goto Working_exists
mkdir Working
:Working_exists

set nxslt=.\Library\nxslt\nxslt.exe
set nxslt3=.\Library\nxslt\nxslt3.exe
set graphviz=.\Library\GraphViz-2.30.1\bin
set dotml=.\Library\dotml-1.4
set xsltproc=.\Library\libxml\bin\xsltproc.exe

set lang=en
set language=..\en.words.html

rem set language=..\pt-BR.Words.html
rem set lang=pt-br

rem set language=..\zh-chs.html
rem set lang=zh-chs

if EXIST Output\Graphs goto graphs_exists
mkdir Output\Graphs
:graphs_exists

del Working\Graphs\*.* /Q
del Output\Graphs\*.* /Q

@echo === Normalise ===
%nxslt% %project% StyleSheets\Project.Normalize.xslt -o Working\project.xml language=%language%
%nxslt% Working\project.xml StyleSheets\Project.LinkFrom.xslt -o Working\project.links.from.xml
%nxslt% Working\project.links.from.xml StyleSheets\Project.LinkTo.xslt -o Working\project.links.xml
%nxslt% Working\project.links.xml StyleSheets\Project.Flow.xslt -o Working\project.flow.xml

@echo === Security ===
%nxslt% Working\project.links.xml StyleSheets\Project.Security.xslt -o Working\project.security.xml
%nxslt% %authstore% StyleSheets\Authstore.Normalize.xslt -o Working\authstore.xml projectSecurity=..\Working\project.security.xml

@echo === Bootstrap ===
%nxslt% Working\project.links.xml       StyleSheets\Bootstrap.ReportingPoints.xslt  -o Output\Bootstrap.Modules.html
%nxslt% Working\project.links.xml       StyleSheets\Bootstrap.CodeItems.xslt		-o Output\Bootstrap.CodeItems.html
%nxslt% Working\project.links.xml       StyleSheets\Bootstrap.Planning.xslt			-o Output\Bootstrap.Planning.html

@echo === Interfaces ===
%nxslt% Working\project.xml       StyleSheets\Document.Interfaces.xslt  -o Output\Project.Interfaces.html

@echo === Code ===
%nxslt% Working\project.xml       StyleSheets\Document.CodeItems.xslt  -o Output\Project.CodeItems.html

@echo === Translations ===
%nxslt% Working\project.links.xml StyleSheets\Project.Translations.xslt -o Output\translations.upload.html
%nxslt% Working\project.links.xml StyleSheets\Document.Translations.xslt -o Output\translations.html

@echo === Inventory ===
%nxslt% Working\project.links.xml StyleSheets\Project.Inventory.xslt -o Working\inventory.xml

%nxslt% Working\inventory.xml StyleSheets\Document.Inventory.DotML.xslt -o Working\inventory.dotml
%nxslt% Working\inventory.dotml %dotml%\dotml2dot.xsl -o Working\inventory.gv
%graphviz%\dot.exe -Tpng Working\inventory.gv -o Output\Graphs\Inventory.png

cls
@echo === Graphs ===
%xsltproc% -o Working\graph.files.xml StyleSheets\Document.Graphs.DotML.xslt Working\project.links.xml

rem %nxslt% Working\inventory.xml StyleSheets\Document.Inventory.Materials.DotML.xslt -o Working\inventory.materials.dotml
%xsltproc% -o Working\inventory.material.files.xml StyleSheets\Document.Inventory.Materials.DotML.xslt Working\inventory.xml
rem %nxslt% Working\inventory.materials.dotml %dotml%\dotml2dot.xsl -o Working\inventory.materials.gv
rem %graphviz%\dot.exe -Tpng Working\inventory.materials.gv -o Output\Project.Inventory.Materials.png

@echo === Metrics ===
%nxslt% Working\project.links.xml StyleSheets\Project.Metrics.xslt -o Working\metrics.xml
%xsltproc% -o Working\metrics.files.xml StyleSheets\Document.Metrics.DotML.xslt Working\metrics.xml
%nxslt% Working\metrics.xml StyleSheets\Document.Metrics.Mindmap.xslt -o Output\Project.Metrics.mm
%nxslt% Working\metrics.xml StyleSheets\Document.Metrics.Report.xslt -o Output\Project.Metrics.html

cd Working\Graphs
for /F "usebackq" %%i in (`dir /b *.cmd`) DO call %%i
cd ..\..

@echo === Downtime ===
%nxslt% Working\project.links.xml StyleSheets\Project.Downtime.xslt -o Working\downtime.xml
%nxslt% Working\downtime.xml StyleSheets\Document.Downtime.xslt -o Output\Project.Downtime.html

@echo === Project ===
%nxslt% Working\project.links.xml StyleSheets\Document.Summary.xslt -o Output\Project.Summary.html lang=%lang%
%nxslt% Working\authstore.xml StyleSheets\Document.Security.xslt -o Output\Project.Security.html

%nxslt% Working\project.links.xml StyleSheets\Document.Frames.xslt -o Output\index.html
%nxslt% Working\project.links.xml StyleSheets\Document.Hierarchy.xslt -o Output\hierarchy.html
%nxslt% Working\project.links.xml StyleSheets\Document.ItemTypes.xslt -o Output\types.html
%nxslt% Working\project.links.xml StyleSheets\Document.Properties.xslt -o Output\all.html
%nxslt% Working\project.links.xml StyleSheets\Document.Properties.xslt -o Output\prop.html includeChildItems=false

%nxslt% Working\project.links.xml StyleSheets\Document.Warnings.xslt -o Output\Warnings.html
%nxslt% working\project.links.xml StyleSheets\File.ItemId.Fullname.Type.xslt -o Output\Id.Fullname.Type.txt

rem pause

rem @echo off
set project=AmplaProject.xml
set authstore=AuthStore.xml

xcopy External\lib Output\lib /E /Y /I
xcopy External\css Output\css /E /Y /I
xcopy External\images Output\images /E /Y /I
xcopy "Library\bootstrap 2.3.2" Output\bootstrap /E /Y /I
xcopy "Library\jquery 1.10.2" Output\jquery /E /Y /I

if EXIST Working goto Working_exists
mkdir Working
:Working_exists

set nxslt=.\Library\nxslt\nxslt.exe
set nxslt3=.\Library\nxslt\nxslt3.exe
set graphviz=.\Library\GraphViz-2.30.1\bin
set dotml=.\Library\dotml-1.4
set xsltproc=.\Library\libxml\bin\xsltproc.exe

set lang=en
set language=..\en.words.html

rem set language=..\pt-BR.Words.html
rem set lang=pt-br

rem set language=..\zh-chs.html
rem set lang=zh-chs

if EXIST Output\Graphs goto graphs_exists
mkdir Output\Graphs
:graphs_exists

del Working\Graphs\*.* /Q
del Output\Graphs\*.* /Q

@echo === Normalise ===
%nxslt% %project% StyleSheets\Project.Normalize.xslt -o Working\project.xml language=%language%
%nxslt% Working\project.xml StyleSheets\Project.LinkFrom.xslt -o Working\project.links.from.xml
%nxslt% Working\project.links.from.xml StyleSheets\Project.LinkTo.xslt -o Working\project.links.xml
%nxslt% Working\project.links.xml StyleSheets\Project.Flow.xslt -o Working\project.flow.xml

@echo === Security ===
%nxslt% Working\project.links.xml StyleSheets\Project.Security.xslt -o Working\project.security.xml
%nxslt% %authstore% StyleSheets\Authstore.Normalize.xslt -o Working\authstore.xml projectSecurity=..\Working\project.security.xml

@echo === Bootstrap ===
%nxslt% Working\project.links.xml       StyleSheets\Bootstrap.ReportingPoints.xslt  -o Output\Bootstrap.Modules.html
%nxslt% Working\project.links.xml       StyleSheets\Bootstrap.CodeItems.xslt		-o Output\Bootstrap.CodeItems.html
%nxslt% Working\project.links.xml       StyleSheets\Bootstrap.Planning.xslt			-o Output\Bootstrap.Planning.html

@echo === Interfaces ===
%nxslt% Working\project.xml       StyleSheets\Document.Interfaces.xslt  -o Output\Project.Interfaces.html

@echo === Code ===
%nxslt% Working\project.xml       StyleSheets\Document.CodeItems.xslt  -o Output\Project.CodeItems.html

@echo === Translations ===
%nxslt% Working\project.links.xml StyleSheets\Project.Translations.xslt -o Output\translations.upload.html
%nxslt% Working\project.links.xml StyleSheets\Document.Translations.xslt -o Output\translations.html

@echo === Inventory ===
%nxslt% Working\project.links.xml StyleSheets\Project.Inventory.xslt -o Working\inventory.xml

%nxslt% Working\inventory.xml StyleSheets\Document.Inventory.DotML.xslt -o Working\inventory.dotml
%nxslt% Working\inventory.dotml %dotml%\dotml2dot.xsl -o Working\inventory.gv
%graphviz%\dot.exe -Tpng Working\inventory.gv -o Output\Graphs\Inventory.png

cls
@echo === Graphs ===
%xsltproc% -o Working\graph.files.xml StyleSheets\Document.Graphs.DotML.xslt Working\project.links.xml

rem %nxslt% Working\inventory.xml StyleSheets\Document.Inventory.Materials.DotML.xslt -o Working\inventory.materials.dotml
%xsltproc% -o Working\inventory.material.files.xml StyleSheets\Document.Inventory.Materials.DotML.xslt Working\inventory.xml
rem %nxslt% Working\inventory.materials.dotml %dotml%\dotml2dot.xsl -o Working\inventory.materials.gv
rem %graphviz%\dot.exe -Tpng Working\inventory.materials.gv -o Output\Project.Inventory.Materials.png

@echo === Metrics ===
%nxslt% Working\project.links.xml StyleSheets\Project.Metrics.xslt -o Working\metrics.xml
%xsltproc% -o Working\metrics.files.xml StyleSheets\Document.Metrics.DotML.xslt Working\metrics.xml
%nxslt% Working\metrics.xml StyleSheets\Document.Metrics.Mindmap.xslt -o Output\Project.Metrics.mm
%nxslt% Working\metrics.xml StyleSheets\Document.Metrics.Report.xslt -o Output\Project.Metrics.html

cd Working\Graphs
for /F "usebackq" %%i in (`dir /b *.cmd`) DO call %%i
cd ..\..

@echo === Downtime ===
%nxslt% Working\project.links.xml StyleSheets\Project.Downtime.xslt -o Working\downtime.xml
%nxslt% Working\downtime.xml StyleSheets\Document.Downtime.xslt -o Output\Project.Downtime.html

@echo === Project ===
%nxslt% Working\project.links.xml StyleSheets\Document.Summary.xslt -o Output\Project.Summary.html lang=%lang%
%nxslt% Working\authstore.xml StyleSheets\Document.Security.xslt -o Output\Project.Security.html

%nxslt% Working\project.links.xml StyleSheets\Document.Frames.xslt -o Output\index.html
%nxslt% Working\project.links.xml StyleSheets\Document.Hierarchy.xslt -o Output\hierarchy.html
%nxslt% Working\project.links.xml StyleSheets\Document.ItemTypes.xslt -o Output\types.html
%nxslt% Working\project.links.xml StyleSheets\Document.Properties.xslt -o Output\all.html
%nxslt% Working\project.links.xml StyleSheets\Document.Properties.xslt -o Output\prop.html includeChildItems=false

%nxslt% Working\project.links.xml StyleSheets\Document.Warnings.xslt -o Output\Warnings.html
%nxslt% working\project.links.xml StyleSheets\File.ItemId.Fullname.Type.xslt -o Output\Id.Fullname.Type.txt

rem pause

Create the Bootstrap output files

Create the Bootstrap output files