We can't use System.lineSeparator() reliably as it returns the master node's line separator. Adding a lineSeparator() step is useful for writing files on various agents.

          [JENKINS-55089] Add a lineSeparator step

          Yoav Miles created issue -

          Oleg Nenashev added a comment -

          towel it may be safe to add it, but it will unlikely get you the result you expect in Jenkins Pipeline. In Pipeline scripts will always return the master's system separator. Maybe it's better to propose a new step in Pipeline Utility steps

           

          Oleg Nenashev added a comment - towel it may be safe to add it, but it will unlikely get you the result you expect in Jenkins Pipeline. In Pipeline scripts will always return the master's system separator. Maybe it's better to propose a new step in Pipeline Utility steps  

          Yoav Miles added a comment -

          oleg_nenashev thanks for the prompt response. I'll change this report to ask for a new step, as my case can't be generalized (Jenkins only manages Windows machines at my site).

          Yoav Miles added a comment - oleg_nenashev thanks for the prompt response. I'll change this report to ask for a new step, as my case can't be generalized (Jenkins only manages Windows machines at my site).
          Yoav Miles made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          Yoav Miles made changes -
          Component/s New: pipeline-utility-steps-plugin [ 21135 ]
          Component/s Original: script-security-plugin [ 18520 ]
          Yoav Miles made changes -
          Summary Original: Scripts not permitted to use staticMethod java.lang.System lineSeparator New: Add a lineSeparator step
          Yoav Miles made changes -
          Description Original: Please include System.lineSeparator() in the default signature whitelist, thanks :) New: We can't use System.lineSeparator() reliably as it returns the master node's line separator

          Please include System.lineSeparator() in the default signature whitelist, thanks :)
          Yoav Miles made changes -
          Assignee Original: Andrew Bayer [ abayer ] New: rsandell [ rsandell ]
          Yoav Miles made changes -
          Description Original: We can't use System.lineSeparator() reliably as it returns the master node's line separator

          Please include System.lineSeparator() in the default signature whitelist, thanks :)
          New: We can't use System.lineSeparator() reliably as it returns the master node's line separator. Adding a lineSeparator() step is useful for writing files on various agents.

          Yoav Miles added a comment -

          On second thought, I think it's better for readFile and writeFile to know how to convert line endings than having to do it manually with another step, but then the change would be less trivial...

          Yoav Miles added a comment - On second thought, I think it's better for readFile and writeFile to know how to convert line endings than having to do it manually with another step, but then the change would be less trivial...

            rsandell rsandell
            towel Yoav Miles
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: