[Android] Add Setup.cmd

This commit is contained in:
zilmar 2021-07-27 20:29:04 +09:30
parent 93bea02106
commit eea736fc71
3 changed files with 38 additions and 65 deletions

36
Android/Script/Setup.cmd Normal file
View File

@ -0,0 +1,36 @@
@ECHO OFF
SETLOCAL
set origdir=%cd%
cd /d %~dp0..\..\
set base_dir=%cd%
cd /d %origdir%
echo buildAssets
call "%base_dir%\Android\Script\buildAssets.cmd"
set Result=%ERRORLEVEL%
echo Done - ERRORLEVEL: %Result%
IF %Result% NEQ 0 goto :EndErr
echo UpdateVersionNumber
call "%base_dir%\Android\Script\UpdateVersionNumber.cmd"
set Result=%ERRORLEVEL%
echo Done - ERRORLEVEL: %Result%
IF %Result% NEQ 0 goto :EndErr
echo copySource
call "%base_dir%\Android\Script\copySource.cmd"
set Result=%ERRORLEVEL%
echo Done - ERRORLEVEL: %Result%
IF %Result% NEQ 0 goto :EndErr
goto :end
:EndErr
ENDLOCAL
echo Build failed
exit /B 1
:End
ENDLOCAL
exit /B 0

View File

@ -1,63 +0,0 @@
@ECHO OFF
SETLOCAL
set origdir=%cd%
cd /d %~dp0..\..\
set base_dir=%cd%
cd /d %origdir%
set VersionName=
if not "%1" == "" set VersionName= %1
set NDK-BUILDER=""
if exist "C:\Android\android-ndk-r10d\ndk-build.cmd" ( set NDK-BUILDER="C:\Android\android-ndk-r10d\ndk-build.cmd" )
if exist "C:\Android\android-ndk-r11c\ndk-build.cmd" ( set NDK-BUILDER="C:\Android\android-ndk-r11c\ndk-build.cmd" )
if exist "C:\Android\android-ndk-r13b\ndk-build.cmd" ( set NDK-BUILDER="C:\Android\android-ndk-r13b\ndk-build.cmd" )
if %NDK-BUILDER% == "" (
echo can not find android NDK
goto :EndErr
)
set ANDROID_SDK=""
if exist "C:\Android\android-sdk" ( set ANDROID_SDK="C:\Android\android-sdk" )
if %ANDROID_SDK% == "" (
echo can not find android SDK
goto :EndErr
)
call "%base_dir%\Android\Script\buildAssets.cmd"
IF %ERRORLEVEL% NEQ 0 goto :EndErr
call "%base_dir%\Android\Script\copySource.cmd"
IF %ERRORLEVEL% NEQ 0 goto :EndErr
cd /d %base_dir%\Android
call %NDK-BUILDER% clean
IF %ERRORLEVEL% NEQ 0 goto :EndErr
call %NDK-BUILDER%
IF %ERRORLEVEL% NEQ 0 goto :EndErr
call ant clean release -Dsdk.dir=%ANDROID_SDK%
IF %ERRORLEVEL% NEQ 0 goto :EndErr
cd /d %origdir%
:: Make sure the sign environment variables exist
IF NOT DEFINED project64_cert_keystore ( exit /B 0 )
IF NOT DEFINED project64_cert_password ( exit /B 0 )
:: Sign the APK
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -tsa http://timestamp.digicert.com -keystore "%project64_cert_keystore%" -storepass %project64_cert_password% -keypass %project64_cert_password% "%base_dir%\Android\bin\Project64-release-unsigned.apk" project64
:: Align the APK
zipalign -v 4 "%base_dir%\Android\bin\Project64-release-unsigned.apk" "%base_dir%\Package\Project64%VersionName%.apk"
echo Build ok
goto :end
:EndErr
ENDLOCAL
echo Build failed
exit /B 1
:End
ENDLOCAL
exit /B 0

View File

@ -29,8 +29,8 @@ IF NOT EXIST "%base_dir%/Android/app/src/main/assets/project64_data/Config/Cheat
xcopy "%base_dir%/Config/Cheats" "%base_dir%/Android/app/src/main/assets/project64_data/Config/Cheats/" /D /I /F /Y /E xcopy "%base_dir%/Config/Cheats" "%base_dir%/Android/app/src/main/assets/project64_data/Config/Cheats/" /D /I /F /Y /E
IF %ERRORLEVEL% NEQ 0 (exit /B 1) IF %ERRORLEVEL% NEQ 0 (exit /B 1)
IF NOT EXIST "%base_dir%/Android/app/src/main/assets/project64_data/Config/Enhancement/" mkdir "%base_dir%/Android/app/src/main/assets/project64_data/Config/Enhancement/" IF NOT EXIST "%base_dir%/Android/app/src/main/assets/project64_data/Config/Enhancements/" mkdir "%base_dir%/Android/app/src/main/assets/project64_data/Config/Enhancements/"
xcopy "%base_dir%/Config/Enhancement" "%base_dir%/Android/app/src/main/assets/project64_data/Config/Enhancement/" /D /I /F /Y /E xcopy "%base_dir%/Config/Enhancements" "%base_dir%/Android/app/src/main/assets/project64_data/Config/Enhancements/" /D /I /F /Y /E
IF %ERRORLEVEL% NEQ 0 (exit /B 1) IF %ERRORLEVEL% NEQ 0 (exit /B 1)
goto :end goto :end