@rem Script to build LuaJIT with MSVC.
@rem Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
@rem
@rem Either open a "Visual Studio .NET Command Prompt"
@rem (Note that the Express Edition does not contain an x64 compiler)
@rem -or-
@rem Open a "Windows SDK Command Shell" and set the compiler environment:
@rem     setenv /release /x86
@rem   -or-
@rem     setenv /release /x64
@rem
@rem Then cd to this directory and run this script.

@if not defined INCLUDE goto :FAIL

@setlocal
@set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE
@set LJLINK=link /nologo
@set LJMT=mt /nologo
@set LJLIB=lib /nologo /nodefaultlib
@set DASMDIR=..\dynasm
@set DASM=%DASMDIR%\dynasm.lua
@set LJDLLNAME=lua51.dll
@set LJLIBNAME=lua51.lib
@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c

%LJCOMPILE% host\minilua.c
@if errorlevel 1 goto :BAD
%LJLINK% /out:minilua.exe minilua.obj
@if errorlevel 1 goto :BAD
if exist minilua.exe.manifest^
  %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe

@set DASMFLAGS=-D WIN -D JIT -D FFI -D P64
@set LJARCH=x64
@minilua
@if errorlevel 8 goto :X64
@set DASMFLAGS=-D WIN -D JIT -D FFI
@set LJARCH=x86
:X64
minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc
@if errorlevel 1 goto :BAD

%LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c
@if errorlevel 1 goto :BAD
%LJLINK% /out:buildvm.exe buildvm*.obj
@if errorlevel 1 goto :BAD
if exist buildvm.exe.manifest^
  %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe

buildvm -m peobj -o lj_vm.obj
@if errorlevel 1 goto :BAD
buildvm -m bcdef -o lj_bcdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m libdef -o lj_libdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m recdef -o lj_recdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
@if errorlevel 1 goto :BAD

@if "%1" neq "debug" goto :NODEBUG
@shift
@set LJCOMPILE=%LJCOMPILE% /Zi
@set LJLINK=%LJLINK% /debug
:NODEBUG
@if "%1"=="amalg" goto :AMALGDLL
@if "%1"=="static" goto :STATIC
%LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
@if errorlevel 1 goto :BAD
%LJLINK% /DLL /out:%LJDLLNAME% lj_*.obj lib_*.obj
@if errorlevel 1 goto :BAD
@goto :MTDLL
:STATIC
%LJCOMPILE% lj_*.c lib_*.c
@if errorlevel 1 goto :BAD
%LJLIB% /OUT:%LJLIBNAME% lj_*.obj lib_*.obj
@if errorlevel 1 goto :BAD
@goto :MTDLL
:AMALGDLL
%LJCOMPILE% /MD /DLUA_BUILD_AS_DLL ljamalg.c
@if errorlevel 1 goto :BAD
%LJLINK% /DLL /out:%LJDLLNAME% ljamalg.obj lj_vm.obj
@if errorlevel 1 goto :BAD
:MTDLL
if exist %LJDLLNAME%.manifest^
  %LJMT% -manifest %LJDLLNAME%.manifest -outputresource:%LJDLLNAME%;2

%LJCOMPILE% luajit.c
@if errorlevel 1 goto :BAD
%LJLINK% /out:luajit.exe luajit.obj %LJLIBNAME%
@if errorlevel 1 goto :BAD
if exist luajit.exe.manifest^
  %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe

@del *.obj *.manifest minilua.exe buildvm.exe
@echo.
@echo === Successfully built LuaJIT for Windows/%LJARCH% ===

@goto :END
:BAD
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
@goto :END
:FAIL
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
:END

@rem Script to build LuaJIT with MSVC.
@rem Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h
@rem
@rem Either open a "Visual Studio .NET Command Prompt"
@rem (Note that the Express Edition does not contain an x64 compiler)
@rem -or-
@rem Open a "Windows SDK Command Shell" and set the compiler environment:
@rem     setenv /release /x86
@rem   -or-
@rem     setenv /release /x64
@rem
@rem Then cd to this directory and run this script.

@if not defined INCLUDE goto :FAIL

@setlocal
@set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE
@set LJLINK=link /nologo
@set LJMT=mt /nologo
@set LJLIB=lib /nologo /nodefaultlib
@set DASMDIR=..\dynasm
@set DASM=%DASMDIR%\dynasm.lua
@set LJDLLNAME=lua51.dll
@set LJLIBNAME=lua51.lib
@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c

%LJCOMPILE% host\minilua.c
@if errorlevel 1 goto :BAD
%LJLINK% /out:minilua.exe minilua.obj
@if errorlevel 1 goto :BAD
if exist minilua.exe.manifest^
  %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe

@set DASMFLAGS=-D WIN -D JIT -D FFI -D P64
@set LJARCH=x64
@minilua
@if errorlevel 8 goto :X64
@set DASMFLAGS=-D WIN -D JIT -D FFI
@set LJARCH=x86
:X64
minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc
@if errorlevel 1 goto :BAD

%LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c
@if errorlevel 1 goto :BAD
%LJLINK% /out:buildvm.exe buildvm*.obj
@if errorlevel 1 goto :BAD
if exist buildvm.exe.manifest^
  %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe

buildvm -m peobj -o lj_vm.obj
@if errorlevel 1 goto :BAD
buildvm -m bcdef -o lj_bcdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m libdef -o lj_libdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m recdef -o lj_recdef.h %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m vmdef -o jit\vmdef.lua %ALL_LIB%
@if errorlevel 1 goto :BAD
buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
@if errorlevel 1 goto :BAD

@if "%1" neq "debug" goto :NODEBUG
@shift
@set LJCOMPILE=%LJCOMPILE% /Zi
@set LJLINK=%LJLINK% /debug
:NODEBUG
@if "%1"=="amalg" goto :AMALGDLL
@if "%1"=="static" goto :STATIC
%LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
@if errorlevel 1 goto :BAD
%LJLINK% /DLL /out:%LJDLLNAME% lj_*.obj lib_*.obj
@if errorlevel 1 goto :BAD
@goto :MTDLL
:STATIC
%LJCOMPILE% lj_*.c lib_*.c
@if errorlevel 1 goto :BAD
%LJLIB% /OUT:%LJLIBNAME% lj_*.obj lib_*.obj
@if errorlevel 1 goto :BAD
@goto :MTDLL
:AMALGDLL
%LJCOMPILE% /MD /DLUA_BUILD_AS_DLL ljamalg.c
@if errorlevel 1 goto :BAD
%LJLINK% /DLL /out:%LJDLLNAME% ljamalg.obj lj_vm.obj
@if errorlevel 1 goto :BAD
:MTDLL
if exist %LJDLLNAME%.manifest^
  %LJMT% -manifest %LJDLLNAME%.manifest -outputresource:%LJDLLNAME%;2

%LJCOMPILE% luajit.c
@if errorlevel 1 goto :BAD
%LJLINK% /out:luajit.exe luajit.obj %LJLIBNAME%
@if errorlevel 1 goto :BAD
if exist luajit.exe.manifest^
  %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe

@del *.obj *.manifest minilua.exe buildvm.exe
@del host\buildvm_arch.h
@del lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h
@echo.
@echo === Successfully built LuaJIT for Windows/%LJARCH% ===

@goto :END
:BAD
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
@goto :END
:FAIL
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
:END

Windows: Remove intermediate files at end of build.


@echo off
cd /D %~dp0
call settings.cmd
call ..\unxutils.cmd

cd dist\%ARCH%

call pp -B -o psass.exe ^
-I ../../../blib/lib ^
-M Encode::Byte ^
-M List::MoreUtils::XS ^
-M List::MoreUtils::PP ^
-M Win32::ChangeNotify ^
-M Filesys::Notify::Simple ^
CSS-Sass-%RELVERSION%/bin/psass

cd ..\..

REM tested and working, but much bigger size
REM -l "%PERLPATH%/c/bin/_libsass-0.dll" ^

copy %CD%\dist\%ARCH%\psass.exe %CD%\..\create\%XARCH%

@echo off
cd /D %~dp0
call settings.cmd
call ..\unxutils.cmd

cd dist\%ARCH%

call pp -B -o psass.exe ^
-I ../../../blib/lib ^
-M Encode::Byte ^
-M PerlIO::encoding ^
-M List::MoreUtils::XS ^
-M List::MoreUtils::PP ^
-M Win32::ChangeNotify ^
-M Filesys::Notify::Simple ^
CSS-Sass-%RELVERSION%/bin/psass

cd ..\..

REM tested and working, but much bigger size
REM -l "%PERLPATH%/c/bin/_libsass-0.dll" ^

copy %CD%\dist\%ARCH%\psass.exe %CD%\..\create\%XARCH%

Add missing perl dependency for packer

Add missing perl dependency for packer


@echo off
set ROMVERSION=0
title Compiling AEVILIA GB version 1.%ROMVERSION%
echo === COMPILATION ===
rgbasm -E -p 0xFF -o obj/aevilia.o  	 main.asm
rgbasm -E -p 0xFF -o obj/home.o     	 home.asm
rgbasm -E -p 0xFF -o obj/gfx.o      	 gfx/graphics.asm
rgbasm -E -p 0xFF -o obj/txt.o      	 engine/text.asm
rgbasm -E -p 0xFF -o obj/error_handler.o engine/error_handler.asm
rgbasm -E -p 0xFF -o obj/save.o     	 engine/save.asm
rgbasm -E -p 0xFF -o obj/map.o      	 engine/map.asm
rgbasm -E -p 0xFF -o obj/font.o          engine/font.asm
rgbasm -E -p 0xFF -o obj/thread2.o       engine/thread2.asm
rgbasm -E -p 0xFF -o obj/testmaps.o 	 maps/test.asm
rgbasm -E -p 0xFF -o obj/intromap.o 	 maps/intro.asm
rgbasm -E -p 0xFF -o obj/sound.o    	 sound/DevSound.asm
rgbasm -E -p 0xFF -o obj/battle.o   	 battle/battle_engine.asm
rgbasm -E -p 0xFF -o obj/defaultsave.o	 save/defaultsave.asm
rgbasm -E -p 0xFF -o obj/rants.o		 save/rants.asm
echo.
echo COMPILATION DONE
echo.
echo.
echo === LINKING ===
rgblink -m bin/Aevilia.map -n bin/Aevilia.sym -o bin/aevilia.gbc obj/aevilia.o obj/home.o obj/gfx.o obj/txt.o obj/error_handler.o obj/save.o obj/map.o obj/font.o obj/thread2.o obj/testmaps.o obj/intromap.o obj/sound.o obj/battle.o obj/defaultsave.o obj/rants.o
echo.
echo LINKING DONE
echo.
echo.
echo === FIXING ===
rgbfix -Cjv -i ISSO -k 42 -l 0x33 -m 0x1B -n %ROMVERSION% -p 0xFF -r 0x04 -t AEVILIA bin/aevilia.gbc
echo.
echo FIXING DONE
echo.
echo.
echo FILES READY !
pause

@echo off
set ROMVERSION=0
title Compiling AEVILIA GB version 1.%ROMVERSION%
echo === COMPILATION ===
rgbasm -E -p 0xFF -o obj/main.o			 main.asm
rgbasm -E -p 0xFF -o obj/battle.o		 battle.asm
rgbasm -E -p 0xFF -o obj/engine.o		 engine.asm
rgbasm -E -p 0xFF -o obj/home.o			 home.asm
rgbasm -E -p 0xFF -o obj/gfx.o			 gfx.asm
rgbasm -E -p 0xFF -o obj/maps.o			 maps.asm
rgbasm -E -p 0xFF -o obj/save.o			 save.asm
rgbasm -E -p 0xFF -o obj/sound.o		 sound.asm
rgbasm -E -p 0xFF -o obj/tileset.o		 tileset.asm
echo.
echo COMPILATION DONE
echo.
echo.
echo === LINKING ===
rgblink -m bin/Aevilia.map -n bin/Aevilia.sym -o bin/aevilia.gbc obj/main.o obj/battle.o obj/engine.o obj/home.o obj/gfx.o obj/maps.o obj/save.o obj/sound.o obj/tileset.o
echo.
echo LINKING DONE
echo.
echo.
echo === FIXING ===
rgbfix -Cjv -i ISSO -k 42 -l 0x33 -m 0x1B -n %ROMVERSION% -p 0xFF -r 0x04 -t AEVILIA bin/aevilia.gbc
echo.
echo FIXING DONE
echo.
echo.
echo FILES READY !
pause

Update Windows compiling script

Update Windows compiling script


@echo off

REM Copyright (c) 2013-2022, The PurpleI2P Project
REM This file is part of Purple i2pd project and licensed under BSD3
REM See full license text in LICENSE file at top of project tree

setlocal enableextensions

set CURL=%~dp0curl.exe
set FFversion=102.3.0esr
set I2Pdversion=2.43.0
call :GET_LOCALE
call :GET_PROXY
call :GET_ARCH

if "%locale%"=="ru" (
	echo ઠ I2Pd Browser Portable
	echo  㧥: %locale%, ⥪: %xOS%
	echo.
	echo 㧪 ⠭騪 Firefox ESR
) else (
	echo Building I2Pd Browser Portable
	echo Browser locale: %locale%, architecture: %xOS%
	echo.
	echo Downloading Firefox ESR installer
)

"%CURL%" -L -f -# -o firefox.exe https://ftp.mozilla.org/pub/firefox/releases/%FFversion%/%xOS%/%locale%/Firefox%%20Setup%%20%FFversion%.exe %$X%
if errorlevel 1 (
	echo ERROR:%ErrorLevel%
	pause
	exit
) else (echo OK!)

echo.
if "%locale%"=="ru" (
	echo ᯠ ⠭騪  㤠  㦭 䠩
) else (
	echo Unpacking the installer and deleting unnecessary files
)

7z x -y -o..\Firefox\App firefox.exe > nul
del /Q firefox.exe
ren ..\Firefox\App\core Firefox
del /Q ..\Firefox\App\setup.exe
del /Q ..\Firefox\App\Firefox\browser\crashreporter-override.ini
rmdir /S /Q ..\Firefox\App\Firefox\browser\features
rmdir /S /Q ..\Firefox\App\Firefox\gmp-clearkey
rmdir /S /Q ..\Firefox\App\Firefox\uninstall
del /Q ..\Firefox\App\Firefox\Accessible*.*
del /Q ..\Firefox\App\Firefox\application.ini
del /Q ..\Firefox\App\Firefox\crashreporter.*
del /Q ..\Firefox\App\Firefox\*.sig
del /Q ..\Firefox\App\Firefox\IA2Marshal.dll
del /Q ..\Firefox\App\Firefox\maintenanceservice*.*
del /Q ..\Firefox\App\Firefox\minidump-analyzer.exe
del /Q ..\Firefox\App\Firefox\precomplete
del /Q ..\Firefox\App\Firefox\removed-files
del /Q ..\Firefox\App\Firefox\ucrtbase.dll
del /Q ..\Firefox\App\Firefox\update*.*

mkdir ..\Firefox\App\Firefox\browser\extensions > nul
echo OK!

echo.
if "%locale%"=="ru" (
	echo 稬 ७ 䠩 㧥  ⪫祭 稢 ᮢ
) else (
	echo Patching browser internal files to disable annoying external requests
)

7z -bso0 -y x ..\Firefox\App\Firefox\omni.ja -o..\Firefox\App\tmp > nul 2>&1

REM Patching them
sed -i "s/\"https\:\/\/firefox\.settings\.services\.mozilla\.com\/v1\"$/gServerURL/" ..\Firefox\App\tmp\modules\services-settings\Utils.jsm
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo Patched 1/2)
sed -i "s/\"https\:\/\/firefox\.settings\.services\.mozilla\.com\/v1\",$/\"\",/" ..\Firefox\App\tmp\modules\AppConstants.jsm
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo Patched 2/2)

REM Backing up old omni.ja
ren ..\Firefox\App\Firefox\omni.ja omni.ja.bak

REM Repacking patched files
7z a -mx0 -tzip ..\Firefox\App\Firefox\omni.ja -r ..\Firefox\App\tmp\* > nul

REM Removing temporary files
rmdir /S /Q ..\Firefox\App\tmp
del ..\Firefox\App\Firefox\omni.ja.bak
echo OK!

echo.
if "%locale%"=="ru" (
	echo 㧪 몮 ⮢
) else (
	echo Downloading language packs
)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\langpack-ru@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3971589/russian_ru_language_pack-102.0.1buildid20220705.093820.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\ruspell-wiktionary@addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3997957/2696307-1.41.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\langpack-en-US@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3971625/english_us_language_pack-102.0.1buildid20220705.093820.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\en-US@dictionaries.addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3893473/us_english_dictionary-91.0.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)

echo.
if "%locale%"=="ru" (
	echo 㧪  NoScript
) else (
	echo Downloading NoScript extension
)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi https://addons.mozilla.org/firefox/downloads/file/4002416/noscript-11.4.11.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)

echo.
if "%locale%"=="ru" (
	echo ஢ 䠩 ஥   Firefox
) else (
	echo Copying Firefox launcher and settings
)
mkdir ..\Firefox\App\DefaultData\profile\ > nul
xcopy /E /Y profile\* ..\Firefox\App\DefaultData\profile\ > nul
if "%locale%"=="ru" (
	copy /Y profile-ru\* ..\Firefox\App\DefaultData\profile\ > nul
) else (
	copy /Y profile-en\* ..\Firefox\App\DefaultData\profile\ > nul
)
copy /Y firefox-portable\* ..\Firefox\ > nul
xcopy /E /Y preferences\* ..\Firefox\App\Firefox\ > nul
echo OK!

