I have created new Gradle project, added
apply plugin: \'antlr\'
and
dependencies { antlr \"org.antlr:antlr4:4.5.3\"
For Issue 2:
you can configure in the gradle.build:
generateGrammarSource { maxHeapSize = "64m" arguments += ["-visitor", "-long-messages", "-package", "your.package.name"] }