HMBXR5601-143 - Handle projects that aren't built but do provide binaries

This commit is contained in:
Dan Hawkins 2018-06-12 15:22:13 +01:00
commit 423e88d322

View file

@ -1,7 +1,34 @@
def doExport(exportpathlist, build_variant = "") {
for (exportpath in exportpathlist) {
echo "Export path at: ${exportpath}"
script {
if (build_variant) {
env.destFolder = "${exportfolder}/${build_variant}/${project}"
env.srcFile = "${WORKSPACE}/${exportpath}"
env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}")
}
else {
env.destFolder = "${exportfolder}/${project}"
env.srcFileExpanded = "${WORKSPACE}/${exportpath}"
}
}
dir (env.destFolder) {
echo "Copy ${srcFileExpanded} to ${destFolder}"
if (isUnix()) {
sh 'cp \"${srcFileExpanded}\" ${destFolder}'
}
else {
bat 'copy \"%srcFileExpanded%\" %destFolder%'
}
}
}
}
// Build and export files
def doBuild(apps, exportfolder = "${WORKSPACE}/bin") {
for (appInfo in apps ) {
(build, project, variants, exportpath) = appInfo
(build, project, variants, exportpathlist) = appInfo
if (build) {
for (build_variant in variants) {
retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing)
@ -15,27 +42,12 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") {
"""
}
}
if (exportpath) {
echo "Export path at: ${exportpath}"
script {
env.destFolder = "${exportfolder}/${build_variant}/${project}"
env.srcFile = "${WORKSPACE}/${exportpath}"
env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}")
}
dir (env.destFolder) {
if (exportpath) {
echo "Copy ${srcFileExpanded} to ${destFolder}"
if (isUnix()) {
sh 'cp \"${srcFileExpanded}\" ${destFolder}'
}
else {
bat 'copy \"%srcFileExpanded%\" %destFolder%'
}
}
}
}
doExport(exportpathlist, build_variant)
}
}
else {
doExport(exportpathlist, build_variant)
}
}
}