Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANTLR 4.9.1 support? #13

Open
kyessenov opened this issue Jan 28, 2021 · 6 comments · May be fixed by #14
Open

ANTLR 4.9.1 support? #13

kyessenov opened this issue Jan 28, 2021 · 6 comments · May be fixed by #14

Comments

@kyessenov
Copy link

Seems that ANTLR 4.9.x is not in the list of supported versions.

@movelazar
Copy link

Also interested in getting this.

In the meantime, going to look into making my own bundle. Anyone tried yet?

@lgalfaso
Copy link

lgalfaso commented Feb 6, 2021

@movelazar I created a small example on how to do this https://github.com/lgalfaso/bazel_antlr

@movelazar
Copy link

@marcohu any chance of getting this updated?

@movelazar
Copy link

Ended up just writing a patch.

diff --git a/antlr/repositories.bzl b/antlr/repositories.bzl
index e2525ab..342dd57 100644
--- a/antlr/repositories.bzl
+++ b/antlr/repositories.bzl
@@ -3,13 +3,18 @@
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
 load(":lang.bzl", "C", "CPP", "GO", "JAVA", "OBJC", "PYTHON", "PYTHON2", "PYTHON3", supportedLanguages = "supported")
 
-v4 = [4, "4.7.1", "4.7.2", "4.8"]
+v4 = [4, "4.7.1", "4.7.2", "4.8", "4.9.1"]
 v4_opt = [4, "4.7.1", "4.7.2", "4.7.3", "4.7.4"]
 v3 = [3, "3.5.2"]
 v2 = [2, "2.7.7"]
 
 PACKAGES = {
     "antlr": {
+        "4.9.1": {
+            "url": "https://github.com/antlr/antlr4/archive/4.9.1.tar.gz",
+            "prefix": "antlr4-4.9.1",
+            "sha256": "db170179917ce6fec7bc4ecf72edba36b97c9881e09e03af6ac0c901eba52a8f",
+        },
         "4.8": {
             "url": "https://github.com/antlr/antlr4/archive/4.8.tar.gz",
             "prefix": "antlr4-4.8",
@@ -38,6 +43,10 @@ PACKAGES = {
         },
     },
     "antlr4_runtime": {
+        "4.9.1": {
+            "path": "org/antlr/antlr4-runtime/4.9.1/antlr4-runtime-4.9.1.jar",
+            "sha256": "a80502c3140ae7acfbb1f57847c8eb1c101461a969215ec38c3f1ebdff61ac29",
+        },
         "4.8": {
             "path": "org/antlr/antlr4-runtime/4.8/antlr4-runtime-4.8.jar",
             "sha256": "2337df5d81e715b39aeea07aac46ad47e4f1f9e9cd7c899f124f425913efdcf8",
@@ -68,6 +77,10 @@ PACKAGES = {
         },
     },
     "antlr4_tool": {
+        "4.9.1": {
+            "path": "org/antlr/antlr4/4.9.1/antlr4-4.9.1.jar",
+            "sha256": "e6bd18f14126ab85a42dcb80ba5f67da2f35ba164ec5a64d40024bd0e7436584",
+        },
         "4.8": {
             "path": "org/antlr/antlr4/4.8/antlr4-4.8.jar",
             "sha256": "6e4477689371f237d4d8aa40642badbb209d4628ccdd81234d90f829a743bac8",
@@ -179,7 +192,9 @@ def rules_antlr_dependencies(*versionsAndLanguages):
             languages = [JAVA]
 
         for version in sorted(versions, key = _toString):
-            if version == 4 or version == "4.8":
+            if version == 4 or version == "4.9.1":
+                _antlr491_dependencies(languages)
+            elif version == "4.8":
                 _antlr48_dependencies(languages)
             elif version == "4.7.2":
                 _antlr472_dependencies(languages)
@@ -217,6 +232,19 @@ def rules_antlr_optimized_dependencies(version):
     else:
         fail('Unsupported ANTLR version provided: "{0}". Currently supported are: {1}'.format(version, v4_opt), attr = "version")
 
+def _antlr491_dependencies(languages):
+    _antlr4_dependencies(
+        "4.9.1",
+        languages,
+        {
+            "antlr4_runtime": "4.9.1",
+            "antlr4_tool": "4.9.1",
+            "antlr3_runtime": "3.5.2",
+            "stringtemplate4": "4.3",
+            "javax_json": "1.0.4",
+        },
+    )
+
 def _antlr48_dependencies(languages):
     _antlr4_dependencies(
         "4.8",

@movelazar movelazar linked a pull request Feb 26, 2021 that will close this issue
@andyfengHKU
Copy link

Can someone merge the PR so that antlr4.9 is supported? Thanks!

@rbuckland
Copy link

this fork has 4.11.1 support - https://github.com/GorNishanov/rules_antlr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants