gradle-git-properties icon indicating copy to clipboard operation
gradle-git-properties copied to clipboard

fix: make the unit tests work under Windows

Open Fiouz opened this issue 3 years ago • 2 comments

Windows uses the \ backslash character as the directory separator, which interferes with the standard Groovy escaping.

Fiouz avatar Aug 02 '22 11:08 Fiouz

How about using / as the separator? It should work with both Windows and *nix

tha2015 avatar Aug 02 '22 14:08 tha2015

PR modified to adopt a safer and more generic approach; instead, we use a system property to pass a JSON-encapsulated value around (we rely on Groovy JsonOutput/JsonSlurper):

  • no need to worry about the Groovy parser/compiler escaping rules (\ was only one special case among others), value is now a runtime value
  • no need to transform values, because the runtime Gradle API knows how to handle native paths

Fiouz avatar Aug 02 '22 23:08 Fiouz