Do a dependency check on each binary produced
This commit is contained in:
parent
1f21e0f2b9
commit
c7d58a0e48
1 changed files with 37 additions and 5 deletions
|
|
@ -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...."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue