Skip to content

Commit

Permalink
fix(build): Extended the prerequisite check to check for "poetry" whe…
Browse files Browse the repository at this point in the history
…n building with python.
  • Loading branch information
chrisdutz committed Apr 18, 2022
1 parent 6014213 commit c1ff8b9
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions src/main/script/prerequisiteCheck.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,37 @@ def checkPython() {
}
}

def checkPoetry(boolean isWin) {
print "Detecting Poetry version: "
try {
def process
if (isWin) {
process = ("poetry.bat --version").execute()
} else {
process = ("poetry --version").execute()
}

def stdOut = new StringBuilder()
def stdErr = new StringBuilder()
process.consumeProcessOutput(stdOut, stdErr)
process.waitForOrKill(500)
Matcher matcher = extractVersion(stdOut + stdErr)
if (matcher.size() > 0) {
def curVersion = matcher[0][1]
def result = checkVersionAtLeast(curVersion, "1.0.0")
if (!result) {
allConditionsMet = false
}
} else {
println "missing (Please install at least version 3.6.0)"
allConditionsMet = false
}
} catch (Exception e) {
println "missing"
allConditionsMet = false
}
}

def checkSetupTools() {
print "Detecting setuptools: "
try {
Expand Down Expand Up @@ -513,7 +544,7 @@ println ""

// - Windows:
// - Check the length of the path of the base dir as we're having issues with the length of paths being too long.
if (os == "win") {
if (os == "windows") {
File pomFile = project.model.pomFile
if (pomFile.absolutePath.length() > 100) {
println "On Windows we encounter problems with maximum path lengths. " +
Expand Down Expand Up @@ -562,11 +593,12 @@ if (cppEnabled) {

if (pythonEnabled) {
checkPython()
checkPoetry(os == "windows")
checkSetupTools()
}

// Boost needs the visual-studio `cl` compiler to compile the boostrap.
if (boostEnabled && (os == "win")) {
if (boostEnabled && (os == "windows")) {
// TODO: checkVisualStudio()
}

Expand All @@ -588,7 +620,7 @@ if (apacheReleaseEnabled) {
// TODO: Check libpcap is installed
}

if (cppEnabled && (os == "win")) {
if (cppEnabled && (os == "windows")) {
print "Unfortunately currently we don't support building the 'with-cpp' profile on windows. This will definitely change in the future."
allConditionsMet = false
}
Expand Down

0 comments on commit c1ff8b9

Please sign in to comment.