echo.
if "%locale%"=="ru" (
	echo 㧪 I2Pd
) else (
	echo Downloading I2Pd
)
"%CURL%" -L -f -# -O https://github.com/PurpleI2P/i2pd/releases/download/%I2Pdversion%/i2pd_%I2Pdversion%_%xOS%_mingw.zip
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
7z x -y -o..\i2pd i2pd_%I2Pdversion%_%xOS%_mingw.zip i2pd.exe > nul
del /Q i2pd_%I2Pdversion%_%xOS%_mingw.zip

xcopy /E /I /Y i2pd ..\i2pd > nul

echo.
if "%locale%"=="ru" (
	echo I2Pd Browser Portable ⮢  !
) else (
	echo I2Pd Browser Portable is ready to start!
)
pause
exit

:GET_LOCALE
for /f "tokens=3" %%a in ('reg query "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload"^|find "REG_SZ"') do (
	if %%a==00000419 (set locale=ru) else (set locale=en-US)
	goto :eof
)
goto :eof

:GET_PROXY
set $X=&set $R=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
for /F "Tokens=1,3" %%i in ('reg query "%$R%"^|find "Proxy"') do set %%i=%%j
if %ProxyEnable%==0x1 set $X=-x %ProxyServer%
goto :eof

:GET_ARCH
set xOS=win32
if defined PROCESSOR_ARCHITEW6432 (set xOS=x64) else if "%PROCESSOR_ARCHITECTURE%" neq "x86" (set xOS=win64)
goto :eof

:eof

@echo off

REM Copyright (c) 2013-2022, The PurpleI2P Project
REM This file is part of Purple i2pd project and licensed under BSD3
REM See full license text in LICENSE file at top of project tree

setlocal enableextensions

set CURL=%~dp0curl.exe
set FFversion=102.3.0esr
set I2Pdversion=2.43.0
call :GET_LOCALE
call :GET_PROXY
call :GET_ARCH

if "%locale%"=="ru" (
	echo ‘¡®àª  I2Pd Browser Portable
	echo Ÿ§ëª ¡à ã§¥à : %locale%,  àå¨â¥ªâãà : %xOS%
	echo.
	echo ‡ £àã§ª  ãáâ ®¢é¨ª  Firefox ESR
) else (
	echo Building I2Pd Browser Portable
	echo Browser locale: %locale%, architecture: %xOS%
	echo.
	echo Downloading Firefox ESR installer
)

"%CURL%" -L -f -# -o firefox.exe https://ftp.mozilla.org/pub/firefox/releases/%FFversion%/%xOS%/%locale%/Firefox%%20Setup%%20%FFversion%.exe %$X%
if errorlevel 1 (
	echo ERROR:%ErrorLevel%
	pause
	exit
) else (echo OK!)

echo.
if "%locale%"=="ru" (
	echo  á¯ ª®¢ª  ãáâ ®¢é¨ª  ¨ ã¤ «¥¨¥ ¥ ã¦ëå ä ©«®¢
) else (
	echo Unpacking the installer and deleting unnecessary files
)

7z x -y -o..\Firefox\App firefox.exe > nul
del /Q firefox.exe
ren ..\Firefox\App\core Firefox
del /Q ..\Firefox\App\setup.exe
del /Q ..\Firefox\App\Firefox\browser\crashreporter-override.ini
rmdir /S /Q ..\Firefox\App\Firefox\browser\features
rmdir /S /Q ..\Firefox\App\Firefox\gmp-clearkey
rmdir /S /Q ..\Firefox\App\Firefox\uninstall
del /Q ..\Firefox\App\Firefox\Accessible*.*
del /Q ..\Firefox\App\Firefox\application.ini
del /Q ..\Firefox\App\Firefox\crashreporter.*
del /Q ..\Firefox\App\Firefox\*.sig
del /Q ..\Firefox\App\Firefox\IA2Marshal.dll
del /Q ..\Firefox\App\Firefox\maintenanceservice*.*
del /Q ..\Firefox\App\Firefox\minidump-analyzer.exe
del /Q ..\Firefox\App\Firefox\precomplete
del /Q ..\Firefox\App\Firefox\removed-files
del /Q ..\Firefox\App\Firefox\ucrtbase.dll
del /Q ..\Firefox\App\Firefox\update*.*

mkdir ..\Firefox\App\Firefox\browser\extensions > nul
echo OK!

echo.
if "%locale%"=="ru" (
	echo  âç¨¬ ¢ãâà¥¨¥ ä ©«ë ¡à ã§¥à  ¤«ï ®âª«îç¥¨ï  ¢ï§ç¨¢ëå § ¯à®á®¢
) else (
	echo Patching browser internal files to disable annoying external requests
)

7z -bso0 -y x ..\Firefox\App\Firefox\omni.ja -o..\Firefox\App\tmp > nul 2>&1

REM Patching them
sed -i "s/\"https\:\/\/firefox\.settings\.services\.mozilla\.com\/v1\"$/gServerURL/" ..\Firefox\App\tmp\modules\services-settings\Utils.jsm
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo Patched 1/2)
sed -i "s/\"https\:\/\/firefox\.settings\.services\.mozilla\.com\/v1\",$/\"\",/" ..\Firefox\App\tmp\modules\AppConstants.jsm
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo Patched 2/2)

REM Backing up old omni.ja
ren ..\Firefox\App\Firefox\omni.ja omni.ja.bak

REM Repacking patched files
7z a -mx0 -tzip ..\Firefox\App\Firefox\omni.ja -r ..\Firefox\App\tmp\* > nul

REM Removing temporary files
rmdir /S /Q ..\Firefox\App\tmp
del ..\Firefox\App\Firefox\omni.ja.bak
echo OK!

echo.
if "%locale%"=="ru" (
	echo ‡ £àã§ª  ï§ëª®¢ëå ¯ ª¥â®¢
) else (
	echo Downloading language packs
)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\langpack-ru@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3971589/russian_ru_language_pack-102.0.1buildid20220705.093820.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\ruspell-wiktionary@addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3997957/2696307-1.41.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\langpack-en-US@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3971625/english_us_language_pack-102.0.1buildid20220705.093820.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\en-US@dictionaries.addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/3893473/us_english_dictionary-91.0.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)

echo.
if "%locale%"=="ru" (
	echo ‡ £àã§ª  ¤®¯®«¥¨ï NoScript
) else (
	echo Downloading NoScript extension
)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi https://addons.mozilla.org/firefox/downloads/file/4002416/noscript-11.4.11.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)

echo.
if "%locale%"=="ru" (
	echo Š®¯¨à®¢ ¨¥ ä ©«®¢  áâà®¥ª ¢ ¯ ¯ªã Firefox
) else (
	echo Copying Firefox launcher and settings
)
mkdir ..\Firefox\App\DefaultData\profile\ > nul
xcopy /E /Y profile\* ..\Firefox\App\DefaultData\profile\ > nul
if "%locale%"=="ru" (
	copy /Y profile-ru\* ..\Firefox\App\DefaultData\profile\ > nul
) else (
	copy /Y profile-en\* ..\Firefox\App\DefaultData\profile\ > nul
)
copy /Y firefox-portable\* ..\Firefox\ > nul
xcopy /E /Y preferences\* ..\Firefox\App\Firefox\ > nul
echo OK!

echo.
if "%locale%"=="ru" (
	echo ‡ £àã§ª  I2Pd
) else (
	echo Downloading I2Pd
)
"%CURL%" -L -f -# -O https://github.com/PurpleI2P/i2pd/releases/download/%I2Pdversion%/i2pd_%I2Pdversion%_%xOS%_mingw.zip
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
7z x -y -o..\i2pd i2pd_%I2Pdversion%_%xOS%_mingw.zip i2pd.exe > nul
del /Q i2pd_%I2Pdversion%_%xOS%_mingw.zip

xcopy /E /I /Y i2pd ..\i2pd > nul

echo.
if "%locale%"=="ru" (
	echo I2Pd Browser Portable £®â®¢ ª § ¯ãáªã!
) else (
	echo I2Pd Browser Portable is ready to start!
)
pause
exit

:GET_LOCALE
for /f "tokens=3" %%a in ('reg query "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload"^|find "REG_SZ"') do (
	if %%a==00000419 (set locale=ru) else (set locale=en-US)
	goto :eof
)
goto :eof

:GET_PROXY
set $X=&set $R=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
for /F "Tokens=1,3" %%i in ('reg query "%$R%"^|find "Proxy"') do set %%i=%%j
if %ProxyEnable%==0x1 set $X=-x %ProxyServer%
goto :eof

:GET_ARCH
set xOS=win32
if defined PROCESSOR_ARCHITEW6432 (set xOS=win64) else if "%PROCESSOR_ARCHITECTURE%" neq "x86" (set xOS=win64)
goto :eof

:eof

