Extract gradle build logic
Fixed incorrect task names in antlr.gradle.
Added new template candidate grammar.