Do a dependency check on each binary produced

This commit is contained in:
Dan Hawkins 2019-02-28 00:01:14 +00:00
commit c7d58a0e48

View file

@ -28,22 +28,50 @@ def doKillLeftovers() {
}
}
def doCheck(checkpathlist, build_variant = "") {
def result = 0
for (checkpath in checkpathlist) {
echo "Checking file at: ${checkpath}"
script {
echo "Build variant is ${build_variant}"
if (build_variant) {
def srcFile = "${WORKSPACE}/${checkpath}"
def srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}")
result = sh( script: """
// Print out dependencies of the built file
readelf -d "${srcFileExpanded}" | grep NEEDED
if [ \$? -ne 0 ]; then exit 1; fi
""",
returnStatus: true
)
if (result != 0) {
return result
}
}
}
}
return result
}
def doExport(exportfolder, exportpathlist, project = "", build_variant = "") {
def result = 0
def destFolder = ""
def srcFile = ""
def srcFileExpanded = ""
for (exportpath in exportpathlist) {
echo "Export path at: ${exportpath}"
script {
echo "Build variant is ${build_variant}"
if (build_variant) {
echo "Build variant is ${build_variant}"
env.destFolder = "${exportfolder}/${build_variant}"
env.srcFile = "${WORKSPACE}/${exportpath}"
env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}")
destFolder = "${exportfolder}/${build_variant}"
srcFile = "${WORKSPACE}/${exportpath}"
srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}")
}
else {
echo "No build variant"
env.destFolder = "${exportfolder}/${project}"
env.srcFileExpanded = "${WORKSPACE}/${exportpath}"
destFolder = "${exportfolder}/${project}"
srcFileExpanded = "${WORKSPACE}/${exportpath}"
}
}
dir (env.destFolder) {
@ -162,6 +190,10 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou
"""
}
}
result = doCheck(exportpathlist, build_variant)
if (result != 0) {
error "Failed to check files...."
}
result = doExport(exportfolder, exportpathlist, "", build_variant)
if (result != 0) {
error "Failed to copy...."