[
https://issues.apache.org/jira/browse/GEODE-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15625524#comment-15625524
]
Anthony Baker commented on GEODE-165:
-------------------------------------
This might be as simple as using the gradle anltr plugin:
{noformat}
modified: build.gradle
renamed:
src/main/java/org/apache/geode/cache/query/internal/parse/oql.g ->
src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g
modified: ../gradle/rat.gradle
{noformat}
{code}
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 067bafc..3103e71 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+apply plugin: 'antlr'
sourceSets {
jca {
@@ -28,7 +29,7 @@ configurations {
}
dependencies {
- // Source Dependencies
+ // Source Dependencies
// External
provided files("${System.getProperty('java.home')}/../lib/tools.jar")
compile 'com.github.stephenc.findbugs:findbugs-annotations:' +
project.'stephenc-findbugs.version'
diff --git
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/oql.g
b/geode-core/src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g
similarity index 100%
rename from
geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/oql.g
rename to
geode-core/src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index 4b4a3cc..4aa5b20 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -135,13 +135,6 @@ rat {
'geode-site/website/tmp/**',
'geode-site/website/layouts/**',
-
- // ANTLR generated files
-
'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexer.java',
-
'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.java',
-
'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLParser.java',
-
'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.txt',
-
{code}
> Add build support for generating antlr classes from grammar
> -----------------------------------------------------------
>
> Key: GEODE-165
> URL: https://issues.apache.org/jira/browse/GEODE-165
> Project: Geode
> Issue Type: Bug
> Components: build
> Reporter: Dan Smith
> Assignee: Mark Bretl
>
> The OQL engine currently uses antlr to generate some parsing classes from
> gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/parse/oql.g
> These are the generated classes. They are currently checked into the source.
> OQLLexer.java
> OQLLexerTokenTypes.java
> OQLLexerTokenTypes.txt
> OQLParser.java
> They can be generated manually by running antlr.Tool on the provided grammar.
> cd gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/parse/
> java -cp antlr.jar antlr.Tool oql.g
> We should add support to the gradle build to generate these classes.
> In my opinion we should also remove the checked in classes. With gradle we
> can configure things so that the gradle eclipse target will generate these
> classes and make them available to the IDE as well. Look at
> gemfire-core/build.gradle for how we do this with the version properties file:
> sourceSets {
> main {
> output.dir(generatedResources, builtBy: 'createVersionPropertiesFile')
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)