Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Variable retriever with special characters #4283

tomz ·

We have a build script that tries to grab perforce change descriptions from a variable. A problem we've seen rarely is that builds fail because change descriptions in perforce contain the special string ${some_thing_unrelated_to_quickbuild_but_important_to_code} and this will throw an exception trying to extract a variable within a variable. Is there a way to set/parse a string without treating these characters as a secondary parse markup? How would you suggest resolving this problem, short of telling developers to stop putting this string in change descriptions?

Thanks in advance

  • replies 1
  • views 35
  • stars 1
robinshen ADMIN ·

When storing the description in variable, replace all occurrences of '{' with '{'. For instance:

groovy:
vars.get("some var").setValue(description.replace("{", "\{"));