From fdae97a2b507c1a99ec22e3d57574b20106bd670 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 9 May 2016 17:28:15 -0400 Subject: [PATCH] Fail build when docs contain // AUTOSENSE It is deprecated and should be replaced with // CONSOLE. --- .../org/elasticsearch/gradle/doc/SnippetsTask.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy index fee0c15d383..afd91858e9d 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy @@ -112,8 +112,12 @@ public class SnippetsTask extends DefaultTask { lastLanguageLine = lineNumber return } - if (line ==~ /\/\/\s*AUTOSENSE\s*/ - || line ==~ /\/\/\s*CONSOLE\s*/) { + if (line ==~ /\/\/\s*AUTOSENSE\s*/) { + throw new InvalidUserDataException("AUTOSENSE has been " + + "replaced by CONSOLE. Use that instead at " + + "$file:$lineNumber") + } + if (line ==~ /\/\/\s*CONSOLE\s*/) { if (snippet == null) { throw new InvalidUserDataException("CONSOLE not " + "paired with a snippet at $file:$lineNumber")