-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathbuild_release.bat
More file actions
26 lines (21 loc) · 985 Bytes
/
build_release.bat
File metadata and controls
26 lines (21 loc) · 985 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
@echo off
rem Step 1: Increment version code in build.gradle
rem echo Incrementing version code in build.gradle...
rem powershell -Command "$file='build.gradle'; (Get-Content $file) | ForEach-Object { if ($_ -match 'project\.ext\.set\(\"versionCode\",\s*(\d+)\)') { $v = [int]$matches[1] + 1; 'project.ext.set(\"versionCode\", ' + $v + ')' } else { $_ } } | Set-Content $file"
rem Step 2: Sync project (trigger configuration phase)
rem echo Syncing project...
rem call gradlew.bat help
rem Step 3: Build and explicitly trigger copy tasks from afterEvaluate
echo Starting build process for Release (AABs, APKs and Second APKs)...
call gradlew.bat clean :mobile:bundleRelease :wear:bundleRelease
if %ERRORLEVEL% EQU 0 (
call gradlew.bat clean :mobile:assembleRelease :wear:assembleRelease :mobile:assembleSecond :wear:assembleSecond
)
if %ERRORLEVEL% EQU 0 (
echo.
echo Build and Copy completed successfully!
) else (
echo.
echo ERROR during build process!
)
pause