@echo off
setlocal enabledelayedexpansion

REM ///////////////////////////////////////////////////////////////////////////
REM // Set Paths
REM ///////////////////////////////////////////////////////////////////////////
set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
set "UPX3_PATH=C:\Program Files (x86)\UPX"
set "PDOC_PATH=C:\Program Files (x86)\Pandoc"
set "QT_SOURCE=C:\Qt\4.8.6"
set "QT_SHARED=C:\Qt\4.8.6-Shared"
set "QT_STATIC=C:\Qt\4.8.6-Static"
set "JDK8_PATH=C:\Program Files (x86)\Java\jdk1.8.0_25"
set "ANT1_PATH=C:\Eclipse\plugins\org.apache.ant_1.9.2.v201404171502"

REM ###############################################
REM # DO NOT MODIFY ANY LINES BELOW THIS LINE !!! #
REM ###############################################

REM ///////////////////////////////////////////////////////////////////////////
REM // Setup environment
REM ///////////////////////////////////////////////////////////////////////////
set "QTDIR=%QT_SOURCE%"
call "%MSVC_PATH%\vcvarsall.bat" x86
set "JAVA_HOME=%JDK8_PATH%"
set "ANT_HOME=%ANT1_PATH%"
set "PATH=%QTDIR%\bin;%PATH%"

REM ///////////////////////////////////////////////////////////////////////////
REM // Check environment
REM ///////////////////////////////////////////////////////////////////////////
if "%VCINSTALLDIR%"=="" (
	echo %%VCINSTALLDIR%% not specified. Please check your MSVC_PATH var^^!
	goto BuildError
)
if not exist "%VCINSTALLDIR%\bin\cl.exe" (
	echo C++ compiler binary not found. Please check your MSVC_PATH var^^!
	goto BuildError
)
if not exist "%UPX3_PATH%\upx.exe" (
	echo UPX binary could not be found. Please check your UPX3_PATH var^^!
	goto BuildError
)
if not exist "%PDOC_PATH%\pandoc.exe" (
	echo Pandoc binary could not be found. Please check your PDOC_PATH var^^!
	goto BuildError
)
if not exist "%QTDIR%\bin\moc.exe" (
	echo Qt could not be found. Please check your QT_SOURCE var^^!
	goto BuildError
)
if not exist "%QTDIR%\include\QtCore\qglobal.h" (
	echo Qt could not be found. Please check your QT_SOURCE var^^!
	goto BuildError
)
if not exist "%QT_SHARED%\bin\QtCore4.dll" (
	echo Qt *shared* libraries could not be found. Please check your QT_SHARED var^^!
	goto BuildError
)
if not exist "%QT_STATIC%\lib\QtCore.lib" (
	echo Qt *static* libraries could not be found. Please check your QT_STATIC var^^!
	goto BuildError
)
if not exist "%JDK8_PATH%\include\jni.h" (
	echo JNI header files could not be found. Please check your JDK8_PATH var^^!
	goto BuildError
)
if not exist "%ANT1_PATH%\lib\ant.jar" (
	echo Ant library file could not be found. Please check your ANT1_PATH var^^!
	goto BuildError
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Get current date and time (in ISO format)
REM ///////////////////////////////////////////////////////////////////////////
set "ISO_DATE="
set "ISO_TIME="
if not exist "%~dp0\etc\date.exe" BuildError
for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d') do (
	if "%%a"=="ISODATE" set "ISO_DATE=%%b"
)
for /F "tokens=1,2,3,4 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISOTIME:%%T') do (
	if "%%a"=="ISOTIME" set "ISO_TIME=%%b:%%c:%%d"
)
if "%ISO_DATE%"=="" goto BuildError
if "%ISO_TIME%"=="" goto BuildError

REM ///////////////////////////////////////////////////////////////////////////
REM // Detect version number
REM ///////////////////////////////////////////////////////////////////////////
set "VER_MAJOR="
set "VER_MINOR="
set "VER_PATCH="
for /F "tokens=4,5,6 delims=; " %%a in (%~dp0\DynamicAudioNormalizerAPI\src\Version.cpp) do (
	if "%%b"=="=" (
		if "%%a"=="DYNAUDNORM_VERSION_MAJOR" set "VER_MAJOR=%%c"
		if "%%a"=="DYNAUDNORM_VERSION_MINOR" set "VER_MINOR=%%c"
		if "%%a"=="DYNAUDNORM_VERSION_PATCH" set "VER_PATCH=%%c"
	)
)
if "%VER_MAJOR%"=="" goto BuildError
if "%VER_MINOR%"=="" goto BuildError
if "%VER_PATCH%"=="" goto BuildError
if %VER_MINOR% LSS 10 set "VER_MINOR=0%VER_MINOR%

REM ///////////////////////////////////////////////////////////////////////////
REM // Clean Binaries
REM ///////////////////////////////////////////////////////////////////////////
for /d %%d in (%~dp0\bin\*) do (rmdir /S /Q "%%~d")
for /d %%d in (%~dp0\obj\*) do (rmdir /S /Q "%%~d")

REM ///////////////////////////////////////////////////////////////////////////
REM // Build the binaries
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	for %%p in (Win32, x64) do (
		echo ---------------------------------------------------------------------
		echo BEGIN BUILD [%%p/Release_%%c]
		echo ---------------------------------------------------------------------

		MSBuild.exe /property:Platform=%%p /property:Configuration=Release_%%c /target:clean   "%~dp0\DynamicAudioNormalizer.sln"
		if not "!ERRORLEVEL!"=="0" goto BuildError
		MSBuild.exe /property:Platform=%%p /property:Configuration=Release_%%c /target:rebuild "%~dp0\DynamicAudioNormalizer.sln"
		if not "!ERRORLEVEL!"=="0" goto BuildError
		MSBuild.exe /property:Platform=%%p /property:Configuration=Release_%%c /target:build   "%~dp0\DynamicAudioNormalizer.sln"
		if not "!ERRORLEVEL!"=="0" goto BuildError
	)
)

call "%ANT1_PATH%\bin\ant.bat" -buildfile "%~dp0\DynamicAudioNormalizerJNI\build.xml"

REM ///////////////////////////////////////////////////////////////////////////
REM // Copy program files
REM ///////////////////////////////////////////////////////////////////////////
set "PACK_PATH=%TMP%\~%RANDOM%%RANDOM%.tmp"
mkdir "%PACK_PATH%"

for %%c in (DLL, Static) do (
	echo ---------------------------------------------------------------------
	echo BEGIN PACKAGING [Release_%%c]
	echo ---------------------------------------------------------------------

	mkdir "%PACK_PATH%\%%c"
	mkdir "%PACK_PATH%\%%c\x64"
	mkdir "%PACK_PATH%\%%c\img"

	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerCLI.exe" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerGUI.exe" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerVST.dll" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerVST.dll" "%PACK_PATH%\%%c\x64"
	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerWA5.dll" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerWA5.dll" "%PACK_PATH%\%%c\x64"

	if "%%c"=="DLL" (
		mkdir "%PACK_PATH%\%%c\include"

		copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerAPI.dll" "%PACK_PATH%\%%c"
		copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerAPI.lib" "%PACK_PATH%\%%c"
		copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerNET.dll" "%PACK_PATH%\%%c"
		copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerAPI.dll" "%PACK_PATH%\%%c\x64"
		copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerAPI.lib" "%PACK_PATH%\%%c\x64"
		copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerNET.dll" "%PACK_PATH%\%%c\x64"

		copy "%~dp0\DynamicAudioNormalizerAPI\include\*.h"               "%PACK_PATH%\%%c\include"
		copy "%~dp0\DynamicAudioNormalizerPAS\include\*.pas"             "%PACK_PATH%\%%c\include"
		copy "%~dp0\DynamicAudioNormalizerJNI\out\*.jar"                 "%PACK_PATH%\%%c"
		copy "%~dp0\etc\sndfile\lib\Win32\shared\libsndfile-1.dll"       "%PACK_PATH%\%%c"
		copy "%~dp0\etc\pthread\lib\Win32\shared\pthreadVC2.dll"         "%PACK_PATH%\%%c"
		copy "%~dp0\etc\pthread\lib\x64\.\shared\pthreadVC2.dll"         "%PACK_PATH%\%%c\x64"

		copy "%MSVC_PATH%\redist\x86\Microsoft.VC120.CRT\msvc????.dll"   "%PACK_PATH%\%%c"
		copy "%MSVC_PATH%\redist\x64\Microsoft.VC120.CRT\msvc????.dll"   "%PACK_PATH%\%%c\x64"
		copy "%QT_SHARED%\bin\QtGui4.dll"                                "%PACK_PATH%\%%c"
		copy "%QT_SHARED%\bin\QtCore4.dll"                               "%PACK_PATH%\%%c"
	)

	copy "%~dp0\LICENSE-LGPL.html" "%PACK_PATH%\%%c"
	copy "%~dp0\LICENSE-GPL2.html" "%PACK_PATH%\%%c"
	copy "%~dp0\LICENSE-GPL3.html" "%PACK_PATH%\%%c"
	copy "%~dp0\img\*.png"         "%PACK_PATH%\%%c\img"

	"%PDOC_PATH%\pandoc.exe" --from markdown_github+header_attributes --to html5 --standalone -H "%~dp0\img\Style.inc" "%~dp0\README.md" --output "%PACK_PATH%\%%c\README.html"
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Compress
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\%%c\*.exe"
	"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\%%c\*.dll"
	"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\%%c\x64\*.dll"
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Attributes
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	attrib +R "%PACK_PATH%\%%c\*.exe"
	attrib +R "%PACK_PATH%\%%c\*.html"
	if "%%c"=="DLL" (
		attrib +R "%PACK_PATH%\%%c\*.dll"
	)
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Generate outfile name
REM ///////////////////////////////////////////////////////////////////////////
mkdir "%~dp0\out" 2> NUL
set "OUT_NAME=DynamicAudioNormalizer.%ISO_DATE%"
:CheckOutName
for %%c in (DLL, Static) do (
	if exist "%~dp0\out\%OUT_NAME%.%%c.zip" (
		set "OUT_NAME=%OUT_NAME%.new"
		goto CheckOutName
	)
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Create version tag
REM ///////////////////////////////////////////////////////////////////////////
echo Dynamic Audio Normalizer >                                                                      "%PACK_PATH%\BUILD_TAG"
echo Copyright (C) 2014 LoRd_MuldeR ^<MuldeR2@GMX.de^> >>                                            "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
echo Version %VER_MAJOR%.%VER_MINOR%-%VER_PATCH%. Built on %ISO_DATE%, at %ISO_TIME% >>              "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
cl 2>&1  | "%~dp0\etc\head.exe" -n1 | "%~dp0\etc\sed.exe" -e "/^$/d" -e "s/^/Compiler version: /" >> "%PACK_PATH%\BUILD_TAG"
ver 2>&1 |                            "%~dp0\etc\sed.exe" -e "/^$/d" -e "s/^/Build platform:   /" >> "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
echo This library is free software; you can redistribute it and/or >>                                "%PACK_PATH%\BUILD_TAG"
echo modify it under the terms of the GNU Lesser General Public >>                                   "%PACK_PATH%\BUILD_TAG"
echo License as published by the Free Software Foundation; either >>                                 "%PACK_PATH%\BUILD_TAG"
echo version 2.1 of the License, or (at your option) any later version. >>                           "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
echo This library is distributed in the hope that it will be useful, >>                              "%PACK_PATH%\BUILD_TAG"
echo but WITHOUT ANY WARRANTY; without even the implied warranty of >>                               "%PACK_PATH%\BUILD_TAG"
echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU >>                            "%PACK_PATH%\BUILD_TAG"
echo Lesser General Public License for more details. >>                                              "%PACK_PATH%\BUILD_TAG"

REM ///////////////////////////////////////////////////////////////////////////
REM // Build the package
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	copy "%PACK_PATH%\BUILD_TAG" "%PACK_PATH%\%%c"
	pushd "%PACK_PATH%\%%c"
	"%~dp0\etc\zip.exe" -9 -r -z "%~dp0\out\%OUT_NAME%.%%c.zip" "*.*" < "%PACK_PATH%\BUILD_TAG"
	popd
	attrib +R "%~dp0\out\%OUT_NAME%.%%c.zip"
)

REM Clean up!
rmdir /Q /S "%PACK_PATH%"

REM ///////////////////////////////////////////////////////////////////////////
REM // COMPLETE
REM ///////////////////////////////////////////////////////////////////////////
echo.
echo Build completed.
echo.
pause
goto:eof

REM ///////////////////////////////////////////////////////////////////////////
REM // FAILED
REM ///////////////////////////////////////////////////////////////////////////
:BuildError
echo.
echo Build has failed ^^!^^!^^!
echo.
pause

@echo off
setlocal enabledelayedexpansion

REM ///////////////////////////////////////////////////////////////////////////
REM // Set Paths
REM ///////////////////////////////////////////////////////////////////////////
set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
set "UPX3_PATH=C:\Program Files (x86)\UPX"
set "PDOC_PATH=C:\Program Files (x86)\Pandoc"
set "QT_SOURCE=C:\Qt\4.8.6"
set "QT_SHARED=C:\Qt\4.8.6-Shared"
set "QT_STATIC=C:\Qt\4.8.6-Static"
set "JDK8_PATH=C:\Program Files (x86)\Java\jdk1.8.0_25"
set "ANT1_PATH=C:\Eclipse\plugins\org.apache.ant_1.9.2.v201404171502"

REM ###############################################
REM # DO NOT MODIFY ANY LINES BELOW THIS LINE !!! #
REM ###############################################

REM ///////////////////////////////////////////////////////////////////////////
REM // Setup environment
REM ///////////////////////////////////////////////////////////////////////////
set "QTDIR=%QT_SOURCE%"
call "%MSVC_PATH%\vcvarsall.bat" x86
set "JAVA_HOME=%JDK8_PATH%"
set "ANT_HOME=%ANT1_PATH%"
set "PATH=%QTDIR%\bin;%PATH%"

REM ///////////////////////////////////////////////////////////////////////////
REM // Check environment
REM ///////////////////////////////////////////////////////////////////////////
if "%VCINSTALLDIR%"=="" (
	echo %%VCINSTALLDIR%% not specified. Please check your MSVC_PATH var^^!
	goto BuildError
)
if not exist "%VCINSTALLDIR%\bin\cl.exe" (
	echo C++ compiler binary not found. Please check your MSVC_PATH var^^!
	goto BuildError
)
if not exist "%UPX3_PATH%\upx.exe" (
	echo UPX binary could not be found. Please check your UPX3_PATH var^^!
	goto BuildError
)
if not exist "%PDOC_PATH%\pandoc.exe" (
	echo Pandoc binary could not be found. Please check your PDOC_PATH var^^!
	goto BuildError
)
if not exist "%QTDIR%\bin\moc.exe" (
	echo Qt could not be found. Please check your QT_SOURCE var^^!
	goto BuildError
)
if not exist "%QTDIR%\include\QtCore\qglobal.h" (
	echo Qt could not be found. Please check your QT_SOURCE var^^!
	goto BuildError
)
if not exist "%QT_SHARED%\bin\QtCore4.dll" (
	echo Qt *shared* libraries could not be found. Please check your QT_SHARED var^^!
	goto BuildError
)
if not exist "%QT_STATIC%\lib\QtCore.lib" (
	echo Qt *static* libraries could not be found. Please check your QT_STATIC var^^!
	goto BuildError
)
if not exist "%JDK8_PATH%\include\jni.h" (
	echo JNI header files could not be found. Please check your JDK8_PATH var^^!
	goto BuildError
)
if not exist "%ANT1_PATH%\lib\ant.jar" (
	echo Ant library file could not be found. Please check your ANT1_PATH var^^!
	goto BuildError
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Get current date and time (in ISO format)
REM ///////////////////////////////////////////////////////////////////////////
set "ISO_DATE="
set "ISO_TIME="
if not exist "%~dp0\etc\date.exe" BuildError
for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d') do (
	if "%%a"=="ISODATE" set "ISO_DATE=%%b"
)
for /F "tokens=1,2,3,4 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISOTIME:%%T') do (
	if "%%a"=="ISOTIME" set "ISO_TIME=%%b:%%c:%%d"
)
if "%ISO_DATE%"=="" goto BuildError
if "%ISO_TIME%"=="" goto BuildError

