Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63597

Double-quoted string literals perceived as String instead of as GString

    XMLWordPrintable

    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.

        Attachments

          Activity

          ant_222 Anton Shepelev created issue -
          ant_222 Anton Shepelev made changes -
          Field Original Value New Value
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Fixed but Unreleased [ 10203 ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ant_222 Anton Shepelev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: