Move code to common position

This commit is contained in:
Dan Hawkins 2017-12-07 13:33:27 +00:00
commit 584a016c49

View file

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