REM ///////////////////////////////////////////////////////////////////////////
REM // Detect version number
REM ///////////////////////////////////////////////////////////////////////////
set "VER_MAJOR="
set "VER_MINOR="
set "VER_PATCH="
for /F "tokens=4,5,6 delims=; " %%a in (%~dp0\DynamicAudioNormalizerAPI\src\Version.cpp) do (
	if "%%b"=="=" (
		if "%%a"=="DYNAUDNORM_VERSION_MAJOR" set "VER_MAJOR=%%c"
		if "%%a"=="DYNAUDNORM_VERSION_MINOR" set "VER_MINOR=%%c"
		if "%%a"=="DYNAUDNORM_VERSION_PATCH" set "VER_PATCH=%%c"
	)
)
if "%VER_MAJOR%"=="" goto BuildError
if "%VER_MINOR%"=="" goto BuildError
if "%VER_PATCH%"=="" goto BuildError
if %VER_MINOR% LSS 10 set "VER_MINOR=0%VER_MINOR%

REM ///////////////////////////////////////////////////////////////////////////
REM // Clean Binaries
REM ///////////////////////////////////////////////////////////////////////////
for /d %%d in (%~dp0\bin\*) do (rmdir /S /Q "%%~d")
for /d %%d in (%~dp0\obj\*) do (rmdir /S /Q "%%~d")

REM ///////////////////////////////////////////////////////////////////////////
REM // Build the binaries
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	for %%p in (Win32, x64) do (
		echo ---------------------------------------------------------------------
		echo BEGIN BUILD [%%p/Release_%%c]
		echo ---------------------------------------------------------------------

		MSBuild.exe /property:Platform=%%p /property:Configuration=Release_%%c /target:clean   "%~dp0\DynamicAudioNormalizer.sln"
		if not "!ERRORLEVEL!"=="0" goto BuildError
		MSBuild.exe /property:Platform=%%p /property:Configuration=Release_%%c /target:rebuild "%~dp0\DynamicAudioNormalizer.sln"
		if not "!ERRORLEVEL!"=="0" goto BuildError
		MSBuild.exe /property:Platform=%%p /property:Configuration=Release_%%c /target:build   "%~dp0\DynamicAudioNormalizer.sln"
		if not "!ERRORLEVEL!"=="0" goto BuildError
	)
)

call "%ANT1_PATH%\bin\ant.bat" -buildfile "%~dp0\DynamicAudioNormalizerJNI\build.xml"

REM ///////////////////////////////////////////////////////////////////////////
REM // Copy program files
REM ///////////////////////////////////////////////////////////////////////////
set "PACK_PATH=%TMP%\~%RANDOM%%RANDOM%.tmp"
mkdir "%PACK_PATH%"

