mirror of
https://github.com/izzy2lost/Super3.git
synced 2026-07-05 15:18:38 -07:00
added build aab .bat
This commit is contained in:
@@ -51,6 +51,7 @@ Makefile
|
||||
android/.gradle/
|
||||
android/.idea/
|
||||
android/local.properties
|
||||
android/key.properties
|
||||
android/*.iml
|
||||
android/**/build/
|
||||
android/**/.cxx/
|
||||
|
||||
@@ -1,8 +1,23 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
}
|
||||
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
val keystoreProperties = Properties()
|
||||
val hasKeystoreProperties = keystorePropertiesFile.exists()
|
||||
|
||||
if (hasKeystoreProperties) {
|
||||
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
|
||||
}
|
||||
|
||||
val hasReleaseKeystore = hasKeystoreProperties &&
|
||||
listOf("storeFile", "storePassword", "keyAlias", "keyPassword").all {
|
||||
!keystoreProperties.getProperty(it).isNullOrBlank()
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.izzy2lost.super3"
|
||||
compileSdk = 36
|
||||
@@ -28,6 +43,17 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (hasReleaseKeystore) {
|
||||
create("release") {
|
||||
storeFile = file(keystoreProperties.getProperty("storeFile"))
|
||||
storePassword = keystoreProperties.getProperty("storePassword")
|
||||
keyAlias = keystoreProperties.getProperty("keyAlias")
|
||||
keyPassword = keystoreProperties.getProperty("keyPassword")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
@@ -35,6 +61,9 @@ android {
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
if (hasReleaseKeystore) {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set "ROOT=%~dp0"
|
||||
set "ANDROID_DIR=%ROOT%android"
|
||||
set "KEY_PROPS=%ANDROID_DIR%\key.properties"
|
||||
|
||||
if not exist "%KEY_PROPS%" (
|
||||
echo Creating "%KEY_PROPS%" with placeholders...
|
||||
>"%KEY_PROPS%" (
|
||||
echo storeFile=C:/path/to/your-release-key.jks
|
||||
echo storePassword=REPLACE_ME
|
||||
echo keyAlias=REPLACE_ME
|
||||
echo keyPassword=REPLACE_ME
|
||||
)
|
||||
echo.
|
||||
echo Edit %KEY_PROPS% with your real values, then rerun this script.
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
findstr /C:"REPLACE_ME" "%KEY_PROPS%" >nul
|
||||
if %errorlevel%==0 (
|
||||
echo.
|
||||
echo Please replace the placeholders in %KEY_PROPS% before building.
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
findstr /C:"C:/path/to/your-release-key.jks" "%KEY_PROPS%" >nul
|
||||
if %errorlevel%==0 (
|
||||
echo.
|
||||
echo Please replace the storeFile placeholder in %KEY_PROPS% before building.
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
pushd "%ANDROID_DIR%" || exit /b 1
|
||||
call gradlew.bat bundleRelease
|
||||
set "EXITCODE=%ERRORLEVEL%"
|
||||
popd
|
||||
|
||||
if not "%EXITCODE%"=="0" (
|
||||
echo.
|
||||
echo Build failed with exit code %EXITCODE%.
|
||||
echo.
|
||||
pause
|
||||
exit /b %EXITCODE%
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Build complete.
|
||||
echo Release AAB:
|
||||
echo %ANDROID_DIR%\app\build\outputs\bundle\release\app-release.aab
|
||||
echo.
|
||||
pause
|
||||
Reference in New Issue
Block a user