[JIRA] (JENKINS-57596) Problem using MSBuild Tool name in multi-line batch file in Pipeline script

7 views
Skip to first unread message

liangming2003@outlook.com (JIRA)

unread,
May 22, 2019, 4:26:02 AM5/22/19
to jenkinsc...@googlegroups.com
Ming Liang created an issue
 
Jenkins / Bug JENKINS-57596
Problem using MSBuild Tool name in multi-line batch file in Pipeline script
Issue Type: Bug Bug
Assignee: Lionel Cabasson
Components: msbuild-plugin
Created: 2019-05-22 08:25
Labels: pipeline plugin
Priority: Minor Minor
Reporter: Ming Liang

 
In Jenkins->Global Tool Configuration->MSBUILD

I Added a MSBUILD like below

Name: MSBuildTool2017

Path to MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe

Variable ${tool 'MSBuildTool2017'} can be recognized in one-line batch script but not in the multi-line script, Why?

Is there any way I can void the hardcoded MSBUILd Tool Path in the batch script of Jenkins pipeline script?

def buildSource() { //${tool 'MSBuildTool2017'} is recognized.
 bat "\"${tool 'MSBuildTool2017'}\" ABC.sln /p:Configuration=Release /p:Platform=\"x64\" /t:rebuild"
}

def BuildABC() { //${tool 'MSBuildTool2017'} is not recognized.
 {{bat label: '', script: '''@echo off

set RETVAL=0

echo Navigating to ABC folder
cd %WORKSPACE%
cd project

echo Cleaning up bin folder
REM del bin_x64
*.exe /F /Q /S
REM if NOT "%errorlevel%" == "0" set RETVAL=%errorlevel%

echo Navigating to InstallActionsolution folder
cd ABC

echo Building ABC Binaries
\"${tool 'MSBuildTool2017'}\" "ABC.sln" /p:Configuration=Release /p:Platform=\"x64\" /t:rebuild

if NOT "%errorlevel%" == "0" set RETVAL=%errorlevel%

exit %RETVAL%'''}}
}

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

liangming2003@outlook.com (JIRA)

unread,
May 22, 2019, 4:28:01 AM5/22/19
to jenkinsc...@googlegroups.com

liangming2003@outlook.com (JIRA)

unread,
May 22, 2019, 10:33:02 PM5/22/19
to jenkinsc...@googlegroups.com
Ming Liang started work on Bug JENKINS-57596
 
Change By: Ming Liang
Status: Open In Progress

liangming2003@outlook.com (JIRA)

unread,
May 22, 2019, 10:34:02 PM5/22/19
to jenkinsc...@googlegroups.com
Ming Liang resolved as Fixed
 

 

bat label: '', script: '''@echo off

changed to

 

bat label: '', script: """@echo off{{}}

Change By: Ming Liang
Status: In Progress Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages