Make variants of build all in one run

This commit is contained in:
Dan Hawkins 2017-12-19 16:16:09 +00:00
commit c21c6348a4

View file

@ -1,38 +1,38 @@
// Build and export files
def doBuild(apps) {
for (appInfo in apps ) {
env.build = appInfo[0]
env.project = appInfo[1]
env.variants = appInfo[2]
env.exportpath = appInfo[3]
if (build)
{
build = appInfo[0]
project = appInfo[1]
variants = appInfo[2]
exportpath = appInfo[3]
if (build) {
for (build_variant in variants) {
retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing)
if (isUnix()) {
sh "${BUILD_COMMAND} -build ${project}/${build_variant}"
}
else {
bat "%BUILD_COMMAND% -build ${project}/${build_variant}"
}
}
echo "Export path at: ${exportpath}"
script {
env.destFolder = "${WORKSPACE}/export/${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}'
sh "${BUILD_COMMAND} -build ${project}/${build_variant}"
}
else {
bat 'copy \"%srcFileExpanded%\" %destFolder%'
bat "%BUILD_COMMAND% -build ${project}/${build_variant}"
}
}
}
echo "Export path at: ${exportpath}"
script {
env.destFolder = "${WORKSPACE}/export/${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%'
}
}
}
}
}
}
}