Repository navigation
Expand file tree
/
Copy pathbuild.ps1
More file actions
63 lines (50 loc) · 1.43 KB
/
Copy pathbuild.ps1
File metadata and controls
63 lines (50 loc) · 1.43 KB
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
function Write-Line($Object) {
$width = $Host.UI.RawUI.WindowSize.Width
Write-Host "$Object".PadRight($width) @args
}
function Write-Failed($Object) {
Write-Line $Object -BackgroundColor Red -ForegroundColor White
}
function Write-Successful($Object) {
Write-Line $Object -BackgroundColor Green -ForegroundColor Black
}
$arguments = $args
function build {
$gradleTasks = @()
$gradleTasks += ,@(
# build apks
,"build"
# run unit tests
,"test"
)
if ($arguments[0] -ne 'quick') {
$gradleTasks += ,@(
# run android tests
,":common:connectedAndroidTest"
,":mipush_hook:connectedAndroidTest"
#,":push:connectedVc105DebugAndroidTest",
,":push:connectedNormalDebugAndroidTest"
)
}
foreach ($task in $gradleTasks) {
$task = @() + $task
Write-Host
Write-Host
Write-Host "Run Tasks: $((@('') + $task) -join "`n ")" -ForegroundColor Green
./gradlew @task
if ($LASTEXITCODE -ne 0) {
Write-Failed "BUILD FAILED"
return
}
}
Write-Host "Ensure dex files remain uncompressed in prebuilt variant" -ForegroundColor Green
$compressed = & ./build_scripts/check_dex_compressed.ps1 prebuilt
if ($compressed) {
Write-Failed "Found compressed dex files in prebuilt variant"
return
}
Write-Successful "BUILD SUCCESSFUL"
}
$elapsed = Measure-Command { build | Out-Default }
Write-Host -ForegroundColor Cyan ("{0} days {1:d2}:{2:d2}:{3:d2}:{4:d3}" -f
$elapsed.Days, $elapsed.Hours, $elapsed.Minutes, $elapsed.Seconds, $elapsed.Milliseconds)