Set correct xOS value (closes #46)

Set correct xOS value (closes #46)


call "%VS100COMNTOOLS%vsvars32.bat"

mkdir libs
pushd libs
cmake -DWITH_TESTS=YES -G "Visual Studio 10" ../

popd

Create build_vs10_test.bat

Create build_vs10_test.bat


.\node_modules\.bin\uglifyjs.cmd --compress --mangle --output codemirror.min.js ^
lib/codemirror.js ^
addon/mode/overlay.js ^
addon/mode/simple.js ^
addon/mode/multiplex.js ^
addon/selection/active-line.js ^
addon/search/searchcursor.js ^
addon/search/search.js ^
addon/search/jump-to-line.js ^
addon/search/matchesonscrollbar.js ^
addon/search/match-highlighter.js ^
addon/scroll/simplescrollbars.js ^
addon/scroll/annotatescrollbar.js ^
addon/display/panel.js ^
addon/display/placeholder.js ^
addon/display/fullscreen.js ^
addon/display/autorefresh.js ^
addon/dialog/dialog.js ^
addon/edit/matchbrackets.js ^
addon/edit/closebrackets.js ^
addon/edit/matchtags.js ^
addon/edit/closetag.js ^
addon/edit/continuelist.js ^
addon/comment/comment.js ^
addon/comment/continuecomment.js ^
addon/wrap/hardwrap.js ^
addon/fold/foldcode.js ^
addon/fold/brace-fold.js ^
addon/fold/foldgutter.js ^
addon/fold/markdown-fold.js ^
addon/fold/xml-fold.js ^
mode/xml/xml.js ^
mode/markdown/markdown_math.js ^
mode/gfm/gfm.js ^
mode/javascript/javascript.js ^
mode/typescript/typescript.js ^
mode/jsx/jsx.js ^
mode/css/css.js ^
mode/htmlmixed/htmlmixed.js ^
mode/htmlembedded/htmlembedded.js ^
mode/clike/clike.js ^
mode/clojure/clojure.js ^
mode/ruby/ruby.js ^
mode/python/python.js ^
mode/shell/shell.js ^
mode/php/php.js ^
mode/sas/sas.js ^
mode/sql/sql.js ^
mode/haskell/haskell.js ^
mode/coffeescript/coffeescript.js ^
mode/yaml/yaml.js ^
mode/pug/pug.js ^
mode/lua/lua.js ^
mode/cmake/cmake.js ^
mode/nginx/nginx.js ^
mode/perl/perl.js ^
mode/sass/sass.js ^
mode/r/r.js ^
mode/dockerfile/dockerfile.js ^
mode/tiddlywiki/tiddlywiki.js ^
mode/mediawiki/mediawiki.js ^
mode/go/go.js ^
mode/gherkin/gherkin.js ^
keymap/emacs.js ^
keymap/sublime.js ^
keymap/vim.js

uglifyjs.cmd --compress --mangle --output codemirror.min.js ^
lib\codemirror.js ^
addon\mode\overlay.js ^
addon\mode\simple.js ^
addon\mode\multiplex.js ^
addon\selection\active-line.js ^
addon\search\searchcursor.js ^
addon\search\search.js ^
addon\search\jump-to-line.js ^
addon\search\matchesonscrollbar.js ^
addon\search\match-highlighter.js ^
addon\scroll\simplescrollbars.js ^
addon\scroll\annotatescrollbar.js ^
addon\display\panel.js ^
addon\display\placeholder.js ^
addon\display\fullscreen.js ^
addon\display\autorefresh.js ^
addon\dialog\dialog.js ^
addon\edit\matchbrackets.js ^
addon\edit\closebrackets.js ^
addon\edit\matchtags.js ^
addon\edit\closetag.js ^
addon\edit\continuelist.js ^
addon\comment\comment.js ^
addon\comment\continuecomment.js ^
addon\wrap\hardwrap.js ^
addon\fold\foldcode.js ^
addon\fold\brace-fold.js ^
addon\fold\foldgutter.js ^
addon\fold\markdown-fold.js ^
addon\fold\xml-fold.js ^
mode\xml\xml.js ^
mode\markdown\markdown_math.js ^
mode\gfm\gfm.js ^
mode\javascript\javascript.js ^
mode\typescript\typescript.js ^
mode\jsx\jsx.js ^
mode\css\css.js ^
mode\htmlmixed\htmlmixed.js ^
mode\htmlembedded\htmlembedded.js ^
mode\clike\clike.js ^
mode\clojure\clojure.js ^
mode\ruby\ruby.js ^
mode\python\python.js ^
mode\shell\shell.js ^
mode\php\php.js ^
mode\sas\sas.js ^
mode\sql\sql.js ^
mode\haskell\haskell.js ^
mode\coffeescript\coffeescript.js ^
mode\yaml\yaml.js ^
mode\pug\pug.js ^
mode\lua\lua.js ^
mode\cmake\cmake.js ^
mode\nginx\nginx.js ^
mode\perl\perl.js ^
mode\sass\sass.js ^
mode\r\r.js ^
mode\dockerfile\dockerfile.js ^
mode\tiddlywiki\tiddlywiki.js ^
mode\mediawiki\mediawiki.js ^
mode\go\go.js ^
mode\gherkin\gherkin.js ^
keymap\emacs.js ^
keymap\sublime.js ^
keymap\vim.js

Fix uglifyjs path when use as npm module


rem ***********************************************************************************************
rem Download BuildTools from https://www.visualstudio.com/downloads/ and install first.
rem ***********************************************************************************************
rem x86 build command
rem "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" .\Castle.Facilities.IBatisNet.sln /t:Rebuild /p:Configuration=Release /p:WarningLevel=0
rem x64 build command
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\amd64\MSBuild.exe" .\Castle.Facilities.IBatisNet.sln /t:Rebuild /p:Configuration=Release /p:WarningLevel=0
pause

add build script

add build script


@echo off
setlocal
cd /d %~dp0

rem Set the WDDK and SDK directories
set WDKBASEDIR=C:\WinDDK\7600.16385.1
set SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1

pushd ..
call update_version.bat
popd

rem x86
set INCLUDE=%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\ddk
set LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386
set PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%PATH%
set OUTDIR=..\Release
set OBJDIR=%OUTDIR%\obj

TITLE Building Notepad2 x86...
call "build_base.bat" x86

rem x64
set LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64
set PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%PATH%
set OUTDIR=..\Release_x64
set OBJDIR=%OUTDIR%\obj

TITLE Building Notepad2 x64...
call "build_base.bat" x64

:end
TITLE Finished!
endlocal
goto :eof

@echo off
setlocal
cd /d %~dp0

rem Set the WDDK and SDK directories
set WDKBASEDIR=C:\WinDDK\7600.16385.1
set SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1

IF NOT EXIST "%WDKBASEDIR%" ECHO:[ERROR] Specify your WDK dir&&PAUSE&&EXIT
IF NOT EXIST "%SDKDIR%" ECHO:[ERROR] Specify your SDK dir&&PAUSE&&EXIT

pushd ..
call "update_version.bat"
popd

rem x86
set "INCLUDE=%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\ddk"
set "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"
set "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%PATH%"
set OUTDIR=..\Release
set OBJDIR=%OUTDIR%\obj

TITLE Building Notepad2 x86...
call "build_base.bat" x86

rem x64
set "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"
set "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%PATH%"
set OUTDIR=..\Release_x64
set OBJDIR=%OUTDIR%\obj

TITLE Building Notepad2 x64...
call "build_base.bat" x64

:end
TITLE Finished!
endlocal
exit /b

add some checks in the build.cmd

add some checks in the build.cmd


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

set HERE=%~dp0

echo HERE %HERE%
echo APPVEYOR_PROJECT_NAME %APPVEYOR_PROJECT_NAME%
echo CONFIGURATION %CONFIGURATION%
echo PLATFORM %PLATFORM%
echo APPVEYOR_BUILD_VERSION %APPVEYOR_BUILD_VERSION%
echo APPVEYOR_REPO_BRANCH %APPVEYOR_REPO_BRANCH%
echo APPVEYOR_REPO_COMMIT %APPVEYOR_REPO_COMMIT%

7z a %CONFIGURATION%.zip .\src\bin\%CONFIGURATION%\*

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

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

:ok
exit /b 0

:ko
exit /b 5

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

set HERE=%~dp0

echo HERE %HERE%
echo APPVEYOR_PROJECT_NAME %APPVEYOR_PROJECT_NAME%
echo CONFIGURATION %CONFIGURATION%
echo PLATFORM %PLATFORM%
echo APPVEYOR_BUILD_VERSION %APPVEYOR_BUILD_VERSION%
echo APPVEYOR_REPO_BRANCH %APPVEYOR_REPO_BRANCH%
echo APPVEYOR_REPO_COMMIT %APPVEYOR_REPO_COMMIT%

7z a %CONFIGURATION%.zip .\src\bin\%CONFIGURATION%\*

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

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

:ok
exit /b 0

:ko
exit /b 5

fix tag for push

fix tag for push


git add .
git commit -m %1
git push
git checkout gh-pages
git rebase master
git push
git checkout master

add batch file

add batch file


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

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

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

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

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

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

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

goto fail

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

if exist "%JAVA_EXE%" goto init

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

goto fail

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

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

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

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

set CMD_LINE_ARGS=%*
goto execute

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

:execute
@rem Setup the command line

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

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

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

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

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

:omega

add graldew.bat

add graldew.bat


set pgbin_path=C:\Program Files\PostgreSQL\8.4\bin
set study_db_name=site_study_database_name_goes_here
set zip_source=pathe_to_the_directory_where_extracted_database_dump_is_stored\extracted
REM 4. restore db using
REM user clinica password is set in the %APPDATA%\postgresql\pgpass.conf (where %APPDATA% refers to the Application Data subdirectory in the user's profile).
REM ---------------------------------------------------
"%pgbin_path%\pg_restore.exe" -i -h localhost -p 5432 -U clinica -d %study_db_name% -v "%zip_source%\%study_db_name%.backup"

Create restore.cmd

Create restore.cmd


@if "%1" == "" goto error
@if "%2" == "" goto error

@for /f "delims=. tokens=1-3" %%a in ( "%2" ) do (set major=%%a && set minor=%%b && set revision=%%c)

@if not defined revision goto error
@if not defined minor goto error
@if not defined major goto error

git fetch
git tag -a v%2 -m "Telerik AppBuilder %2" remotes/origin/master
git push origin v%2

@goto :EOF

:error
@echo Sample usage: publish appbuilder.tgz 1.2.3
@echo Version string must be in Major.Minor.Revision format

npm publish "%1" --ignore-scripts

@if "%1" == "" goto error
@if "%2" == "" goto error

@for /f "delims=. tokens=1-3" %%a in ( "%2" ) do (set major=%%a && set minor=%%b && set revision=%%c)

@if not defined revision goto error
@if not defined minor goto error
@if not defined major goto error

git fetch
git tag -a v%2 -m "Telerik AppBuilder %2" remotes/origin/release
git push origin v%2

npm publish "%1" --ignore-scripts
@goto :EOF

:error
@echo Sample usage: publish appbuilder.tgz 1.2.3
@echo Version string must be in Major.Minor.Revision format

Fix publish script

Fix publish script

Use release branch to tag the latest version.
Invoke `npm publish`


@echo off
rem --------------------------------------------------------------------
rem Release vims setting script in windows.
rem
rem Version: 0.0.0
rem Author: Shohei Mukai
rem Licence: MIT Licence
rem --------------------------------------------------------------------
rem :: Remain works::
rem     * Set http request command.
rem     * If not exist http command request, not moving some
rem       NeoBundle.
rem --------------------------------------------------------------------

rem Set variable data.
set CUR_DIR=%~dp0
set HOME_DIR=%HOMEPATH%
set TODAY=%date:~0,4%%date:~5,2%%date:~8,2%
set NOW=%TODAY%%time:~0,2%%time:~3,2%%time:~6,2%

rem Backup vim files.
set BACKUP_DIR=%HOME_DIR%.vim-backup
if not exist %BACKUP_DIR% (
  cd %HOME_DIR%
  mkdir .vim-backup
  cd %CUR_DIR%
)

rem Backup vimrc script.
if exist %HOME_DIR%\_vimrc (
  copy %HOME_DIR%\_vimrc %HOME_DIR%\.vim-backup\_vimrc%NOW%
)

rem Backup gvimrc script.
if exist %HOME_DIR%\_vimrc (
  copy %HOME_DIR%\_gvimrc %HOME_DIR%\.vim-backup\_gvimrc%NOW%
)

rem Copy vimrc.
copy %CUR_DIR%vimrc %HOME_DIR%\_vimrc

rem Copy gvimrc.
copy %CUR_DIR%gvimrc %HOME_DIR%\_gvimrc

rem Copy vimrc.cnf(need confirm).
set /P IS_COPY="Copy cnf? [Y]: "
echo %IS_COPY%
if "%IS_COPY%"=="Y" (
  copy %CUR_DIR%vimrc.cnf %HOME_DIR%\.vimrc.cnf
)

@echo off
rem --------------------------------------------------------------------
rem Release vims setting script in windows.
rem
rem Version: 0.0.0
rem Author: Shohei Mukai
rem Licence: MIT Licence
rem --------------------------------------------------------------------
rem :: Remain works::
rem     * Set http request command.
rem     * If not exist http command request, not moving some
rem       NeoBundle.
rem --------------------------------------------------------------------

rem Set variable data.
set CUR_DIR=%~dp0
set HOME_DIR=%HOMEPATH%
set TODAY=%date:~0,4%%date:~5,2%%date:~8,2%
set NOW=%TODAY%%time:~0,2%%time:~3,2%%time:~6,2%

rem Backup vim files.
set BACKUP_DIR=%HOME_DIR%.vim-backup
if not exist %BACKUP_DIR% (
  cd %HOME_DIR%
  mkdir .vim-backup
  cd %CUR_DIR%
)

rem Backup vimrc script.
if exist %HOME_DIR%\_vimrc (
  copy %HOME_DIR%\_vimrc %HOME_DIR%\.vim-backup\_vimrc%NOW%
)

rem Backup gvimrc script.
if exist %HOME_DIR%\_vimrc (
  copy %HOME_DIR%\_gvimrc %HOME_DIR%\.vim-backup\_gvimrc%NOW%
)

rem Copy vimrc.
copy %CUR_DIR%vimrc %HOME_DIR%\_vimrc

rem Copy gvimrc.
copy %CUR_DIR%gvimrc %HOME_DIR%\_gvimrc

rem Copy vimrc command list (if you need).
copy %CUR_DIR%vimrc.command %HOME_DIR%\.vimrc.command

rem Copy vimrc.cnf(need confirm).
set /P IS_COPY="Copy cnf? [Y]: "
echo %IS_COPY%
if "%IS_COPY%"=="Y" (
  copy %CUR_DIR%vimrc.cnf %HOME_DIR%\.vimrc.cnf
)

Fix to copy `vimrc.command`

Fix to copy `vimrc.command`


:: Copyright 2014 The 'mumble-releng' Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that
:: can be found in the LICENSE file in the source tree or at
:: <http://mumble.info/mumble-releng/LICENSE>.

:: Dereference the C:\MumbleBuild\latest-1.3.x junction point.
for /F "skip=9 tokens=3" %%M IN ('fsutil reparsepoint query c:\MumbleBuild\latest-1.3.x') DO ^
IF NOT DEFINED MUMBLE_BUILDENV_DIR (SET MUMBLE_BUILDENV_DIR=%%M)

for /F %%G IN ('%MUMBLE_BUILDENV_DIR%\mumble-releng\tools\mumble-version.py') DO SET mumblebuildversion=%%G

call %MUMBLE_BUILDENV_DIR%\prep.cmd
if errorlevel 1 exit /b errorlevel

echo Build mumble
if "%MUMBLE_BUILD_TYPE%" == "Release" (
	qmake CONFIG+="release static symbols packaged" DEFINES+="MUMBLE_VERSION=%mumblebuildversion%" -recursive
) else (
	qmake CONFIG+="release static symbols packaged" DEFINES+="MUMBLE_VERSION=%mumblebuildversion% SNAPSHOT_BUILD=1" -recursive
)
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel

echo Build SSE2 versions of opus
cd opus-build
nmake clean
if errorlevel 1 exit /b errorlevel
qmake -recursive CONFIG+=sse2
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..

echo Build SSE2 versions of celt 0.11.0
cd celt-0.11.0-build
nmake clean
if errorlevel 1 exit /b errorlevel
qmake -recursive CONFIG+=sse2
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..

echo Build SSE2 versions of celt 0.7.0
cd celt-0.7.0-build
nmake clean
if errorlevel 1 exit /b errorlevel
qmake -recursive CONFIG+=sse2
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..

if "%MUMBLE_DO_PLUGIN_REPLACEMENT" == "1" (
	echo Perform plugin replacement
	"%MUMBLE_PREFIX%\mumble-releng\tools\plugin_replacement.py" --version "%mumblebuildversion%" --repo . release\plugins
)

echo Build installer
SET MumbleNoMergeModule=1
SET MumbleDebugToolsDir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
SET MumbleSourceDir=%cd%
cd scripts
call mkini-win32.bat
if errorlevel 1 exit /b errorlevel
cd ..\installer
if errorlevel 1 exit /b errorlevel
msbuild  /p:Configuration=Release;Platform=x86 MumbleInstall.sln /t:Clean,Build
if errorlevel 1 exit /b errorlevel
perl build_installer.pl
if errorlevel 1 exit /b errorlevel
cd bin\Release
rename Mumble.msi "mumble-%mumblebuildversion%.msi"
if errorlevel 1 exit /b errorlevel

cd ..\..\..

if not "%MUMBLE_SKIP_INTERNAL_SIGNING%" == "1" (
	echo Adding build machine's signature to installer
	signtool sign /sm /a "installer/bin/Release/mumble-%mumblebuildversion%.msi"
	if errorlevel 1 exit /b errorlevel
)

"%MUMBLE_BUILDENV_DIR%\mumble-releng\tools\collect_symbols.py" collect --version "%mumblebuildversion%" --buildtype "%MUMBLE_BUILD_TYPE%" --product "Mumble %MUMBLE_BUILD_ARCH%" release\ symbols.7z
if errorlevel 1 exit /b errorlevel

:: Copyright 2014-2015 The 'mumble-releng' Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that
:: can be found in the LICENSE file in the source tree or at
:: <http://mumble.info/mumble-releng/LICENSE>.

:: Dereference the C:\MumbleBuild\latest-1.3.x junction point.
for /F "skip=9 tokens=3" %%M IN ('fsutil reparsepoint query c:\MumbleBuild\latest-1.3.x') DO ^
IF NOT DEFINED MUMBLE_BUILDENV_DIR (SET MUMBLE_BUILDENV_DIR=%%M)

for /F %%G IN ('%MUMBLE_BUILDENV_DIR%\mumble-releng\tools\mumble-version.py') DO SET mumblebuildversion=%%G

call %MUMBLE_BUILDENV_DIR%\prep.cmd
if errorlevel 1 exit /b errorlevel

echo Build mumble
if "%MUMBLE_BUILD_TYPE%" == "Release" (
	qmake CONFIG+="release static symbols packaged" DEFINES+="MUMBLE_VERSION=%mumblebuildversion%" -recursive
) else (
	qmake CONFIG+="release static symbols packaged" DEFINES+="MUMBLE_VERSION=%mumblebuildversion% SNAPSHOT_BUILD=1" -recursive
)
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel

echo Build SSE2 versions of opus
cd 3rdparty\opus-build
nmake clean
if errorlevel 1 exit /b errorlevel
qmake -recursive CONFIG+=sse2
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..\..

echo Build SSE2 versions of celt 0.11.0
cd 3rdparty\celt-0.11.0-build
nmake clean
if errorlevel 1 exit /b errorlevel
qmake -recursive CONFIG+=sse2
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..\..

echo Build SSE2 versions of celt 0.7.0
cd 3rdparty\celt-0.7.0-build
nmake clean
if errorlevel 1 exit /b errorlevel
qmake -recursive CONFIG+=sse2
if errorlevel 1 exit /b errorlevel
nmake release
if errorlevel 1 exit /b errorlevel
cd ..\..

if "%MUMBLE_DO_PLUGIN_REPLACEMENT" == "1" (
	echo Perform plugin replacement
	"%MUMBLE_PREFIX%\mumble-releng\tools\plugin_replacement.py" --version "%mumblebuildversion%" --repo . release\plugins
)

echo Build installer
SET MumbleNoMergeModule=1
SET MumbleDebugToolsDir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
SET MumbleSourceDir=%cd%
cd scripts
call mkini-win32.bat
if errorlevel 1 exit /b errorlevel
cd ..\installer
if errorlevel 1 exit /b errorlevel
msbuild  /p:Configuration=Release;Platform=x86 MumbleInstall.sln /t:Clean,Build
if errorlevel 1 exit /b errorlevel
perl build_installer.pl
if errorlevel 1 exit /b errorlevel
cd bin\Release
rename Mumble.msi "mumble-%mumblebuildversion%.msi"
if errorlevel 1 exit /b errorlevel

cd ..\..\..

if not "%MUMBLE_SKIP_INTERNAL_SIGNING%" == "1" (
	echo Adding build machine's signature to installer
	signtool sign /sm /a "installer/bin/Release/mumble-%mumblebuildversion%.msi"
	if errorlevel 1 exit /b errorlevel
)

"%MUMBLE_BUILDENV_DIR%\mumble-releng\tools\collect_symbols.py" collect --version "%mumblebuildversion%" --buildtype "%MUMBLE_BUILD_TYPE%" --product "Mumble %MUMBLE_BUILD_ARCH%" release\ symbols.7z
if errorlevel 1 exit /b errorlevel

buildscripts/1.3.x: update mumble-win32-static.cmd with new 3rdparty paths.


@rem Copyright 2018, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem     * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem     * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem     * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd github/google-cloud-intellij

@rem Explicitly set to JDK 8 to get around Kokoro default environment value of JDK 9
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144

gradlew.bat check --stacktrace

exit /b %ERRORLEVEL%

@rem Copyright 2018, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem     * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem     * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem     * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd github/google-container-tools-intellij

@rem Explicitly set to JDK 8 to get around Kokoro default environment value of JDK 9
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144

gradlew.bat check --stacktrace

exit /b %ERRORLEVEL%

Fix incorrect path in windows kokoro script (#31)


# Download windows 7 AIK
# http://www.microsoft.com/en-us/download/details.aspx?id=5753

# Daemon Tools Lite Free Edition can be used to mount the iso

# After Windows AIK software is installed on your system go to Windows Start -> All Programs -> Microsoft Windows AIK -> right click on Deployment Tools Command Prompt and select Run as Administrator and a new Windows Shell console should open on your screen.

# copype amd64 C:\winPE_amd64
# copy "C:\Program Files\Windows AIK\Tools\PETools\amd64\winpe.wim" C:\winpe_amd64\ISO\Sources\Boot.wim
# copy "C:\Program Files\Windows AIK\Tools\amd64\Imagex.exe" C:\winpe_amd64\ISO\
# oscdimg -n -bC:\winpe_amd64\etfsboot.com C:\winpe_amd64\ISO C:\winpe_amd64\winpe_amd64.iso

# After WinPE x64 ISO file is completely transferred to "10.10.10.10:/home/$USER/Downloads go back to PXE Server console and move this image from root’s /windows directory to TFTP windows directory path to complete the entire installation process.

Create Windows_Create_PE.bat

Create Windows_Create_PE.bat


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

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

set GOBUILDFAIL=0

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

rem TODO avoid rebuild if possible

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

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

set GOBUILDFAIL=0

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

rem TODO avoid rebuild if possible

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6506096


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

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

set GOBUILDFAIL=0

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

rem TODO avoid rebuild if possible

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

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

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

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

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

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

if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
echo # Testing race detector.
go test -race -i flag
if errorlevel 1 goto fail
go test -race -short flag
if errorlevel 1 goto fail
echo.
:norace

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

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

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

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

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

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

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

set OLDGOMAXPROCS=%GOMAXPROCS%

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

set GOMAXPROCS=%OLDGOMAXPROCS%
set OLDGOMAXPROCS=

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

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

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

set GOBUILDFAIL=0

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

rem TODO avoid rebuild if possible

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

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

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

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

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

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

if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
echo # Testing race detector.
go test -race -i flag
if errorlevel 1 goto fail
go test -race -short flag
if errorlevel 1 goto fail
echo.
:norace

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

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

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

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

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

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

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

set OLDGOMAXPROCS=%GOMAXPROCS%

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

set GOMAXPROCS=%OLDGOMAXPROCS%
set OLDGOMAXPROCS=

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

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

disable cgo on windows

build: disable cgo on windows

Update #4955.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7435049


<!-- :
@echo off
echo ==^> Enabling updates for other products from Microsoft Update
net stop wuauserv

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v EnableFeaturedSoftware /t REG_DWORD /d 1 /f

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v IncludeRecommendedUpdates /t REG_DWORD /d 1 /f

cscript //nologo "%~f0?.wsf"

net start wuauserv
exit /b

----- Begin wsf script --->
<job><script language="VBScript">
  Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager")
  Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"")
</script></job>

<!-- :
@echo off
echo ==^> Enabling updates for other products from Microsoft Update
net stop wuauserv

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v EnableFeaturedSoftware /t REG_DWORD /d 1 /f

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v IncludeRecommendedUpdates /t REG_DWORD /d 1 /f

cscript //nologo "%~f0?.wsf"

net start wuauserv
exit /b

----- Begin wsf script --->
<job><script language="VBScript">
  Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager")
  Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"")

  Const NOT_CONFIGURED = 0
  Const DISABLED = 1
  Const PROMPT_TO_APPROVE_BEFORE_DOWNLOAD = 2
  Const DOWNLOAD_AUTOMATICALLY = 3
  Const SCHEDULED_INSTALLATION = 4
  Set AutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
  Set AutoUpdateSettings = AutoUpdate.Settings
  AutoUpdateSettings.NotificationLevel = DISABLED
  AutoUpdateSettings.Save
  AutoUpdateSettings.Refresh
</script></job>

Disable updates on Windows 2008 R2 and Windows 7


@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

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

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

goto end

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

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

:end
popd
echo Finished successfully.
exit /b 0

@echo off
setlocal enabledelayedexpansion

pushd %1

set attempts=5
set counter=0

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

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

goto end

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

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

:end
popd
echo Finished successfully.
exit /b 0

update kuduscript version

update kuduscript version


set target=Build
set config=Release
rm build.sln
python gyp/gyp build.gyp --depth=. -f msvs -G msvs_version=2010
msbuild build.sln
copy Default\\_zipfile.node lib\\_zipfile.node
rem test!
set NODE_PATH=lib
rem have to put zip.lib on PATH
set PATH=%PATH%;c:\\dev2\node-zipfile\\lib
copy deps\\libzip-0.10\\build_vc100\\lib\\zip.dll lib\\zip.dll
rem node node_modules\expresso\bin\expresso
mocha
rem node -e "console.log(require('zipfile'))"

del build.sln
rd /q /s Default
del lib\\_zipfile.node
python gyp/gyp build.gyp --depth=. -f msvs -G msvs_version=2010
msbuild build.sln
copy Default\\_zipfile.node lib\\_zipfile.node
rem test!
set NODE_PATH=lib
rem have to put zip.lib on PATH
set PATH=%PATH%;c:\\dev2\node-zipfile\\lib
copy deps\\libzip-0.10\\build_vc100\\lib\\zip.dll lib\\zip.dll
rem node node_modules\expresso\bin\expresso
mocha
rem node -e "console.log(require('zipfile'))"

clear out builds

clear out builds


@echo off

echo Building dependencies...

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

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

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

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

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

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

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

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

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

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

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

add dep build script for vs2017

add dep build script for vs2017

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


set PACKAGE=acid88
set ZIPDIR=%TMPDIR%\%PACKAGE%
mkdir %ZIPDIR%
copy acid88.txt %ZIPDIR%
copy acid88.com %ZIPDIR%

Add makedist.bat for acid88

Add makedist.bat for acid88


..\tools\Build.Tools\Fake\FAKE.exe ..\tools\Build.Tools\YC.Core.fsx %1 %2

Add parameters to YC.Core.bat

Add parameters to YC.Core.bat


@ECHO ON

call activate test-environment

echo "%PATH%"
echo "%QT_PLUGIN_PATH%"
python -V
call pyuic5 --version

pyrcc5 -version

lrelease -version

pip install -r requirements.txt
pip install pyinstaller

python gen_resources.py
if %errorlevel% neq 0 exit /b 1s

python gen_translations.py
if %errorlevel% neq 0 exit /b 1

pyinstaller sakia.spec
if %errorlevel% neq 0 exit /b 1

@ECHO ON

call activate test-environment

echo "%PATH%"
echo "%QT_PLUGIN_PATH%"
python -V
call pyuic5 --version

pyrcc5 -version

lrelease -version

pip install -r requirements.txt
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

python gen_resources.py
if %errorlevel% neq 0 exit /b 1s

python gen_translations.py
if %errorlevel% neq 0 exit /b 1

pyinstaller sakia.spec
if %errorlevel% neq 0 exit /b 1

Install with develop version

Install with develop version


@echo off
rem rime build script for msvc toolchain.
rem
rem 2012-11-25 <chen.sst@gmail.com>

set BACK=%CD%

if exist env.bat call env.bat

set OLD_PATH=%PATH%
if defined DEV_PATH set PATH=%OLD_PATH%;%DEV_PATH%
path
echo.

if not defined RIME_ROOT set RIME_ROOT=%CD%
echo RIME_ROOT=%RIME_ROOT%
echo.

echo BOOST_ROOT=%BOOST_ROOT%
echo.

set build=vcbuild
set build_boost=0
set build_thirdparty=0
set build_librime=0
set build_shared=ON
set build_test=OFF
set enable_logging=ON

if "%1" == "" set build_librime=1

:parse_cmdline_options
if "%1" == "" goto end_parsing_cmdline_options
if "%1" == "boost" set build_boost=1
if "%1" == "thirdparty" set build_thirdparty=1
if "%1" == "librime" set build_librime=1
if "%1" == "static" (
  set build=vcbuild-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=vcbuild
  set build_librime=1
  set build_shared=ON
)
if "%1" == "test" (
  set build_librime=1
  set build_test=ON
)
if "%1" == "nologging" (
  set build_librime=1
  set enable_logging=OFF
)
shift
goto parse_cmdline_options
:end_parsing_cmdline_options

rem set CURL=%RIME_ROOT%\thirdparty\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all
rem set GOOGLECODE_SVN=http://rimeime.googlecode.com/svn/trunk/

if %build_boost% == 1 (
  cd %BOOST_ROOT%
  if not exist bjam.exe call bootstrap.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd "%RIME_ROOT%"\thirdparty\src\glog
  rem devenv google-glog-vc10.sln /build "Release"
  msbuild.exe google-glog-vc12.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y src\windows\glog "%RIME_ROOT%"\thirdparty\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building kyotocabinet.
  cd "%RIME_ROOT%"\thirdparty\src\kyotocabinet
  nmake -f VC12makefile
  if %ERRORLEVEL% NEQ 0 goto ERROR
  nmake -f VC12makefile binpkg
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  copy /Y output\include\*.h "%RIME_ROOT%"\thirdparty\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y output\lib\*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y output\bin\*.* "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd "%RIME_ROOT%"\thirdparty\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem devenv YAML_CPP.sln /build "Release"
  msbuild.exe YAML_CPP.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\yaml-cpp "%RIME_ROOT%"\thirdparty\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building gtest.
  cd "%RIME_ROOT%"\thirdparty\src\gtest
  if not exist build mkdir build
  cd build
  cmake ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem devenv gtest.sln /build "Release"
  msbuild.exe gtest.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\gtest "%RIME_ROOT%"\thirdparty\include\gtest\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\gtest*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building marisa.
  cd "%RIME_ROOT%"\thirdparty\src\marisa-trie\vs2013
  msbuild.exe vs2013.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\lib\marisa "%RIME_ROOT%"\thirdparty\include\marisa\
  xcopy /Y ..\lib\marisa.h "%RIME_ROOT%"\thirdparty\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libmarisa.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\marisa-*.exe "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo skipped building opencc.

  cd "%RIME_ROOT%"\thirdparty\src\opencc-windows
  call generate_vc_lib_file.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR

  cd "%RIME_ROOT%"\thirdparty\include
  if not exist opencc mkdir opencc
  cd opencc
  rem if not exist opencc.h %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.h
  rem if not exist opencc_types.h %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc_types.h
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.h .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc_types.h .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\lib
  rem if not exist opencc.lib %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/vc10/opencc.lib
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.lib .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\bin
  rem if not exist opencc.dll %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.dll
  rem if not exist opencc.exe %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.exe
  rem if not exist opencc_dict.exe %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc_dict.exe
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.dll .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.exe .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc_dict.exe .
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

rem TODO: select a cmake generator
rem set CMAKE_GENERATOR="MinGW Makefiles"
rem set CMAKE_GENERATOR="Eclipse CDT4 - MinGW Makefiles"
rem set CMAKE_GENERATOR="Visual Studio 9 2008"
set CMAKE_GENERATOR="Visual Studio 12"

set BUILD_DIR=%RIME_ROOT%\%build%
if not exist %BUILD_DIR% mkdir %BUILD_DIR%

set RIME_CMAKE_FLAGS=-DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=%build_shared% -DBUILD_TEST=%build_test% -DENABLE_LOGGING=%enable_logging% -DBOOST_USE_CXX11=ON

cd %BUILD_DIR%
echo cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
call cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
if exist msbuild.log del msbuild.log
msbuild.exe rime.sln /p:Configuration=Release /fl
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo ready.
echo.
goto EXIT

:ERROR
echo.
echo error building la rime.
echo.

:EXIT
set PATH=%OLD_PATH%
cd %RIME_ROOT%
rem pause

@echo off
rem rime build script for msvc toolchain.
rem
rem 2014-12-30  Chen Gong <chen.sst@gmail.com>

set BACK=%CD%

if exist env.bat call env.bat

set OLD_PATH=%PATH%
if defined DEV_PATH set PATH=%OLD_PATH%;%DEV_PATH%
path
echo.

if not defined RIME_ROOT set RIME_ROOT=%CD%
echo RIME_ROOT=%RIME_ROOT%
echo.

echo BOOST_ROOT=%BOOST_ROOT%
echo.

set build=vcbuild
set build_boost=0
set build_thirdparty=0
set build_librime=0
set build_shared=ON
set build_test=OFF
set enable_logging=ON

if "%1" == "" set build_librime=1

:parse_cmdline_options
if "%1" == "" goto end_parsing_cmdline_options
if "%1" == "boost" set build_boost=1
if "%1" == "thirdparty" set build_thirdparty=1
if "%1" == "librime" set build_librime=1
if "%1" == "static" (
  set build=vcbuild-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=vcbuild
  set build_librime=1
  set build_shared=ON
)
if "%1" == "test" (
  set build_librime=1
  set build_test=ON
)
if "%1" == "nologging" (
  set build_librime=1
  set enable_logging=OFF
)
shift
goto parse_cmdline_options
:end_parsing_cmdline_options

rem set CURL=%RIME_ROOT%\thirdparty\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all

if %build_boost% == 1 (
  cd %BOOST_ROOT%
  if not exist bjam.exe call bootstrap.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd "%RIME_ROOT%"\thirdparty\src\glog
  msbuild.exe google-glog-vc12.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y src\windows\glog "%RIME_ROOT%"\thirdparty\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building leveldb.
  cd "%RIME_ROOT%"\thirdparty\src\
  echo "checking out 'windows' branch from lotem/leveldb"
  git clone -b windows git@github.com:lotem/leveldb.git leveldb-windows
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd leveldb-windows
  echo BOOST_ROOT=%BOOST_ROOT%
  msbuild.exe leveldb.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y include\leveldb "%RIME_ROOT%"\thirdparty\include\leveldb\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\leveldb.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd "%RIME_ROOT%"\thirdparty\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  msbuild.exe YAML_CPP.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\yaml-cpp "%RIME_ROOT%"\thirdparty\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building gtest.
  cd "%RIME_ROOT%"\thirdparty\src\gtest
  if not exist build mkdir build
  cd build
  cmake ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  msbuild.exe gtest.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\gtest "%RIME_ROOT%"\thirdparty\include\gtest\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\gtest*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building marisa.
  cd "%RIME_ROOT%"\thirdparty\src\marisa-trie\vs2013
  msbuild.exe vs2013.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\lib\marisa "%RIME_ROOT%"\thirdparty\include\marisa\
  xcopy /Y ..\lib\marisa.h "%RIME_ROOT%"\thirdparty\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libmarisa.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\marisa-*.exe "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building opencc.
  cd "%RIME_ROOT%"\thirdparty\src\opencc
  if not exist build mkdir build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX=""
  echo patching src\libopencc.vcxproj for static linking runtime.
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\libopencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\opencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\opencc_dict.vcxproj
  msbuild.exe opencc.sln /t:libopencc;opencc;opencc_dict /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  cd "%RIME_ROOT%"\thirdparty\include
  if not exist opencc mkdir opencc
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc\src\*.h* opencc\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\lib
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc\build\src\Release\opencc.lib .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\bin
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc\build\src\Release\opencc.dll .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc\build\src\Release\opencc.exe .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc\build\src\Release\opencc_dict.exe .
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

set CMAKE_GENERATOR="Visual Studio 12"

set BUILD_DIR=%RIME_ROOT%\%build%
if not exist %BUILD_DIR% mkdir %BUILD_DIR%

set RIME_CMAKE_FLAGS=-DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=%build_shared% -DBUILD_TEST=%build_test% -DENABLE_LOGGING=%enable_logging% -DBOOST_USE_CXX11=ON

cd %BUILD_DIR%
echo cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
call cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
if exist msbuild.log del msbuild.log
msbuild.exe rime.sln /p:Configuration=Release /fl
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo ready.
echo.
goto EXIT

:ERROR
echo.
echo error building la rime.
echo.

:EXIT
set PATH=%OLD_PATH%
cd %RIME_ROOT%
rem pause

update build script for thirdparty libs on Windows.


mkdir C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload

call git clone git://github.com/tpope/vim-surround C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone git://github.com/tpope/vim-commentary.git C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/easymotion/vim-easymotion C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/kien/rainbow_parentheses.vim C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/itchyny/calendar.vim C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/itchyny/lightline.vim C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/Yggdroot/indentLine C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\
call git clone https://github.com/Raimondi/delimitMate.git C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\

:: C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\

MD "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload"
call git clone git://github.com/tpope/pathogen.git "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\autoload\"

call git clone git://github.com/tpope/vim-surround "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\vim-surround"
call git clone git://github.com/tpope/vim-commentary.git "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\vim-commentary"
call git clone https://github.com/easymotion/vim-easymotion "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\vim-easymotion"
call git clone https://github.com/kien/rainbow_parentheses.vim "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\rainbow_parentheses"
call git clone https://github.com/itchyny/calendar.vim "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\calendar"
call git clone https://github.com/itchyny/lightline.vim "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\lightline"
call git clone https://github.com/Yggdroot/indentLine "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\indentLine"
call git clone https://github.com/Raimondi/delimitMate.git "C:\Users\Nathan Mador-House\Documents\gVimPortable\Data\settings\vimfiles\bundle\delimitMate"

Fix syntax and add pathogen for windows vim setup script.


mkdir build
cd build

cmake -G "MinGW Makefiles" ^
      -D CMAKE_BUILD_TYPE:STRING=Release ^
      -D CMAKE_PREFIX_PATH:FILEPATH=%LIBRARY_PREFIX% ^
      -D CMAKE_INSTALL_PREFIX:FILEPATH=%LIBRARY_PREFIX% ^
      -D CMAKE_SH="CMAKE_SH-NOTFOUND" ^
      ..

mingw32-make
mingw32-make install

rem create the libxfoil.lib which is needed for linking!!
rem copied from lapack-feedstock
for xfoil in (xfoil) do (
dumpbin /exports "%LIBRARY_PREFIX%/lib/libxfoil.dll" > exportsxfoil.txt
echo LIBRARY libxfoil.dll > xfoil.def
echo EXPORTS >> xfoil.def
for /f "skip=19 tokens=4" %%A in (exportsxfoil.txt) do echo %%A >> xfoil.def
lib /def:xfoil.def /out:xfoil.lib /machine:x64
copy xfoil.lib "%LIBRARY_PREFIX%/lib/xfoil.lib"

cd ..

%PYTHON% setup.py build_ext
%PYTHON% setup.py install

mkdir build
cd build

cmake -G "MinGW Makefiles" ^
      -D CMAKE_BUILD_TYPE:STRING=Release ^
      -D CMAKE_PREFIX_PATH:FILEPATH=%LIBRARY_PREFIX% ^
      -D CMAKE_INSTALL_PREFIX:FILEPATH=%LIBRARY_PREFIX% ^
      -D CMAKE_SH="CMAKE_SH-NOTFOUND" ^
      ..

mingw32-make
mingw32-make install

rem create the libxfoil.lib which is needed for linking!!
rem copied from lapack-feedstock
dumpbin /exports "%LIBRARY_PREFIX%/lib/libxfoil.dll" > exportsxfoil.txt
echo LIBRARY libxfoil.dll > xfoil.def
echo EXPORTS >> xfoil.def
for /f "skip=19 tokens=4" %%A in (exportsxfoil.txt) do echo %%A >> xfoil.def
lib /def:xfoil.def /out:xfoil.lib /machine:x64
copy xfoil.lib "%LIBRARY_PREFIX%/lib/xfoil.lib"

cd ..

%PYTHON% setup.py build_ext
%PYTHON% setup.py install

Update bld.bat

Update bld.bat


"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" ..\Source\Examples\DocumentationExamples\ExampleGenerator\ExampleGenerator.sln /p:Configuration=Release
..\Source\Examples\DocumentationExamples\ExampleGenerator\bin\Release\ExampleGenerator.exe ..\Documentation\Images\Series

..\Tools\Lynx\WikiT.exe /format=html /template=..\Documentation\Help_Template.html /localLinks={0}.html /version=2013.1.1 /input=..\Documentation\*.wiki /output=..\Output\Documentation > GenerateDocumentation.log
..\Tools\Lynx\WikiT.exe /format=html /template=..\Documentation\UserGuide_Template.html /version=2013.1.1 /localLinks={0}.html /input=..\Documentation\UserGuide.mwiki /output=..\Output\Documentation  > GenerateDocumentation_UserGuide.log

mkdir ..\Output\Documentation\Images
copy ..\Documentation\*.css ..\Output\Documentation
copy ..\Documentation\OxyPlot.hhp ..\Output\Documentation
xcopy ..\Documentation\Images\*.* ..\Output\Documentation\Images /S /Y

..\Tools\Lynx\HhcGen.exe /input=..\Documentation\OxyPlot.hhcgen /output=..\Output\Documentation\OxyPlot.hhc > GenerateDocumentation_HelpContent.log

..\Tools\HtmlHelp\hhc.exe ..\Output\Documentation\OxyPlot.hhp > GenerateDocumentation_HelpCompiler.log
del ..\Output\Documentation\*.hh?

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" ..\Source\Examples\DocumentationExamples\ExampleGenerator\ExampleGenerator.sln /p:Configuration=Release
mkdir ..\Documentation\Images\Series
..\Source\Examples\DocumentationExamples\ExampleGenerator\bin\Release\ExampleGenerator.exe ..\Documentation\Images\Series

..\Tools\Lynx\WikiT.exe /format=html /template=..\Documentation\Help_Template.html /localLinks={0}.html /version=2013.1.1 /input=..\Documentation\*.wiki /output=..\Output\Documentation > GenerateDocumentation.log
..\Tools\Lynx\WikiT.exe /format=html /template=..\Documentation\UserGuide_Template.html /version=2013.1.1 /localLinks={0}.html /input=..\Documentation\UserGuide.mwiki /output=..\Output\Documentation  > GenerateDocumentation_UserGuide.log

mkdir ..\Output\Documentation\Images
copy ..\Documentation\*.css ..\Output\Documentation
copy ..\Documentation\OxyPlot.hhp ..\Output\Documentation
xcopy ..\Documentation\Images\*.* ..\Output\Documentation\Images /S /Y

..\Tools\Lynx\HhcGen.exe /input=..\Documentation\OxyPlot.hhcgen /output=..\Output\Documentation\OxyPlot.hhc > GenerateDocumentation_HelpContent.log

..\Tools\HtmlHelp\hhc.exe ..\Output\Documentation\OxyPlot.hhp > GenerateDocumentation_HelpCompiler.log
del ..\Output\Documentation\*.hh?

Build: create output directory before running example generator