mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-02 17:29:37 +02:00
GP-6005: The Windows build can now use prerelease versions of Visual
Studio with the new -PvswherePrerelease arg
This commit is contained in:
parent
05a72b569a
commit
6bb33b0025
1 changed files with 19 additions and 3 deletions
|
@ -34,7 +34,7 @@ def configureVisualStudio() {
|
|||
println " -> To manually specify the location of vswhere.exe, add \"-PvswherePath=<vswhere path>\" to the Gradle command line arguments"
|
||||
return
|
||||
}
|
||||
def vswhereProcess = "\"${vswherePath}\" -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute()
|
||||
def vswhereProcess = "\"${vswherePath}\" -products * -sort -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute()
|
||||
def vswhereOutput = vswhereProcess.text.trim()
|
||||
def vswhereExit = vswhereProcess.exitValue()
|
||||
if (vswhereExit != 0) {
|
||||
|
@ -49,11 +49,27 @@ def configureVisualStudio() {
|
|||
return
|
||||
}
|
||||
def vswhereJson = new groovy.json.JsonSlurper().parseText(vswhereOutput);
|
||||
if (vswhereJson.isEmpty()) {
|
||||
def usePrerelease = project.hasProperty("vswherePrerelease")
|
||||
def i = -1
|
||||
println " -> Searching for Visual Studio installations..."
|
||||
vswhereJson.eachWithIndex { item, index ->
|
||||
def isPrerelease = item.get("isPrerelease")
|
||||
def name = item.get("displayName") + (isPrerelease ? " Prerelease" : "")
|
||||
if (i == -1) {
|
||||
if (usePrerelease || !isPrerelease) {
|
||||
i = index
|
||||
}
|
||||
}
|
||||
println " ${index + 1}: ${name}" +
|
||||
(i == index ? " (selected)" : "") +
|
||||
(isPrerelease && !usePrerelease ? " (enable with -PvswherePrerelease)" : "")
|
||||
}
|
||||
if (i == -1) {
|
||||
println " -> Visual Studio not found!"
|
||||
return
|
||||
}
|
||||
def vsInstallDir = vswhereJson[0].installationPath
|
||||
|
||||
def vsInstallDir = vswhereJson[i].installationPath
|
||||
println " -> Installation Directory: ${vsInstallDir}"
|
||||
|
||||
// Use vcvarsall.bat to determine the latest Visual Studio's default SDK and tool versions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue