-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
34 lines (26 loc) · 743 Bytes
/
Copy pathbuild.bat
File metadata and controls
34 lines (26 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
setlocal
:: Set JAVA_HOME to Android Studio's bundled JDK
set "JAVA_HOME=C:\Program Files\Android\Android Studio\jbr"
:: Default to debug if no argument provided
set BUILD_TYPE=%1
if "%BUILD_TYPE%"=="" set BUILD_TYPE=debug
:: Validate build type
if /i "%BUILD_TYPE%"=="debug" goto :build
if /i "%BUILD_TYPE%"=="release" goto :build
echo Invalid build type: %BUILD_TYPE%
echo Usage: build.bat [debug^|release]
exit /b 1
:build
echo Building %BUILD_TYPE% APK...
echo.
:: Run gradle build
call gradlew.bat assemble%BUILD_TYPE%
if %ERRORLEVEL% neq 0 (
echo.
echo Build failed!
exit /b %ERRORLEVEL%
)
echo.
echo Build successful!
echo APK location: app\build\outputs\apk\%BUILD_TYPE%\NetworkLibraries-%BUILD_TYPE%.apk