From 423e88d3221238b488c2c1b9eeaa6bfe77d4f383 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 15:22:13 +0100 Subject: [PATCH] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 52 +++++++++++++++--------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 30fe4d5..e17f4b9 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -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) + } } }