forked from fei-ke/HMSPush
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.ps1
More file actions
35 lines (25 loc) · 821 Bytes
/
build.ps1
File metadata and controls
35 lines (25 loc) · 821 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
35
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 {
Write-Host
Write-Host
Write-Host "Run Tasks: build" -ForegroundColor Green
./gradlew --build-cache --parallel --daemon build
if ($LASTEXITCODE -ne 0) {
Write-Failed "BUILD FAILED"
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)