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

Add support for antlr4 version 4.11.1 into rules_antlr. #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion antlr/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.11.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.11.1": {
"url": "https://github.com/antlr/antlr4/archive/4.11.1.tar.gz",
"prefix": "antlr4-4.11.1",
"sha256": "81f87f03bb83b48da62e4fc8bfdaf447efb9fb3b7f19eb5cbc37f64e171218cf",
},
"4.8": {
"url": "https://github.com/antlr/antlr4/archive/4.8.tar.gz",
"prefix": "antlr4-4.8",
Expand Down Expand Up @@ -38,6 +43,10 @@ PACKAGES = {
},
},
"antlr4_runtime": {
"4.11.1": {
"path": "org/antlr/antlr4-runtime/4.11.1/antlr4-runtime-4.11.1.jar",
"sha256": "e06c6553c1ccc14d36052ec4b0fc6f13b808cf957b5b1dc3f61bf401996ada59",
},
"4.8": {
"path": "org/antlr/antlr4-runtime/4.8/antlr4-runtime-4.8.jar",
"sha256": "2337df5d81e715b39aeea07aac46ad47e4f1f9e9cd7c899f124f425913efdcf8",
Expand Down Expand Up @@ -68,6 +77,10 @@ PACKAGES = {
},
},
"antlr4_tool": {
"4.11.1": {
"path": "org/antlr/antlr4/4.11.1/antlr4-4.11.1.jar",
"sha256": "e9686e8a663ca512afe3a2eeb6f6ad3f303abb46188991f19ebc6a0fd9c1c14f",
},
"4.8": {
"path": "org/antlr/antlr4/4.8/antlr4-4.8.jar",
"sha256": "6e4477689371f237d4d8aa40642badbb209d4628ccdd81234d90f829a743bac8",
Expand Down Expand Up @@ -181,6 +194,8 @@ def rules_antlr_dependencies(*versionsAndLanguages):
for version in sorted(versions, key = _toString):
if version == 4 or version == "4.8":
_antlr48_dependencies(languages)
elif version == "4.11.1":
_antlr4111_dependencies(languages)
elif version == "4.7.2":
_antlr472_dependencies(languages)
elif version == "4.7.1":
Expand Down Expand Up @@ -217,6 +232,20 @@ def rules_antlr_optimized_dependencies(version):
else:
fail('Unsupported ANTLR version provided: "{0}". Currently supported are: {1}'.format(version, v4_opt), attr = "version")

def _antlr4111_dependencies(languages):
_antlr4_dependencies(
"4.11.1",
languages,
{
"antlr4_runtime": "4.11.1",
"antlr4_tool": "4.11.1",
"antlr3_runtime": "3.5.2",
"stringtemplate4": "4.3",
"javax_json": "1.0.4",
},
)


def _antlr48_dependencies(languages):
_antlr4_dependencies(
"4.8",
Expand Down