Details
-
Type:
Bug
-
Status: Fixed but Unreleased (View Workflow)
-
Priority:
Minor
-
Resolution: Not A Defect
-
Component/s: pipeline
-
Labels:None
-
Environment:Jenkins 2.252.
-
Similar Issues:
Description
I declared the following var module in a shared pipeline library:
{{call(
GString msbuildloc,
GString arguments,
GString projloc,
GString projfile)}}
and invoke it from a declarative piplene with the following arguments:
{{gt_msbuild(
"C:
Program Files (x86)\\MSBuild\\14.0\\Bin
",
"${MSBUILD_PARAMS} /p:Configuration=Debug;Platform=AnyCPU;DotNetVer=${DotNetVer}",
"$ProjDir",
"Common.Encrypter.csproj")}}
The invocation fails with the following error:
{{No signature of method: gt_msbuild.call() is applicable for argument types:
( java.lang.String,
org.codehaus.groovy.runtime.GStringImpl,
org.codehaus.groovy.runtime.GStringImpl,
java.lang.String)}}
As you see, the percevied argument type of a double-quoted string depends on whether it contains actual interpolation or not. This is counterintuitive, incompatible with Groovy, and hard to work with. So much so that I consider it bug. Double-quoted string literals should treated consistently.
I am sorry for the ruined code formatting. I used the "Preformatted text" option in the visual editor, but it did not seem to work, and there was no preview for me to notice it. Here is the properly formatted code.