- Timestamp:
- 12/14/18 12:21:19 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Build.ps1
r16224 r16381 19 19 } 20 20 21 if ($msBuildPath -eq $undefined) { 22 "Could not locate MSBuild, ABORTING ..." 23 } else { 21 Try { 22 If ($msBuildPath -eq $undefined) { 23 "Could not locate MSBuild, ABORTING ..." 24 Return 25 } 26 24 27 $curPath = $MyInvocation.MyCommand.Path 25 28 $curDir = Split-Path $curPath … … 27 30 $slnFiles = Get-ChildItem $curDir -Filter *.sln 28 31 29 "Found the following solutions:" 32 If ($slnFiles.Count -le 0) { 33 "No solutions found, ABORTING ..." 34 Return 35 } 30 36 31 ""37 $slnIndices = @() 32 38 33 $slnFiles | % { $i = 0 } { (" {0}. `"{1}`"" -f ($i + 1), $_.Name); $i++ } 39 If ($slnFiles.Count -eq 1) { 40 "Selecting the only solution found: `"{0}`"" -f $slnFiles[0].Name 41 $slnIndices += 0 42 } Else { 43 "Found the following solutions:" 34 44 35 ""45 "" 36 46 37 $success = $false47 $slnFiles | % { $i = 0 } { (" {0}. `"{1}`"" -f ($i + 1), $_.Name); $i++ } 38 48 39 # query solution to build 40 $slnIndex = -1 41 $slnIndices = @() 42 Do { 43 $input = Read-Host "Which solution(s) to build? {1..$($slnFiles.Count)}" 44 $inputParts = $input -Split " " 49 "" 45 50 46 Foreach ($part in $inputParts) { 47 If ($part -eq "") { Continue } 51 $success = $false 48 52 49 $success = [int]::TryParse($part, [ref]$slnIndex) -and ($slnIndex -gt 0) -and ($slnIndex -le $slnFiles.Count) 53 # query solution to build 54 $slnIndex = -1 55 Do { 56 $input = Read-Host "Which solution(s) to build? (e.g.: 1 2 3) { 1..$($slnFiles.Count) }" 57 $inputParts = $input -Split " " 50 58 51 If ($success) { 52 $slnIndices += $slnIndex - 1 53 } Else { 54 $slnIndices = @() 55 Break 59 Foreach ($part in $inputParts) { 60 If ($part -eq "") { Continue } 61 62 $success = [int]::TryParse($part, [ref]$slnIndex) -and ($slnIndex -gt 0) -and ($slnIndex -le $slnFiles.Count) 63 64 If ($success) { 65 $slnIndices += $slnIndex - 1 66 } Else { 67 $slnIndices = @() 68 Break 69 } 56 70 } 57 } 58 } While (-Not $success) 71 } While (-Not $success) 59 72 60 $slnIndices = $slnIndices | Select-Object -Unique 73 $slnIndices = $slnIndices | Select-Object -Unique 74 } 75 61 76 62 77 # query configuration to build … … 80 95 "" 81 96 82 if ($clean) {97 If ($clean) { 83 98 Foreach ($slnIndex in $slnIndices) { 84 99 $solution = $slnFiles[$slnIndex] … … 107 122 "===== BUILD FINISHED =====" 108 123 } 124 } Finally { 125 "" 126 127 Write-Host -NoNewline "Press any key to continue ... " 128 129 [void][System.Console]::ReadKey($true) 109 130 } 110 111 ""112 113 Write-Host -NoNewline "Press any key to continue ... "114 [void][System.Console]::ReadKey($true)
Note: See TracChangeset
for help on using the changeset viewer.