@echo off
for /f "tokens=1 delims=" %%r in ('cd') do set CD=%%r

cd ..\..\..\libs
call make_libs_android_all.bat
cd ..\SHS\src\widgets
call make_lib_android_all.bat

cd %CD%
rem for /F "tokens=1 delims=" %%r in ('cscript //Nologo .\path_convert.vbs "%ANDROID_NDK_HOME%"') do set ANDROID_NDK_ROOT=%%r
set ANDROID_NDK_ROOT=%ANDROID_NDK_HOME%
set ANDROID_NDK_HOST=windows-x86_64
rem set LLVM_BIN=%ANDROID_NDK_HOME%\toolchains\llvm\prebuilt\windows-x86_64\bin
set INSTALL_ROOT=%CD%\..\pult_remote_android
for %%a in (x86,x86_64,arm,arm64) do (
	cd %CD%
	call .\make_app_android.bat %%a
)
cd %CD%
rem rmdir /q /s %INSTALL_ROOT%\res
rem rmdir /q /s %INSTALL_ROOT%\src
xcopy /y /e .\android-src\* %INSTALL_ROOT%\
cd %INSTALL_ROOT%
set JAVA_HOME="c:\Program Files (x86)\Java\jdk1.8.0_181"
del /F /Q /S build\outputs
call gradlew assembleDebug
call gradlew bundleRelease
cd %CD%
call .\android_install.bat apk\debug "_all" "%CD%\..\..\bin\packages\Pult_remote\"
call .\android_install.bat bundle\release "_market" "%CD%\..\..\"
pause