for %%c in (DLL, Static) do (
	echo ---------------------------------------------------------------------
	echo BEGIN PACKAGING [Release_%%c]
	echo ---------------------------------------------------------------------

	mkdir "%PACK_PATH%\%%c"
	mkdir "%PACK_PATH%\%%c\x64"
	mkdir "%PACK_PATH%\%%c\img"

	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerCLI.exe" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerGUI.exe" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerVST.dll" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerVST.dll" "%PACK_PATH%\%%c\x64"
	copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerWA5.dll" "%PACK_PATH%\%%c"
	copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerWA5.dll" "%PACK_PATH%\%%c\x64"

	if "%%c"=="DLL" (
		mkdir "%PACK_PATH%\%%c\include"

		copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerAPI.dll" "%PACK_PATH%\%%c"
		copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerAPI.lib" "%PACK_PATH%\%%c"
		copy "%~dp0\bin\Win32\Release_%%c\DynamicAudioNormalizerNET.dll" "%PACK_PATH%\%%c"
		copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerAPI.dll" "%PACK_PATH%\%%c\x64"
		copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerAPI.lib" "%PACK_PATH%\%%c\x64"
		copy "%~dp0\bin\x64\.\Release_%%c\DynamicAudioNormalizerNET.dll" "%PACK_PATH%\%%c\x64"

		copy "%~dp0\DynamicAudioNormalizerAPI\include\*.h"               "%PACK_PATH%\%%c\include"
		copy "%~dp0\DynamicAudioNormalizerPAS\include\*.pas"             "%PACK_PATH%\%%c\include"
		copy "%~dp0\DynamicAudioNormalizerJNI\out\*.jar"                 "%PACK_PATH%\%%c"
		copy "%~dp0\etc\sndfile\lib\Win32\shared\libsndfile-1.dll"       "%PACK_PATH%\%%c"
		copy "%~dp0\etc\pthread\lib\Win32\shared\pthreadVC2.dll"         "%PACK_PATH%\%%c"
		copy "%~dp0\etc\pthread\lib\x64\.\shared\pthreadVC2.dll"         "%PACK_PATH%\%%c\x64"

		copy "%MSVC_PATH%\redist\x86\Microsoft.VC120.CRT\msvc????.dll"   "%PACK_PATH%\%%c"
		copy "%MSVC_PATH%\redist\x64\Microsoft.VC120.CRT\msvc????.dll"   "%PACK_PATH%\%%c\x64"
		copy "%QT_SHARED%\bin\QtGui4.dll"                                "%PACK_PATH%\%%c"
		copy "%QT_SHARED%\bin\QtCore4.dll"                               "%PACK_PATH%\%%c"
	)

	copy "%~dp0\LICENSE-LGPL.html" "%PACK_PATH%\%%c"
	copy "%~dp0\LICENSE-GPL2.html" "%PACK_PATH%\%%c"
	copy "%~dp0\LICENSE-GPL3.html" "%PACK_PATH%\%%c"
	copy "%~dp0\img\*.png"         "%PACK_PATH%\%%c\img"

	"%PDOC_PATH%\pandoc.exe" --from markdown_github+header_attributes --to html5 --standalone -H "%~dp0\img\Style.inc" "%~dp0\README.md" --output "%PACK_PATH%\%%c\README.html"
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Compress
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\%%c\*.exe"
	"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\%%c\*.dll"
	"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\%%c\x64\*.dll"
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Attributes
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	attrib +R "%PACK_PATH%\%%c\*.exe"
	attrib +R "%PACK_PATH%\%%c\*.html"
	attrib +R "%PACK_PATH%\%%c\*.dll"
	attrib +R "%PACK_PATH%\%%c\*.jar"
	attrib +R "%PACK_PATH%\%%c\*.lib"
	attrib +R "%PACK_PATH%\%%c\x64\*.dll"
	attrib +R "%PACK_PATH%\%%c\x64\*.lib"
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Generate outfile name
REM ///////////////////////////////////////////////////////////////////////////
mkdir "%~dp0\out" 2> NUL
set "OUT_NAME=DynamicAudioNormalizer.%ISO_DATE%"
:CheckOutName
for %%c in (DLL, Static) do (
	if exist "%~dp0\out\%OUT_NAME%.%%c.zip" (
		set "OUT_NAME=%OUT_NAME%.new"
		goto CheckOutName
	)
)

REM ///////////////////////////////////////////////////////////////////////////
REM // Create version tag
REM ///////////////////////////////////////////////////////////////////////////
echo Dynamic Audio Normalizer >                                                                      "%PACK_PATH%\BUILD_TAG"
echo Copyright (C) 2014 LoRd_MuldeR ^<MuldeR2@GMX.de^> >>                                            "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
echo Version %VER_MAJOR%.%VER_MINOR%-%VER_PATCH%. Built on %ISO_DATE%, at %ISO_TIME% >>              "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
cl 2>&1  | "%~dp0\etc\head.exe" -n1 | "%~dp0\etc\sed.exe" -e "/^$/d" -e "s/^/Compiler version: /" >> "%PACK_PATH%\BUILD_TAG"
ver 2>&1 |                            "%~dp0\etc\sed.exe" -e "/^$/d" -e "s/^/Build platform:   /" >> "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
echo This library is free software; you can redistribute it and/or >>                                "%PACK_PATH%\BUILD_TAG"
echo modify it under the terms of the GNU Lesser General Public >>                                   "%PACK_PATH%\BUILD_TAG"
echo License as published by the Free Software Foundation; either >>                                 "%PACK_PATH%\BUILD_TAG"
echo version 2.1 of the License, or (at your option) any later version. >>                           "%PACK_PATH%\BUILD_TAG"
echo. >>                                                                                "%PACK_PATH%\BUILD_TAG"
echo This library is distributed in the hope that it will be useful, >>                              "%PACK_PATH%\BUILD_TAG"
echo but WITHOUT ANY WARRANTY; without even the implied warranty of >>                               "%PACK_PATH%\BUILD_TAG"
echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU >>                            "%PACK_PATH%\BUILD_TAG"
echo Lesser General Public License for more details. >>                                              "%PACK_PATH%\BUILD_TAG"

REM ///////////////////////////////////////////////////////////////////////////
REM // Build the package
REM ///////////////////////////////////////////////////////////////////////////
for %%c in (DLL, Static) do (
	copy "%PACK_PATH%\BUILD_TAG" "%PACK_PATH%\%%c"
	pushd "%PACK_PATH%\%%c"
	"%~dp0\etc\zip.exe" -9 -r -z "%~dp0\out\%OUT_NAME%.%%c.zip" "*.*" < "%PACK_PATH%\BUILD_TAG"
	popd
	attrib +R "%~dp0\out\%OUT_NAME%.%%c.zip"
)

REM Clean up!
rmdir /Q /S "%PACK_PATH%"

REM ///////////////////////////////////////////////////////////////////////////
REM // COMPLETE
REM ///////////////////////////////////////////////////////////////////////////
echo.
echo Build completed.
echo.
pause
goto:eof

REM ///////////////////////////////////////////////////////////////////////////
REM // FAILED
REM ///////////////////////////////////////////////////////////////////////////
:BuildError
echo.
echo Build has failed ^^!^^!^^!
echo.
pause

Update build script.

Update build script.


@echo off
set release_name=OpenEMap-1.2.0
echo ..\release\%release_name%
cd ..\release
rd /s /q %release_name%
del %release_name%.zip
del ..\%release_name%-all.js
del ..\%release_name%-all-debug.js
md %release_name%
cd %release_name%
md config
md resources
cd..
sencha.exe compile --classpath=..\src\main\javascript,..\..\libs\ext-4.2.1\src,..\..\libs\geoext2-2.0.1\src exclude -all and include -namespace OpenEMap and include -file ..\src\main\javascript\OpenEMap.js and concat --closure ..\%release_name%-all.js
sencha.exe compile --classpath=..\src\main\javascript,..\..\libs\ext-4.2.1\src,..\..\libs\geoext2-2.0.1\src exclude -all and include -namespace OpenEMap and include -file ..\src\main\javascript\OpenEMap.js and concat ..\%release_name%-all-debug.js
copy ..\*.html ..\release\%release_name%
copy ..\*-all.js ..\release\%release_name%
xcopy ..\config ..\release\%release_name%\config /E
xcopy ..\resources ..\release\%release_name%\resources /E
zip -r %release_name%.zip %release_name%/*

set release_name=OpenEMap-1.3.0-rc.1
echo ..\release\%release_name%
cd ..\release
rd /s /q %release_name%
del %release_name%.zip
del ..\%release_name%-all.js
del ..\%release_name%-all-debug.js
md %release_name%
cd %release_name%
md config
md resources
cd..
sencha.exe compile --classpath=..\src\main\javascript,..\..\libs\ext-4.2.1\src,..\..\libs\geoext-2.0.1\src exclude -all and include -namespace OpenEMap and include -file ..\src\main\javascript\OpenEMap.js and concat --closure ..\%release_name%-all.js
sencha.exe compile --classpath=..\src\main\javascript,..\..\libs\ext-4.2.1\src,..\..\libs\geoext-2.0.1\src exclude -all and include -namespace OpenEMap and include -file ..\src\main\javascript\OpenEMap.js and concat ..\%release_name%-all-debug.js
copy ..\*.html ..\release\%release_name%
copy ..\*-all.js ..\release\%release_name%
xcopy ..\config ..\release\%release_name%\config /E
xcopy ..\resources ..\release\%release_name%\resources /E
7z a -tzip %release_name%.zip -r %release_name%
pause

build file updates

build file updates


@echo off

setlocal enabledelayedexpansion
setlocal enableextensions

call "%~dp0elasticsearch-env.bat" || exit /b 1

set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
if "%SERVICE_ID%" == "" set SERVICE_ID=elasticsearch-service-x64
set ARCH=64-bit

if EXIST "%EXECUTABLE%" goto okExe
echo elasticsearch-service-x64.exe was not found...
exit /B 1

:okExe
set ES_VERSION=${project.version}

if "%SERVICE_LOG_DIR%" == "" set SERVICE_LOG_DIR=%ES_HOME%\logs

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
set SERVICE_ID=%1

:checkServiceCmd

if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%SERVICE_LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto

if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == manager goto doManagment
echo Unknown option "%SERVICE_CMD%"

:displayUsage
echo.
echo Usage: elasticsearch-service.bat install^|remove^|start^|stop^|manager [SERVICE_ID]
goto:eof

:doStart
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
goto:eof
:started
echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
goto:eof
:stopped
echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
goto:eof
:managed
echo Successfully started service manager for '%SERVICE_ID%'.
goto:eof

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
goto:eof
:removed
echo The service '%SERVICE_ID%' has been removed
goto:eof

:doInstall
echo Installing service      :  "%SERVICE_ID%"
echo Using JAVA_HOME (%ARCH%):  "%JAVA_HOME%"

rem Check JVM server dll first
if exist "%JAVA_HOME%\jre\bin\server\jvm.dll" (
	set JVM_DLL=\jre\bin\server\jvm.dll
	goto foundJVM
)

rem Check 'server' JRE (JRE installed on Windows Server)
if exist "%JAVA_HOME%\bin\server\jvm.dll" (
	set JVM_DLL=\bin\server\jvm.dll
	goto foundJVM
) else (
  	echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Exiting...
  	goto:eof
)

:foundJVM
set ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

@setlocal
for /F "usebackq delims=" %%a in (`"%JAVA% -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.JvmOptionsParser" "!ES_JVM_OPTIONS!" || echo jvm_options_parser_failed"`) do set JVM_OPTIONS=%%a
@endlocal & set "MAYBE_JVM_OPTIONS_PARSER_FAILED=%JVM_OPTIONS%" & set ES_JAVA_OPTS=%JVM_OPTIONS:${ES_TMPDIR}=!ES_TMPDIR!% %ES_JAVA_OPTS%

if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" (
  exit /b 1
)

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

if "%ES_JAVA_OPTS:~-1%"==";" set ES_JAVA_OPTS=%ES_JAVA_OPTS:~0,-1%

echo %ES_JAVA_OPTS%

@setlocal EnableDelayedExpansion
for %%a in ("%ES_JAVA_OPTS:;=","%") do (
  set var=%%a
  if "!var:~1,4!" == "-Xms" (
    if not "!JVM_MS!" == "" (
      echo duplicate min heap size settings found
      goto:eof
    )
    set XMS=!var:~5,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,16!" == "-XX:MinHeapSize=" (
    if not "!JVM_MS!" == "" (
      echo duplicate min heap size settings found
      goto:eof
    )
    set XMS=!var:~17,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,4!" == "-Xmx" (
    if not "!JVM_MX!" == "" (
      echo duplicate max heap size settings found
      goto:eof
    )
    set XMX=!var:~5,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,16!" == "-XX:MaxHeapSize=" (
    if not "!JVM_MX!" == "" (
      echo duplicate max heap size settings found
      goto:eof
    )
    set XMX=!var:~17,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,4!" == "-Xss" (
    if not "!JVM_SS!" == "" (
      echo duplicate thread stack size settings found
      exit 1
    )
    set XSS=!var:~5,-1!
    call:convertxk !XSS! JVM_SS
  )
  if "!var:~1,20!" == "-XX:ThreadStackSize=" (
    if not "!JVM_SS!" == "" (
      echo duplicate thread stack size settings found
      goto:eof
    )
    set XSS=!var:~21,-1!
    call:convertxk !XSS! JVM_SS
  )
)
@endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS%

if "%JVM_MS%" == "" (
  echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_MX%" == "" (
  echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_SS%" == "" (
  echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)

set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%"

if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

if "%SERVICE_DISPLAY_NAME%" == "" set SERVICE_DISPLAY_NAME=Elasticsearch %ES_VERSION% (%SERVICE_ID%)
if "%SERVICE_DESCRIPTION%" == "" set SERVICE_DESCRIPTION=Elasticsearch %ES_VERSION% Windows Service - https://elastic.co

if not "%SERVICE_USERNAME%" == "" (
	if not "%SERVICE_PASSWORD%" == "" (
		set SERVICE_PARAMS=%SERVICE_PARAMS% --ServiceUser "%SERVICE_USERNAME%" --ServicePassword "%SERVICE_PASSWORD%"
	)
)

"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main ++StartParams --quiet --StopClass org.elasticsearch.bootstrap.Elasticsearch --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmMs %JVM_MS% --JvmMx %JVM_MX% --JvmSs %JVM_SS% --JvmOptions %ES_JAVA_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "%SERVICE_DISPLAY_NAME%" --Description "%SERVICE_DESCRIPTION%" --Jvm "%%JAVA_HOME%%%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%" %SERVICE_PARAMS%

if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_ID%' service
goto:eof

:installed
echo The service '%SERVICE_ID%' has been installed.
goto:eof

:err
echo JAVA_HOME environment variable must be set!
pause
goto:eof

rem ---
rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts
rem ---
:convertxm
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
:kilo
rem convert to MB
set /a conv=%conv% / 1024
goto mega
:giga
rem convert to MB
set /a conv=%conv% * 1024
:mega
set "%~2=%conv%"
goto:eof

:convertxk
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
goto kilo
:mega
rem convert to KB
set /a conv=%conv% * 1024
goto kilo
:giga
rem convert to KB
set /a conv=%conv% * 1024 * 1024
:kilo
set "%~2=%conv%"
goto:eof

endlocal
endlocal

@echo off

setlocal enabledelayedexpansion
setlocal enableextensions

call "%~dp0elasticsearch-env.bat" || exit /b 1

set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
if "%SERVICE_ID%" == "" set SERVICE_ID=elasticsearch-service-x64
set ARCH=64-bit

if EXIST "%EXECUTABLE%" goto okExe
echo elasticsearch-service-x64.exe was not found...
exit /B 1

:okExe
set ES_VERSION=${project.version}

if "%SERVICE_LOG_DIR%" == "" set SERVICE_LOG_DIR=%ES_HOME%\logs

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
set SERVICE_ID=%1

:checkServiceCmd

if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%SERVICE_LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto

if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == start goto doStart
if /i %SERVICE_CMD% == stop goto doStop
if /i %SERVICE_CMD% == manager goto doManagment
echo Unknown option "%SERVICE_CMD%"

:displayUsage
echo.
echo Usage: elasticsearch-service.bat install^|remove^|start^|stop^|manager [SERVICE_ID]
goto:eof

:doStart
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
goto:eof
:started
echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
goto:eof
:stopped
echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
goto:eof
:managed
echo Successfully started service manager for '%SERVICE_ID%'.
goto:eof

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
goto:eof
:removed
echo The service '%SERVICE_ID%' has been removed
goto:eof

:doInstall
echo Installing service      :  "%SERVICE_ID%"
echo Using JAVA_HOME (%ARCH%):  "%JAVA_HOME%"

rem Check JVM server dll first
if exist "%JAVA_HOME%\jre\bin\server\jvm.dll" (
	set JVM_DLL=\jre\bin\server\jvm.dll
	goto foundJVM
)

rem Check 'server' JRE (JRE installed on Windows Server)
if exist "%JAVA_HOME%\bin\server\jvm.dll" (
	set JVM_DLL=\bin\server\jvm.dll
	goto foundJVM
) else (
  	echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Exiting...
  	goto:eof
)

:foundJVM
set ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

@setlocal
for /F "usebackq delims=" %%a in (`"%JAVA% -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.JvmOptionsParser" "!ES_JVM_OPTIONS!" || echo jvm_options_parser_failed"`) do set JVM_OPTIONS=%%a
@endlocal & set "MAYBE_JVM_OPTIONS_PARSER_FAILED=%JVM_OPTIONS%" & set ES_JAVA_OPTS=%JVM_OPTIONS:${ES_TMPDIR}=!ES_TMPDIR!% %ES_JAVA_OPTS%

if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" (
  exit /b 1
)

if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%

if "%ES_JAVA_OPTS:~-1%"==";" set ES_JAVA_OPTS=%ES_JAVA_OPTS:~0,-1%

echo %ES_JAVA_OPTS%

@setlocal EnableDelayedExpansion
for %%a in ("%ES_JAVA_OPTS:;=","%") do (
  set var=%%a
  if "!var:~1,4!" == "-Xms" (
    set XMS=!var:~5,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,16!" == "-XX:MinHeapSize=" (
    set XMS=!var:~17,-1!
    call:convertxm !XMS! JVM_MS
  )
  if "!var:~1,4!" == "-Xmx" (
    set XMX=!var:~5,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,16!" == "-XX:MaxHeapSize=" (
    set XMX=!var:~17,-1!
    call:convertxm !XMX! JVM_MX
  )
  if "!var:~1,4!" == "-Xss" (
    set XSS=!var:~5,-1!
    call:convertxk !XSS! JVM_SS
  )
  if "!var:~1,20!" == "-XX:ThreadStackSize=" (
    set XSS=!var:~21,-1!
    call:convertxk !XSS! JVM_SS
  )
)
@endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS%

if "%JVM_MS%" == "" (
  echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_MX%" == "" (
  echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)
if "%JVM_SS%" == "" (
  echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
  goto:eof
)

set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%"

if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

if "%SERVICE_DISPLAY_NAME%" == "" set SERVICE_DISPLAY_NAME=Elasticsearch %ES_VERSION% (%SERVICE_ID%)
if "%SERVICE_DESCRIPTION%" == "" set SERVICE_DESCRIPTION=Elasticsearch %ES_VERSION% Windows Service - https://elastic.co

if not "%SERVICE_USERNAME%" == "" (
	if not "%SERVICE_PASSWORD%" == "" (
		set SERVICE_PARAMS=%SERVICE_PARAMS% --ServiceUser "%SERVICE_USERNAME%" --ServicePassword "%SERVICE_PASSWORD%"
	)
)

"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main ++StartParams --quiet --StopClass org.elasticsearch.bootstrap.Elasticsearch --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmMs %JVM_MS% --JvmMx %JVM_MX% --JvmSs %JVM_SS% --JvmOptions %ES_JAVA_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "%SERVICE_DISPLAY_NAME%" --Description "%SERVICE_DESCRIPTION%" --Jvm "%%JAVA_HOME%%%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%" %SERVICE_PARAMS%

if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_ID%' service
goto:eof

:installed
echo The service '%SERVICE_ID%' has been installed.
goto:eof

:err
echo JAVA_HOME environment variable must be set!
pause
goto:eof

rem ---
rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts
rem ---
:convertxm
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
:kilo
rem convert to MB
set /a conv=%conv% / 1024
goto mega
:giga
rem convert to MB
set /a conv=%conv% * 1024
:mega
set "%~2=%conv%"
goto:eof

:convertxk
set value=%~1
rem extract last char (unit)
set unit=%value:~-1%
rem assume the unit is specified
set conv=%value:~0,-1%

if "%unit%" == "k" goto kilo
if "%unit%" == "K" goto kilo
if "%unit%" == "m" goto mega
if "%unit%" == "M" goto mega
if "%unit%" == "g" goto giga
if "%unit%" == "G" goto giga

rem no unit found, must be bytes; consider the whole value
set conv=%value%
rem convert to KB
set /a conv=%conv% / 1024
goto kilo
:mega
rem convert to KB
set /a conv=%conv% * 1024
goto kilo
:giga
rem convert to KB
set /a conv=%conv% * 1024 * 1024
:kilo
set "%~2=%conv%"
goto:eof

endlocal
endlocal

Allow overriding JVM options in Windows service (#29044)

Today we allow any other method of starting Elastisearch to override
jvm.options via ES_JAVA_OPTS. Yet, for some settings in the Windows
service, we do not allow this. This commit removes this in favor of
being consistent with other packaging choices.


@echo off

:: Qt Directory
set QT_PATH=C:\Qt
set QT_VERSION=5.8
set QT_COMPILER=msvc2015_64
set QT_DIR=%QT_PATH%\%QT_VERSION%\%QT_COMPILER%
set QT_PLATFORM=%QT_DIR%\plugins\platforms
set QT_BIN=%QT_DIR%\bin

set MSCV_COMPILER=Visual Studio 14 2015 Win64

:: Terms
set RELEASE=bin\Release
set DEBUG=bin\Debug

:: Square Directories
set DEVOPS=%SQUARE%\devops
set BUILD=%SQUARE%\build
set SOURCE=%SQUARE%\source

:: Deployment Directories
set DEPLOY=%BUILD%\deploy
set DEPLOY_DOCS=%DEPLOY%\docs
set DEPLOY_ASSETS=%DEPLOY%\assets
set DEPLOY_RELEASE=%DEPLOY%\%RELEASE%\
set DEPLOY_DEBUG=%DEPLOY%\%DEBUG%\
set DEPLOY_THIRD=%DEPLOY%\thirdparty

::DevOps Directories
set DEVOPS_SCRIPTS=%DEVOPS%\scripts
set DEVOPS_CMAKE=%DEVOPS%\cmake
set DEVOPS_TOOLS=%DEVOPS%\tools

:: Local Third Party Directories
set THIRD=%SOURCE%\thirdparty
set THIRD_QT=%THIRD%\Qt
set THIRD_MSVC=%THIRD%\MSVC
set THIRD_PYTHON=%THIRD%\Python

:: Command shell overview
:: https://technet.microsoft.com/en-us/library/bb490954.aspx

@echo off

:: Qt Directory
set QT_PATH=C:\Qt
set QT_VERSION=5.11.1
set QT_COMPILER=msvc2017_64
set QT_DIR=%QT_PATH%\%QT_VERSION%\%QT_COMPILER%
set QT_PLATFORM=%QT_DIR%\plugins\platforms
set QT_BIN=%QT_DIR%\bin

set MSCV_COMPILER=Visual Studio 15 2017 Win64

:: Terms
set RELEASE=bin\Release
set DEBUG=bin\Debug

:: Square Directories
set DEVOPS=%SQUARE%\devops
set BUILD=%SQUARE%\build
set SOURCE=%SQUARE%\source

:: Deployment Directories
set DEPLOY=%BUILD%\deploy
set DEPLOY_DOCS=%DEPLOY%\docs
set DEPLOY_ASSETS=%DEPLOY%\assets
set DEPLOY_RELEASE=%DEPLOY%\%RELEASE%\
set DEPLOY_DEBUG=%DEPLOY%\%DEBUG%\
set DEPLOY_THIRD=%DEPLOY%\thirdparty

::DevOps Directories
set DEVOPS_SCRIPTS=%DEVOPS%\scripts
set DEVOPS_CMAKE=%DEVOPS%\cmake
set DEVOPS_TOOLS=%DEVOPS%\tools

:: Local Third Party Directories
set THIRD=%SOURCE%\thirdparty
set THIRD_QT=%THIRD%\Qt
set THIRD_MSVC=%THIRD%\MSVC
set THIRD_PYTHON=%THIRD%\Python

:: Command shell overview
:: https://technet.microsoft.com/en-us/library/bb490954.aspx

update versions

update versions


@rem Fetches (and builds if necessary) external dependencies

@rem Assume we start inside the Python source directory
call "Tools\buildbot\external-common.bat"
call "%VS90COMNTOOLS%\vsvars32.bat"

if not exist tcltk\bin\tcl85g.dll (
    cd tcl-8.5.2.1\win
    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all install
    cd ..\..
)

if not exist tcltk\bin\tk85g.dll (
    cd tk-8.5.2.0\win
    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 clean all install
    cd ..\..
)

@rem Fetches (and builds if necessary) external dependencies

@rem Assume we start inside the Python source directory
call "Tools\buildbot\external-common.bat"
call "%VS90COMNTOOLS%\vsvars32.bat"

if not exist tcltk\bin\tcl85.dll (
    @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
    cd tcl-8.5.2.1\win
    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all
    nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
    cd ..\..
)

if not exist tcltk\bin\tk85.dll (
    cd tk-8.5.2.0\win
    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 clean
    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 all
    nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.2.1 install
    cd ..\..
)

Split Tcl make targets into separate ones.


@echo off

set coretestproject=%~dp0src\IxMilia.BCad.Core.Test\IxMilia.BCad.Core.Test.csproj
set filehandlerstestproject=%~dp0src\IxMilia.BCad.FileHandlers.Test\IxMilia.BCad.FileHandlers.Test.csproj

:: IxMilia.Dxf needs a custom invocation
call %~dp0src\IxMilia.Dxf\build-and-test.cmd -notest
if errorlevel 1 echo Error pre-building IxMilia.Dxf && goto error

:: restore packages
dotnet restore
if errorlevel 1 echo Error restoring packages && goto error

:: build .NET
dotnet build
if errorlevel 1 echo Error building solution && goto error

:: test
dotnet test --no-restore --no-build "%coretestproject%"
if errorlevel 1 echo Error running tests && goto error
dotnet test --no-restore --no-build "%filehandlerstestproject%"
if errorlevel 1 echo Error running tests && goto error

:: build electron
pushd %~dp0src\bcad
call npm i
if errorlevel 1 echo Error restoring npm packages && goto error
call npm run pack
if errorlevel 1 echo Error packing electron && goto error
popd

exit /b 0

:error
echo Build exited with failures.
cd /d %~dp0
exit /b 1

@echo off

:: IxMilia.Dxf needs a custom invocation
call %~dp0src\IxMilia.Dxf\build-and-test.cmd -notest
if errorlevel 1 echo Error pre-building IxMilia.Dxf && goto error

:: restore packages
dotnet restore
if errorlevel 1 echo Error restoring packages && goto error

:: build .NET
dotnet build
if errorlevel 1 echo Error building solution && goto error

:: test
dotnet test --no-restore --no-build
if errorlevel 1 echo Error running tests && goto error

:: build electron
pushd %~dp0src\bcad
call npm i
if errorlevel 1 echo Error restoring npm packages && goto error
call npm run pack
if errorlevel 1 echo Error packing electron && goto error
popd

exit /b 0

:error
echo Build exited with failures.
cd /d %~dp0
exit /b 1

simplify test execution

simplify test execution


echo off

REM Usage: set_pycompiler C:\Python37 mingw32
REM Where %PYTHON_DIR% is the directory of your Python installation.
REM Compiler option can be "mingw32" or "msvc".
REM In Pyslvs project.
set HERE=%~dp0
set PYTHON_DIR=%1
set COMPILER=%2

REM Create "distutils.cfg"
set DISTUTILS=%PYTHON_DIR%\Lib\distutils\distutils.cfg
if exist "%DISTUTILS%" del "%DISTUTILS%" /Q /S
echo [build]>> "%DISTUTILS%"
echo compiler=%COMPILER%>> "%DISTUTILS%"
echo patched file "%DISTUTILS%"
REM Apply the patch of "cygwinccompiler.py".
REM Unix "patch" command of Msys.
patch -N "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%\cygwinccompiler.diff"
patch -N "%PYTHON_DIR%\include\pyconfig.h" "%HERE%\pyconfig.diff"

REM Copy "vcruntime140.dll" to "libs".
copy "%PYTHON_DIR%\vcruntime140.dll" "%PYTHON_DIR%\libs"
echo copied "vcruntime140.dll".

echo off

REM Usage: set_pycompiler C:\Python37 mingw32
REM Where %PYTHON_DIR% is the directory of your Python installation.
REM Compiler option can be "mingw32" or "msvc".
REM In Pyslvs project.
set HERE=%~dp0
set PYTHON_DIR=%1
set COMPILER=%2

REM Create "distutils.cfg"
set DISTUTILS=%PYTHON_DIR%\Lib\distutils\distutils.cfg
if exist "%DISTUTILS%" del "%DISTUTILS%" /Q /S
echo [build]>> "%DISTUTILS%"
echo compiler=%COMPILER%>> "%DISTUTILS%"
echo patched file "%DISTUTILS%"
REM Apply the patch of "cygwinccompiler.py".
REM Unix "patch" command of Msys.
set patch="C:\Program Files\Git\usr\bin\patch.exe"
%patch% -N "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%\cygwinccompiler.diff"
%patch% -N "%PYTHON_DIR%\include\pyconfig.h" "%HERE%\pyconfig.diff"

REM Copy "vcruntime140.dll" to "libs".
copy "%PYTHON_DIR%\vcruntime140.dll" "%PYTHON_DIR%\libs"
echo copied "vcruntime140.dll".

Improve patching command.

Improve patching command.


@echo off
::ϵͳ
::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
::û
::HKEY_CURRENT_USER\Environment

set regOgrepath=HKEY_CURRENT_USER\Environment

::BINĿ¼
set regBINName=NFBIN_HOME
set regBINValue=D:\NoahGameFrame\trunk\_Out\Client\Bin
reg add "%regOgrepath%" /v "%regBINName%" /d "%regBINValue%" /f

::SERVER_BINĿ¼
set regSERVERBINName=NFBIN_SERVER
set regSERVERBINValue=D:\NoahGameFrame\trunk\_Out\Server
reg add "%regOgrepath%" /v "%regSERVERBINName%" /d "%regSERVERBINValue%" /f

::COMM_BINĿ¼
set regCOMMBINName=NFBIN_COMM
set regCOMMBINValue=D:\NoahGameFrame\trunk\_Out\Comm
reg add "%regOgrepath%" /v "%regCOMMBINName%" /d "%regCOMMBINValue%" /f

::NF_HOMEĿ¼
set regNF_HOMEName=NF_HOME
set regNF_HOMEValue=D:\NoahGameFrame\trunk\\
reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

::APP_LIBĿ¼
set regAPP_LIBName=APP_DEPLIB
set regAPP_LIBVALUE=D:\NoahGameFrame\trunk\Dependencies\lib\\
reg add "%regOgrepath%" /v "%regAPP_LIBName%" /d "%regAPP_LIBVALUE%" /f

::NF_NOSQL_NETĿ¼
set regNF_HOMEName=NF_NOSQL_NET
set regNF_HOMEValue=D:\NoahGameFrame\trunk\Dependencies\redis-cplusplus-client\msvc\anet_win32\\
reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

::BOOST
set regBOOSTName=BOOST_HOME
set regBOOSTValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\\
reg add "%regOgrepath%" /v "%regBOOSTName%" /d "%regBOOSTValue%" /f

::BOOSTLIB
set regBOOSTLIBName=BOOST_LIB
set regBOOSTLIBValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\stage\lib\x64\vs11_0
reg add "%regOgrepath%" /v "%regBOOSTLIBName%" /d "%regBOOSTLIBValue%" /f

::Dependencies
set regDEPName=NF_DEP
set regDEPNameValue=D:\NoahGameFrame\trunk\Dependencies\\
reg add "%regOgrepath%" /v "%regDEPName%" /d "%regDEPNameValue%" /f

::GLOGĿ¼
set regGLOGName=GLOG_HOME
set regGLOGValue=D:\NoahGameFrame\trunk\Dependencies\glog-0.3.3\src\windows\\
reg add "%regOgrepath%" /v "%regGLOGName%" /d "%regGLOGValue%" /f

::TheronĿ¼
set regTHERONName=THERON_HOME
set regTHERONValue=D:\NoahGameFrame\trunk\Dependencies\Theron-6.00.01\Include\\
reg add "%regOgrepath%" /v "%regTHERONName%" /d "%regTHERONValue%" /f

echo Set Environment end

rem ====================================================================================
echo Start to extract boost_1_53_0

cd Tool
7z x "..\Dependencies\boost_1_53_0.zip" -o"..\Dependencies\" -y

echo Extract boost_1_53_0 completed!
rem ====================================================================================

echo Start to extract nessasery lib

7z x "..\Dependencies\lib.zip" -o"..\Dependencies\" -y

echo Extract nessasery lib completed!
rem ====================================================================================

pause

@echo off
::ϵͳ
::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
::û
::HKEY_CURRENT_USER\Environment

REM set regOgrepath=HKEY_CURRENT_USER\Environment

REM ::BINĿ¼
REM set regBINName=NFBIN_HOME
REM set regBINValue=D:\NoahGameFrame\trunk\_Out\Client\Bin
REM reg add "%regOgrepath%" /v "%regBINName%" /d "%regBINValue%" /f

REM ::SERVER_BINĿ¼
REM set regSERVERBINName=NFBIN_SERVER
REM set regSERVERBINValue=D:\NoahGameFrame\trunk\_Out\Server
REM reg add "%regOgrepath%" /v "%regSERVERBINName%" /d "%regSERVERBINValue%" /f

REM ::COMM_BINĿ¼
REM set regCOMMBINName=NFBIN_COMM
REM set regCOMMBINValue=D:\NoahGameFrame\trunk\_Out\Comm
REM reg add "%regOgrepath%" /v "%regCOMMBINName%" /d "%regCOMMBINValue%" /f

REM ::NF_HOMEĿ¼
REM set regNF_HOMEName=NF_HOME
REM set regNF_HOMEValue=D:\NoahGameFrame\trunk\\
REM reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

REM ::APP_LIBĿ¼
REM set regAPP_LIBName=APP_DEPLIB
REM set regAPP_LIBVALUE=D:\NoahGameFrame\trunk\Dependencies\lib\\
REM reg add "%regOgrepath%" /v "%regAPP_LIBName%" /d "%regAPP_LIBVALUE%" /f

REM ::NF_NOSQL_NETĿ¼
REM set regNF_HOMEName=NF_NOSQL_NET
REM set regNF_HOMEValue=D:\NoahGameFrame\trunk\Dependencies\redis-cplusplus-client\msvc\anet_win32\\
REM reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

REM ::BOOST
REM set regBOOSTName=BOOST_HOME
REM set regBOOSTValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\\
REM reg add "%regOgrepath%" /v "%regBOOSTName%" /d "%regBOOSTValue%" /f

REM ::BOOSTLIB
REM set regBOOSTLIBName=BOOST_LIB
REM set regBOOSTLIBValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\stage\lib\x64\vs11_0
REM reg add "%regOgrepath%" /v "%regBOOSTLIBName%" /d "%regBOOSTLIBValue%" /f

REM ::Dependencies
REM set regDEPName=NF_DEP
REM set regDEPNameValue=D:\NoahGameFrame\trunk\Dependencies\\
REM reg add "%regOgrepath%" /v "%regDEPName%" /d "%regDEPNameValue%" /f

REM ::GLOGĿ¼
REM set regGLOGName=GLOG_HOME
REM set regGLOGValue=D:\NoahGameFrame\trunk\Dependencies\glog-0.3.3\src\windows\\
REM reg add "%regOgrepath%" /v "%regGLOGName%" /d "%regGLOGValue%" /f

REM ::TheronĿ¼
REM set regTHERONName=THERON_HOME
REM set regTHERONValue=D:\NoahGameFrame\trunk\Dependencies\Theron-6.00.01\Include\\
REM reg add "%regOgrepath%" /v "%regTHERONName%" /d "%regTHERONValue%" /f

REM echo Set Environment end

rem ====================================================================================
echo Start to extract boost_1_53_0

cd Tool
7z x "..\Dependencies\boost_1_53_0.zip" -o"..\Dependencies\" -y

echo Extract boost_1_53_0 completed!
rem ====================================================================================

echo Start to extract nessasery lib

7z x "..\Dependencies\lib.zip" -o"..\Dependencies\" -y

echo Extract nessasery lib completed!
rem ====================================================================================

pause

delete use reg to set Environment

delete use reg to set Environment


set conda_env="fc_env"
set copy_dir="FreeCAD_Conda_Build"

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython blas=*=*netlib ^
 numpy matplotlib-base scipy sympy pandas six ^
 pyyaml opencamlib ifcopenshell ^
 freecad.asm3 libredwg pycollada ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin\ QtWebEngineProces* %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
echo [Paths] > %copy_dir%\bin\qt.conf
echo Prefix =.. >> "%copy_dir%\bin\qt.conf"
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy %conda_env%\Library\doc\ *.html %copy_dir%\doc MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
%copy_dir%\bin\python.exe -c "import FreeCAD;print((FreeCAD.Version()[0]) +'.' + (FreeCAD.Version()[1]) +'.' + (FreeCAD.Version()[2]))" > tempver.txt
set /p fcver=<tempver.txt
echo %fcver%
cd %copy_dir%\..
ren %copy_dir% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mmt=%NUMBER_OF_PROCESSORS% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64\
certutil -hashfile "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z" SHA256 > "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt
echo  %date%-%time% >>"FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt

set conda_env="fc_env"
set copy_dir="FreeCAD_Conda_Build"

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython ^
 numpy matplotlib-base scipy sympy pandas six ^
 pyyaml opencamlib ifcopenshell ^
 freecad.asm3 libredwg pycollada ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin\ QtWebEngineProces* %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
echo [Paths] > %copy_dir%\bin\qt.conf
echo Prefix =.. >> "%copy_dir%\bin\qt.conf"
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy %conda_env%\Library\doc\ *.html %copy_dir%\doc MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
%copy_dir%\bin\python.exe -c "import FreeCAD;print((FreeCAD.Version()[0]) +'.' + (FreeCAD.Version()[1]) +'.' + (FreeCAD.Version()[2]))" > tempver.txt
set /p fcver=<tempver.txt
echo %fcver%
cd %copy_dir%\..
ren %copy_dir% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mmt=%NUMBER_OF_PROCESSORS% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64\
certutil -hashfile "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z" SHA256 > "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt
echo  %date%-%time% >>"FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt

remove netlib blas

remove netlib blas


@echo on
REM call setenv_x64.bat
if "%BITSHARES_ROOT%" == "" (
    echo please call setenv_x64.bat firstly
    exit
)

set WORKSPACE=%BITSHARES_ROOT%

REM ======= JENKINS_BUILD setttings =======
set BUILD_NUMBER="0"
set BUILD_URL="http://url"

REM =========================================================================
set MSVC_RUNTIME_DIR_X64=%BITSHARES_ROOT%\vc_runtime.x64

set PREBUILT_BINARY_DIR_SUFFIX=.x64
set BOOST_PREBUILT_BINARY_DIR_SUFFIX=.x64
set ARCHITECTURE_SHORT_NAME=x64
set BLANK_OR_SIXTY_FOUR=64
set VISUAL_STUDIO_CONFIGURATION_SUFFIX= Win64
set MSBUILD_PLATFORM_NAME=x64
set ICU_VERSION_TO_PACKAGE=53

set QT_PATH_X64=%BITSHARES_ROOT%\QT.x64
set OPENSSL_ROOT_DIR_X64=%BITSHARES_ROOT%\OpenSSL.x64
set CRASHRPT_BIN_DIR_X64=%BITSHARES_ROOT%\CrashRpt\bin\x64

set ENABLE_CRASHRPT_FLAG=FALSE

REM if exist %WORKSPACE%\bts_play_build (
REM  rd /S /Q %WORKSPACE%\bts_play_build
REM )
REM
REM mkdir %WORKSPACE%\bts_play_build
REM
REM cd %WORKSPACE%\bts_play_build
REM

cmake %WORKSPACE%/bitshares_play ^
        -DBLOCKCHAIN_NAME:STRING=BitSharesPLAY ^
        -DINCLUDE_QT_WALLET:BOOL=TRUE ^
        -DCMAKE_PREFIX_PATH=%QTDIR% ^
        -DICU_VERSION_TO_PACKAGE:STRING=%ICU_VERSION_TO_PACKAGE% ^
        -DINCLUDE_CRASHRPT:BOOL=%ENABLE_CRASHRPT_FLAG% ^
        -DTARGET_ARCHITECTURE:STRING=%ARCHITECTURE_SHORT_NAME% ^
        -DMSVC_RUNTIME_DIR:PATH=%MSVC_RUNTIME_DIR_X64% ^
        -DGET_VERSION_STRING_FROM_GIT_TAGS:BOOL=TRUE ^
        -G "Visual Studio 12%VISUAL_STUDIO_CONFIGURATION_SUFFIX%" ^
        -T "v120_xp" ^
        -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
        -DBTS_CLIENT_JENKINS_BUILD_NUMBER:STRING=%BUILD_NUMBER% ^
        -DBTS_CLIENT_JENKINS_BUILD_URL:STRING="%BUILD_URL%"

if %errorlevel% neq 0 exit /b %errorlevel%

echo msbuild.exe /M:4 /p:Configuration=RelWithDebInfo /p:Platform=%MSBUILD_PLATFORM_NAME% BitShares.sln
if %errorlevel% neq 0 exit /b %errorlevel%

rem "C:\Program Files (x86)\Inno Setup 5\iscc.exe" "%WORKSPACE%\build\programs\qt_wallet\setup.iss"
rem if %errorlevel% neq 0 exit /b %errorlevel%

rem cd %WORKSPACE%\build\programs\qt_wallet
rem %SHA1SUM_EXE% BitShares-*.exe > sha1sum.txt

rem cd %WORKSPACE%\build
rem "%SEVENZIP_EXE%" a pdbs.7z -ir!*.pdb

@echo off
REM call setenv_x64.bat
if "%BITSHARES_ROOT%" == "" (
    echo please call setenv_x64.bat firstly
    goto done
)

set WORKSPACE=%BITSHARES_ROOT%

REM ======= JENKINS_BUILD setttings =======
set BUILD_NUMBER="0"
set BUILD_URL="http://url"

REM =========================================================================
set MSVC_RUNTIME_DIR_X64=%BITSHARES_ROOT%\vc_runtime.x64

set PREBUILT_BINARY_DIR_SUFFIX=.x64
set BOOST_PREBUILT_BINARY_DIR_SUFFIX=.x64
set ARCHITECTURE_SHORT_NAME=x64
set BLANK_OR_SIXTY_FOUR=64
set VISUAL_STUDIO_CONFIGURATION_SUFFIX= Win64
set MSBUILD_PLATFORM_NAME=x64
set ICU_VERSION_TO_PACKAGE=53

set QT_PATH_X64=%BITSHARES_ROOT%\QT.x64
set OPENSSL_ROOT_DIR_X64=%BITSHARES_ROOT%\OpenSSL.x64
set CRASHRPT_BIN_DIR_X64=%BITSHARES_ROOT%\CrashRpt\bin\x64

set ENABLE_CRASHRPT_FLAG=FALSE

REM if exist %WORKSPACE%\bts_play_build (
REM  rd /S /Q %WORKSPACE%\bts_play_build
REM )
REM
REM mkdir %WORKSPACE%\bts_play_build
REM
REM cd %WORKSPACE%\bts_play_build
REM

cmake %WORKSPACE%/bitshares_play ^
        -DBLOCKCHAIN_NAME:STRING=BitSharesPLAY ^
        -DINCLUDE_QT_WALLET:BOOL=TRUE ^
        -DCMAKE_PREFIX_PATH=%QTDIR% ^
        -DICU_VERSION_TO_PACKAGE:STRING=%ICU_VERSION_TO_PACKAGE% ^
        -DINCLUDE_CRASHRPT:BOOL=%ENABLE_CRASHRPT_FLAG% ^
        -DTARGET_ARCHITECTURE:STRING=%ARCHITECTURE_SHORT_NAME% ^
        -DMSVC_RUNTIME_DIR:PATH=%MSVC_RUNTIME_DIR_X64% ^
        -DGET_VERSION_STRING_FROM_GIT_TAGS:BOOL=TRUE ^
        -G "Visual Studio 12%VISUAL_STUDIO_CONFIGURATION_SUFFIX%" ^
        -T "v120_xp" ^
        -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
        -DBTS_CLIENT_JENKINS_BUILD_NUMBER:STRING=%BUILD_NUMBER% ^
        -DBTS_CLIENT_JENKINS_BUILD_URL:STRING="%BUILD_URL%"

if %errorlevel% neq 0 exit /b %errorlevel%

echo msbuild.exe /M:4 /p:Configuration=RelWithDebInfo /p:Platform=%MSBUILD_PLATFORM_NAME% BitShares.sln
if %errorlevel% neq 0 exit /b %errorlevel%

rem "C:\Program Files (x86)\Inno Setup 5\iscc.exe" "%WORKSPACE%\build\programs\qt_wallet\setup.iss"
rem if %errorlevel% neq 0 exit /b %errorlevel%

rem cd %WORKSPACE%\build\programs\qt_wallet
rem %SHA1SUM_EXE% BitShares-*.exe > sha1sum.txt

rem cd %WORKSPACE%\build
rem "%SEVENZIP_EXE%" a pdbs.7z -ir!*.pdb

:done

update build qtwallet script

update build qtwallet script


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

add simple script to hide all packages for a version on NuGet


if not exist tmp\ mkdir tmp

cl -c -Zm200 -O2 -MT -EHsc -GR -W0 -wd4710 -I"." -I"..\..\include" -I"..\..\include\loki" -Fotmp\ SmallObjBench.cpp

link /NOLOGO /SUBSYSTEM:CONSOLE /incremental:no /OUT:"main-msvc.exe" tmp\SmallObjBench.obj ..\..\lib\SmallObj.obj ..\..\lib\Singleton.obj

if not exist tmp\ mkdir tmp

cl -c -DNDEBUG -Zm200 -O2 -MT -EHsc -GR -W0 -wd4710 -I"." -I"..\..\include" -I"..\..\include\loki" -Fotmp\ SmallObjBench.cpp ..\..\src\SmallObj.cpp

link /NOLOGO /SUBSYSTEM:CONSOLE /incremental:no /OUT:"main-msvc.exe" tmp\SmallObjBench.obj tmp\SmallObj.obj

fix typing mistake which kills ALL speedup

git-svn-id: 2bceadd671bcc8d4f7a34159d1bc3b98592acb3b@240 7ec92016-0320-0410-acc4-a06ded1c099a


@echo on
setlocal

cd app

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

call %VC_DIR% %VC_VARSALL%
echo "step 1"

set qtplatform=%PLATFORM%
for %%* in (.) do set CurrDirName=%%~nx*

echo "step 2"

C:\Qt\%QT_VER%\%qtplatform%\bin\qmake ./ || exit /B 1
echo "step 3"

nmake qmake_all || exit /B 1
echo "step 4"

nmake || exit /B 1
echo "step 5"

nmake lrelease || exit /B 1
echo "step 6"

nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1

@echo on
setlocal

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

call %VC_DIR% %VC_VARSALL%
echo "step 1"

set qtplatform=%PLATFORM%
for %%* in (.) do set CurrDirName=%%~nx*

echo "step 2"

C:\Qt\%QT_VER%\%qtplatform%\bin\qmake .\app\ || exit /B 1
echo "step 3"

nmake qmake_all || exit /B 1
echo "step 4"

nmake || exit /B 1
echo "step 5"

nmake lrelease || exit /B 1
echo "step 6"

nmake INSTALL_ROOT=\projects\%CurrDirName%\install install || exit /B 1

Update build-msvc.bat

Update build-msvc.bat


set ssh_key=%1
set ssh_server_name=%2
set ssh_uname=%3
set client_session_dir=%4
set server_session_dir=%5
set session_name=%6
set container_path=%7
set algorithm=%8

@echo %algorithm%

@echo here 1
@echo %client_session_dir%
@echo %server_session_dir%
pscp -noagent -r %client_session_dir% %ssh_uname%@%ssh_server_name%:%server_session_dir%
@echo "here 2"

set bindingPath=%server_session_dir%/%session_name%:/scratch
@echo "here 3"

plink -noagent -ssh %ssh_uname%@%ssh_server_name% (source  /admin/lsf/mph/conf/profile.lsf; bsub -R rusage[mem=30] -q research -n 1  -W 1:00  -gpu "num=1:gmem=4GB:mode=exclusive_process:mps=no:j_exclusive=yes" -Is singularity run --app %algorithm% --nv --bind  %bindingPath% %container_path% %server_session_dir%/%session_name%)

@echo "here 4"
pscp -noagent -r %ssh_uname%@%ssh_server_name%:%server_session_dir%/%session_name%/outputH5 %client_session_dir%

@echo "here 5"

set ssh_key=%1
set ssh_server_name=%2
set ssh_uname=%3
set client_session_dir=%4
set server_session_dir=%5
set session_name=%6
set container_path=%7
set algorithm=%8

@echo %algorithm%

@echo Copying session dir from client to server...
@echo %client_session_dir%
@echo %server_session_dir%
pscp -noagent -r %client_session_dir% %ssh_uname%@%ssh_server_name%:%server_session_dir%

@echo Setting bind path for container
set bindingPath=%server_session_dir%/%session_name%:/scratch

@echo Executing container
plink -noagent -ssh %ssh_uname%@%ssh_server_name% (source  /admin/lsf/mph/conf/profile.lsf; bsub -R rusage[mem=30] -q research -n 1  -W 1:00  -gpu "num=1:gmem=4GB:mode=exclusive_process:mps=no:j_exclusive=yes" -Is singularity run --app %algorithm% --nv --bind  %bindingPath% %container_path% %server_session_dir%/%session_name%)

@echo Copying result back to Client from Server
pscp -noagent -r %ssh_uname%@%ssh_server_name%:%server_session_dir%/%session_name%/outputH5 %client_session_dir%

@echo DONE

Debug print statements for executing container in client-server configuration


del /f /q /s /a rhsa *.bak *.ncb *.obj *.pdb *.idb *.ilk *.pch *.suo *.aps *.opt *.sbr *.bsc *.user *.ipch *.tlog *.sdf
pause

update fileCleaner

update fileCleaner


if exist %extracted_zip_source% (del %extracted_zip_source%\*.* /Q)
rd %extracted_zip_source% /S /Q
mkdir %extracted_zip_source%

REM 1. Unzip the sync_back_up file using
REM -Remember to add -p when defining the password
REM --------------------------------------------------
"%zip_path%\7z.exe" e %zip_source%\%oc_data% -o%extracted_zip_source% -pPassword_to_extract_the_zipped_file_from_site_goes_here

Create extract.cmd

Create extract.cmd


"%R%" CMD INSTALL --build . %R_ARGS%
IF %ERRORLEVEL% NEQ 0 exit /B 1

Update bld.bat

Update bld.bat


SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if defined TARGET (
	SET platform=%TARGET%
)

if "%TARGET%" == "win_32" (
  SET MACHINE=x86
)

if "%TARGET%" == "win_64" (
  SET MACHINE=x64
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

cd "%SCRIPTPATH%%platform%"

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already exported"
) else (
	svn export http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c ./icu
)

SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
if exist %VC64% (
	SET VC=%VC64%
)

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

if "%platform%" == "win_64" (
	devenv.com icu\source\allinone\allinone.sln /build "Release|x64"
) else (
	devenv.com icu\source\allinone\allinone.sln /build "Release|Win32"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if defined TARGET (
	SET platform=%TARGET%
)

if "%TARGET%" == "win_32" (
  SET MACHINE=x86
)

if "%TARGET%" == "win_64" (
  SET MACHINE=x64
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

cd "%SCRIPTPATH%%platform%"

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already exported"
) else (
	svn export http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c ./icu
)

SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
if exist %VC64% (
	SET VC=%VC64%
)

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

if "%platform%" == "win_64" (
	MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:Platform="X64"
) else (
	MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:Platform="Win32"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

Change devenv to msbuild

Change devenv to msbuild


@echo off
:: ############################
:: # Install the dotfiles on Windows systems.
:: ############################

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Not an admin, exiting.
    exit /B 1
)

setlocal EnableDelayedExpansion

set dotfilesDir=%~dp0
set backupDir=%USERPROFILE%\dotfiles_backup
set dotfiles=bashrc bash_profile config minttyrc zshenv puppet-lint.rc

:: add registry key for init.bat
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f

if exist "%HOME%" (
	set homeDir=%HOME%
) else (
	if exist "%HOMEDRIVE%%HOMEPATH%" (
		set homeDir=%HOMEDRIVE%%HOMEPATH%
	) else (
		set homeDir=%USERPROFILE%
	)
)

IF %homeDir:~-1%==\ SET homeDir=%homeDir:~0,-1%

for %%A in (%dotfiles%) DO (
    call:createSymLink "%dotfilesDir%%%A" "%homeDir%\.%%A" "%backupDir%" true
)

call:createSymLink "%dotfilesDir%config\readline\inputrc" "%homeDir%\.inputrc" "%backupDir%" true

set sublimeDir=%APPDATA%\Sublime Text 3\Packages
set backupDir=%sublimeDir%\dotfiles_backup

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\User" "%sublimeDir%\User" "%backupDir%" false
    call:createSymLink "%dotfilesDir%sublime\User (OS Settings)" "%sublimeDir%\User (OS Settings)" "%backupDir%" false
)

set vsCodeDir=%APPDATA%\Code
set backupDir=%vsCodeDir%\dotfiles_backup

if exist "%vsCodeDir%" (
    call:createSymLink "%dotfilesDir%vscode\User" "%vsCodeDir%\User" "%backupDir%" false
)

set backupDir=%USERPROFILE%\dotfiles_backup\atom
set atomfiles=config.cson init.coffee keymap.cson snippets.cson styles.less

for %%A in (%atomfiles%) DO (
    call:createSymLink "%dotfilesDir%\atom\%%A" "%homeDir%\.atom\%%A" "%backupDir%" true
)

PowerShell.exe -Command  "& Set-ExecutionPolicy RemoteSigned -Force"
PowerShell.exe -ExecutionPolicy RemoteSigned -File install-win.ps1 %dotfilesDir%Microsoft.PowerShell_profile.ps1

call install-open_here.bat

goto:EOF

::function
:createSymLink - target linkName backupDirectory hideLink
    set linkExists="0"
    if exist "%~2" (
        set Z=&& for %%A in ("%~2") do set Z=%%~aA
        if "!Z:~8,1!" == "l" (
            set linkExists="1"
        ) else (
            if not exist "%~3" (
                mkdir "%~3"
            )
            echo Moving existing %2 to %3
            move "%~2" "%~3"
        )
    )

    if !linkExists! == "0" (
        if exist "%~1\" (
            mklink /d "%~2" "%~1"
        ) else (
            mklink "%~2" "%~1"
        )
        if %4 == "true" (
        	attrib /L "%~2" +h
        )
    ) else (
        echo Not replacing existing link %2
    )

goto:EOF

@echo off
:: ############################
:: # Install the dotfiles on Windows systems.
:: ############################

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Not an admin, exiting.
    exit /B 1
)

setlocal EnableDelayedExpansion

set dotfilesDir=%~dp0
set backupDir=%USERPROFILE%\dotfiles_backup
set dotfiles=bashrc bash_profile config minttyrc zshenv puppet-lint.rc

:: add registry key for init.bat
if exist "%CLINK_DIR%" (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%dotfilesDir%init.bat&\"%%CLINK_DIR%%\clink\" inject --profile ~\clink" /f
) else (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f
)

if exist "%HOME%" (
	set homeDir=%HOME%
) else (
	if exist "%HOMEDRIVE%%HOMEPATH%" (
		set homeDir=%HOMEDRIVE%%HOMEPATH%
	) else (
		set homeDir=%USERPROFILE%
	)
)

IF %homeDir:~-1%==\ SET homeDir=%homeDir:~0,-1%

for %%A in (%dotfiles%) DO (
    call:createSymLink "%dotfilesDir%%%A" "%homeDir%\.%%A" "%backupDir%" true
)

call:createSymLink "%dotfilesDir%config\readline\inputrc" "%homeDir%\.inputrc" "%backupDir%" true

set sublimeDir=%APPDATA%\Sublime Text 3\Packages
set backupDir=%sublimeDir%\dotfiles_backup

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\User" "%sublimeDir%\User" "%backupDir%" false
    call:createSymLink "%dotfilesDir%sublime\User (OS Settings)" "%sublimeDir%\User (OS Settings)" "%backupDir%" false
)

set vsCodeDir=%APPDATA%\Code
set backupDir=%vsCodeDir%\dotfiles_backup

if exist "%vsCodeDir%" (
    call:createSymLink "%dotfilesDir%vscode\User" "%vsCodeDir%\User" "%backupDir%" false
)

set backupDir=%USERPROFILE%\dotfiles_backup\atom
set atomfiles=config.cson init.coffee keymap.cson snippets.cson styles.less

for %%A in (%atomfiles%) DO (
    call:createSymLink "%dotfilesDir%\atom\%%A" "%homeDir%\.atom\%%A" "%backupDir%" true
)

PowerShell.exe -Command  "& Set-ExecutionPolicy RemoteSigned -Force"
PowerShell.exe -ExecutionPolicy RemoteSigned -File install-win.ps1 %dotfilesDir%Microsoft.PowerShell_profile.ps1

call install-open_here.bat

goto:EOF

::function
:createSymLink - target linkName backupDirectory hideLink
    set linkExists="0"
    if exist "%~2" (
        set Z=&& for %%A in ("%~2") do set Z=%%~aA
        if "!Z:~8,1!" == "l" (
            set linkExists="1"
        ) else (
            if not exist "%~3" (
                mkdir "%~3"
            )
            echo Moving existing %2 to %3
            move "%~2" "%~3"
        )
    )

    if !linkExists! == "0" (
        if exist "%~1\" (
            mklink /d "%~2" "%~1"
        ) else (
            mklink "%~2" "%~1"
        )
        if %4 == "true" (
        	attrib /L "%~2" +h
        )
    ) else (
        echo Not replacing existing link %2
    )

goto:EOF

Add clink to cmd AutoRun if it exists

Add clink to cmd AutoRun if it exists


allow for running HTTP invoker with Commons HttpClient

git-svn-id: b619a0c99665f88f1afe72824344cefe9a1c8c90@9636 fd5a2b45-1f63-4059-99e9-3c7cb7fd75c8


echo off

echo Check command line parameter
echo html directory: %1
set htmldir=%1
echo wikijournals directory: %2
set wikidir=%2
echo dbuser: %3
set dbuser=%3
echo dbpass: %4
set dbpass=%4
echo dbserver: %5
set dbserver=%5
echo dbname: %6
set dbname=%6
echo wikiuser: %7
set wikiuser=%7
echo wikipwd: %8
set wikipwd=%8
echo wikiname: %9
set wikiname=%9

set PROJECTDIR="%cd%"

echo Download Mediawiki
set MEDIAWIKIVERSION=1.31.1
set MEDIAWIKIURL=https://releases.wikimedia.org/mediawiki/1.31/mediawiki-%MEDIAWIKIVERSION%.tar.gz
set MEDIAWIKIDIR=mediawiki-%MEDIAWIKIVERSION%
cd %1
curl %MEDIAWIKIURL% --output wikijournals.tar.gz

echo Uncompress Mediawiki into wikijournals directory
tar -xvzf wikijournals.tar.gz
ren %MEDIAWIKIDIR% %2
del wikijournals.tar.gz

echo Install Mediawiki
cd %1/%2/maintenance
call php install.php --dbuser=%dbuser% --dbpass=%dbpass% --dbserver=%dbserver% --dbname=%dbname% --dbtype=mysql --installdbpass=%dbpass% --installdbuser=%dbuser% --lang=de --pass=%wikipwd% --scriptpath=/%wikidir%  %wikiname% %wikiuser%
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgLanguageCode = ""en"";" --replace "$wgLanguageCode = ""de"";"
cd ..

echo Install foreground
cd skins
git clone https://github.com/thingles/foreground.git
cd ..

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticDrilldown.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageForms

cd ..

echo Install Semantic Mediawiki
call composer require mediawiki/semantic-media-wiki "3.0.1"

echo Zwschenupdate
cd maintenance
call php update.php
cd ..

cd extensions

echo Install SMW Extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticInternalObjects.git
cd ..

echo Install Maps
call composer require mediawiki/maps "7.1.0"

echo Install Semantic Result Formats
call composer require mediawiki/semantic-result-formats "3.0.0"

echo Install Semantic Compound Queries
call composer require mediawiki/semantic-compound-queries "2.0.0"

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DataTransfer.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ExternalData.git
git clone https://phabricator.wikimedia.org/diffusion/EHET/extension-headertabs.git
ren extension-headertabs HeaderTabs
git clone https://phabricator.wikimedia.org/diffusion/EMYV/extension-myvariables.git
ren extension-myvariables MyVariables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageSchemas.git
git clone https://phabricator.wikimedia.org/diffusion/EVAR/extension-variables.git
ren extension-variables Variables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Widgets.git

cd Widgets
git submodule init
git submodule update

echo Update LocalSetting.php
cd ..\..
type LocalSettings.php %PROJECTDIR%\configExtensions.txt > LocalSettings.bak
del LocalSettings.php
ren LocalSettings.bak LocalSettings.php
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgDefaultSkin = ""vector"";" --replace "$wgDefaultSkin = ""foreground"";"
cd maintenance
call php update.php

echo Install Wikijournals Structure
call php importDump.php < %PROJECTDIR%/wikijournals_structure/wikijournalsStructure.xml

cd %PROJECTDIR%

echo off

echo Check command line parameter
echo html directory: %1
set htmldir=%1
echo wikijournals directory: %2
set wikidir=%2
echo dbuser: %3
set dbuser=%3
echo dbpass: %4
set dbpass=%4
echo dbserver: %5
set dbserver=%5
echo dbname: %6
set dbname=%6
echo wikiuser: %7
set wikiuser=%7
echo wikipwd: %8
set wikipwd=%8
echo wikiname: %9
set wikiname=%9

set PROJECTDIR="%cd%"

echo Download Mediawiki
set MEDIAWIKIVERSION=1.32
set MEDIAWIKIMINORVERSION=0
set MEDIAWIKIURL=https://releases.wikimedia.org/mediawiki/%MEDIAWIKIVERSION%/mediawiki-%MEDIAWIKIVERSION%.%MEDIAWIKIMINORVERSION%.tar.gz
set MEDIAWIKIDIR=mediawiki-%MEDIAWIKIVERSION%.%MEDIAWIKIMINORVERSION%
cd %1

echo %MEDIAWIKIURL%

curl %MEDIAWIKIURL% --output wikijournals.tar.gz

echo Uncompress Mediawiki into wikijournals directory
tar -xvzf wikijournals.tar.gz
ren %MEDIAWIKIDIR% %2
del wikijournals.tar.gz

echo Install Mediawiki
cd %1/%2/maintenance
call php install.php --dbuser=%dbuser% --dbpass=%dbpass% --dbserver=%dbserver% --dbname=%dbname% --dbtype=mysql --installdbpass=%dbpass% --installdbuser=%dbuser% --lang=de --pass=%wikipwd% --scriptpath=/%wikidir%  %wikiname% %wikiuser%
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgLanguageCode = ""en"";" --replace "$wgLanguageCode = ""de"";"
cd ..

echo Install foreground
cd skins
git clone https://github.com/thingles/foreground.git
cd ..

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticDrilldown.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageForms

cd ..

echo Install Semantic Mediawiki
call composer require mediawiki/semantic-media-wiki "3.0.1"

echo Zwschenupdate
cd maintenance
call php update.php
cd ..

cd extensions

echo Install SMW Extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticInternalObjects.git
cd ..

echo Install Maps
call composer require mediawiki/maps "7.1.0"

echo Install Semantic Result Formats
call composer require mediawiki/semantic-result-formats "3.0.0"

echo Install Semantic Compound Queries
call composer require mediawiki/semantic-compound-queries "2.0.0"

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DataTransfer.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ExternalData.git
git clone https://phabricator.wikimedia.org/diffusion/EHET/extension-headertabs.git
ren extension-headertabs HeaderTabs
git clone https://phabricator.wikimedia.org/diffusion/EMYV/extension-myvariables.git
ren extension-myvariables MyVariables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageSchemas.git
git clone https://phabricator.wikimedia.org/diffusion/EVAR/extension-variables.git
ren extension-variables Variables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Widgets.git

cd Widgets
git submodule init
git submodule update

echo Update LocalSetting.php
cd ..\..
type LocalSettings.php %PROJECTDIR%\configExtensions.txt > LocalSettings.bak
del LocalSettings.php
ren LocalSettings.bak LocalSettings.php
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgDefaultSkin = ""vector"";" --replace "$wgDefaultSkin = ""foreground"";"
cd maintenance
call php update.php

echo Install Wikijournals Structure
call php importDump.php < %PROJECTDIR%/wikijournals_structure/wikijournalsStructure.xml

cd %PROJECTDIR%

Split MW-Version into Main and Minor Version


REM for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d"
START cmd /k "cd src/SimpleIdentityServer.Startup && dotnet run -f net46 --server.urls=https://*:5443"
START cmd /k "bash ./wait-for-it.sh localhost:5443 -t 300 && cd src/SimpleIdentityServer.Uma.Host && dotnet run -f net46 --server.urls=https://*:5445"
START cmd /k "bash ./wait-for-it.sh localhost:5445 -t 300 && cd src/SimpleIdentityServer.Manager.Host.Startup && dotnet run -f net46 --server.urls=http://*:5002"
START cmd /k "bash ./wait-for-it.sh localhost:5002 -t 300 && cd src/SimpleIdentityServer.Configuration.Startup && dotnet run -f net46 --server.urls=http://*:5004"
echo Applications are running ...

REM for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d"
START cmd /k "cd src/SimpleIdentityServer.Startup && dotnet run -f net46 --server.urls=https://*:5443"
START cmd /k "bash ./src/wait-for-it.sh localhost:5443 -t 300 && cd src/SimpleIdentityServer.Uma.Host && dotnet run -f net46 --server.urls=https://*:5445"
START cmd /k "bash ./src/wait-for-it.sh localhost:5445 -t 300 && cd src/SimpleIdentityServer.Manager.Host.Startup && dotnet run -f net46 --server.urls=http://*:5002"
START cmd /k "bash ./src/wait-for-it.sh localhost:5002 -t 300 && cd src/SimpleIdentityServer.Configuration.Startup && dotnet run -f net46 --server.urls=http://*:5004"
echo Applications are running ...

fix launcher

fix launcher


@echo off
echo.
echo ######  Nuget Creation Checklist  ######
echo ##                                    ##
echo ##  * Update assembly version number  ##
echo ##  * Update nuspec revision notes    ##
echo ##  * Create tag after final commit   ##
echo ##                                    ##
echo ########################################
echo.
nuget pack Pelasoft.AspNet.Mvc.Slack.csproj -Verbosity detailed -Build -IncludeReferencedProjects -Properties Configuration=Release

Add package action remind notice.

Add package action remind notice.


@REM Configure the build of phreeqc4rkt
cmake -S . -B build ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DBUILD_SHARED_LIBS=ON ^
    -DYAML_BUILD_SHARED_LIBS=ON ^
    -DYAML_CPP_BUILD_TESTS=OFF

@REM Build and install phreeqc4rkt in %LIBRARY_PREFIX%
@REM Note: No need for --parallel below, since cmake takes care of the /MP flag for MSVC
cmake --build build --config Release --target install

@REM Configure the build of yaml-cpp4rkt
cmake -S . -B build ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DBUILD_SHARED_LIBS=ON ^
    -DYAML_BUILD_SHARED_LIBS=ON ^
    -DYAML_CPP_BUILD_TESTS=OFF

@REM Build and install yaml-cpp4rkt in %LIBRARY_PREFIX%
@REM Note: No need for --parallel below, since cmake takes care of the /MP flag for MSVC
cmake --build build --config Release --target install

Fix comment lines refering to other lib

Fix comment lines refering to other lib


REM Add other things if could be automated, RUN THIS AS ADMIN
@echo off

Update windows.bat

Update windows.bat


::  Project API
::
::  This file is called whenever a user enters a project, such p999_Meindbender_Sync
::
::  Arguments:
::    %1: Path = Absolute path bat is located
::    %2: Path = Absolute path to where work folder is
:: 	  %3: Name = Name of project
::    %4: Silo = Parent directory name of assets
::
::  Variables set by bat:
::    %MINDBENDER_FPS%: Is the project FPS
::    %MINDBENDER_RESOLUTION_WIDTH%: Is the project width
::    %MINDBENDER_RESOLUTION_HEIGHT%: Is the project height
::
::  Variables:
::    %MINDBENDER_PROJECTPATH%: Absolute path to project directory
::
::  Example:
::    $ call _mkproject.bat %~dp0 %~n0 ProjectName assets
::    $ set MINDBENDER_FPS=24

@echo off

if "%1"=="" goto :missing_projectdir
if "%2"=="" goto :missing_projectdir

if not "%4"=="assets" (
  if not "%4"=="film" goto :missing_silo
)

if "%3"=="" goto :missing_name
if "%4"=="" goto :missing_silo

set MINDBENDER_PROJECT=%3
set MINDBENDER_PROJECTPATH=%1%2

if not exist %MINDBENDER_PROJECTPATH% (
  echo Creating new project "%MINDBENDER_PROJECTPATH%"..

  mkdir %MINDBENDER_PROJECTPATH%\assets
  mkdir %MINDBENDER_PROJECTPATH%\film
  rem etc..
)

:: Establish base directories for ls() and search() functions.
set MINDBENDER_ROOT=%MINDBENDER_PROJECTPATH%
set MINDBENDER_SILO=%4

pushd %MINDBENDER_PROJECTPATH%\%MINDBENDER_SILO%

:: Clear screen
cls

echo+
echo    Active Project: %MINDBENDER_PROJECT%
echo    You are in: %MINDBENDER_SILO%
echo+

:: List available assets, without their .bat suffix
setlocal enabledelayedexpansion
for %%i in (*.bat) do (
    set temp=%%i
    echo   !temp:.bat=!
)
endlocal

echo+
echo   1. Type first letters of asset
echo   2. Press [TAB] to auto-complete
echo+
echo  --------------------------------------

goto :eof

:missing_name
   	echo ERROR: Missing FULLPATH
   	exit /b
:missing_projectdir
	exit /b
:missing_silo
    echo  Uh oh..
    echo    Specify either "assets" or "film"
    echo+
    echo  Example:
    set temp=%3
    echo    $ %temp% assets
    echo    $ %temp% film
    exit /b

echo+
echo Syntax: _mkproject FULLPATH SUBFOLDER

remove indent add indent space

remove indent
add indent space


SET GOPATH=%CD%\gopath
SET PATH=%PATH%;%CD%\gopath\bin

cd gopath\src\github.com\cloudfoundry\cli

SET GODEPSPATH=%CD%\Godeps\_workspace
SET GOPATH=%GODEPSPATH%;%GOPATH%;
SET PATH=%PATH%;%GODEPSPATH%\bin

go get github.com/jteeuwen/go-bindata/... || exit /b 1
go-bindata -pkg resources -ignore ".go" -o cf/resources/i18n_resources.go cf/i18n/resources/... cf/i18n/test_fixtures/... || exit /b 1

powershell -command set-executionpolicy remotesigned < NUL || exit /b 1
powershell .\bin\replace-sha.ps1 < NUL || exit /b 1

go build -v -o %CF_EXE_NAME% ./main || exit /b 1

REM go install github.com/onsi/ginkgo/ginkgo || exit /b 1

REM ginkgo -cover -r ./cf ./generic ./testhelpers ./main

SET GOPATH=%CD%\gopath
SET PATH=%PATH%;%CD%\gopath\bin

cd gopath\src\github.com\cloudfoundry\cli

SET GODEPSPATH=%CD%\Godeps\_workspace
SET GOPATH=%GODEPSPATH%;%GOPATH%
SET PATH=%PATH%;%GODEPSPATH%\bin

go get github.com/jteeuwen/go-bindata/... || exit /b 1
go-bindata -pkg resources -ignore ".go" -o cf/resources/i18n_resources.go cf/i18n/resources/... cf/i18n/test_fixtures/... || exit /b 1

powershell -command set-executionpolicy remotesigned < NUL || exit /b 1
powershell .\bin\replace-sha.ps1 < NUL || exit /b 1

go build -v -o %CF_EXE_NAME% ./main || exit /b 1

REM go install github.com/onsi/ginkgo/ginkgo || exit /b 1

REM ginkgo -cover -r ./cf ./generic ./testhelpers ./main

Remove trailing semicolon in GOPATH [#104131294]

Causes Go 1.5 to complain about the " " path after the semicolon.


fix for marvin.bat: pass provided command line arguments to java


rem
rem  This script runs the nightly build.
rem
rem  Since it is the starting point for the build chain, it must be manually put into
rem  place for the build server to run.
rem

@echo off

set BUILD_ROOT=C:\builds
set BRANCH=master
set SVN_BRANCH=trunk
set GIT_REPO_ROOT="/git/xtuml"
echo set BUILD_ROOT=%BUILD_ROOT%
echo set BRANCH=%BRANCH%
echo set SVN_BRANCH=%SVN_BRANCH%
echo set GIT_REPO_ROOT=%GIT_REPO_ROOT%

C:
chdir %BUILD_ROOT%

path c:\cygwin\bin;%Path%

unix2dos init_git_repositories.sh
bash init_git_repositories.sh "%BRANCH%" "%GIT_REPO_ROOT%" "yes"

unix2dos configure_eclipse_base.sh
bash configure_eclipse_base.sh "%BRANCH%"

cp -fv %GIT_REPO_ROOT%/internal/utilities/build/configure_build_process.sh .
unix2dos configure_build_process.sh
bash configure_build_process.sh %BRANCH% %GIT_REPO_ROOT% nonrelease 1>2> cfg_output.log

bash create_bp_release.sh %BRANCH% %GIT_REPO_ROOT% 1>2> nb_output.log
rem change to post_process_build bash create_nightly_build.sh %BRANCH% nonrelease 1>2> nb_output.log

echo end of run_nightly_build_git.bat

@echo off

rem
rem  This script runs the nightly build.
rem
rem  Since it is the starting point for the build chain, it must be manually put into
rem  place for the build server to run.
rem

set BUILD_ROOT=C:\builds
set BRANCH=master
set GIT_REPO_ROOT="/git/xtuml"
echo set BUILD_ROOT=%BUILD_ROOT%
echo set BRANCH=%BRANCH%
echo set GIT_REPO_ROOT=%GIT_REPO_ROOT%

C:
chdir %BUILD_ROOT%

path c:\cygwin\bin;%Path%

dos2unix init_git_repositories.sh
echo Initializing git repositories.
bash init_git_repositories.sh "%BRANCH%" "%GIT_REPO_ROOT%" "yes"
echo Done.

cp -fv %GIT_REPO_ROOT%/internal/utilities/build/configure_eclipse_bases.sh .
dos2unix configure_eclipse_bases.sh
echo Configuring eclipse bases.
bash configure_eclipse_bases.sh "%BRANCH%" "nonrelease" 1>2> cfg_output.log
echo Done.

cp -fv %GIT_REPO_ROOT%/internal/utilities/build/configure_build_process.sh .
dos2unix configure_build_process.sh
echo Configuring build process.
bash configure_build_process.sh %BRANCH% %GIT_REPO_ROOT% nonrelease 1>2> cfg_output.log
echo Done.

rem bash create_bp_release.sh %BRANCH% %GIT_REPO_ROOT% 1>2> nb_output.log
rem change to post_process_build bash create_nightly_build.sh %BRANCH% nonrelease 1>2> nb_output.log

echo end of run_nightly_build_git.bat

Update run_nightly_build_git.bat

Update run_nightly_build_git.bat

job: #1 - add in tool to get data from SVN.  Output more status info.


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

set PYTHONPATH=%~dp0../python/google
python %~dp0/chrome_tests.py %*

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

set TSAN_PATH=%~dp0..\..\third_party\tsan
set TSAN_SFX=%TSAN_PATH%\tsan-x86-windows-sfx.exe
if EXIST %TSAN_SFX% GOTO BINARY_OK
echo "Can't find ThreadSanitizer executables."
echo "See http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer/threadsanitizer-on-windows"
echo "for the instructions on how to get them."
set %ERRORLEVEL% 1
goto :EOF

:BINARY_OK
%TSAN_SFX% -o%TSAN_PATH%\unpacked -y
set PIN_COMMAND=%TSAN_PATH%\unpacked\tsan-x86-windows\tsan.bat
set PYTHONPATH=%~dp0../python/google
python %~dp0/chrome_tests.py %*

Set PIN_COMMAND env to the TSan/Win runner path.
This is similar to the way Valgrind path is guessed in locate_valgrind.sh
TBR=glider
Review URL: http://codereview.chromium.org/2150002

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@48033 4ff67af0-8c30-449e-8e8b-ad334ec8d88c