#!groovy
stage "check out"
node {
deleteDir()
checkout scm
stash includes: "**", name: "source"
}
stage "build"
parallel (
"windows": {
node ("windows && visualstudio") {
deleteDir()
unstash "source"
def workspace = pwd()
dir ("build") {
bat "cmake .. -G \"Visual Studio 14 2015 Win64\" -DCMAKE_INSTALL_PREFIX=${workspace}\\install\\windows"
bat "cmake --build . --target ALL_BUILD --config Release"
}
stash includes: "install/**", name: "windowsBinaries"
}
},
"macos": {
node ("macos && xcode") {
deleteDir()
env.PATH = "/usr/local/bin:${env.PATH}"
unstash "source"
dir("build") {
sh "cmake .. -DCMAKE_INSTALL_PREFIX=../install/macos"
sh "make"
}
stash includes: "install/**", name: "macosBinaries"
}
},
"emscripten": {
node ("emscripten") {
deleteDir()
env.PATH = "/usr/local/bin:${env.PATH}"
unstash "source"
dir ("build") {
sh "cmake .. -DCMAKE_INSTALL_PREFIX=../install/emscripten -DCMAKE_TOOLCHAIN_FILE=~/emsdk_portable/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake"
sh "make"
}
stash includes: "install/**", name: "emscriptenBinaries"
}
}
)
stage "package"
node {
deleteDir()
unstash "macosBinaries"
zip zipFile: "thorcc-external-macos.zip", archive: true, dir: "install/macos"
unstash "emscriptenBinaries"
zip zipFile: "thorcc-external-emscripten.zip", archive: true, dir: "install/emscripten"
unstash "windowsBinaries"
zip zipFile: "thorcc-external-windows.zip", archive: true, dir: "install/windows"
try {
build job: "ThorCC/" + BRANCH_NAME, wait: false
} catch (error) {
echo "Skipped building downstream project because branch " + BRANCH_NAME + " doesn't exist."
}
}