Index: build/jenkins/win_autobuild.Jenkinsfile =================================================================== --- /dev/null +++ build/jenkins/win_autobuild.Jenkinsfile @@ -0,0 +1,95 @@ +def AtlasOption = "" +def GlooxOption = "" +def output = "" +def jobs = "2" +pipeline { + agent { label 'WindowsSlave' } + stages { + stage("Checkout") { + options { + retry(3) + } + steps { + script { + try { + svn "https://svn.wildfiregames.com/public/ps/trunk" + } catch(e) { + bat "svn cleanup" + sleep 300 + throw e + } + } + bat "svn cleanup" + } + } + stage('Setup workspace') { + steps { + bat "del binaries\\system\\pyrogenesis.pdb binaries\\system\\pyrogenesis.exe" + script { + if (env.atlas == 'true') { + echo "atlas is enabled" + AtlasOption = "--atlas" + bat 'robocopy /MIR C:\\wxwidgets3.0.4\\lib libraries\\win32\\wxwidgets\\lib & IF %ERRORLEVEL% LEQ 1 exit 0' + bat 'robocopy /MIR C:\\wxwidgets3.0.4\\include libraries\\win32\\wxwidgets\\include & IF %ERRORLEVEL% LEQ 1 exit 0' + bat "del binaries\\system\\AtlasUI.dll" + } + if (env.gloox == 'true') { + echo "gloox is enabled" + GlooxOption = "--build-shared-glooxwrapper" + bat "del binaries\\system\\glooxwrapper.pdb binaries\\system\\glooxwrapper.lib binaries\\system\\glooxwrapper.dll" + bat "del binaries\\system\\glooxwrapper_dbg.pdb binaries\\system\\glooxwrapper_dbg.lib binaries\\system\\glooxwrapper_dbg.dll" + } + if (env.collada == 'true') { + echo "collada is enabled" + bat "del binaries\\system\\Collada.dll" + } + output = bat(returnStdout: true, script: 'svnversion source -n').trim() + output = output.readLines().drop(1).join("") + } + bat "cd build\\workspaces && update-workspaces.bat ${AtlasOption} ${GlooxOption} --large-address-aware --jenkins-tests" + bat "echo L\"${output}\" > build\\svn_revision\\svn_revision.txt" + } + } + stage ('Build') { + steps { + bat("cd build\\workspaces\\vc2015 && MSBuild.exe pyrogenesis.sln /m:${jobs} /p:PlatformToolset=v140_xp /t:pyrogenesis /t:test /p:Configuration=Release -clp:Warningsonly -clp:ErrorsOnly") + } + } + stage ('Build glooxwrapper debug') { + when { environment name: 'gloox', value: 'true'} + steps { + bat("cd build\\workspaces\\vc2015 && MSBuild.exe pyrogenesis.sln /m:${jobs} /p:PlatformToolset=v140_xp /t:glooxwrapper /p:Configuration=Debug -clp:Warningsonly -clp:ErrorsOnly") + } + } + stage ('Tests') { + steps { + bat 'binaries\\system\\test.exe' + } + } + stage ('Commit') { + steps { + bat "svn changelist --remove --recursive --cl commit ." + script { + if (env.pyrogenesis == 'true') { + bat "svn changelist commit binaries\\system\\pyrogenesis.pdb binaries\\system\\pyrogenesis.exe" + } + if (env.atlas == 'true') { + bat "svn changelist commit binaries\\system\\AtlasUI.dll" + } + if (env.collada == 'true') { + bat "svn changelist commit binaries\\system\\Collada.dll" + } + if (env.gloox == 'true') { + bat "svn changelist commit binaries\\system\\glooxwrapper.dll binaries\\system\\glooxwrapper.lib binaries\\system\\glooxwrapper.pdb binaries\\system\\glooxwrapper_dbg.dll binaries\\system\\glooxwrapper_dbg.lib binaries\\system\\glooxwrapper_dbg.pdb" + } + } + bat 'svn ci --changelist commit --non-interactive -m "[Windows] Automated build."' + } + } + } + post { + always { + bat "svn revert -R ." + } + } +}