-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuildAll.ps1
77 lines (71 loc) · 1.37 KB
/
buildAll.ps1
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
param (
[switch]$a = $false,
[switch]$b = $false,
[switch]$c = $false
)
function Write-Success {
param(
[string]$m = ""
)
Write-Host "[OK] $m" -ForegroundColor Green
}
function Write-ErrorMessage {
Write-Host "[Error] There's been an error. Check the output for more information." -ForegroundColor Red
}
npm i
npm run build
npx cap sync android
cd android
cd ..
if (($a -eq $true) -or ($b -eq $true) -or ($c -eq $true)) {
try {
Write-Host "Cleaning gradle workspace"
cd android
.\gradlew.bat clean
}
catch {
Write-Error "[Error] $_"
return
}
if ($? -eq $true) {
Write-Success "Gradle workspace cleaned"
}
else {
Write-ErrorMessage
}
}
if ($a -eq $true) {
try{
Write-Host "Assemblying APK"
.\gradlew.bat assembleRelease
}
catch {
Write-Error "[Error] $_"
return
}
if ($? -eq $true) {
Write-Success "APK Assembled"
}
else {
Write-ErrorMessage
}
}
if ($b -eq $true) {
try {
Write-Host "Bundling release"
.\gradlew.bat bundleRelease
}
catch {
Write-Error "[Error] $_"
return
}
if ($? -eq $true) {
Write-Success "Release bundled"
}
else {
Write-ErrorMessage
}
}
if (($a -eq $true) -or ($b -eq $true)) {
cd ..
}