diff options
-rw-r--r-- | tools/codegenerator/Helper.groovy | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy index 65102143bb..ecae893128 100644 --- a/tools/codegenerator/Helper.groovy +++ b/tools/codegenerator/Helper.groovy @@ -378,8 +378,13 @@ public class Helper File parent = curTemplateFile.getParentFile() // find the relative path to the convertTemplate File cwd = new File('.').getCanonicalFile() - String relative = cwd.toURI().relativize(convertTemplate.toURI()).getPath(); + String relative = cwd.getAbsoluteFile().toURI().relativize(convertTemplate.getAbsoluteFile().toURI()).getPath() convertTemplate = new File(parent,relative) + + // This is a fallback case which is hit occationally on OSX as a result + // of case mismatches between the two paths in the relativize call above. + if (!convertTemplate.exists()) + convertTemplate = new File(parent,cur.toString()) } } |