-
Notifications
You must be signed in to change notification settings - Fork 134
/
build.ps1
45 lines (34 loc) · 1.02 KB
/
build.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
param (
[string]$Source, # Rider SDK Packages folder, optional
[string]$BuildCounter = 9999, # Sets Rider plugin version to version from Packaging.Props with the last zero replaced by $BuildCounter
[string]$Configuration = "Debug", # Release / Debug
[switch]$RunTests,
[switch]$Verbose
)
Set-StrictMode -Version Latest
[System.IO.Directory]::SetCurrentDirectory($PSScriptRoot)
$gradleArgs = @()
($MyInvocation.MyCommand.Parameters).Keys | ForEach-Object {
if ($_ -eq "Verbose") {
return
}
$val = (Get-Variable -Name $_ -EA SilentlyContinue).Value
if($val.ToString().length -gt 0) {
$gradleArgs += "-P$($_)=$($val)"
}
}
if ($Verbose) {
$gradleArgs += "--info"
$gradleArgs += "--stacktrace"
}
Write-Host "gradleArgs=$gradleArgs"
Push-Location -Path rider
Try {
.\gradlew.bat "buildPlugin" $gradleArgs
$code = $LastExitCode
Write-Host "Gradle finished: $code"
if ($code -ne 0) { throw "Exec: Unable to build plugin: exit code $LastExitCode" }
}
Finally {
Pop-Location
}