style(help): fail build if we introduce what to dita are invalid key references in doc
@@ -39,9 +39,15 @@ task ditasite() {
dependsOn generateDocs
doLast {
+ ByteArrayOutputStream stdOut = new ByteArrayOutputStream()
exec {
- commandLine 'dita', '--input=detect.ditamap', '--format=sig-webhelp', '-o', '../ditasite'
+ commandLine 'dita', '-v', '--input=detect.ditamap', '--format=sig-webhelp', '-o', '../ditasite'
workingDir "docs/generated"
+ standardOutput = stdOut
+ }
+ for (String outputLine: stdOut.toString().split('\n')) {
+ if (outputLine.matches(".*\\[keyref\\].*\\[DOTJ047I\\].*"))
+ throw new Exception("dita found invalid key references. Square brackets around doc text must be escaped if not inside back quotes.")
}
}
}
