在声明性管道语法中,MSBuild的工具较笨拙。这是我必须使用
script块处理的方式:
pipeline { agent { label 'win-slave-node' } stages { stage('Build') { steps { script { def msbuild = tool name: 'MSBuild', type: 'hudson.plugins.msbuild.MsBuildInstallation' bat "${msbuild} SimpleWindowsProject.sln" } } } } }在较旧的脚本管道语法中,可能是这样的:
node('win-slave-node') { def msbuild = tool name: 'MSBuild', type: 'hudson.plugins.msbuild.MsBuildInstallation' stage('Checkout') { checkout scm } stage('Build') { bat "${msbuild} SimpleWindowsProject.sln" }}


