From eb15d9e942d6f4596a1828140e96459adec0497b Mon Sep 17 00:00:00 2001 From: Shashank Bharadwaj Date: Wed, 28 Jun 2023 21:54:30 -0700 Subject: [PATCH 1/4] Encode version information for 4.13 --- antlr/repositories.bzl | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/antlr/repositories.bzl b/antlr/repositories.bzl index e2525ab..707221c 100644 --- a/antlr/repositories.bzl +++ b/antlr/repositories.bzl @@ -10,6 +10,11 @@ v2 = [2, "2.7.7"] PACKAGES = { "antlr": { + "4.13": { + "url": "https://github.com/antlr/antlr4/archive/4.13.0.zip", + "prefix": "antlr4-4.13.0", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + }, "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.13": { + "path": "org/antlr/antlr4-runtime/4.13/antlr4-runtime-4.13.jar", + "sha256": "bd7f7b5d07bc0b047f10915b32ca4bb1de9e57d8049098882e4453c88c076a5d", + }, "4.8": { "path": "org/antlr/antlr4-runtime/4.8/antlr4-runtime-4.8.jar", "sha256": "2337df5d81e715b39aeea07aac46ad47e4f1f9e9cd7c899f124f425913efdcf8", @@ -68,6 +77,10 @@ PACKAGES = { }, }, "antlr4_tool": { + "4.13": { + "path": "org/antlr/antlr4/4.13/antlr4-4.13-complete.jar", + "sha256": "bc6f4abc0d225a27570126c51402569f000a8deda3487b70e7642840e570e4a6", + }, "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.13": + _antlr4_13_0_dependencies(languages) + if version == "4.8": _antlr48_dependencies(languages) elif version == "4.7.2": _antlr472_dependencies(languages) @@ -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 _antlr4_13_0_dependencies(languages): + _antlr4_dependencies( + "4.13.0", + languages, + { + "antlr4_runtime": "4.13.0", + "antlr4_tool": "4.13.0", + "antlr3_runtime": "3.5.2", + "stringtemplate4": "4.3", + "javax_json": "1.0.4", + }, + ) + + def _antlr48_dependencies(languages): _antlr4_dependencies( "4.8", From ba289da8fdad83a74d0ee1ea32dc873d084f7c6c Mon Sep 17 00:00:00 2001 From: Shashank Bharadwaj Date: Wed, 28 Jun 2023 22:01:20 -0700 Subject: [PATCH 2/4] oops fixed bug --- antlr/repositories.bzl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/antlr/repositories.bzl b/antlr/repositories.bzl index 707221c..bbd21e8 100644 --- a/antlr/repositories.bzl +++ b/antlr/repositories.bzl @@ -192,7 +192,7 @@ def rules_antlr_dependencies(*versionsAndLanguages): languages = [JAVA] for version in sorted(versions, key = _toString): - if version == 4 or version = "4.13": + if version == 4 or version == "4.13": _antlr4_13_0_dependencies(languages) if version == "4.8": _antlr48_dependencies(languages) @@ -245,7 +245,6 @@ def _antlr4_13_0_dependencies(languages): }, ) - def _antlr48_dependencies(languages): _antlr4_dependencies( "4.8", From 8e522d15978c2899991b6b0265c82e011f71fc32 Mon Sep 17 00:00:00 2001 From: Shashank Bharadwaj Date: Wed, 28 Jun 2023 22:07:01 -0700 Subject: [PATCH 3/4] use the right versions --- antlr/repositories.bzl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/antlr/repositories.bzl b/antlr/repositories.bzl index bbd21e8..278a02a 100644 --- a/antlr/repositories.bzl +++ b/antlr/repositories.bzl @@ -3,14 +3,14 @@ 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.13.0"] 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.13": { + "4.13.0": { "url": "https://github.com/antlr/antlr4/archive/4.13.0.zip", "prefix": "antlr4-4.13.0", "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", @@ -43,8 +43,8 @@ PACKAGES = { }, }, "antlr4_runtime": { - "4.13": { - "path": "org/antlr/antlr4-runtime/4.13/antlr4-runtime-4.13.jar", + "4.13.0": { + "path": "org/antlr/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar", "sha256": "bd7f7b5d07bc0b047f10915b32ca4bb1de9e57d8049098882e4453c88c076a5d", }, "4.8": { @@ -77,8 +77,8 @@ PACKAGES = { }, }, "antlr4_tool": { - "4.13": { - "path": "org/antlr/antlr4/4.13/antlr4-4.13-complete.jar", + "4.13.0": { + "path": "org/antlr/antlr4/4.13.0/antlr4-4.13.0.jar", "sha256": "bc6f4abc0d225a27570126c51402569f000a8deda3487b70e7642840e570e4a6", }, "4.8": { @@ -192,7 +192,7 @@ def rules_antlr_dependencies(*versionsAndLanguages): languages = [JAVA] for version in sorted(versions, key = _toString): - if version == 4 or version == "4.13": + if version == 4 or version == "4.13.0": _antlr4_13_0_dependencies(languages) if version == "4.8": _antlr48_dependencies(languages) From 4909c1898523f7a5a58569d9d5626df940753f92 Mon Sep 17 00:00:00 2001 From: Shashank Bharadwaj Date: Wed, 28 Jun 2023 22:11:46 -0700 Subject: [PATCH 4/4] fix checksum for tool --- antlr/repositories.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/antlr/repositories.bzl b/antlr/repositories.bzl index 278a02a..d4c30b2 100644 --- a/antlr/repositories.bzl +++ b/antlr/repositories.bzl @@ -79,7 +79,7 @@ PACKAGES = { "antlr4_tool": { "4.13.0": { "path": "org/antlr/antlr4/4.13.0/antlr4-4.13.0.jar", - "sha256": "bc6f4abc0d225a27570126c51402569f000a8deda3487b70e7642840e570e4a6", + "sha256": "1c0deb26992514922fb8b99619198f09c32f7984246dc6ad1c3bbc4983de1d35", }, "4.8": { "path": "org/antlr/antlr4/4.8/antlr4-4.8.jar",