Make variants of build all in one run

This commit is contained in:
Dan Hawkins 2017-12-19 13:24:11 +00:00
commit aeb712f073

View file

@ -1,23 +1,28 @@
// Build and export files
def doBuild(apps) {
for (appInfo in apps ) {
if (appInfo[0])
env.build = appInfo[0]
env.project = appInfo[1]
env.variants = appInfo[2]
env.exportpath = appInfo[3]
if (build)
{
retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing)
for (build_variant in variants) {
retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing)
if (isUnix()) {
sh "${BUILD_COMMAND} -build ${appInfo[1]}/${BUILD_VARIANT}"
sh "${BUILD_COMMAND} -build ${project}/${build_variant}"
}
else {
bat "%BUILD_COMMAND% -build ${appInfo[1]}/${BUILD_VARIANT}"
bat "%BUILD_COMMAND% -build ${project}/${build_variant}"
}
}
echo "Looking at: ${appInfo[2]}"
echo "Export path at: ${exportpath}"
script {
env.destFolder = "${WORKSPACE}/export/${appInfo[1]}"
env.srcFile = "${WORKSPACE}/${appInfo[2]}"
env.destFolder = "${WORKSPACE}/export/${project}"
env.srcFile = "${WORKSPACE}/${exportpath}"
}
dir (env.destFolder) {
if (appInfo[2]) {
if (exportpath) {
echo "Copy ${srcFile} to ${destFolder}"
if (isUnix()) {
sh 'cp \"${srcFile}\" ${destFolder}'